LibEngsas
Public Types | Public Slots | Signals | Public Member Functions | List of all members
EPart Class Referenceabstract

Implement this class to create an object, which can be used in several applications. More...

#include <epart.h>

+ Inheritance diagram for EPart:
+ Collaboration diagram for EPart:

Public Types

enum  InitState { Exit, Failed, Successful }
 Used to identify the result of the init() function. More...
 

Public Slots

virtual void show ()=0
 This should show the standard widget of this module. More...
 
- Public Slots inherited from EObject
virtual void reloadSettings ()
 Used to reload the settings. More...
 

Signals

virtual void showSetupWizard ()=0
 
- Signals inherited from EObject
void error (const QString &message)
 
void warning (const QString &message)
 
void information (const QString &message)
 
void reloadEnableActions ()
 Request reloading of enabled actions in EMainWindow. More...
 
void addMenu (QMenu *newMenu, const QString &parent, QString before=QString())
 
void addAction (QAction *newAction, const QString &parent, QString before=QString())
 
void addToolBar (QToolBar *newToolBar, Qt::ToolBarArea area=Qt::TopToolBarArea)
 
void addNewDockWidget (QDockWidget *widget, const Qt::DockWidgetArea &area)
 
void setCentralWidget (QWidget *centralWidget)
 
void showSettings ()
 
void showHelp (const QString &page)
 
void showStatusWidget (QWidget *widget)
 
void reloadSettingsRequest ()
 Indicates, that a reload of the settings is needed. More...
 
void doReloadSettings ()
 Emitted to bring the reload request back to the farest child. More...
 

Public Member Functions

virtual QString translationDir () const =0
 Should return the directory, where all translations for this part can be found. More...
 
virtual QString resourceDir () const =0
 Should return the resource directory, where all resources for this part can be found. More...
 
virtual EngSaS::CmdLineOptions cmdLineArgs () const =0
 Return a list a supported command line options. More...
 
virtual InitState init (ECmdLineArgs *args, bool standalone=false)=0
 Called to setup the EPart. More...
 
virtual QString name () const =0
 Return the real long name of the EPart. More...
 
virtual QString shortName () const =0
 Return the short name of the EPart (used as window title and for QSettings). More...
 
virtual QImage icon () const =0
 Return an icon to represent the EPartMainWindow. More...
 
virtual QString helpDescription () const =0
 Return the help description of the EPart. More...
 
virtual QString description () const =0
 Return the description of the EPart. More...
 
virtual QUrl website () const =0
 The Url to the website of this EPart. More...
 
virtual QString versionString () const =0
 Return the version of this EPart. More...
 
virtual QString libEngsasVersion () const =0
 The LibEngsas version at compile time of your EPart. More...
 
virtual EHelpCenterSetup helpSetup ()=0
 Used to setup the EHelpCenter correctly for this part. More...
 
virtual EDependencyItemdependencies ()=0
 Return all needed dependencies (like used libraries) as or in an EDependencyItem. More...
 
virtual EngSaS::SetupWizardObjects setupWizardObjects ()=0
 Return a list with ESetupObjects, which should be placed in an ESetupWizard before show() is called. More...
 
virtual EngSaS::AboutPersons aboutPersons ()=0
 A list of persons, who should be mentioned at the about dialog. More...
 
virtual ESettingsModelItemsettingsModelItem ()=0
 The returned item should contain all needed settings for this EPart. More...
 
- Public Member Functions inherited from EObject
 EObject (QObject *parent=0)
 
virtual ~EObject ()
 
void connectByPass (QObject *object)
 

Additional Inherited Members

- Static Public Member Functions inherited from EObject
static void connectByPass (QObject *parent, QObject *child)
 
- Protected Slots inherited from EObject
virtual void errorByPass (const QString &message)
 
virtual void warningByPass (const QString &message)
 
virtual void informationByPass (const QString &message)
 
virtual void reloadEnableActionsByPass ()
 
virtual void addMenuByPass (QMenu *newMenu, const QString &parent, QString before=QString())
 
virtual void addActionByPass (QAction *newAction, const QString &parent, QString before=QString())
 
virtual void addToolBarByPass (QToolBar *newToolBar, Qt::ToolBarArea area=Qt::TopToolBarArea)
 
virtual void addNewDockWidgetByPass (QDockWidget *widget, const Qt::DockWidgetArea &area)
 
virtual void setCentralWidgetByPass (QWidget *centralWidget)
 
virtual void showSettingsByPass ()
 
virtual void showHelpByPass (const QString &page)
 
virtual void showStatusWidgetByPass (QWidget *widget)
 
virtual void reloadSettingsRequestByPass ()
 
- Protected Member Functions inherited from EObject
void addManagedDockWidget (QDockWidget *widget, const Qt::DockWidgetArea &area, QString actionLabel=QString(), QString actionParent=QString())
 Adds an dock widget via addNewDockWidget() and adds widget to the list of managed dock widgets. More...
 

Detailed Description

Implement this class to create an object, which can be used in several applications.

It is compareable to KDE KParts, but also a bit differently in detail. The loading of an EPart contains the following steps:

To implement libEngsasVersion() function, just add EPART_LIBENGSAS_VERSION to your header.

Note
Do not forget to register the functions icon(), shortName() and description() as an Q_PROPERTY like shown below:
Q_PROPERTY(QString name READ shortName)
Q_PROPERTY(QString description READ description)
Q_PROPERTY(QImage icon READ icon)
You can use the class TestEParts from LibEngsas-testing to make sure, that your parts pass some basic quality checks.
QString error;
part = ELibrary::loadEPart("Partname", error, false);
if(!part || !error.isEmpty()){
emit error(tr("Could not load Partname!\n(%1)").arg(error));
return EPart::Failed;
}
connect(part, SIGNAL(showSetupWizard()), this, SLOT(showSetupWizardByPass()));
part->init(args, false);

