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

47 lines
1.4 KiB
C++

#ifndef TJD_UI_APP_OTA_PRESENTER_H
#define TJD_UI_APP_OTA_PRESENTER_H
#include "Presenter.h"
#include "components/ui_slider.h"
#include "components/ui_view.h"
#include "graphic_timer.h"
#include "components/root_view.h"
#include <string>
#include "TjdUiAppIds.h"
#include "NativeAbility.h"
namespace TJD {
#define BTN_OTA_UPGRADE_ID "OtaUpgrade"
#define BTN_OTA_INTERRUPT_ID "Otainterrupt"
#define BTN_OTA_FAIL_ID "Otafail"
#define BTN_OTA_ENTER_ID "OtaEnter"
#define BTN_OTA_KNOB_ID "OtaKonb"
class TjdUiAppOtaView;
class TjdUiAppOtaPresenter : public OHOS::Presenter<TjdUiAppOtaView>,
public OHOS::UIView::OnClickListener,
public OHOS::UIView::OnDragListener,
public OHOS::RootView::OnKeyActListener
{
public:
TjdUiAppOtaPresenter();
virtual ~TjdUiAppOtaPresenter();
static TjdUiAppOtaPresenter *GetInstance(void);
void OnStart() override;
void OnPause() override;
void OnResume() override;
void OnStop() override;
bool OnClick(OHOS::UIView &view, const OHOS::ClickEvent &event);
bool OnDragStart(OHOS::UIView &view, const OHOS::DragEvent &event);
bool OnDrag(OHOS::UIView &view, const OHOS::DragEvent &event);
bool OnDragEnd(OHOS::UIView &view, const OHOS::DragEvent &event);
bool OnKeyAct(OHOS::UIView& view, const OHOS::KeyEvent& event);
private:
bool UpgrateStart{false};
};
}//tjd
#endif