Advertisement
Guest User

Untitled

a guest
Sep 12th, 2011
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.07 KB | None | 0 0
  1. #ifndef _ZPOPUP_H
  2. #define _ZPOPUP_H
  3.  
  4. #include <qdialog.h>
  5. #include <ZSkinBase.h>
  6. #include <ZFormContainer.h>
  7.  
  8. class ZAppInfoArea;
  9. class ZSoftKey;
  10. class ZWidget;
  11. class ZPopupHeader;
  12. class ZPopupPrrivate;
  13.  
  14. struct ZPopupPrivate;
  15.  
  16. //class ZFormContainer;
  17. class ZDetailView;
  18. class ZIconView;
  19. class ZListBox;
  20. //class ZWidgetBorderInfo;
  21. //class ZWidgetPaddingInfo;
  22. class ZScrollPanel;
  23.  
  24.  
  25.  
  26.  
  27. /* Size <= 228=57*4 bytes, 216=54*4 */
  28.  
  29. class ZPopup : public QDialog
  30. {
  31. Q_OBJECT
  32. //unsigned int data[54 - sizeof(QDialog)/4];
  33.  
  34. public:
  35. enum POPUP_TYPE_E {
  36. DIALOG,
  37. NOTICE
  38. };
  39.  
  40. enum PopupCode {
  41. Rejected = QDialog::Rejected,
  42. Accepted = QDialog::Accepted,
  43. AutoDismissed = 100,
  44. AnykeyPressed
  45. };
  46.  
  47. ZPopup(POPUP_TYPE_E = DIALOG, QWidget* parent = 0, char const* name = 0, bool modal = true, int dismiss_time = 0, WFlags f = 0);
  48. ~ZPopup();
  49.  
  50. void setTitle(const QString& strTitle);
  51. QString getTitle();
  52. void setTitleIcon(const QPixmap& icon);
  53. void setTitleIcon(const QString& strResourceID);
  54. ZPopupHeader* getPopupHeader();
  55. void enableAia(bool);
  56. ZAppInfoArea* getAppInfoArea();
  57. void setInstructText(const QString& str);
  58. void setInsTruncPolicy(bool truncated = false);
  59. int getBodyAvailableWidth() const;
  60. int getBodyAvailableHeight();
  61. void insertChild(ZWidget* child, int index = -1);
  62. void removeChild(ZWidget* child);
  63. void insertChild(ZFormContainer*, int index = -1);
  64. void insertChild(ZIconView*, int index = -1);
  65. void insertChild(ZDetailView*, int index = -1);
  66.  
  67. void setSoftkeyTextLeft(const QString&);
  68. void setSoftkeyTextRight(const QString&);
  69. void setSoftkeyText(const QString& textLeft, const QString& textRight);
  70. ZSoftKey * getSoftKey();
  71.  
  72. void setAutoDismissTime(int msec);
  73. void setReturnIdlePolicy(int reason, bool disableDefBehavior = false);
  74.  
  75. virtual void doLayout();
  76. virtual void show();
  77.  
  78. void setScrollable(bool);
  79. bool getScrollable();
  80.  
  81. //????????????????
  82. void setBodyPadding(const WIDGET_PADDING_INFO_T&);
  83. //???????????????
  84. void setBodyBorder(WIDGET_BORDER_INFO_T*);
  85.  
  86. void setBodyBorder(ZSkinBase::BorderPixmaps& pixmaps);
  87. void setBodyBackground(QPixmap&);
  88. void setBodyVSpacing(int);
  89. //????????????
  90. void setInstructPadding(const WIDGET_PADDING_INFO_T&);
  91.  
  92. void setInstructFont(const QFont&);
  93. void setInstructFontColor(const QColor&);
  94. void setPalette(const QPalette&);
  95.  
  96.  
  97. public slots:
  98. virtual void done(int);
  99. virtual void accept();
  100. virtual void reject();
  101.  
  102. signals:
  103. void leftSoftkeyClicked();
  104. void rightSoftkeyClicked();
  105. void signalClearKeyPressed();
  106. void askReturnToIdle(int reason);
  107.  
  108. protected slots:
  109. virtual void slotLSKClicked();
  110. virtual void slotRSKClicked();
  111. virtual void slotKbStateChanged(int, bool);
  112. virtual void slotResizeAllChild(int);
  113.  
  114. public:
  115. ZScrollPanel* getBody() const;
  116. virtual void keyPressEvent(QKeyEvent*);
  117. virtual void showEvent(QShowEvent*);
  118. virtual void hideEvent(QHideEvent*);
  119. virtual void timerEvent(QTimerEvent*);
  120. virtual void customEvent(QCustomEvent*);
  121.  
  122. private slots:
  123. void slotSPC_resize(ZScrollPanel*, int, int);
  124.  
  125. private:
  126. void updateIdleScreenSign();
  127. void loadSkinData(bool);
  128. void applySkinData();
  129. void releaseBodyPixmap();
  130. void applyBodyBk();
  131. void removeAndInsert();
  132. void layoutDialog();
  133. void layoutNotice();
  134. void layoutScrollPanel();
  135. void layoutListbox();
  136. void layoutFormContainer();
  137. void layoutDetailView();
  138. void layoutIconView();
  139. void layoutNothing();
  140. void layoutDialogFourAreas();
  141. void layoutNoticeTwoAreas();
  142. int getChildrenMaxWidth();
  143. bool isNeedShowVScrollBar() const;
  144. void detect_xModal();
  145. void postLayoutEvent();
  146. int calculateDesiredContentHeight(const int nWidthMax);
  147. int calculateBodyAvailWidth(bool bShowScrollbar) const;
  148. void layout_inner(const int nTop, const int nAvailW);
  149. void setInsLabelProperty(bool);
  150.  
  151. private:
  152. ZPopupPrivate* mpData;
  153. };
  154.  
  155. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement