Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

ZApplication Class Reference

The ZApplication class implements various services that are available to EZX applications. More...

#include <ZApplication.h>

Inheritance diagram for ZApplication::

QApplication List of all members.

Public Types

enum  { LEFT_ONLY = 0, PRESS_HOLD }
 EZX widgets have two mouse respond modes:. More...


Signals

void appMessage (const QCString &msg, const QByteArray &data)
 Emitted when the application receive a message over the application Channel which is pre-created and its channel name is EZX/Application/appname. More...

void shutdown ()
 Emitted when the phone is going to shutdown. More...

void quickQuit ()
 Emitted when the application manager requests this application to quit. More...

void clickAppIcon ()
 Emitted when this application icon on the home screen is clicked. More...

void signalRaise ()
 Emitted when this application is raised from the background to the foreground. More...

void signalOpenDoc (const QString &doc)
 Emitted when another application requests this application to open a file. More...

void signalBridgeMessage (const QByteArray &data)
 Emitted when another application sends a message to this application. More...

void signalBridgeMessage (const QCString &action, const QByteArray &data)
 Emitted when another application sends a message to this application. More...

void signalBridgeMessageWithoutRaise (const QCString &action, const QByteArray &data)
 Emitted when another application sends a message to this application. More...

void signalHomeKeyClicked ()
 Emitted when the 'Home' hardkey is clicked. More...

void signalMasterClear ()
 Emitted when user has selected to do a master clear. More...

void signalMasterReset ()
 Emitted when the system is doing a master reset. More...

void editableWidgetClicked (int mwId, bool canClick)
 Emitted when the user has clicked in an editable widget. More...

void systemMessage (const QCString &msg, const QByteArray &data)
 Emitted when the application received a message via the system QCopChannel. More...


Public Methods

 ZApplication (int &argc, char **argv, Type=GuiClient)
 Constructor of ZApplication. More...

virtual ~ZApplication ()
 Destructor of ZApplication. More...

virtual void setMainWidget (QWidget *mainWidget)
 Reimplement Set the main widget of the application. More...

void showMainWidget (QWidget *mainWidget)
 Set the main widget of the application and show it. More...

int exec ()
 Reimplement enter the application main event loop. More...

void setAutoInvokeKb (bool invoke=true)
 Set the flag to enable/disable invoking the input widget automatically when text entry is clicked. More...

bool getAutoInvokeKb ()
 Get the flag to enable/disable invoking the input widget automatically when text entry is clicked. More...

void setAutoHideKb (bool hide=false)
 Set the flag to enable/disable hiding the input widget automatically by clicking a non-text-entry widget when the input widget is visible. More...

bool getAutoHideKb ()
 Get the flag that indicates whether or not the input widget should be automatically hidden when a non-text-entry widget is clicked. More...

void setDefaultKbMethod (const QUuid &method)
 Set the application's default input method. More...

const QUuid getDefaultKbMethod (bool readConfig=false)
 Get the application default input method. More...

void startShowWaitCursor (int startTime=0, const QString &resId=QString::null)
 Start to show a wait cursor. More...

void stopShowWaitCursor ()
 Stop a wait cursor. More...

void loadString (const QString &strFileName)
 Load string resource files (.qm files). More...

const QString& getAppName ()
 Get the application's name. More...

void enableTouchSound (bool enable=true)
 Enable/disable the touch panel's sound when the application's widgets are clicked. More...

void enableHardKeyEventFilter (bool enable=true)
 Enable/disable the hardkey event filter. More...

bool getHardKeyEventFilter ()
 Get the flag to enable/disable the hardkey event filter. More...

void raiseAppWindows ()
 Raise all widgets in this application. More...

const QIMMapgetIMList ()
 Get input method name list. More...

void updateIMNameList ()
 Update input methods name. More...

void flushMsgs ()
 Flush the messages in the message queue. More...

int getTouchSoundMsgQueue ()
 Get the touch panel msg queue. More...

virtual void insertStr (QWSEvent *e)

Static Public Methods

void setMouseMode (QWidget *widget, int mode)
 Enable/disable the press-and-hold for a widget. More...

int getMouseMode (QWidget *widget)
 Get the widget's mouse mode. More...


