ZKWindow.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * ZKWindow.h
  3. *
  4. * Created on: Jun 10, 2017
  5. * Author: guoxs
  6. */
  7. #ifndef _WINDOW_ZKWINDOW_H_
  8. #define _WINDOW_ZKWINDOW_H_
  9. #include <vector>
  10. #include "control/ZKBase.h"
  11. class ZKWindowPrivate;
  12. /**
  13. * @brief 窗口控件
  14. */
  15. class ZKWindow : public ZKBase {
  16. ZK_DECLARE_PRIVATE(ZKWindow)
  17. public:
  18. ZKWindow(ZKBase *pParent);
  19. virtual ~ZKWindow();
  20. bool isModalWindow() const;
  21. virtual ZKBase* findControlByID(int id);
  22. virtual void getAllControls(vector<ZKBase*> &controlsList);
  23. /**
  24. * @brief 显示窗口
  25. */
  26. void showWnd();
  27. /**
  28. * @brief 隐藏窗口
  29. */
  30. void hideWnd();
  31. /**
  32. * @brief 窗口是否显示
  33. */
  34. bool isWndShow() const;
  35. protected:
  36. ZKWindow(ZKBase *pParent, ZKBasePrivate *pBP);
  37. virtual void onBeforeCreateWindow(const Json::Value &json);
  38. virtual void onAfterCreateWindow(const Json::Value &json);
  39. virtual const char* getClassName() const { return ZK_WINDOW; }
  40. virtual bool onInterceptMessage(const struct _message_t *pMsg);
  41. virtual bool onTouchEvent(const MotionEvent &ev);
  42. virtual void onTimer(int id);
  43. bool isWindowClass(const char *pClassName) const;
  44. bool checkHideModalWindow(int x, int y);
  45. private:
  46. void parseWindowAttributeFromJson(const Json::Value &json);
  47. void parseControlsFromJson(const Json::Value &json);
  48. };
  49. #endif /* _WINDOW_ZKWINDOW_H_ */