mcu_hi3321_watch/tjd/ui/app/compass/TjdUiAppCompassPresenter.h
2025-05-26 20:15:20 +08:00

50 lines
1.6 KiB
C++

/*----------------------------------------------------------------------------
* Copyright (c) TJD Technologies Co., Ltd. 2024. All rights reserved.
*
* Description: TjdUiAppCompassPresenter.h
*
* Author: wuchangxin@ss-tjd.com
*
* Create: 2025-02-25
*--------------------------------------------------------------------------*/
#ifndef TJD_UI_APP_COMPASS_PRESENTER_H
#define TJD_UI_APP_COMPASS_PRESENTER_H
#include "Presenter.h"
#include "TjdUiScreenDrag.h"
#include "components/root_view.h"
#include "components/ui_slider.h"
#include "components/ui_view.h"
#include "graphic_timer.h"
#include <string>
namespace TJD {
class TjdUiAppCompassView;
class TjdUiAppCompassPresenter : public OHOS::Presenter<TjdUiAppCompassView>,
public OHOS::UIView::OnClickListener,
public TjdUiScreenDragListener,
public OHOS::RootView::OnKeyActListener
{
public:
TjdUiAppCompassPresenter();
virtual ~TjdUiAppCompassPresenter();
static TjdUiAppCompassPresenter &GetInstance(void);
void OnStart() override;
void OnPause() override;
void OnResume() override;
void OnStop() override;
bool OnClick(OHOS::UIView &view, const OHOS::ClickEvent &event) override;
void ScreenDragEventCallback(OHOS::UIView &view, const OHOS::DragEvent &event) override { ViewExitEvent(); }
bool OnKeyAct(OHOS::UIView &view, const OHOS::KeyEvent &event);
void OnClickTrans(OHOS::UIView &view);
bool IsChinese();
void ViewExitEvent(void);
private:
bool initFlag_{false};
bool isExit_{true};
};
} // namespace TJD
#endif