Protected Slots

virtual void slotShutdown ()
 The default implementation of this slot will cause the current application to exit. More...

virtual void slotQuickQuit ()
 The default implementation of this slot will cause the current application to exit. More...

virtual void slotClickAppIcon ()
 By default, this slot is connected to signal clickAppIcon(). More...

virtual void slotRaise ()
 By default, this slot is connected to signal signalRaise(). More...


Protected Methods

bool qwsEventFilter (QWSEvent *e)
 Reimplement. More...

virtual bool eventFilter (QObject *o, QEvent *e)
 Reimplement. More...

virtual void timerEvent (QTimerEvent *e)
 Reimplement. More...

virtual void tryQuit ()
 Try to quit the application. More...

virtual bool hardKeyEventFilter (QEvent *e)
 Event filter for the ezx hard keys. More...

void setMaxWindowRect ()
 Set the applications max screen size. More...

void setEnv (const QString &env)
 Set the environment variable. More...


Detailed Description

The ZApplication class implements various services that are available to EZX applications.

Qt applications that use ZApplication instead of QApplication, should became standard EZX applications. They inherit EZX Styles, and some EZX-specific features

 ZApplication a(argc,argv);
 ZMainWidget* w = new ZMainWidget(true,0);
 w->show();
 a.exec();
 delete w;

See also:
ZMainWidget


Member Enumeration Documentation

anonymous enum
 

EZX widgets have two mouse respond modes:.

1. Application only responds to press (left) mouse events. 2. Application also responds to press-and-hold (right) mouse events.

Can use the setMouseMode() to set the widget's responsive mode.

Enumeration values:
LEFT_ONLY   \c Only support LEFT mouse events.
PRESS_HOLD   \c support PRESS_HOLD funstions.


Constructor & Destructor Documentation

ZApplication::ZApplication ( int & argc,
char ** argv,
Type = GuiClient )
 

Constructor of ZApplication.

argc, argv and Type are same as QApplication's. for applications, Type should be GuiClient, only the EZX Server can pass GuiServer.

ZApplication::~ZApplication ( ) [virtual]
 

Destructor of ZApplication.


Member Function Documentation

void ZApplication::appMessage ( const QCString & msg,
const QByteArray & data ) [signal]
 

Emitted when the application receive a message over the application Channel which is pre-created and its channel name is EZX/Application/appname.

Parameters:
msg   the name of the message
data   the data of the message

void ZApplication::clickAppIcon ( ) [signal]
 

Emitted when this application icon on the home screen is clicked.

void ZApplication::editableWidgetClicked ( int mwId,
bool canClick ) [signal]
 

Emitted when the user has clicked in an editable widget.

For internal use only.

void ZApplication::enableHardKeyEventFilter ( bool enable = true )
 

Enable/disable the hardkey event filter.

Note:
the function is not implemented in the A760 and A768

void ZApplication::enableTouchSound ( bool enable = true )
 

Enable/disable the touch panel's sound when the application's widgets are clicked.

Parameters:
enable   enable/disable the touch panel's sound The default is to enable touch panel's sound

bool ZApplication::eventFilter ( QObject * o,
QEvent * e ) [protected, virtual]
 

Reimplement.

int ZApplication::exec ( )
 

Reimplement enter the application main event loop.

See also:
the exec() of the QApplication

void ZApplication::flushMsgs ( )
 

Flush the messages in the message queue.

For internal use only.

const QString & ZApplication::getAppName ( ) [inline]
 

Get the application's name.

bool ZApplication::getAutoHideKb ( )
 

Get the flag that indicates whether or not the input widget should be automatically hidden when a non-text-entry widget is clicked.

Return values:
if   true, input widget will be hidden automatically or return false.

bool ZApplication::getAutoInvokeKb ( )
 

Get the flag to enable/disable invoking the input widget automatically when text entry is clicked.

Return values:
if   true, input widget will be invoke automatically or return false.

const QUuid ZApplication::getDefaultKbMethod ( bool readConfig = false )
 

Get the application default input method.

Parameters:
readConfig   if false, when the application initial input method is IMID_UNDEFINED, the function will not read the system config to get the system defualt value or the function will read the system config.

