ZKMainWindow.h 1005 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * ZKMainWindow.h
  3. *
  4. * Created on: Jun 10, 2017
  5. * Author: guoxs
  6. */
  7. #ifndef _WINDOW_ZKMAINWINDOW_H_
  8. #define _WINDOW_ZKMAINWINDOW_H_
  9. #include "ZKWindow.h"
  10. #include "system/Mutex.h"
  11. class ZKMainWindowPrivate;
  12. class ZKMainWindow : public ZKWindow {
  13. ZK_DECLARE_PRIVATE(ZKMainWindow)
  14. public:
  15. ZKMainWindow();
  16. virtual ~ZKMainWindow();
  17. class ITimerListener {
  18. public:
  19. virtual ~ITimerListener() { }
  20. virtual bool onTimer(int id) = 0;
  21. };
  22. void registerTimerListener(int id, uint32_t time, ITimerListener *pListener);
  23. void unregisterTimerListener(int id, ITimerListener *pListener);
  24. void resetTimer(int id, uint32_t time);
  25. protected:
  26. virtual void onBeforeCreateWindow(const Json::Value &json);
  27. virtual bool createWindow();
  28. virtual ret_t procCtrlFun(const struct _message_t *pMsg);
  29. private:
  30. const char* getClassName() const { return NULL; }
  31. void parseMainWindowAttributeFromJson(const Json::Value &json);
  32. void notifyTimerListener(int id);
  33. };
  34. #endif /* _WINDOW_ZKMAINWINDOW_H_ */