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

ZMainWidget Class Reference

The ZMainWidget class implements the EZX style's base screen which consists of two parts, a content Area and a CST Area. More...

#include <ZMainWidget.h>

Inheritance diagram for ZMainWidget::

QWidget List of all members.

Public Types

enum  { INPUTWIDGET_HIDE = 0, INPUTWIDGET_SHOW }

Public Slots

virtual void hideInputWidget ()
 Hide the input widget. More...

virtual void slotPopupMenu (int id)
 The slot for the popup menu item is selected, You can override it for the application own input widget. More...

virtual void invokeInputWidget ()
 Invoke the input widget. More...


Signals

void kbStateChanged (bool show)
 The signal is emitted when input widget's status is changed. More...


Public Methods

 ZMainWidget (bool editorMode, QWidget *parent, const char *name=0, WFlags f=0)
 Constructor of ZMainWidget. More...

 ZMainWidget (QWidget *parent, const char *name=0, WFlags f=0)
 Constructor of non-edit-mode ZMainWidget. More...

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

bool getEditMode ()
 Get the edit mode flag. More...

QWidgetgetContentWidget ()
 Get the content widget, if you do not set content widget before calling this, the default content widget, a ZScrollView, will be created and returned. More...

virtual bool setContentWidget (QWidget *w=NULL)
 Set the content widget. More...

QWidgetgetCSTWidget ()
 Get the CST widget, if you do not set CST widget before calling this, the default CST widget, a QFrame, will be created. More...

virtual bool setCSTWidget (QWidget *w=NULL)
 Set the CST widget. More...

QPopupMenu* getKbPopupMenu ()
 Get the popup menu which lists the input methods' names. More...

ZPushButtongetKbBtn ()
 Get the popup menu which lists the input methods' names. More...

int getKbState ()
 Get the input widget status. More...

void setInputMethod (const QUuid &method=IMID_UNDEFINED)
 Set the current input method. More...

void showWithInputMethod (const QUuid &method=IMID_UNDEFINED)
 Show the main widget and input widget at the same time. More...

void setFavoriteInputMethods (const QValueList< QUuid > &imList)
 Specify some input methods to the ZMainWidget, the user can see these candidates. More...

void setInputMethods (QWidget *widget, const QUuid &defaultIM, const QValueList< QUuid > &favourIMList)
 Bind the default input method and input methods names list that can be seen in the menu when the text entry focuses to the text entry. More...

void setInputMethods (QWidget *widget, const QUuid &defaultIM)
 Almost the same as the above function, but there are all the input methods are available, just for convenience. More...

virtual void show ()
 Reimplement. More...

virtual void hide ()
 Reimplement. More...

void raise ()
 Raise the ZMainWidget. More...

void lower ()
 Raise the ZMainWidget. More...


Protected Slots

virtual void updateInputWidgetState (int mwId, bool canClick)
 Update the input widget state. More...


Protected Methods

virtual bool event (QEvent *e)
 Reimplement. More...

virtual bool qwsEvent (QWSEvent *e)
 Reimplement. More...

virtual void keyPressEvent (QKeyEvent *e)
 Reimplement. More...

virtual bool showToolBar ()
 Show a custom input widget, instead of the standard ones. More...

virtual bool setToolBar (const QUuid &)
 Set a custom input widget, instead of the standard ones. More...

virtual bool hideToolBar ()
 Hide a custom input widget, instead of the standard ones. More...

QUuid getCurrentInputMethodName (bool readConfig=false)
 Get ZMainWidget's current input method. More...

virtual void setupInputMethodsPopupMenu ()
 Set up the input method menu. More...

void checkMenuItem (QPopupMenu *popup, QString text, bool select)
 Check the menu item. More...

QIMMapgetIMList ()
 Get the loaded input methods list. More...


Detailed Description

The ZMainWidget class implements the EZX style's base screen which consists of two parts, a content Area and a CST Area.

|--------------| | | | Content Area | | | |------------- | | CST Area | |--------------|

You can use getContentWidget()/getCSTWidget() to get a default content/cst widget which is ZScrollView/QFrame.

You can also can use setContentWidget()/setCSTWidget() to set your own Content/CST widget.

The class has two modes:

1. Edit mode (note: set constructor's param editorMode true): this class encapsulates some input methods relating functions.

2. Non-edit mode: in this mode, the input methods functions are not available. The class is a simple container class.

For an application's to add its own input widget (like MMS object keyboard), override showToolBar(), setToolBar(), hideToolBar(), and return true in these functions to indicate it is the application's special keyboard.

 //set to edit mode
 ZMainWidget* w = new ZMainWidget(true);

 ZScrollView* sv =  (ZScrollView*)w->getContentWidget();
 ZMultiLineEdit* ml = new ZMultiLineEdit( sv->viewport(), true );
 sv->addChild( ml, 0, 0 );
 w->showMaximized();


Member Enumeration Documentation

anonymous enum
 

Enumeration values:
INPUTWIDGET_HIDE   \c input widget is hidden.
INPUTWIDGET_SHOW   \c input widget is shown.


Constructor & Destructor Documentation

ZMainWidget::ZMainWidget ( bool editorMode,
QWidget * parent,
const char * name = 0,
WFlags f = 0 )
 

Constructor of ZMainWidget.

Parameters:
editorMode   if true, it is edit mode, some input methods' functions are available; if false, it uses non-edit mode, making this just a container class

ZMainWidget::ZMainWidget ( QWidget * parent,
const char * name = 0,
WFlags f = 0 )
 

Constructor of non-edit-mode ZMainWidget.

Just for convenience

ZMainWidget::~ZMainWidget ( ) [virtual]
 

Destructor of ZApplication.


Member Function Documentation

void ZMainWidget::checkMenuItem ( QPopupMenu * popup,
QString text,
bool select ) [protected]
 

Check the menu item.

For internal use only.

bool ZMainWidget::event ( QEvent * e ) [protected, virtual]
 

Reimplement.

QWidget * ZMainWidget::getCSTWidget ( )
 

Get the CST widget, if you do not set CST widget before calling this, the default CST widget, a QFrame, will be created.

QWidget * ZMainWidget::getContentWidget ( )
 

Get the content widget, if you do not set content widget before calling this, the default content widget, a ZScrollView, will be created and returned.

QUuid ZMainWidget::getCurrentInputMethodName ( bool readConfig = false ) [protected]
 

Get ZMainWidget's current input method.

Parameters:
readConfig   if true when there is no default input method, the function will read the system config to get the application current input method name

bool ZMainWidget::getEditMode ( )
 

Get the edit mode flag.

QIMMap & ZMainWidget::getIMList ( ) [protected]
 

Get the loaded input methods list.

For internal use only.

ZPushButton * ZMainWidget::getKbBtn ( )
 

Get the popup menu which lists the input methods' names.

Note:
after A768, it will be obsolete, because the design is changed so that there is no keyboad button.

New applications should not use this function.

QPopupMenu * ZMainWidget::getKbPopupMenu ( )
 

Get the popup menu which lists the input methods' names.

Note:
after A768, it will be obsolete, because the design is changed so that there is no keyboad button.

New applications should not use this function.

int ZMainWidget::getKbState ( )
 

Get the input widget status.

See also:
the enum above

void ZMainWidget::hide ( ) [virtual]
 

Reimplement.

void ZMainWidget::hideInputWidget ( ) [virtual, slot]
 

Hide the input widget.

bool ZMainWidget::hideToolBar ( ) [inline, protected, virtual]
 

Hide a custom input widget, instead of the standard ones.

Return values:
if   true, the ZMainWidget has hide its ownreadConfig input widget

Note:
need to care for your own content widget's geometry

void ZMainWidget::invokeInputWidget ( ) [virtual, slot]
 

Invoke the input widget.

See also:
setInputMethod()

\internal, please use setInputMethod()

void ZMainWidget::kbStateChanged ( bool show ) [signal]
 

The signal is emitted when input widget's status is changed.

Parameters:
show   if true, input widget is shown, or it is hidden

void ZMainWidget::keyPressEvent ( QKeyEvent * e ) [protected, virtual]
 

Reimplement.

void ZMainWidget::lower ( )
 

Raise the ZMainWidget.

bool ZMainWidget::qwsEvent ( QWSEvent * e ) [protected, virtual]
 

Reimplement.

void ZMainWidget::raise ( )
 

Raise the ZMainWidget.

bool ZMainWidget::setCSTWidget ( QWidget * w = NULL ) [virtual]
 

Set the CST widget.

Parameters:
w   the CST widget, if is NULL, a default CST widget, a QFrame, is created.

Note:
for A760 and A768, you can not set CST in the edit mode.

bool ZMainWidget::setContentWidget ( QWidget * w = NULL ) [virtual]
 

Set the content widget.

Parameters:
w   the content widget, if NULL, a default content widget, a ZScrollView, is created.

void ZMainWidget::setFavoriteInputMethods ( const QValueList< QUuid > & imList )
 

Specify some input methods to the ZMainWidget, the user can see these candidates.

if do not set widget favour list, the default is the all input methods that the application knows.

Parameters:
imList   the ZMainWidget's favour input mathods list

See also:
ZGlobal for system default input methods name list.

See also:
setFavoriteInputMethods

void ZMainWidget::setInputMethod ( const QUuid & method = IMID_UNDEFINED )
 

Set the current input method.

This method will call setToolbar(). So, if want implement your own input widget, you only need to override setToolbar() and return true

Parameters:
method   input method name

 //set to edit mode
 ZMainWidget* w = new ZMainWidget(true);
 if ( w )
 {
     //set english key board
     w->setInputMethod(IMID_ENGLISH_KB);
 }

See also:
ZGlobal for system default input methods name list.

See also:
setToolbar()

void ZMainWidget::setInputMethods ( QWidget * widget,
const QUuid & defaultIM )
 

Almost the same as the above function, but there are all the input methods are available, just for convenience.

Parameters:
widget   text entry
defaultIM   the widget's default input mathod

See also:
ZGlobal for system default input methods name list.

void ZMainWidget::setInputMethods ( QWidget * widget,
const QUuid & defaultIM,
const QValueList< QUuid > & favourIMList )
 

Bind the default input method and input methods names list that can be seen in the menu when the text entry focuses to the text entry.

If you do not set the widget's favourite list, the default list is ZMainWidget's list.

Parameters:
widget   text entry
defaultIM   the default input method
favourIMList   the widget's favour input mathods name list

 ZMultiLineEdit* ml = new UTIL_MultiLineEdit(sv->viewport(),true,2);
 ml->setFixedWidth(230);
 sv->addChild(ml,3,30,true);

 //set the input methods names list and set the default input method
 QValueList<QUuid> flist1;
 flist1.append( IMID_NUMBER_KB );
 flist1.append( IMID_PINYIN_KB );
 setInputMethods(ml,IMID_NUMBER_KB, flist1);

See also:
ZGlobal for system default input methods name list.

See also:
setFavoriteInputMethods

bool ZMainWidget::setToolBar ( const QUuid & ) [inline, protected, virtual]
 

Set a custom input widget, instead of the standard ones.

Return values:
if   true, the ZMainWidget has set its own input widget

Note:
need to care for your own content widget's geometry

void ZMainWidget::setupInputMethodsPopupMenu ( ) [protected, virtual]
 

Set up the input method menu.

For internal use only.

void ZMainWidget::show ( ) [virtual]
 

Reimplement.

bool ZMainWidget::showToolBar ( ) [inline, protected, virtual]
 

Show a custom input widget, instead of the standard ones.

Return values:
if   true, the ZMainWidget has defined its own input widget

Note:
need to care for your own content widget's geometry

void ZMainWidget::showWithInputMethod ( const QUuid & method = IMID_UNDEFINED )
 

Show the main widget and input widget at the same time.

Parameters:
method   input method name

 //set to edit mode
 ZMainWidget* w = new ZMainWidget(true);
 if ( w )
 {
     //set english key board and show the main widget 
     w->showWithInputMethod(IMID_ENGLISH_KB);
 }

See also:
ZGlobal for system default input methods name list.

void ZMainWidget::slotPopupMenu ( int id ) [virtual, slot]
 

The slot for the popup menu item is selected, You can override it for the application own input widget.

Parameters:
id   the id of the menu item

void ZMainWidget::updateInputWidgetState ( int mwId,
bool canClick ) [protected, virtual, slot]
 

Update the input widget state.

For internal use only.


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