All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
te::qt::af::ApplicationController Class Reference

The base API for TerraLib applications. More...

#include <ApplicationController.h>

Inheritance diagram for te::qt::af::ApplicationController:
te::common::Singleton< ApplicationController >

Public Slots

void broadcast (te::qt::af::evt::Event *evt)
 Send events in broadcast for all registered components. More...
 

Signals

void triggered (te::qt::af::evt::Event *)
 Signal emmited to the aplication framework listeners. More...
 

Public Member Functions

void addListener (QObject *obj)
 Insert an application item that will listen to framework events. More...
 
 ApplicationController ()
 Constructor. More...
 
virtual void finalize ()
 Finalize the application framework. More...
 
const QString & getAboutLogo () const
 
const QString & getAppIconName () const
 Returns the application icon. More...
 
const QString & getAppName () const
 Returns the application name. More...
 
const QString & getAppPluginsPath () const
 Returns the plugins file path of application. More...
 
const QString & getAppProjectExtension () const
 Returns the application project extension. More...
 
const QString & getAppTitle () const
 Returns the application title. More...
 
int getDefaultSRID () const
 Returns the application default SRID value. More...
 
QWidget * getMainWindow () const
 Returns main window. More...
 
QString getMostRecentProject () const
 Returns the most recent project. More...
 
te::qt::af::ProjectgetProject ()
 Get the current project. More...
 
QColor getSelectionColor () const
 Returns the application selection color. More...
 
QSettings & getSettings ()
 Return the QSettings of the application. This can be used to add settings from external sources. More...
 
const QString & getTlibLogo () const
 
const QString & getUserDataDir () const
 
virtual void initialize ()
 Initializes the application framework. More...
 
virtual void initializePlugins ()
 Load the plugin list and initialize the plugins enabled by the user. More...
 
virtual void initializeProjectMenus ()
 Initializes the menus for the most recent open projects. More...
 
void removeListener (QObject *obj)
 Remove the obj from the list of event listeners. More...
 
void set (te::qt::af::Project *prj)
 Set the current project. More...
 
virtual void setConfigFile (const std::string &configFileName)
 It gives access to the controller singleton. More...
 
virtual void setMsgBoxParentWidget (QWidget *w)
 Tells the widget to be used as the parent of messages showned in a QMessageBox. More...
 
void setResetTerraLibFlag (const bool &status)
 
void setSelectionColor (const QColor &c)
 Sets the application selection color. More...
 
void updateRecentProjects (const QString &prjFile, const QString &prjTitle)
 Update the list of recent projects. This is commonly used when there's a new most recent project. More...
 
virtual ~ApplicationController ()
 Destructor. More...
 
Menus and Menubars Management.

Register and recover menus and menu bars.

The methods find will returns a valid object only if it exists in some menu, otherwise the return will be a NULL pointer. The methods get ALWAYS returns a valid pointer. If the requested menu or menubar does not exists these funtions will create, register and return the object.

Note
The identifiers of the menus are the texts presented by menus.
The search for menus will occurs in ALL OF THE REGISTERED menus and menu bars, including submenus. The correct sintaxe for searchies submenus may be found in the documentation of the findMenu(QString mnuText, QMenu* mnu) method.
void addToolBar (const QString &id, QToolBar *bar)
 Register the toolbar in the list of the known toolbars and dispatch an event. More...
 
void registerToolBar (const QString &id, QToolBar *bar)
 Register the toolbar in the list of the known toolbars. More...
 
QToolBar * getToolBar (const QString &id) const
 Return the toolbar identified by id or NULL if none is found. More...
 
std::vector< QToolBar * > getToolBars () const
 Return the list of registered toolbars. More...
 
void removeToolBar (const QString &id)
 Removes the toolbar identified by id. More...
 
void registerMenu (QMenu *mnu)
 Register the mnu. More...
 
QMenu * findMenu (const QString &id) const
 Returns the menu registered with key id. More...
 
QMenu * getMenu (const QString &id)
 Returns a menu registered with key id. More...
 
void registerMenuBar (QMenuBar *bar)
 Register the bar. More...
 
QMenuBar * findMenuBar (const QString &id) const
 Returns the menu bar registered with key id. More...
 
QMenuBar * getMenuBar (const QString &id) const
 Returns a menu bar registered with key id. More...
 
QAction * findAction (const QString &id) const
 Returns the action identified by id or NULL if there's not an action identified by id. More...
 
QActionGroup * findActionGroup (const QString &id) const
 Returns the action group identified by id or NULL if there's not an action group identified by id. More...
 

Static Public Member Functions

static ApplicationControllergetInstance ()
 It returns a reference to the singleton instance. More...
 

Protected Attributes

QString m_aboutLogo
 
std::string m_appConfigFile
 The application framework configuration file. More...
 
std::string m_appDatasourcesFile
 Name of the file containing datasources used. More...
 
QString m_appDefaultIconTheme
 Name of the icon theme to be used. More...
 
QString m_appHelpFile
 Name of the help file. More...
 
QString m_appIconName
 Icon used in the application. More...
 
QString m_appIconThemeDir
 Directory of the application icon theme. More...
 
std::set< QObject * > m_applicationItems
 The list of registered application items. More...
 
QString m_appName
 Application name. More...
 
QString m_appOrganization
 Organization name. More...
 
QString m_appPluginsPath
 Name of the plugins path. More...
 
QString m_appProjectExtension
 Application project extension. More...
 
QSettings m_appSettings
 
QString m_appTitle
 Application title. More...
 
QString m_appToolBarDefaultIconSize
 Size of the tool buttons. More...
 
std::string m_appUserSettingsFile
 Name of the user settings file. More...
 
int m_defaultSRID
 Default SRID value. More...
 
bool m_initialized
 A flag indicating if the controller is initialized. More...
 
std::vector< QMenuBar * > m_menuBars
 Menu bars registered. More...
 
std::vector< QMenu * > m_menus
 Menus registered. More...
 
QWidget * m_msgBoxParentWidget
 Parent used to show message boxes. More...
 
Projectm_project
 Pointer to current project. More...
 
QStringList m_recentProjs
 List of the recent projects. More...
 
QStringList m_recentProjsTitles
 List of the titles of the recent projects. More...
 
bool m_resetTerralib
 
QColor m_selectionColor
 Default selection color. More...
 
QString m_tLibLogo
 
std::map< QString, QToolBar * > m_toolbars
 Toolbars registered. More...
 
QString m_userDataDir
 The data dir used to store data files. More...
 

Related Functions

(Note that these are not member functions.)

QMenu * findMenu
 

Detailed Description

The base API for TerraLib applications.

Note
Temporally this class is a singleton!

Definition at line 80 of file ApplicationController.h.

Constructor & Destructor Documentation

te::qt::af::ApplicationController::ApplicationController ( )

Constructor.

Parameters
parentThe parent object.

Definition at line 92 of file ApplicationController.cpp.

te::qt::af::ApplicationController::~ApplicationController ( )
virtual

Destructor.

Definition at line 103 of file ApplicationController.cpp.

Member Function Documentation

void te::qt::af::ApplicationController::addListener ( QObject *  obj)

Insert an application item that will listen to framework events.

Parameters
objThe application item that will listen to framework events.
Note
The obj MUST HAVE AN IMPLEMENTATION of the slot onApplicationTriggered(Event*). If it hasn't, a warning will be sent at run-time.
If the obj was previously registered, nothing will be done.

Definition at line 271 of file ApplicationController.cpp.

Referenced by te::qt::af::BaseApplication::makeDialog(), te::qt::af::BaseApplication::onChartDisplayCreated(), te::qt::af::BaseApplication::onLayerHistogramTriggered(), te::qt::af::BaseApplication::onLayerScatterTriggered(), and te::qt::af::BaseApplication::onLayerShowTableTriggered().

void te::qt::af::ApplicationController::addToolBar ( const QString &  id,
QToolBar *  bar 
)

Register the toolbar in the list of the known toolbars and dispatch an event.

Parameters
idThe toolbar identification string.
barThe toolbar to be registered. The controller will not take the bar ownership.

An event will be broadcasted to indicate that the toolbar was appended.

Exceptions
ExceptionIt throws an exception if a toolbar with the given id already exists.

Definition at line 118 of file ApplicationController.cpp.

Referenced by te::qt::af::ToolbarsWidget::saveChanges().

void te::qt::af::ApplicationController::broadcast ( te::qt::af::evt::Event evt)
slot

Send events in broadcast for all registered components.

Parameters
evtEvent to be sent.

Definition at line 860 of file ApplicationController.cpp.

Referenced by te::qt::af::MapDisplay::configSRS(), te::qt::af::BaseApplication::newProject(), te::qt::af::BaseApplication::onAddDataSetLayerTriggered(), te::qt::af::BaseApplication::onAddFolderLayerTriggered(), te::qt::af::BaseApplication::onAddQueryLayerTriggered(), te::qt::af::BaseApplication::onAddTabularLayerTriggered(), te::qt::af::LayerExplorer::onApplicationTriggered(), te::qt::af::BaseApplication::onChangeLayerDataSourceTriggered(), te::qt::af::MapDisplay::onCoordTracked(), te::qt::af::BaseApplication::onCreateNewLayer(), te::qt::af::MapDisplay::onDrawLayersFinished(), te::qt::af::BaseApplication::onDrawTriggered(), te::qt::af::BaseApplication::onHighlightLayerObjects(), te::qt::af::BaseApplication::onLayerChartTriggered(), te::qt::af::BaseApplication::onLayerGroupingTriggered(), te::qt::af::LayerExplorer::onLayerOrderChanged(), te::qt::af::BaseApplication::onLayerRemoveItemTriggered(), te::qt::af::BaseApplication::onLayerRemoveSelectionTriggered(), te::qt::af::BaseApplication::onLayerSelectedObjectsChanged(), te::qt::af::LayerExplorer::onLayerVisibilityChanged(), te::qt::af::BaseApplication::onLinkTriggered(), te::qt::af::BaseApplication::onMapRemoveSelectionTriggered(), te::qt::af::BaseApplication::onMapSetUnknwonSRIDTriggered(), te::qt::af::BaseApplication::onMapSRIDTriggered(), te::qt::af::BaseApplication::onPanToggled(), te::qt::af::BaseApplication::onRemoveLayerTriggered(), te::qt::af::BaseApplication::onRenameLayerTriggered(), te::qt::af::LayerExplorer::onSelectedLayersChanged(), te::qt::af::BaseApplication::onSelectionToggled(), te::qt::af::LayerExplorer::onTreeItemDoubleClicked(), te::qt::af::BaseApplication::onZoomInToggled(), te::qt::af::BaseApplication::onZoomOutToggled(), te::qt::af::BaseApplication::openProject(), te::qt::af::DataSetTableDockWidget::removeSelectedOIds(), te::qt::af::DisplayWidget::saveChanges(), te::qt::af::TableWidget::saveChanges(), te::qt::af::ChartDisplayDockWidget::selectionChanged(), and te::qt::af::DataSetTableDockWidget::selectionChanged().

