# FAKT - Automatisk Generert Dokumantasjon

## Tilgjengelighet

/***********************************************************************
  Tilgjengelighet
    A QGIS plugin
  My Tilgjengelighet assignment

    begin : 2017-08-21 git sha : $Format:%H$ copyright : (C) 2017 by Kasper Skjeggestad email : kasper.skjeggestad@gmail.com

  ***********************************************************************/

/***********************************************************************
  - This program is free software; you can redistribute it and/or modify *
  - it under the terms of the GNU General Public License as published by *
  - the Free Software Foundation; either version 2 of the License, or *
  - (at your option) any later version. *

  ***********************************************************************/

class `Tilgjengelighet.``Tilgjengelighet`(iface)

  Bases: `object`

  QGIS Plugin Implementation.

  `OpenBrowser`()

    Opens broeser to save file

  `addLayer`(layerType)

    The folowing code has been taken out from OpenLayers Plugin writen by Sourcepole

  `add_action`(icon_path, text, callback, enabled_flag=True, add_to_menu=True, add_to_toolbar=True, status_tip=None, whats_this=None, parent=None)

    Add a toolbar icon to the toolbar.

    Parameters: | icon_path (str) – Path to the icon for this action. Can be a resource path (e.g. ‘:/plugins/foo/bar.png’) or a normal file system path. text (str) – Text that should be shown in menu items for this action. callback (function) – Function to be called when the action is triggered. enabled_flag (bool) – A flag indicating if the action should be enabled by default. Defaults to True. add_to_menu (bool) – Flag indicating whether the action should also be added to the menu. Defaults to True. add_to_toolbar (bool) – Flag indicating whether the action should also be added to the toolbar. Defaults to True. status_tip (str) – Optional text to show in a popup when mouse pointer hovers over the action. parent (QWidget) – Parent widget for the new action. Defaults None. whats_this – Optional text to show in the status bar when the mouse pointer hovers over the action.
    Returns: | The action that was created. Note that the action is also added to self.actions list.
    Return type: | QAction

  `assign_combobox_baderampe`()

    Assigning a AttributeForm object to each option in Baderampe

  `assign_combobox_fiskeplass`()

    Assigning a AttributeForm object to each option in Baderampe

  `assign_combobox_hc_parkering`()

    Assigning a AttributeForm object to each option in hc parkering

  `assign_combobox_inngang`()

    Assigning a AttributeForm object to each option in inngang

  `assign_combobox_parkeringsomraade`()

    Assigning a AttributeForm object to each option in parkeringsområde

  `assign_combobox_vei`()

    Assigning a AttributeForm object to each option in vei

  `canvasCrs`()

    The folowing code has been taken out from OpenLayers Plugin writen by Sourcepole

  `change_search_name`()

    Changes the name of search based on current tab and fyle and kommune

  `createGdalTmsLayer`(layerType, name)

    The folowing code has been taken out from OpenLayers Plugin writen by Sourcepole

  `create_filter`(opperator, valueReference, value)

    creates FE based on input, made to take less space in other method create_filtherencoding

    Parameters: | opperator (str) – opperator for FE valueReference (str) – name of attribute for FE value (str) – value for FE

  `create_filtherencoding`(attributeList)

    creates FE based on user choices

    Parameters: | attributeList (list<AttributeForms>) – list of all attriubtes for filterencoding
    Returns: | FilterEncoding
    Return type: | str

  `excelSave`()

    obtaind from xytools, Saves features to excel format @author: Richard Duivenvoorde

  `fill_combobox`(combobox, filename)

    Fikks combobox with lines from filename

    Parameters: | combobox (QComboBox) – The combobox to be filled filename (str, QString) – name of file with info to be filled in combobox

  `fill_fylker`()

    Fill up the combobox fylker with fylker from komm.txt

  `fill_infoWidget`(attributes)

    Filling infowidget with attributes name and no value. Also ajustes size of infowidget

    Parameters: | attributes (list<AttributeForms>) – List of gui attriibutes

  `filtrer`()

    Makes FE and layer based on choises from user an current tab

  `fylke_valgt`()

    Fill up kommune combobox with kommune in chosen fylke

  `get_previus_search_activeLayer`()

    Open filtering window set to preweus choises

  `get_temppath`(filename)

    Creating a temperarly path for a temperary file

    Parameters: | filename (str, QString) – String name for file
    Returns: | string of full path
    Return type: | str

  `hide_show_gui`(attributeForms, condition, extra=None)

    Shows parts of GUI if conditions are meat, hids it if not

    Parameters: | attributeForms (list<AttributeForm>) – A list of witch attributes to hide in GUI condition (boolean) – The condition to show GUI parts extra (list<QtWidgets>) – include if gui consists of more than attributes that needs to be showed/hidden

  `highlightSelected`()

    Highlights the object viewed in infowidget

  `imageSave`()

    saves a screenshot of canvas

  `infoWidget_next`()

    shows next object in infoWidget

  `infoWidget_prev`()

    shows previus object in infoWidget

  `initGui`()

    Create the menu entries and toolbar icons inside the QGIS GUI.

  `kommune_valgt`()

    Alter the name on seach after a kommune is chosen

  `lagre_lag`()

    Saves layer as exported

  `obj_info`()

    Fills infowidget with info of current object

  `openLayer_background_init`()

    The folowing code has been taken out from OpenLayers Plugin writen by Sourcepole

  `open_export_layer_dialog`()

    opens the excport gui

  `reset`()

    Resets the gui back to default

  `resolve`(basepath=None)
  `run`()

    Run method that performs all the real work

  `savePath`(saveType, saveExtension)

    Find the save path

    Parameters: | saveType (str) – The type of file to be saved saveExtension (str) – File extention (e.g .xls .png)
    Returns: | direktory path and file namle
    Return type: | (str,str)

  `save_search`()

    “Saves the search to search history so it can set choises in GUI bac to preveus desisions

  `selectedObjects`(selFeatures)

    changing number of selected objects in infowidget and settning current selected object

    Parameters: | selFeatures – Selected features of layer

  `setMapCrs`(coordRefSys)

    The folowing code has been taken out from OpenLayers Plugin writen by Sourcepole

  `setReferenceLayer`(layer)

    The folowing code has been taken out from OpenLayers Plugin writen by Sourcepole

  `show_message`(msg_text, msg_title=None, msg_info=None, msg_details=None, msg_type=None)

    Show the user a message :param msg_text: the tekst to show the user :type msg_text: str

    Parameters: | msg_title (str) – the title of the message box msg_info (str) – additional info for the user msg_details (str) – details for the user msg_type (QMessageBox.Icon) – the type of message

  `show_tabell`()

    Shows or hide tableWidget

  `to_unicode`(in_string)

    Transforme string to unicode

    Parameters: | in_string – String to transforme
    Returns: | unicode verson of string
    Return type: | unicode

  `tr`(message)

    Get the translation for a string using Qt translation API.

    We implement this ourselves since we do not inherit QObject.

    Parameters: | message (str, QString) – String for translation.
    Returns: | Translated version of message.
    Return type: | QString

  `unload`()

    Removes the plugin menu item and icon from QGIS GUI.

