MagicSmoke  $VERSION$
MTGetLanguage Class Reference

This transaction returns basic language and formatting settings from the server - it must be used before the client displays any times or monetary values, even if it does not indend to translate any strings. If the transaction fails on the first attempt (eg. because the language could not be found), the client MUST repeat the request with "C" as language to retrieve formatting rules - "C" as language MUST succeed on the server, regardless of any other settings. More...

#include <srcMTGetLanguage.h>

Inheritance diagram for MTGetLanguage:
MTransaction

Public Member Functions

 MTGetLanguage ()
 default constructor: generates an invalid transaction More...
 
 MTGetLanguage (const MTGetLanguage &)
 copy constructor: the two copies share their state More...
 
virtual ~MTGetLanguage ()
 deletes this instance More...
 
Q_SLOT Nullable< QByteArray > getfile () const
 The Qt translation file to translate string from the server. All strings are found in the virtual class "::php". More...
 
Q_SLOT Nullable< MOServerFormatgetformats () const
 The formatting as requested by the server. Please note that the names of days and months does not necessarily correspond to the language that has been request but, to the language that the server wants to set for all printouts. More...
 
Q_SLOT Nullable< QString > getstatusBarText () const
 Text (plain or HTML) shown on the client's status bar. More...
 
MTGetLanguageoperator= (const MTGetLanguage &)
 copy assignment: the copy shares the state of the original object More...
 

Static Public Member Functions

static MTGetLanguage asyncQuery (const QString &alanguage, const QString &aformat, QString iface="MagicSmoke")
 emits the query over the network and returns the transaction object, use isFinished() to check for the transaction's state More...
 
static MTGetLanguage query (const QString &alanguage, const QString &aformat, QString iface="MagicSmoke")
 emits the query over the network and returns the finished transaction object More...
 
- Static Public Member Functions inherited from MTransaction
static void setStartStopActions (const MTStartStop &start, const MTStartStop &stop)
 set actions to be executed at start/stop More...
 

Protected Member Functions

 MTGetLanguage (const QString &alanguage, const QString &aformat, QString iface)
 generates an instance from its properties More...
 
virtual void endQuery ()
 
- Protected Member Functions inherited from MTransaction
 MTransaction (QString iface=QString())
 internal: construct the transaction More...
 
 MTransaction (const WTransaction &)
 internal: copy the transaction More...
 
 MTransaction (const MTransaction &)
 internal: copy the transaction More...
 
QByteArray executeQuery (QString, QByteArray)
 internal: extend executeQuery to show a wait cursor More...
 

Friends

class MTGetLanguage_Private
 

Detailed Description

This transaction returns basic language and formatting settings from the server - it must be used before the client displays any times or monetary values, even if it does not indend to translate any strings. If the transaction fails on the first attempt (eg. because the language could not be found), the client MUST repeat the request with "C" as language to retrieve formatting rules - "C" as language MUST succeed on the server, regardless of any other settings.

Constructor & Destructor Documentation

MTGetLanguage::MTGetLanguage ( const QString &  alanguage,
const QString &  aformat,
QString  iface 
)
explicitprotected

generates an instance from its properties

Parameters
alanguageThe language that the client wants to use, use "C" for no translation wanted.
aformatThe translation file format that the client supports: either "ts" for Qt translation XML source files, or "qm" for translated binary Qt translation files.
ifaceID of the interface that the transaction will be sent on

References MTGetLanguage_Private::in_format, MTGetLanguage_Private::in_language, and MTGetLanguage_Private.

MTGetLanguage::MTGetLanguage ( )

default constructor: generates an invalid transaction

References MTGetLanguage_Private.

MTGetLanguage::MTGetLanguage ( const MTGetLanguage t)

copy constructor: the two copies share their state

References MTGetLanguage_Private::attach().

MTGetLanguage::~MTGetLanguage ( )
virtual

deletes this instance

References MTGetLanguage_Private::detach().

Member Function Documentation

MTGetLanguage MTGetLanguage::asyncQuery ( const QString &  alanguage,
const QString &  aformat,
QString  iface = "MagicSmoke" 
)
static

emits the query over the network and returns the transaction object, use isFinished() to check for the transaction's state

Parameters
alanguageThe language that the client wants to use, use "C" for no translation wanted.
aformatThe translation file format that the client supports: either "ts" for Qt translation XML source files, or "qm" for translated binary Qt translation files.
ifaceID of the interface that the transaction will be sent on
void MTGetLanguage::endQuery ( )
protectedvirtual
Nullable< QByteArray > MTGetLanguage::getfile ( ) const

The Qt translation file to translate string from the server. All strings are found in the virtual class "::php".

References MTGetLanguage_Private::out_file.

Referenced by MSInterface::initialize().

Nullable< MOServerFormat > MTGetLanguage::getformats ( ) const

The formatting as requested by the server. Please note that the names of days and months does not necessarily correspond to the language that has been request but, to the language that the server wants to set for all printouts.

References MTGetLanguage_Private::out_formats.

Referenced by MSInterface::initialize().

Nullable< QString > MTGetLanguage::getstatusBarText ( ) const

Text (plain or HTML) shown on the client's status bar.

References MTGetLanguage_Private::out_statusBarText.

Referenced by MSInterface::initialize().

MTGetLanguage & MTGetLanguage::operator= ( const MTGetLanguage t)

copy assignment: the copy shares the state of the original object

References MTGetLanguage_Private::attach(), and MTGetLanguage_Private::detach().

MTGetLanguage MTGetLanguage::query ( const QString &  alanguage,
const QString &  aformat,
QString  iface = "MagicSmoke" 
)
static

emits the query over the network and returns the finished transaction object

Parameters
alanguageThe language that the client wants to use, use "C" for no translation wanted.
aformatThe translation file format that the client supports: either "ts" for Qt translation XML source files, or "qm" for translated binary Qt translation files.
ifaceID of the interface that the transaction will be sent on

Referenced by MSInterface::initialize(), and MInterface::queryGetLanguage().

Friends And Related Function Documentation

friend class MTGetLanguage_Private
friend

Referenced by MTGetLanguage().


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