#ifndef TJD_UI_APP_MS_GAME_PRESENTER_H #define TJD_UI_APP_MS_GAME_PRESENTER_H #include "Presenter.h" #include "TjdUiScreenDrag.h" #include "components/root_view.h" #include "components/ui_view.h" #include namespace TJD { enum MSGameViewIndex { MS_GAME_MAIN, MS_GAME_DISCONNECT, MS_GAME_UNKNOWN }; class TjdUiAppMSGameView; class TjdUiAppMSGamePresenter : public OHOS::Presenter, public TjdUiScreenDragListener, public OHOS::RootView::OnKeyActListener { public: TjdUiAppMSGamePresenter(); virtual ~TjdUiAppMSGamePresenter(); static TjdUiAppMSGamePresenter *GetInstance(void); void OnStart() override; void OnStop() override; bool OnKeyAct(OHOS::UIView &view, const OHOS::KeyEvent &event) override; void ScreenDragEventCallback(OHOS::UIView &view, const OHOS::DragEvent &event) override { ViewExitEvent(true); } private: void ViewExitEvent(bool isSwipe); osThreadId_t ms_game_task_id = NULL; }; } // namespace TJD #endif