BPS C++ API  2.24.4
BpsMdeApplication Class Referenceabstract

Virtual class for MDE applications. More...

#include <bpsmdeapplication.h>

+ Inheritance diagram for BpsMdeApplication:

Signals

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

Public Member Functions

 BpsMdeApplication (QObject *aParent=nullptr)
 Default constructor. More...
 
virtual BpsLicenseTokencreateLicenseToken (BpsDatastore *aDatastore, QObject *aParent=nullptr)
 Create a license token for a new session upon login. More...
 
virtual bool handleRequest (BpsMdeRequest *aRequest, BpsMdeSession *aSession)=0
 Handle the request for a page. More...
 
virtual QString icon () const
 
virtual bool isPermittedFor (BpsMdeSession *aSession)
 Check permission flags for a logged in session. More...
 
virtual int menuIndex () const
 Using a menuIndex the position of the application within the menu can be fixed. More...
 
virtual QStringList paths () const =0
 
virtual QString text () const
 
virtual ~BpsMdeApplication ()
 Destructor: Your application should have a virtual destructor.
 
- Public Member Functions inherited from QObject
bool blockSignals (bool block)
 
const QObjectListchildren () const const
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectInfo ()
 
void dumpObjectInfo () const const
 
void dumpObjectTree ()
 
void dumpObjectTree () const const
 
QList< QByteArraydynamicPropertyNames () const const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegExp &regExp, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
QVariant property (const char *name) const const
 
 Q_CLASSINFO (Name, Value)
 
 Q_DISABLE_COPY (Class)
 
 Q_DISABLE_COPY_MOVE (Class)
 
 Q_DISABLE_MOVE (Class)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_OBJECT Q_OBJECT
 
 Q_PROPERTY (...)
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SLOT Q_SLOT
 
 Q_SLOTS Q_SLOTS
 
qFindChild (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
 
QList< T > qFindChildren (const QObject *obj, const QString &name)
 
 QObject (QObject *parent)
 
qobject_cast (const QObject *object)
 
qobject_cast (QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds time, Qt::TimerType timerType)
 
QThreadthread () const const
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Public Attributes inherited from QObject
typedef QObjectList
 
- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
int receivers (const char *signal) const const
 
QObjectsender () const const
 
int senderSignalIndex () const const
 
virtual void timerEvent (QTimerEvent *event)
 
- Properties inherited from QObject
 objectName
 

Detailed Description

Virtual class for MDE applications.

Constructor & Destructor Documentation

◆ BpsMdeApplication()

BpsMdeApplication::BpsMdeApplication ( QObject aParent = nullptr)

Default constructor.

Parameters
aParentParent object.

Member Function Documentation

◆ createLicenseToken()

virtual BpsLicenseToken* BpsMdeApplication::createLicenseToken ( BpsDatastore aDatastore,
QObject aParent = nullptr 
)
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
aDatastoreDatastore of the session in connected state.
aParentThe parent object taking ownership of the created token.
Returns
The created license token, or 0 for sub-pages.

◆ handleRequest()

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
aRequestThe request to be handled.
aSessionThe session associated with the request.
Returns
True if request was handled, false if not and server shall send a "resource not found" reply.

◆ icon()

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.

◆ isPermittedFor()

virtual bool BpsMdeApplication::isPermittedFor ( BpsMdeSession aSession)
virtual

Check permission flags for a logged in session.

The default implementation returns true.

Parameters
aSessionThe session to check permission for.
Returns
True if permitted for the session.

◆ logError

void BpsMdeApplication::logError ( const QString aText)
signal

Emitted when a error should get logged.

Parameters
aTextThe text to log.

◆ logInformation

void BpsMdeApplication::logInformation ( const QString aText)
signal

Emitted when a information should get logged.

Parameters
aTextThe text to log.

◆ logSuccess

void BpsMdeApplication::logSuccess ( const QString aText)
signal

Emitted when a success should get logged.

Parameters
aTextThe text to log.

◆ logWarning

void BpsMdeApplication::logWarning ( const QString aText)
signal

Emitted when a warning should get logged.

Parameters
aTextThe text to log.

◆ menuIndex()

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.

◆ paths()

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.

◆ text()

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: