#include <ZMainWidget.h>
Inheritance diagram for ZMainWidget::
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... | |
QWidget* | 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. More... | |
virtual bool | setContentWidget (QWidget *w=NULL) |
Set the content widget. More... | |
QWidget* | getCSTWidget () |
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... | |
ZPushButton* | getKbBtn () |
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... | |
QIMMap& | getIMList () |
Get the loaded input methods list. More... |
|--------------| | | | 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();
|
|
|
Constructor of ZMainWidget.
|
|
Constructor of non-edit-mode ZMainWidget. Just for convenience |
|
Destructor of ZApplication.
|
|
Check the menu item.
For internal use only. |
|
Reimplement.
|
|
Get the CST widget, if you do not set CST widget before calling this, the default CST widget, a QFrame, will be created.
|
|
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.
|
|
Get ZMainWidget's current input method.
|
|
Get the edit mode flag.
|
|
Get the loaded input methods list.
For internal use only. |
|
Get the popup menu which lists the input methods' names.
|
|
Get the popup menu which lists the input methods' names.
|
|
Get the input widget status.
|
|
Reimplement.
|
|
Hide the input widget.
|
|
Hide a custom input widget, instead of the standard ones.
|
|
Invoke the input widget.
|
|
The signal is emitted when input widget's status is changed.
|
|
Reimplement.
|
|
Raise the ZMainWidget.
|
|
Reimplement.
|
|
Raise the ZMainWidget.
|
|
Set the CST widget.
|
|
Set the content widget.
|
|
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.
|
|
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
//set to edit mode ZMainWidget* w = new ZMainWidget(true); if ( w ) { //set english key board w->setInputMethod(IMID_ENGLISH_KB); }
|
|
Almost the same as the above function, but there are all the input methods are available, just for convenience.
|
|
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.
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);
|
|
Set a custom input widget, instead of the standard ones.
|
|
Set up the input method menu.
For internal use only. |
|
Reimplement.
|
|
Show a custom input widget, instead of the standard ones.
|
|
Show the main widget and input widget at the same time.
//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); }
|
|
The slot for the popup menu item is selected, You can override it for the application own input widget.
|
|
Update the input widget state.
For internal use only. |