00001 00002 //------------------------------------------------------------------------------------------------- 00003 // Header Name: ZBaseDialog.h 00004 // 00005 // General Description: EZX-style base dialog class 00006 // 00007 //------------------------------------------------------------------------------------------------- 00008 // 00009 // Motorola Confidential Proprietary 00010 // Template ID and version: TMP_LFC_50068 Version 1.2 00011 // (c) Copyright Motorola 2004, All Rights Reserved 00012 // 00013 //------------------------------------------------------------------------------------------------- 00014 00015 #ifndef Z_BASEDIALOG_H 00016 #define Z_BASEDIALOG_H 00017 00018 #ifndef __cplusplus 00019 #error "This is a C++ header file;it requires C++ to compile." 00020 #endif 00021 00022 #include <qdialog.h> 00023 #include <qpalette.h> 00024 00025 /** 00026 * the ZBaseDialog class implements the application modal and system modal dialogs. 00027 * 00028 * Application modal: the dialog blocks the application's input. 00029 * System modal: the dialog blocks the system's input. 00030 * 00031 * @note: Due to input-widget limitations, dialogs can not contain text-input 00032 * fields in A760 and A768. 00033 */ 00034 00035 class ZBaseDialog : public QDialog 00036 { 00037 Q_OBJECT 00038 00039 public: 00040 00041 /** 00042 * Dialog's Modal type 00043 */ 00044 enum 00045 { 00046 NO_MODAL = 0, ///< \a \c the dialog is modalessness 00047 APP_MODAL, ///< \a \c the dialog is application modal 00048 SYSTEM_MODAL ///< \a \c the dialog is system modal 00049 }; 00050 00051 /** 00052 * Constructor of ZBaseDialog 00053 * 00054 * @param modal set the dialog modal type 00055 * 00056 * @see the enum above 00057 */ 00058 ZBaseDialog( QWidget *parent = 0,const char* name = 0,int modal = NO_MODAL,WFlags f = 0 ); 00059 00060 00061 /** 00062 * Destructor of ZBaseDialog. 00063 */ 00064 virtual ~ZBaseDialog(); 00065 00066 00067 /** 00068 * Get the dialog modal type. 00069 * 00070 * @see the enum above 00071 */ 00072 int getModalType() { return mModal; } 00073 00074 public slots: 00075 00076 /** 00077 * Reimplement 00078 * Hides the dialog and sets its result code to r 00079 * 00080 * @param r the result code 00081 */ 00082 virtual void done( int r ); 00083 00084 /** 00085 * Reimplement 00086 * Hides the dialog and sets its result code to Rejected 00087 */ 00088 virtual void reject(); 00089 00090 /** 00091 * Reimplement 00092 * Hides the dialog and sets its result code to Accepted 00093 */ 00094 virtual void accept(); 00095 00096 protected: 00097 00098 /** 00099 * Reimplement 00100 */ 00101 virtual bool qwsEvent( QWSEvent* e ); 00102 00103 /** 00104 * Reimplement 00105 */ 00106 virtual bool event( QEvent* e ); 00107 00108 /** 00109 * Reimplement 00110 */ 00111 virtual bool eventFilter( QObject* o, QEvent* e); 00112 00113 private: 00114 00115 int mModal; 00116 }; 00117 00118 #endif 00119 00120 00121 00122