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

50 lines
1.8 KiB
C++

#ifndef TJD_UI_APP_FLASHLIGHT_PRESENTER_H
#define TJD_UI_APP_FLASHLIGHT_PRESENTER_H
#include "NativeAbility.h"
#include "Presenter.h"
#include "TjdUiAppIds.h"
#include "TjdUiTaskListener.h"
#include "TjdUiScreenDrag.h"
#include "components/ui_slider.h"
#include "components/ui_view.h"
#include "graphic_timer.h"
#include "ui_swipe_view.h"
#include <string>
namespace TJD {
#define FLASHLIGHT_ID "Flashlight_"
#define LASHLIGHT_ON_ID "Flashlighton"
#define LASHLIGHT_OFF_ID "Flashlightoff"
#define FLASHLIGHT_ONOFF_ID "Flashlightonoff"
class TjdUiAppFlashlightView;
class TjdUiAppFlashlightPresenter : public OHOS::Presenter<TjdUiAppFlashlightView>,
public TjdUiTaskListener,
public OHOS::UIView::OnClickListener,
public OHOS::UISwipeView::OnSwipeListener,
public TjdUiScreenDragListener,
public OHOS::RootView::OnKeyActListener
{
public:
TjdUiAppFlashlightPresenter();
virtual ~TjdUiAppFlashlightPresenter();
static TjdUiAppFlashlightPresenter *GetInstance(void);
virtual void Notify() override;
void OnStart() override;
void OnPause() override;
void OnResume() override;
void OnStop() override;
void OnSwipe(OHOS::UISwipeView &view) override;
bool OnClick(OHOS::UIView &view, const OHOS::ClickEvent &event) override;
bool OnDrag(OHOS::UIView &view, const OHOS::DragEvent &event);
bool OnKeyAct(OHOS::UIView &view, const OHOS::KeyEvent &event);
// void ScreenDragEventCallback(OHOS::UIView &view, const OHOS::DragEvent &event) override { ViewExitEvent(true); }
void SetScreenBrightness(int value);
int GetScreenBrightness(void);
bool changeFlag{false};
private:
};
} // namespace TJD
#endif