bool ZApplication::getHardKeyEventFilter ( )
 

Get the flag to enable/disable the hardkey event filter.

Note:
the function is not implemented in the A760 and A768

const QIMMap & ZApplication::getIMList ( )
 

Get input method name list.

For internal use only.

int ZApplication::getMouseMode ( QWidget * widget ) [static]
 

Get the widget's mouse mode.

Return values:
LEFT_ONLY   or PRESS_HOLD

int ZApplication::getTouchSoundMsgQueue ( )
 

Get the touch panel msg queue.

For internal use only.

bool ZApplication::hardKeyEventFilter ( QEvent * e ) [protected, virtual]
 

Event filter for the ezx hard keys.

Return values:
if   true the application can stop the default hardkey behaviors.

Note:
the function is not implemented in the A760 and 768

void ZApplication::insertStr ( QWSEvent * e ) [virtual]
 

void ZApplication::loadString ( const QString & strFileName )
 

Load string resource files (.qm files).

void ZApplication::quickQuit ( ) [signal]
 

Emitted when the application manager requests this application to quit.

The application manager will do this to save RAM.

By default, quickQuit() is connected to slotQuickQuit().

See also:
slotQuickQuit()

bool ZApplication::qwsEventFilter ( QWSEvent * e ) [protected]
 

Reimplement.

void ZApplication::raiseAppWindows ( )
 

Raise all widgets in this application.

For internal use only.

void ZApplication::setAutoHideKb ( bool hide = false )
 

Set the flag to enable/disable hiding the input widget automatically by clicking a non-text-entry widget when the input widget is visible.

Parameters:
hide   if true when a non-text-entry widget is clicked the input widget will be hidden automatically; if false the input widget will not be hidden.

The default is to hide input widget automatically.

void ZApplication::setAutoInvokeKb ( bool invoke = true )
 

Set the flag to enable/disable invoking the input widget automatically when text entry is clicked.

Parameters:
invoke   if true when text entry is clicked, the input widget will be invoked automatically; if false the input widget will not be invoked, the function affects all text entries in the application.

The default is to invoke input widget automatically.

void ZApplication::setDefaultKbMethod ( const QUuid & method )
 

Set the application's default input method.

Parameters:
method   the default input method name.

See also:
ZMainWidget for how to bind special input methods to a text entry and to a ZMainWidget. , ZGlobal for system default input methods name list.

Note:
if application does not set the default input method, the initial input method is system default input method.

Note:
if the lastest input method user used is not been bound to a special text entry, the application default input method will be set to remember it, but the input method bound by a text entry will be ignored.

For example: There are three text entries: text entries A,C do not bind to any input method, another text entry B binds number keyboard, user uses the Keyboard as follows:

A --> English Keyboard B --> Number keyboard C --> English Keyboard --> Change to Hand Writing Keyboard A --> Hand Writing Keyboard (application default is changed) B --> Number keyboard (not affected)

void ZApplication::setEnv ( const QString & env ) [protected]
 

Set the environment variable.

Parameters:
env   the environment variable

void ZApplication::setMainWidget ( QWidget * mainWidget ) [virtual]
 

Reimplement Set the main widget of the application.

See also:
the setMainWidget() of the QApplication
Parameters:
mainWidget   will be the application's main widget

void ZApplication::setMaxWindowRect ( ) [protected]
 

Set the applications max screen size.

Note:
the function is not implemented in the A760 and A768

void ZApplication::setMouseMode ( QWidget * widget,
int mode ) [static]
 

Enable/disable the press-and-hold for a widget.

Parameters:
widget   the QWidget whose press-and-hold will be enabled/disabled
mode   mouse mode

 QLineEdit* ln = new QLineEdit(parent);
 //enable Press and Hold
 if ( ln )
 {
    ZApplication::setMouseMode(ln, ZApplication::PRESS_HOLD);   
 }

Note:
Most widgets default mouse mode is LEFT_ONLY, except for some special widgets such as ZMultiLineEdit etc...

Note:
when PRESS_HOLD is enabled, the mouse events sequence that the widget may receive are:

Left mouse press, Right Mouse Press, Right Mouse Release, Left Mouse Release

