The base API for TerraLib applications. More...
#include <ApplicationController.h>
Signals | |
void | triggered (te::qt::af::evt::Event *) |
Send events in broadcast for all registered components. More... | |
Public Member Functions | |
void | addListener (QObject *obj, const ListenerType &type=BOTH) |
Insert an application item that will listen to framework events. More... | |
ApplicationController () | |
Constructor. More... | |
virtual void | finalize () |
Finalize the application framework. More... | |
virtual void | finalizePlugins () |
const QString & | getAboutLogo () const |
Returns the application project extension. More... | |
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 & | getAppTitle () const |
Returns the application title. More... | |
int | getDefaultSRID () const |
Returns the most recent project. More... | |
QWidget * | getMainWindow () const |
Returns main window. 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... | |
void | removeListener (QObject *obj) |
Remove the obj from the list of event listeners. More... | |
virtual void | setConfigFile (const std::string &configFileName) |
Tells wich configuration file to be used by the controller during its initialization. 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 | trigger (te::qt::af::evt::Event *) |
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.
| |
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... | |
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... | |
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... | |
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 |
The base API for TerraLib applications.
Definition at line 85 of file ApplicationController.h.
te::qt::af::ApplicationController::ApplicationController | ( | ) |
Constructor.
parent | The parent object. |
|
virtual |
Destructor.
void te::qt::af::ApplicationController::addListener | ( | QObject * | obj, |
const ListenerType & | type = BOTH |
||
) |
Insert an application item that will listen to framework events.
obj | The application item that will listen to framework events. |
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.
id | The toolbar identification string. |
bar | The toolbar to be registered. The controller will not take the bar ownership. |
An event will be broadcasted to indicate that the toolbar was appended.
Exception | It throws an exception if a toolbar with the given id already exists. |
|
virtual |
|
virtual |
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.
id | Identifier if the action. |
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.
id | Identifier of the action group. |
QMenu* te::qt::af::ApplicationController::findMenu | ( | const QString & | id | ) | const |
Returns the menu registered with key id.
id | Indentifier of the menu. |
QMenuBar* te::qt::af::ApplicationController::findMenuBar | ( | const QString & | id | ) | const |
Returns the menu bar registered with key id.
id | Indentifier of the menu bar. |
const QString& te::qt::af::ApplicationController::getAboutLogo | ( | ) | const |
Returns the application project extension.
const QString& te::qt::af::ApplicationController::getAppIconName | ( | ) | const |
Returns the application icon.
const QString& te::qt::af::ApplicationController::getAppName | ( | ) | const |
Returns the application name.
const QString& te::qt::af::ApplicationController::getAppPluginsPath | ( | ) | const |
Returns the plugins file path of application.
const QString& te::qt::af::ApplicationController::getAppTitle | ( | ) | const |
Returns the application title.
int te::qt::af::ApplicationController::getDefaultSRID | ( | ) | const |
Returns the most recent project.
Returns the application default SRID value.
QWidget* te::qt::af::ApplicationController::getMainWindow | ( | ) | const |
Returns main window.
QMenu* te::qt::af::ApplicationController::getMenu | ( | const QString & | id | ) |
Returns a menu registered with key id.
id | Identifier of menu to be searched. |
QMenuBar* te::qt::af::ApplicationController::getMenuBar | ( | const QString & | id | ) | const |
Returns a menu bar registered with key id.
id | Identifier of menu bar to be searched. |
QColor te::qt::af::ApplicationController::getSelectionColor | ( | ) | const |
Returns the application selection color.
QSettings& te::qt::af::ApplicationController::getSettings | ( | ) |
Return the QSettings of the application. This can be used to add settings from external sources.
const QString& te::qt::af::ApplicationController::getTlibLogo | ( | ) | const |
QToolBar* te::qt::af::ApplicationController::getToolBar | ( | const QString & | id | ) | const |
Return the toolbar identified by id or NULL if none is found.
id | The toolbar identification string. |
std::vector<QToolBar*> te::qt::af::ApplicationController::getToolBars | ( | ) | const |
Return the list of registered toolbars.
const QString& te::qt::af::ApplicationController::getUserDataDir | ( | ) | const |
|
virtual |
Initializes the application framework.
The initialization will read the following configurations files (in order):
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()).
Exception | It throws an exception if the initialization fails. |
|
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.
void te::qt::af::ApplicationController::registerMenu | ( | QMenu * | mnu | ) |
Register the mnu.
mnu | Pointer to the menu to be registered. |
void te::qt::af::ApplicationController::registerMenuBar | ( | QMenuBar * | bar | ) |
Register the bar.
bar | Pointer to the menu bar to be registered. |
void te::qt::af::ApplicationController::registerToolBar | ( | const QString & | id, |
QToolBar * | bar | ||
) |
Register the toolbar in the list of the known toolbars.
id | The toolbar identification string. |
bar | The toolbar to be registered. The controller will not take the bar ownership. |
Exception | It throws an exception if a toolbar with the given id already exists. |
void te::qt::af::ApplicationController::removeListener | ( | QObject * | obj | ) |
Remove the obj from the list of event listeners.
obj | The application item to be removed. |
void te::qt::af::ApplicationController::removeToolBar | ( | const QString & | id | ) |
Removes the toolbar identified by id.
id | Identifier of the tool bar. |
|
virtual |
Tells wich configuration file to be used by the controller during its initialization.
configFileName | The configuration file name with full path. |
|
virtual |
Tells the widget to be used as the parent of messages showned in a QMessageBox.
w | The widget to be used as the parent of messages showned in a QMessageBox. |
void te::qt::af::ApplicationController::setResetTerraLibFlag | ( | const bool & | status | ) |
void te::qt::af::ApplicationController::setSelectionColor | ( | const QColor & | c | ) |
Sets the application selection color.
void te::qt::af::ApplicationController::trigger | ( | te::qt::af::evt::Event * | ) |
|
signal |
Send events in broadcast for all registered components.
evt | Event to be sent. |
Signal emmited to the aplication framework listeners.
|
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.
|
protected |
Definition at line 432 of file ApplicationController.h.
|
protected |
The application framework configuration file.
Definition at line 426 of file ApplicationController.h.
|
protected |
Name of the file containing datasources used.
Definition at line 440 of file ApplicationController.h.
|
protected |
Name of the icon theme to be used.
Definition at line 438 of file ApplicationController.h.
|
protected |
Name of the help file.
Definition at line 436 of file ApplicationController.h.
|
protected |
Icon used in the application.
Definition at line 431 of file ApplicationController.h.
|
protected |
Directory of the application icon theme.
Definition at line 437 of file ApplicationController.h.
|
protected |
The list of registered application items.
Definition at line 424 of file ApplicationController.h.
|
protected |
Application name.
Definition at line 429 of file ApplicationController.h.
|
protected |
Organization name.
Definition at line 428 of file ApplicationController.h.
|
protected |
Name of the plugins path.
Definition at line 435 of file ApplicationController.h.
|
protected |
Definition at line 446 of file ApplicationController.h.
|
protected |
Application title.
Definition at line 430 of file ApplicationController.h.
|
protected |
Size of the tool buttons.
Definition at line 439 of file ApplicationController.h.
|
protected |
Name of the user settings file.
Definition at line 434 of file ApplicationController.h.
|
protected |
Default SRID value.
Definition at line 441 of file ApplicationController.h.
|
protected |
A flag indicating if the controller is initialized.
Definition at line 444 of file ApplicationController.h.
|
protected |
Menu bars registered.
Definition at line 423 of file ApplicationController.h.
|
protected |
Menus registered.
Definition at line 422 of file ApplicationController.h.
|
protected |
Parent used to show message boxes.
Definition at line 425 of file ApplicationController.h.
|
protected |
Definition at line 448 of file ApplicationController.h.
|
protected |
Default selection color.
Definition at line 442 of file ApplicationController.h.
|
protected |
Definition at line 433 of file ApplicationController.h.
|
protected |
Toolbars registered.
Definition at line 421 of file ApplicationController.h.
|
protected |
The data dir used to store data files.
Definition at line 427 of file ApplicationController.h.