To use the EPart as a standalone application, nothing needs to be done, but installing the EPart into the ELibrary EPart-directory. Afterwards just call

epartexe Partname

to open the EPart as a standalone application.

See also
EPartMainWindow to integrate your EPart into an standalone application
Todo:

Plugins should be allowed to be licensed under different licenses than GPLv2, e.g. LGPL for not soo free sources -> this will lead to provide a license by every epart and will also need some changes in epartexe

Add function to epart interface providing a help text regarding the eparts general functionality and usage (special descriptions regarding the options are located in the option list)

Member Enumeration Documentation

Used to identify the result of the init() function.

Enumerator
Exit 

means, that the init was successful, but the application should exit now. This can be the case, if commandline arguments are used, which requires only some processing and the processing was done successful without any further interaction neeed.

Failed 

init or the started operations have failed

Successful 

everything is alright

Member Function Documentation

virtual EngSaS::AboutPersons EPart::aboutPersons ( )
pure virtual

A list of persons, who should be mentioned at the about dialog.

result << new EAboutPerson("Important", "Very", "very.important@example.org", EAboutPersons::Author);
result << new EAboutPerson("Important", "Lesser", EAboutPersons::Thanks);
return result;

+ Here is the caller graph for this function:

virtual EngSaS::CmdLineOptions EPart::cmdLineArgs ( ) const
pure virtual

Return a list a supported command line options.

Some like -v or -h are added by the epartexe automatically.

+ Here is the caller graph for this function:

virtual EDependencyItem* EPart::dependencies ( )
pure virtual

Return all needed dependencies (like used libraries) as or in an EDependencyItem.

+ Here is the caller graph for this function:

virtual QString EPart::description ( ) const
pure virtual

Return the description of the EPart.

+ Here is the caller graph for this function:

virtual QString EPart::helpDescription ( ) const
pure virtual

Return the help description of the EPart.

+ Here is the caller graph for this function:

virtual EHelpCenterSetup EPart::helpSetup ( )
pure virtual

Used to setup the EHelpCenter correctly for this part.

See also
EHelpCenter
EHelpCenterSetup

+ Here is the caller graph for this function:

virtual QImage EPart::icon ( ) const
pure virtual

Return an icon to represent the EPartMainWindow.

+ Here is the caller graph for this function:

virtual InitState EPart::init ( ECmdLineArgs args,
bool  standalone = false 
)
pure virtual

Called to setup the EPart.

This is the first function called from an EPart, after creating an instance of the part. You should not emit showSetupWizard() within this context, because the setupwizard is normally shown later on, to let the application load all EParts and show one setupwizard for all EParts.

The specified command line arguments are given with args and can be parsed with help of ECmdLineArgs. standalone is set to true, if the EPart is the only part, which is loaded. The Epart may organize it's menus and actions in another way then. For example in standalone mode, it's actions are placed under File-menu and if standalone is false, the actions are placed in an submenu below the File-menu.

Returns
the result state of the operations
Note
Before you call this function you should connect nearly all of the signals

+ Here is the caller graph for this function:

virtual QString EPart::libEngsasVersion ( ) const
pure virtual

The LibEngsas version at compile time of your EPart.

To implement this function at your EPart, just add EPART_LIBENGSAS_VERSION to your header file.

See also
EPART_LIBENGSAS_VERSION
virtual QString EPart::name ( ) const
pure virtual

Return the real long name of the EPart.

See also
shortName()

+ Here is the caller graph for this function:

virtual QString EPart::resourceDir ( ) const
pure virtual

Should return the resource directory, where all resources for this part can be found.

The resource directory should contain all resource files provided by this EPart (not Qt or LibEngsas ones).

Returns
A QString, pointing to the directory which contains the resource (*.rcc) files. Return an empty string, if you do not provide resources.
See also
translationDir()

+ Here is the caller graph for this function:

virtual ESettingsModelItem* EPart::settingsModelItem ( )
pure virtual

The returned item should contain all needed settings for this EPart.

See also
ESettingsModelItem
ESettingsDialog

+ Here is the caller graph for this function:

virtual EngSaS::SetupWizardObjects EPart::setupWizardObjects ( )
pure virtual

Return a list with ESetupObjects, which should be placed in an ESetupWizard before show() is called.

+ Here is the caller graph for this function:

virtual QString EPart::shortName ( ) const
pure virtual

Return the short name of the EPart (used as window title and for QSettings).

See also
name()

+ Here is the caller graph for this function:

virtual void EPart::show ( )
pure virtualslot

This should show the standard widget of this module.

+ Here is the caller graph for this function:

virtual void EPart::showSetupWizard ( )
pure virtualsignal
virtual QString EPart::translationDir ( ) const
pure virtual

Should return the directory, where all translations for this part can be found.

The translation directory should contain all translation files provided by this EPart (not Qt or LibEngsas ones).

Returns
A QString, pointing to the directory which contains the translation files. Return an empty string, if you do not provide translations.
See also
resourceDir()

+ Here is the caller graph for this function:

virtual QString EPart::versionString ( ) const
pure virtual

Return the version of this EPart.

+ Here is the caller graph for this function:

virtual QUrl EPart::website ( ) const
pure virtual

The Url to the website of this EPart.

Should be relative to engsas.de to get localized absolute url in EAboutDialog.

+ Here is the caller graph for this function:


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