54 lines
1.4 KiB
C++
54 lines
1.4 KiB
C++
#ifndef TJDUI_APP_CAMERA_PRESENTER_H
|
|
#define TJDUI_APP_CAMERA_PRESENTER_H
|
|
|
|
#include "Presenter.h"
|
|
#include "TjdUiScreenDrag.h"
|
|
#include "components/ui_view.h"
|
|
#include "graphic_timer.h"
|
|
#include "root_view.h"
|
|
|
|
enum CameraView
|
|
{
|
|
CAMERA_TIPVIEW = 0,
|
|
CAMERA_LINKVIEW,
|
|
CAMERA_PHOTOVIEW,
|
|
CAMERA_MAXTHVIEW
|
|
};
|
|
|
|
namespace TJD {
|
|
enum KeyType
|
|
{
|
|
KEY_SLICE = 0,
|
|
KEY_POPUPWINDOW ,
|
|
};
|
|
|
|
void gatts_send_to_app(void);
|
|
class TjdUiAppCameraView;
|
|
class TjdUiAppCameraPresenter : public OHOS::Presenter<TjdUiAppCameraView>,
|
|
public TjdUiScreenDragListener,
|
|
public OHOS::RootView::OnKeyActListener,
|
|
public OHOS::UIView::OnClickListener
|
|
{
|
|
public:
|
|
TjdUiAppCameraPresenter(KeyType type = KEY_SLICE);
|
|
virtual ~TjdUiAppCameraPresenter();
|
|
static TjdUiAppCameraPresenter &GetInstance(void);
|
|
void OnStart() override;
|
|
void OnStop() override;
|
|
bool OnKeyAct(OHOS::UIView &view, const OHOS::KeyEvent &event) override;
|
|
bool OnClick(OHOS::UIView &view, const OHOS::ClickEvent &event) override;
|
|
void ExitCameraView(void);
|
|
void ScreenDragEventCallback(OHOS::UIView &view, const OHOS::DragEvent &event) override { ExitCameraView(); }
|
|
|
|
private:
|
|
KeyType type_ = KEY_SLICE;
|
|
bool isExit_{false};
|
|
int16_t dragStartX_{0};
|
|
int16_t dragCurrentX_{0};
|
|
int32_t dragDistance_{0};
|
|
osThreadId_t camera_shark_task_id = NULL;
|
|
};
|
|
|
|
} // namespace TJD
|
|
|
|
#endif |