Documents > BPS V2 C++ API
BpsMdeApplication Class Reference

Virtual class for MDE applications. More...

#include <bpsmdeapplication.h>

List of all members.

Signals

void logError (const QString &aText)
 Emitted when a error should get logged.
void logInformation (const QString &aText)
 Emitted when a information should get logged.
void logSuccess (const QString &aText)
 Emitted when a success should get logged.
void logWarning (const QString &aText)
 Emitted when a warning should get logged.

Public Member Functions

 BpsMdeApplication (QObject *aParent=0)
 Default constructor.
virtual BpsLicenseTokencreateLicenseToken (BpsDatastore *aDatastore, QObject *aParent=0)
 Create a license token for a new session upon login.
virtual bool handleRequest (BpsMdeRequest *aRequest, BpsMdeSession *aSession)=0
 Handle the request for a page.
virtual QString icon () const
virtual bool isPermittedFor (BpsMdeSession *aSession)
 Check permission flags for a logged in session.
virtual int menuIndex () const
 Using a menuIndex the position of the application within the menu can be fixed.
virtual QStringList paths () const =0
virtual QString text () const
virtual ~BpsMdeApplication ()
 Destructor: Your application should have a virtual destructor.

Detailed Description

Virtual class for MDE applications.


Constructor & Destructor Documentation

BpsMdeApplication::BpsMdeApplication ( QObject *  aParent = 0)

Default constructor.

Parameters:
[in]aParentParent object.

Member Function Documentation

virtual BpsLicenseToken* BpsMdeApplication::createLicenseToken ( BpsDatastore aDatastore,
QObject *  aParent = 0 
) [virtual]

Create a license token for a new session upon login.

Every main application should create a license token, at least for monitoring usage even if the license is free and unlimited. Sub-pages need not implement this function, the default implementation returns 0, bypassing the check for a valid license.

Parameters:
[in]aDatastoreDatastore of the session in connected state.
[in]aParentThe parent object taking ownership of the created token.
Returns:
The created license token, or 0 for sub-pages.
virtual bool BpsMdeApplication::handleRequest ( BpsMdeRequest aRequest,
BpsMdeSession aSession 
) [pure virtual]

Handle the request for a page.

Your application will only get requests to handle where the path begins with one of your main pages, for example "/myapp1/some_more_stuff_here".

Parameters:
[in]aRequestThe request to be handled.
[in]aSessionThe session associated with the request.
Returns:
True if request was handled, false if not and server shall send a "resource not found" reply.
virtual QString BpsMdeApplication::icon ( ) const [virtual]
Returns:
Path to the application icon image, a 32 x 32 GIF, for example "/myapp1/img/myico_32.gif". The default implementation returns an empty string, so no menu item is created.
virtual bool BpsMdeApplication::isPermittedFor ( BpsMdeSession aSession) [virtual]

Check permission flags for a logged in session.

The default implementation returns true.

Parameters:
[in]aSessionThe session to check permission for.
Returns:
True if permitted for the session.
void BpsMdeApplication::logError ( const QString &  aText) [signal]

Emitted when a error should get logged.

Parameters:
[in]aTextThe text to log.
void BpsMdeApplication::logInformation ( const QString &  aText) [signal]

Emitted when a information should get logged.

Parameters:
[in]aTextThe text to log.
void BpsMdeApplication::logSuccess ( const QString &  aText) [signal]

Emitted when a success should get logged.

Parameters:
[in]aTextThe text to log.
void BpsMdeApplication::logWarning ( const QString &  aText) [signal]

Emitted when a warning should get logged.

Parameters:
[in]aTextThe text to log.
virtual int BpsMdeApplication::menuIndex ( ) const [virtual]

Using a menuIndex the position of the application within the menu can be fixed.

Applications plugging directly into the MDE server should not implement this but use the default method which will return -1 and leave it up to the MDE server to order the application menu. When using this class as template to create pages within the own application, it may be of use to have the items ordered in a certain way. By convention the "exit" function should be placed at menuIndex 9.

Returns:
The menu index in range 1...9, or -1 if menu order is up to the upstream software.
virtual QStringList BpsMdeApplication::paths ( ) const [pure virtual]
Returns:
A list of root paths handled by the application, for example ("/myapp1", "/myapp2"). The first path in the list is used as entry point when calling the application. The paths should not end with a slash.
virtual QString BpsMdeApplication::text ( ) const [virtual]
Returns:
Label text for the application menu item. The default implementation returns an empty string, so no menu item is created.

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