Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

QlabApplication Class Reference
[LAB Foundation Classes]

#include <qlabapplication.h>

List of all members.


Detailed Description

The QlabApplication extends the standard Qt Qapplication class.

Version:
1.2.8
Author:
DJ Anubis <labproject@free.fr>

QlabApplication class extends the standard Qt QApplication class and adds more features.

If your application calls it instead of QApplication, you start a LAB application with all LAB methods available.

Attention:
This class has 2 flavours. The standard class is used on main servers. The later "abridged" is used in embedded libraries (ie. cashboxdblib, with only some functionality).
New in 1.2.8 guiEnabled flag added to allow use with daemon tools. setup now uses the QlabCryptoAPI to allow safe network setup setup is now stored in a FPT compliant file format to allow sharing with Clip APIs. RCM engine revamped for better performance.

Sample:

        #include <qlabapplication.h>
        #include "labkiosk.h"
        #include <qdir.h>

        int main( int argc, char ** argv )
        {
                QString appname = "labkiosk" ;
        QlabApplication * a = new QlabApplication( appname, argc, argv );
                a->i18n() ;
                LabKiosk w;
        w.show();
        a->connect( a, SIGNAL( lastWindowClosed() ), a, SLOT( quit() ) );
        return a->exec();
        }

License : See License section.

Warning:
This class uses strong encryption algorithms which might be considered as illegal in some countries. If this is the case, please feel free to contact DJ Anubis <labproject@free.fr> to get a weaker or no encryption package to replace the standard one.

Public Member Functions

Private Attributes


Constructor & Destructor Documentation

QlabApplication::QlabApplication const QString &  app,
int &  argc,
char **  argv,
bool  guiEnabled = FALSE
 

Constructs a new instance of QlabApplication class
app is the Symbolic application name, argc and argv are standard C/C++ command line arguments. This is the first object you must create.

You have ONE and ONLY One instance of QlabApplication running by application program.

Note:
Instanciating this class does many behind the scene jobs.
  • Initiating backend repository connections.
    A failure occurs whenever the default connection cannot be setup. failure is expanded to a qFatal() call.
  • creating the initial cryptoAPI engine which is then used by further calls from most other Foundation Classes. (Except in QlabDatabaseCashboxClient embedded library)
  • Spawning an IniFile connection and retrieve standard parameters. INI files are seeked in /etc directory from the distribution tree. labrc file is parsed, then app name is searched if you have some specific ini values for this.
  • the Internationalization engine is fired and loads translations for System libraries and Foundation classes, providing /share/locale from the distribution tree is fed with the needed locale informations (.qm files).
  • Graphics interface (when running in graphics environment) is setup and the standard Login Form is fired.
  • The LabUser is setup and his ACLs records are bring to life and sorted before access is granted.

All Qt QApplication class methods remain available, as we inherit them. Beware: if you need direct access to advanced functionality, you MUST use labApp instead of qApp pseudo global access.


Member Function Documentation

bool QlabApplication::createConnections  ) 
 

Creates Database Connections at startup.

QString QlabApplication::getLabLicense  )  const
 

Returns LAB License key.

Unused in Free Cashbox Client

QString QlabApplication::getLabSignature  )  const
 

Returns LAB Signature.

Unused in Free Cashbox Client

int QlabApplication::getModuleId const QString &  module  ) 
 

Returns the registered application Module ID for module mane.

ModuleID has to be registered for this method. Registered modules (applications) can shared data between them, without querying a master server, using a kind of grid system to establish inter application dialogs, even via network.

Note:
In embedded version, this always return 0 as embedded cashboxes are not System Modules, but true autonomous applications.

Todo:
Document the network wide protocol used for registration and conversations.

void QlabApplication::i18n const QString &  app = 0,
const QString &  locale = 0,
QlabApplication a = 0
 

Loads Application Internationalization stuff using app appliaction name, locale as lowercase standard locale notation (fr_utf8, fr_fr, fr, ...) and a application hook.

All parameters are optional. If so:

  • app grabs the global application name
  • locale grabs the User Configuration locale from desktop
  • gets the labApp appliaction instance.


Member Data Documentation

QString QlabApplication::applicationName [private]
 

Active application name place holder.

For internal use only.

Convenient access via Global appname shortcut

QString QlabApplication::lic [private]
 

Handles crypted Lab License Key.

For internal use only.

QString QlabApplication::lsig [private]
 

Handles crypted LAB Signature.

For internal use only.

uint QlabApplication::modID [private]
 

Registered moduleID, if exists.

For internal use only.

 

L.A.B. Project © 2001-2004 LAB Project & DJ Anubis