void te::qt::af::ApplicationController::finalize ( )
virtual

Finalize the application framework.

This method will unload all TerraLib modules, plugins, and dynamic libraries that are loaded.

Note
Make sure that the application calls this method BEFORE it finishes.

Definition at line 784 of file ApplicationController.cpp.

References TerraLib::finalize(), te::common::Singleton< TerraLib >::getInstance(), te::common::Singleton< PluginManager >::getInstance(), te::qt::af::SaveDataSourcesFile(), and te::qt::af::UpdateUserSettings().

Referenced by te::qt::af::BaseApplication::~BaseApplication().

QAction * te::qt::af::ApplicationController::findAction ( const QString &  id) const

Returns the action identified by id or NULL if there's not an action identified by id.

Parameters
idIdentifier if the action.
Returns
QAction identified or NULL if could not find one.
Note
There's a rule to determine id. The text of menus and submenus separated by '.' character.

Definition at line 229 of file ApplicationController.cpp.

References te::qt::widgets::FindAction().

QActionGroup * te::qt::af::ApplicationController::findActionGroup ( const QString &  id) const

Returns the action group identified by id or NULL if there's not an action group identified by id.

Parameters
idIdentifier of the action group.
Returns
QActionGroup identified or NULL if could not find one.

Definition at line 250 of file ApplicationController.cpp.

References te::qt::widgets::FindActionGroup().

QMenu * te::qt::af::ApplicationController::findMenu ( const QString &  id) const

Returns the menu registered with key id.

Parameters
idIndentifier of the menu.
Returns
Menu registered or NULL with there is not one registered with the key id.

Definition at line 169 of file ApplicationController.cpp.

References te::qt::widgets::FindMenu().

QMenuBar * te::qt::af::ApplicationController::findMenuBar ( const QString &  id) const

Returns the menu bar registered with key id.

Parameters
idIndentifier of the menu bar.
Returns
Menu bar registered or NULL with there is not one registered with the key id.

Definition at line 219 of file ApplicationController.cpp.

const QString & te::qt::af::ApplicationController::getAboutLogo ( ) const

Definition at line 893 of file ApplicationController.cpp.

const QString & te::qt::af::ApplicationController::getAppIconName ( ) const

Returns the application icon.

Returns
Application icon.

Definition at line 883 of file ApplicationController.cpp.

const QString & te::qt::af::ApplicationController::getAppName ( ) const

Returns the application name.

Returns
Application name.

Definition at line 868 of file ApplicationController.cpp.

const QString & te::qt::af::ApplicationController::getAppPluginsPath ( ) const

Returns the plugins file path of application.

Returns
A path of plugins file.

Definition at line 888 of file ApplicationController.cpp.

const QString & te::qt::af::ApplicationController::getAppProjectExtension ( ) const

Returns the application project extension.

Returns
Application project extension.

Definition at line 878 of file ApplicationController.cpp.

Referenced by te::qt::af::BaseApplication::onSaveProjectTriggered().

const QString & te::qt::af::ApplicationController::getAppTitle ( ) const

Returns the application title.

Returns
Application title.

Definition at line 873 of file ApplicationController.cpp.

int te::qt::af::ApplicationController::getDefaultSRID ( ) const

Returns the application default SRID value.

Returns
Application default SRID value.

Definition at line 908 of file ApplicationController.cpp.

static ApplicationController & te::common::Singleton< ApplicationController >::getInstance ( )
staticinherited

It returns a reference to the singleton instance.

Returns
A reference to the singleton instance.

Referenced by AboutDialog::AboutDialog(), te::qt::plugins::attributefill::AbstractAction::addNewLayer(), te::qt::plugins::cellspace::AbstractAction::addNewLayer(), te::qt::plugins::sa::AbstractAction::addNewLayer(), te::qt::plugins::vp::AbstractAction::addNewLayer(), te::qt::plugins::rp::AbstractAction::addNewLayer(), te::qt::af::BaseApplication::BaseApplication(), te::qt::af::BaseApplication::checkProjectSave(), te::qt::af::MapDisplay::configSRS(), te::qt::plugins::layout::ProxyProject::contains(), te::qt::af::DataSetTableDockWidget::DataSetTableDockWidget(), te::qt::af::MapDisplay::drawLayerSelection(), te::qt::plugins::terralib4::TL4ConverterWizard::finish(), te::qt::plugins::layout::ProxyProject::getAllLayers(), te::qt::plugins::attributefill::AbstractAction::getCurrentLayer(), te::qt::plugins::cellspace::AbstractAction::getCurrentLayer(), te::qt::plugins::sa::AbstractAction::getCurrentLayer(), te::qt::plugins::vp::AbstractAction::getCurrentLayer(), te::qt::plugins::rp::AbstractAction::getCurrentLayer(), te::qt::af::GetDefaultPluginsNames(), te::qt::af::GetExtensionFilter(), te::qt::plugins::edit::ToolBar::getLayer(), te::qt::plugins::addressgeocoding::Plugin::getLayers(), te::qt::plugins::attributefill::AbstractAction::getLayers(), te::qt::plugins::cellspace::AbstractAction::getLayers(), te::qt::plugins::sa::AbstractAction::getLayers(), te::qt::plugins::vp::AbstractAction::getLayers(), te::qt::plugins::rp::AbstractAction::getLayers(), te::qt::plugins::edit::ToolBar::getSelectedLayer(), te::qt::plugins::layout::ProxyProject::getSelectedLayers(), te::qt::af::GetWindowTitle(), TerraView::init(), te::qt::af::BaseApplication::init(), te::qt::plugins::edit::ToolBar::initializeActions(), te::qt::af::BaseApplication::initMenus(), te::qt::af::BaseApplication::initToolbars(), TerraView::makeDialog(), te::qt::af::BaseApplication::makeDialog(), te::qt::af::MapDisplay::MapDisplay(), te::qt::af::BaseApplication::newProject(), te::qt::plugins::rp::VectorizationAction::onActionActivated(), te::qt::plugins::sa::BayesGlobalAction::onActionActivated(), te::qt::plugins::sa::BayesLocalAction::onActionActivated(), te::qt::plugins::sa::GeostatisticalMethodsAction::onActionActivated(), te::qt::plugins::sa::KernelMapAction::onActionActivated(), te::qt::plugins::sa::KernelRatioAction::onActionActivated(), te::qt::plugins::sa::SamplePointsGeneratorAction::onActionActivated(), te::qt::plugins::sa::SkaterAction::onActionActivated(), te::qt::plugins::sa::SpatialStatisticsAction::onActionActivated(), te::qt::plugins::sa::ProximityMatrixCreatorAction::onActionActivated(), te::qt::plugins::vp::BufferAction::onActionActivated(), te::qt::plugins::layout::LayoutEditorAction::onActionActivated(), te::qt::plugins::vp::MultipartToSinglepartAction::onActionActivated(), te::qt::plugins::rp::ArithmeticOpAction::onActionActivated(), te::qt::plugins::rp::ClassifierAction::onActionActivated(), te::qt::plugins::rp::ColorTransformAction::onActionActivated(), te::qt::plugins::rp::ComposeBandsAction::onActionActivated(), te::qt::plugins::rp::FusionAction::onActionActivated(), te::qt::plugins::rp::MixtureModelAction::onActionActivated(), te::qt::plugins::rp::MosaicAction::onActionActivated(), te::qt::plugins::rp::RegisterAction::onActionActivated(), te::qt::plugins::rp::FilterAction::onActionActivated(), te::qt::plugins::rp::ClippingAction::onActionActivated(), te::qt::plugins::rp::ContrastAction::onActionActivated(), te::qt::plugins::vp::AggregationAction::onActionActivated(), te::qt::plugins::vp::GeometricOpAction::onActionActivated(), te::qt::plugins::rp::SegmenterAction::onActionActivated(), te::qt::plugins::vp::LineToPolygonAction::onActionActivated(), te::qt::plugins::vp::IntersectionAction::onActionActivated(), te::qt::plugins::vp::TransformationAction::onActionActivated(), te::qt::plugins::vp::SummarizationAction::onActionActivated(), te::qt::plugins::vp::PolygonToLineAction::onActionActivated(), te::qt::plugins::attributefill::RasterToVectorAction::onActionActivated(), te::qt::plugins::attributefill::VectorToRasterAction::onActionActivated(), te::qt::plugins::attributefill::VectorToVectorAction::onActionActivated(), te::qt::plugins::cellspace::CreateCellLayerAction::onActionActivated(), te::qt::plugins::st::TimeSeriesAction::onActionActivated(), te::qt::plugins::st::TrajectoryAction::onActionActivated(), te::qt::plugins::st::ObservationAction::onActionActivated(), te::qt::plugins::terralib4::TL4ConverterAction::onActionActivated(), te::qt::plugins::addressgeocoding::Plugin::onActionActivated(), te::qt::af::BaseApplication::onAddDataSetLayerTriggered(), te::qt::af::BaseApplication::onAddFolderLayerTriggered(), te::qt::af::BaseApplication::onAddQueryLayerTriggered(), te::qt::af::BaseApplication::onAddTabularLayerTriggered(), te::qt::af::LayerExplorer::onApplicationTriggered(), te::qt::af::MapDisplay::onApplicationTriggered(), te::qt::af::BaseApplication::onChangeLayerDataSourceTriggered(), te::qt::af::BaseApplication::onChartDisplayCreated(), te::qt::af::MapDisplay::onCoordTracked(), te::qt::plugins::edit::ToolBar::onCreateLineToolActivated(), te::qt::af::BaseApplication::onCreateNewLayer(), te::qt::plugins::edit::ToolBar::onCreatePolygonToolActivated(), te::qt::af::BaseApplication::onDataSourceExplorerTriggered(), te::qt::af::MapDisplay::onDrawLayersFinished(), te::qt::af::BaseApplication::onDrawTriggered(), te::qt::af::BaseApplication::onHighlightLayerObjects(), te::qt::af::BaseApplication::onLayerChartTriggered(), te::qt::af::BaseApplication::onLayerFitOnMapDisplayTriggered(), te::qt::af::BaseApplication::onLayerFitSelectedOnMapDisplayTriggered(), te::qt::af::BaseApplication::onLayerGroupingTriggered(), te::qt::af::BaseApplication::onLayerHistogramTriggered(), te::qt::af::LayerExplorer::onLayerOrderChanged(), te::qt::af::BaseApplication::onLayerPanToSelectedOnMapDisplayTriggered(), te::qt::af::BaseApplication::onLayerPropertiesTriggered(), te::qt::af::BaseApplication::onLayerRemoveItemTriggered(), te::qt::af::BaseApplication::onLayerRemoveSelectionTriggered(), te::qt::af::BaseApplication::onLayerScatterTriggered(), te::qt::af::BaseApplication::onLayerSelectedObjectsChanged(), te::qt::af::BaseApplication::onLayerShowTableTriggered(), te::qt::af::BaseApplication::onLayerSRSTriggered(), te::qt::af::BaseApplication::onLayerTableClose(), te::qt::af::LayerExplorer::onLayerVisibilityChanged(), te::qt::af::BaseApplication::onLinkTriggered(), te::qt::af::BaseApplication::onMapRemoveSelectionTriggered(), te::qt::af::BaseApplication::onMapSetUnknwonSRIDTriggered(), te::qt::af::BaseApplication::onMapSRIDTriggered(), te::qt::plugins::edit::ToolBar::onMoveGeometryToolActivated(), te::qt::af::BaseApplication::onOpenProjectTriggered(), te::qt::af::BaseApplication::onPanToggled(), te::qt::af::BaseApplication::onPluginsManagerTriggered(), te::qt::plugins::rp::ClippingAction::onPopUpActionActivated(), te::qt::plugins::rp::ContrastAction::onPopUpActionActivated(), te::qt::plugins::rp::MixtureModelAction::onPopUpActionActivated(), te::qt::plugins::rp::SegmenterAction::onPopUpActionActivated(), te::qt::af::BaseApplication::onProjectPropertiesTriggered(), te::qt::af::BaseApplication::onQueryLayerTriggered(), te::qt::af::BaseApplication::onRemoveLayerTriggered(), te::qt::af::BaseApplication::onRenameLayerTriggered(), te::qt::af::BaseApplication::onSaveProjectAsTriggered(), te::qt::af::BaseApplication::onSaveProjectTriggered(), te::qt::af::LayerExplorer::onSelectedLayersChanged(), te::qt::af::BaseApplication::onSelectionToggled(), te::qt::plugins::edit::ToolBar::onSnapOptionsActivated(), te::qt::af::BaseApplication::onToolsCustomizeTriggered(), te::qt::af::BaseApplication::onToolsDataExchangerDirectPopUpTriggered(), te::qt::af::BaseApplication::onToolsDataExchangerDirectTriggered(), te::qt::af::BaseApplication::onToolsDataExchangerTriggered(), te::qt::af::BaseApplication::onToolsFixGeometryTriggered(), te::qt::af::BaseApplication::onToolsQueryDataSourceTriggered(), te::qt::af::BaseApplication::onToolsRasterMultiResolutionTriggered(), te::qt::af::LayerExplorer::onTreeItemDoubleClicked(), te::qt::af::BaseApplication::onUpdateLayerDataSourceTriggered(), te::qt::plugins::edit::ToolBar::onVertexToolActivated(), te::qt::af::BaseApplication::onZoomExtentTriggered(), te::qt::af::BaseApplication::onZoomInToggled(), te::qt::af::BaseApplication::onZoomOutToggled(), te::qt::plugins::gdal::Plugin::openFileDialog(), te::qt::af::BaseApplication::openProject(), te::qt::plugins::st::Plugin::registerActions(), RemoveBars(), te::qt::af::DataSetTableDockWidget::removeSelectedOIds(), te::qt::af::BaseApplication::resetTerraLib(), te::qt::af::ToolbarsWidget::saveChanges(), te::qt::af::TableWidget::saveChanges(), te::qt::af::DisplayWidget::saveChanges(), te::qt::af::GeneralConfigWidget::saveChanges(), te::qt::af::ChartDisplayDockWidget::selectionChanged(), te::qt::af::DataSetTableDockWidget::selectionChanged(), SetActions(), SetToolbars(), te::qt::plugins::ogr::Plugin::showWindow(), te::qt::plugins::terralib4::Plugin::showWindow(), te::qt::plugins::layout::Plugin::startup(), te::qt::plugins::cellspace::Plugin::startup(), te::qt::plugins::edit::Plugin::startup(), te::qt::plugins::attributefill::Plugin::startup(), te::qt::plugins::ogr::Plugin::startup(), te::qt::plugins::st::Plugin::startup(), te::qt::plugins::gdal::Plugin::startup(), te::qt::plugins::terralib4::Plugin::startup(), te::qt::plugins::addressgeocoding::Plugin::startup(), te::qt::plugins::vp::Plugin::startup(), te::qt::plugins::sa::Plugin::startup(), te::qt::plugins::rp::Plugin::startup(), te::qt::plugins::st::TimeSliderWidgetAction::TimeSliderWidgetAction(), te::qt::af::UpdateToolBarsInTheSettings(), te::qt::af::BaseApplication::~BaseApplication(), and te::qt::plugins::st::TimeSliderWidgetAction::~TimeSliderWidgetAction().

