1
0

fsmonitor.h 807 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef _FS_MONITOR_H
  2. #define _FS_MONITOR_H
  3. #include <bfc/ptrlist.h>
  4. #include <api/timer/timerclient.h>
  5. class FSCallback {
  6. public:
  7. virtual void onGoFullscreen()=0;
  8. virtual void onCancelFullscreen()=0;
  9. };
  10. class FullScreenMonitor : public TimerClientDI {
  11. public:
  12. FullScreenMonitor();
  13. virtual ~FullScreenMonitor();
  14. void registerCallback(FSCallback *cb);
  15. void unregisterCallback(FSCallback *cb);
  16. int isFullScreen() { return m_fs; }
  17. int wndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  18. void timerclient_timerCallback(int id);
  19. private:
  20. void onGoFullscreen();
  21. void onCancelFullscreen();
  22. void sendGoFSCallbacks();
  23. void sendCancelFSCallbacks();
  24. PtrList<FSCallback> m_callbacks;
  25. HWND hWnd;
  26. int m_fs;
  27. int m_go_fs_timer_set;
  28. int m_cancel_fs_timer_set;
  29. };
  30. #endif