42 lines
1.3 KiB
C++
42 lines
1.3 KiB
C++
#ifndef TJD_UI_APP_CALCULATOR_PRESENTER_H
|
|
#define TJD_UI_APP_CALCULATOR_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 TjdUiAppCalculatorView;
|
|
class TjdUiAppCalculatorPresenter : public OHOS::Presenter<TjdUiAppCalculatorView>,
|
|
public OHOS::UIView::OnClickListener,
|
|
public TjdUiScreenDragListener,
|
|
public OHOS::RootView::OnKeyActListener
|
|
{
|
|
public:
|
|
TjdUiAppCalculatorPresenter();
|
|
virtual ~TjdUiAppCalculatorPresenter();
|
|
static TjdUiAppCalculatorPresenter &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(false); }
|
|
bool OnKeyAct(OHOS::UIView &view, const OHOS::KeyEvent &event);
|
|
void OnClickTrans(OHOS::UIView &view);
|
|
bool IsChinese();
|
|
void ViewExitEvent(bool isSwipe);
|
|
|
|
private:
|
|
bool initFlag_{false};
|
|
bool isExit_{true};
|
|
};
|
|
|
|
} // namespace TJD
|
|
|
|
#endif |