QWidget * te::qt::af::ApplicationController::getMainWindow ( ) const

Returns main window.

Returns
The main window pointer.

Definition at line 923 of file ApplicationController.cpp.

QMenu * te::qt::af::ApplicationController::getMenu ( const QString &  id)

Returns a menu registered with key id.

Parameters
idIdentifier of menu to be searched.
Returns
The menu registered with the id identifier.
Note
If the menu does not exists, then this function will create it.

Definition at line 196 of file ApplicationController.cpp.

References te::qt::widgets::GetMenu().

QMenuBar * te::qt::af::ApplicationController::getMenuBar ( const QString &  id) const

Returns a menu bar registered with key id.

Parameters
idIdentifier of menu bar to be searched.
Returns
The menu bar registered with the id identifier.
Note
If the menu bar does not exists, then this function will create it.

Definition at line 224 of file ApplicationController.cpp.

QString te::qt::af::ApplicationController::getMostRecentProject ( ) const

Returns the most recent project.

Returns
Application most recent opened project.

Definition at line 903 of file ApplicationController.cpp.

Referenced by te::qt::af::BaseApplication::init().

QColor te::qt::af::ApplicationController::getSelectionColor ( ) const

Returns the application selection color.

Returns
Application selection color.

Definition at line 913 of file ApplicationController.cpp.