## AttributeForm

class `AttributeForm.``AttributeForm`(attribute, comboBox=None, lineEdit=None, comboBoxText=None, label=None)

  Bases: `object`

  Saves attributes and assosiated gui widgets

  `getAttribute`()

    Returns the assosiated attriubte name

    Returns: | returns the associated attribute name
    Return type: | str

  `getComboBox`()

    Returns the assosiated combobox widget

    Returns: | returns the associated comboBox
    Return type: | QComboBox

  `getComboBoxCurrentText`()

    Returns the assosoated combobox text

    Returns: | returns the associated comboBox text, return None if no combobox is availeble
    Return type: | QString

  `getLabel`()

    Returns the assisiated label widget if any :returns: returns the associated label :rtype: QLabel

  `getLineEdit`()

    Returns the assosiated lineEdit widget if any

    Returns: | returns the associated lineEdit
    Return type: | QLineEdit

  `getLineEditText`()

    Returns the lineEdit text

    Returns: | returns the lineEdit text, return None if no lineEdit is availeble
    Return type: | QString

  `is_number`(s)

    Sett text in AttributeForm lineEdit

    Parameters: | s (str) – string to be change for being a number
    Returns: | tru if s is number, false if s in not a number
    Return type: | boolean

  `opperator`()

    Returns: | the opperator for attriubutt qury
    Return type: | QString, None

  `reset`()

    Resets form to defult

  `setComboBox`(comboBox)

    Assigning comboBox

    Parameters: | comboBox (QComboBox) – combobox assisiated to attribute

  `setLineEdit`(lineEdit)

    Assigning lineEdit

    Parameters: | lineEdit (QLineEdit) – Linedit assisiated to attribute

  `setLineEditText`(string)

    Sett text in AttributeForm lineEdit

    Parameters: | string (str) – String to set in lineEdit

  `valudeValid`()

    checks if the attribute is valid and search ready

    Returns: | True if attrivute is valid, false if not
    Return type: | boolean

  `value`()

    returns the value constraint, if alternative combobox is set, return that value, if lineedit, ruturn value freom line edit, else return from combobox

    Returns: | the value constraint
    Return type: | str

  `valueReference`()

    Returns the objekt attribute

    Returns: | name of object attribute in database
    Return type: | str

## SavedSearch

class `SavedSearch.``SavedSearch`(search_name, layer, tabIndex_main, tabIndex_friluft, tabIndex_tettsted)

  Bases: `object`

  Class made to save the choises made by user on a previus search

  `add_attribute`(attribute, current_index, current_lineText)

    Add attribute with current index for combobx and current text for lineText Attributes are stored in dictionarys as key, while value is list of combobox indes and lintEdtid text

    Parameters: | attribute (AttributeForm) – one attribute from filter interface current_index (int) – index of combobx at search current_lineText (str) – text of lineEdit at search

  `get_attributes`()

    Returns dictionary of attributes

    Returns: | dictionary of attributes
    Return type: | list<AttributeForm>