void ZApplication::showMainWidget ( QWidget * mainWidget )
 

Set the main widget of the application and show it.

Parameters:
mainWidget   will be the application's main widget

void ZApplication::shutdown ( ) [signal]
 

Emitted when the phone is going to shutdown.

void ZApplication::signalBridgeMessage ( const QCString & action,
const QByteArray & data ) [signal]
 

Emitted when another application sends a message to this application.

If this application is not running when the message is sent, it will be launched and then the signal sent.

If already running, this application will be raised from the background to the foreground

Parameters:
action   another application indicate this application what should be done by this parameter
data   information sent from another application

See also:
signalBridgeMessageWithoutRaise( const QCString &action, const QByteArray &data )

void ZApplication::signalBridgeMessage ( const QByteArray & data ) [signal]
 

Emitted when another application sends a message to this application.

If this application is not running when the message is sent, it will be launched and then the signal sent.

If already running, this application will be raised from the background to the foreground

Parameters:
data   information sent from another application

See also:
signalBridgeMessage( const QCString &action, const QByteArray &data )

void ZApplication::signalBridgeMessageWithoutRaise ( const QCString & action,
const QByteArray & data ) [signal]
 

Emitted when another application sends a message to this application.

If this application is not running when the message is sent, it will be launched and then the signal sent.

If already running, this application will be raised from the background to the foreground

Parameters:
action   another application indicate this application what should be done by this parameter
data   information sent from another application

See also:
signalBridgeMessage( const QCString &action, const QByteArray &data )

void ZApplication::signalHomeKeyClicked ( ) [signal]
 

Emitted when the 'Home' hardkey is clicked.

For internal use only.

void ZApplication::signalMasterClear ( ) [signal]
 

Emitted when user has selected to do a master clear.

void ZApplication::signalMasterReset ( ) [signal]
 

Emitted when the system is doing a master reset.

void ZApplication::signalOpenDoc ( const QString & doc ) [signal]
 

Emitted when another application requests this application to open a file.

Parameters:
doc   full path name of the document file

void ZApplication::signalRaise ( ) [signal]
 

Emitted when this application is raised from the background to the foreground.

void ZApplication::slotClickAppIcon ( ) [protected, virtual, slot]
 

By default, this slot is connected to signal clickAppIcon().

void ZApplication::slotQuickQuit ( ) [protected, virtual, slot]
 

The default implementation of this slot will cause the current application to exit.

By default, this slot is connected to signal quickQuit().

void ZApplication::slotRaise ( ) [protected, virtual, slot]
 

By default, this slot is connected to signal signalRaise().

By default, this function will raise the current application from the background to the foreground

void ZApplication::slotShutdown ( ) [protected, virtual, slot]
 

The default implementation of this slot will cause the current application to exit.

By default, this slot is connected to signal shutdown().

void ZApplication::startShowWaitCursor ( int startTime = 0,
const QString & resId = QString::null )
 

Start to show a wait cursor.

 //start to show a wait cusor
 ZApplication* app = (ZApplication*)qApp;
 app->startShowWaitCursor();

 //chance to handle event
 app->processEvents();
 ...
 app->stopShowWaitCursor();

Note:
param startTime and param resId have not been implemented in the A760

Note:
the application needs to call stopShowWaitCursor() to stop the wait cursor, so the application's UI will be blocked.

void ZApplication::stopShowWaitCursor ( )
 

Stop a wait cursor.

void ZApplication::systemMessage ( const QCString & msg,
const QByteArray & data ) [signal]
 

Emitted when the application received a message via the system QCopChannel.

Parameters:
msg   the name of the message
data   the data of the message

For internal use only.

void ZApplication::timerEvent ( QTimerEvent * e ) [protected, virtual]
 

Reimplement.

void ZApplication::tryQuit ( ) [protected, virtual]
 

Try to quit the application.

void ZApplication::updateIMNameList ( )
 

Update input methods name.

Note:
if language is changed, and the application is a deamon, it must call this function to update the imput method names list.

For internal use only.


Friends And Related Function Documentation

class ZMainWidget [friend]
 


The documentation for this class was generated from the following file:
Generated at Wed Mar 3 13:22:49 2004 by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001