Referenced by te::qt::af::MapDisplay::drawLayerSelection().

QSettings & te::qt::af::ApplicationController::getSettings ( )

Return the QSettings of the application. This can be used to add settings from external sources.

Returns
QSettings being used.

Definition at line 855 of file ApplicationController.cpp.

const QString & te::qt::af::ApplicationController::getTlibLogo ( ) const

Definition at line 898 of file ApplicationController.cpp.

QToolBar * te::qt::af::ApplicationController::getToolBar ( const QString &  id) const

Return the toolbar identified by id or NULL if none is found.

Parameters
idThe toolbar identification string.
Returns
A toolbar identified by id or NULL if none is found.

Definition at line 138 of file ApplicationController.cpp.

std::vector< QToolBar * > te::qt::af::ApplicationController::getToolBars ( ) const

Return the list of registered toolbars.

Returns
List of registered ToolBars.

Definition at line 145 of file ApplicationController.cpp.

const QString & te::qt::af::ApplicationController::getUserDataDir ( ) const

Definition at line 933 of file ApplicationController.cpp.

void te::qt::af::ApplicationController::initialize ( )
virtual

Initializes the application framework.

The initialization will read the following configurations files (in order):

  • A main config file, generally called config.xml
  • A user settings file, generally called user_settings.xml<li>

It will start by initializing the available TerraLib modules. This means that applications that uses the application framework, does not need to call TerraLib initialization (TerraLib::getInstance().initialize()) and finalization methods (TerraLib::getInstance().finalize()).

Exceptions
ExceptionIt throws an exception if the initialization fails.
Note
Make sure that the application calls this method BEFORE it uses any TerraLib modules or functions.

Definition at line 295 of file ApplicationController.cpp.

References te::common::Version::asString(), te::qt::af::CreateDefaultSettings(), te::common::uri::urisyn::decode(), te::common::FindInTerraLibPath(), te::qt::af::XMLFormatter::formatDataSourceInfos(), te::common::Singleton< TerraLib >::getInstance(), te::common::Singleton< HelpManager >::getInstance(), te::common::Singleton< SplashScreenManager >::getInstance(), te::common::Singleton< T >::getInstance(), TerraLib::initialize(), te::serialize::xml::ReadDataSourceInfo(), te::qt::af::SplashScreenManager::showMessage(), and TERRALIB_APPLICATION_DATASOURCE_FILE_NAME.

Referenced by te::qt::af::BaseApplication::init().

void te::qt::af::ApplicationController::initializePlugins ( )
virtual

Load the plugin list and initialize the plugins enabled by the user.

The plugin initialization will read a file containing a list of plugins with their addresses. This file is generally called application_plugins.xml.

Precondition
The application must assure that any resource needed by their plugins are ready for use. This means that initialize should be called before initializing the plugins.

Definition at line 523 of file ApplicationController.cpp.

References te::qt::af::GetDefaultPluginsNames(), te::plugin::GetInstalledPlugin(), te::common::Singleton< PluginManager >::getInstance(), te::common::Singleton< SplashScreenManager >::getInstance(), te::qt::af::GetPluginsFiles(), te::plugin::PluginInfo::m_name, and te::qt::af::SplashScreenManager::showMessage().

Referenced by te::qt::af::BaseApplication::init().

void te::qt::af::ApplicationController::initializeProjectMenus ( )
virtual

Initializes the menus for the most recent open projects.

Definition at line 656 of file ApplicationController.cpp.

References te::common::Singleton< SplashScreenManager >::getInstance(), and te::qt::af::SplashScreenManager::showMessage().

Referenced by te::qt::af::BaseApplication::init().

void te::qt::af::ApplicationController::registerMenu ( QMenu *  mnu)

Register the mnu.

Parameters
mnuPointer to the menu to be registered.

Definition at line 164 of file ApplicationController.cpp.

Referenced by te::qt::af::BaseApplication::initMenus().

void te::qt::af::ApplicationController::registerMenuBar ( QMenuBar *  bar)

Register the bar.

Parameters
barPointer to the menu bar to be registered.

Definition at line 214 of file ApplicationController.cpp.

Referenced by te::qt::af::BaseApplication::initMenus().

void te::qt::af::ApplicationController::registerToolBar ( const QString &  id,
QToolBar *  bar 
)

Register the toolbar in the list of the known toolbars.

Parameters
idThe toolbar identification string.
barThe toolbar to be registered. The controller will not take the bar ownership.
Exceptions
ExceptionIt throws an exception if a toolbar with the given id already exists.

Definition at line 128 of file ApplicationController.cpp.

References TE_TR.

Referenced by te::qt::af::BaseApplication::initToolbars().

void te::qt::af::ApplicationController::removeListener ( QObject *  obj)

Remove the obj from the list of event listeners.

Parameters
objThe application item to be removed.
Note
If the obj was not previously registered, nothing will be done.

Definition at line 283 of file ApplicationController.cpp.

Referenced by te::qt::af::BaseApplication::onLayerTableClose().

void te::qt::af::ApplicationController::removeToolBar ( const QString &  id)

Removes the toolbar identified by id.

Parameters
idIdentifier of the tool bar.

Definition at line 156 of file ApplicationController.cpp.

void te::qt::af::ApplicationController::set ( te::qt::af::Project prj)

Set the current project.

Parameters
prjPointer to a current project.

Definition at line 774 of file ApplicationController.cpp.

Referenced by te::qt::af::BaseApplication::newProject(), and te::qt::af::BaseApplication::openProject().

void te::qt::af::ApplicationController::setConfigFile ( const std::string &  configFileName)
virtual

It gives access to the controller singleton.

Returns
A pointer to the application singleton.
Precondition
The application must have been initialized before calling this method.

Tells wich configuration file to be used by the controller during its initialization.

Parameters
configFileNameThe configuration file name with full path.

Definition at line 108 of file ApplicationController.cpp.

Referenced by te::qt::af::BaseApplication::init().

void te::qt::af::ApplicationController::setMsgBoxParentWidget ( QWidget *  w)
virtual

Tells the widget to be used as the parent of messages showned in a QMessageBox.

Parameters
wThe widget to be used as the parent of messages showned in a QMessageBox.

Definition at line 113 of file ApplicationController.cpp.

void te::qt::af::ApplicationController::setResetTerraLibFlag ( const bool &  status)
void te::qt::af::ApplicationController::setSelectionColor ( const QColor &  c)

Sets the application selection color.

Definition at line 918 of file ApplicationController.cpp.

Referenced by te::qt::af::GeneralConfigWidget::saveChanges().

void te::qt::af::ApplicationController::triggered ( te::qt::af::evt::Event )
signal

Signal emmited to the aplication framework listeners.

void te::qt::af::ApplicationController::updateRecentProjects ( const QString &  prjFile,
const QString &  prjTitle 
)

Update the list of recent projects. This is commonly used when there's a new most recent project.

Parameters
prj_fileComplete file name for the project file.
prj_titleTitle of the project.

Definition at line 716 of file ApplicationController.cpp.

References te::qt::af::GetProjectInformationsFromSettings().

Referenced by te::qt::af::BaseApplication::onSaveProjectAsTriggered(), te::qt::af::BaseApplication::onSaveProjectTriggered(), and te::qt::af::BaseApplication::openProject().

Friends And Related Function Documentation

QMenu * te::qt::widgets::findMenu ( const QString &  mnuText,
QMenuBar *  bar 
)
related

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

The difference for the above function is that this will search in all QMenu objects contained in the bar.

Member Data Documentation

QString te::qt::af::ApplicationController::m_aboutLogo
protected

Definition at line 462 of file ApplicationController.h.

std::string te::qt::af::ApplicationController::m_appConfigFile
protected

The application framework configuration file.

Definition at line 455 of file ApplicationController.h.

std::string te::qt::af::ApplicationController::m_appDatasourcesFile
protected

Name of the file containing datasources used.

Definition at line 472 of file ApplicationController.h.

QString te::qt::af::ApplicationController::m_appDefaultIconTheme
protected

Name of the icon theme to be used.

Definition at line 470 of file ApplicationController.h.

QString te::qt::af::ApplicationController::m_appHelpFile
protected

Name of the help file.

Definition at line 468 of file ApplicationController.h.

QString te::qt::af::ApplicationController::m_appIconName
protected

Icon used in the application.

Definition at line 461 of file ApplicationController.h.

QString te::qt::af::ApplicationController::m_appIconThemeDir
protected

Directory of the application icon theme.

Definition at line 469 of file ApplicationController.h.

std::set<QObject*> te::qt::af::ApplicationController::m_applicationItems
protected

The list of registered application items.

Definition at line 453 of file ApplicationController.h.

QString te::qt::af::ApplicationController::m_appName
protected

Application name.

Definition at line 458 of file ApplicationController.h.

QString te::qt::af::ApplicationController::m_appOrganization
protected

Organization name.

Definition at line 457 of file ApplicationController.h.

QString te::qt::af::ApplicationController::m_appPluginsPath
protected

Name of the plugins path.

Definition at line 467 of file ApplicationController.h.

QString te::qt::af::ApplicationController::m_appProjectExtension
protected

Application project extension.

Definition at line 460 of file ApplicationController.h.

QSettings te::qt::af::ApplicationController::m_appSettings
protected

Definition at line 480 of file ApplicationController.h.

QString te::qt::af::ApplicationController::m_appTitle
protected

Application title.

Definition at line 459 of file ApplicationController.h.

QString te::qt::af::ApplicationController::m_appToolBarDefaultIconSize
protected

Size of the tool buttons.

Definition at line 471 of file ApplicationController.h.

std::string te::qt::af::ApplicationController::m_appUserSettingsFile
protected

Name of the user settings file.

Definition at line 466 of file ApplicationController.h.

int te::qt::af::ApplicationController::m_defaultSRID
protected

Default SRID value.

Definition at line 473 of file ApplicationController.h.

bool te::qt::af::ApplicationController::m_initialized
protected

A flag indicating if the controller is initialized.

Definition at line 476 of file ApplicationController.h.

std::vector<QMenuBar*> te::qt::af::ApplicationController::m_menuBars
protected

Menu bars registered.

Definition at line 452 of file ApplicationController.h.

std::vector<QMenu*> te::qt::af::ApplicationController::m_menus
protected

Menus registered.

Definition at line 451 of file ApplicationController.h.

QWidget* te::qt::af::ApplicationController::m_msgBoxParentWidget
protected

Parent used to show message boxes.

Definition at line 454 of file ApplicationController.h.

Project* te::qt::af::ApplicationController::m_project
protected

Pointer to current project.

Definition at line 478 of file ApplicationController.h.

QStringList te::qt::af::ApplicationController::m_recentProjs
protected

List of the recent projects.

Definition at line 464 of file ApplicationController.h.

QStringList te::qt::af::ApplicationController::m_recentProjsTitles
protected

List of the titles of the recent projects.

Definition at line 465 of file ApplicationController.h.

bool te::qt::af::ApplicationController::m_resetTerralib
protected

Definition at line 482 of file ApplicationController.h.

QColor te::qt::af::ApplicationController::m_selectionColor
protected

Default selection color.

Definition at line 474 of file ApplicationController.h.

QString te::qt::af::ApplicationController::m_tLibLogo
protected

Definition at line 463 of file ApplicationController.h.

std::map<QString, QToolBar*> te::qt::af::ApplicationController::m_toolbars
protected

Toolbars registered.

Definition at line 450 of file ApplicationController.h.

QString te::qt::af::ApplicationController::m_userDataDir
protected

The data dir used to store data files.

Definition at line 456 of file ApplicationController.h.


The documentation for this class was generated from the following files: