46 lines
1.3 KiB
C++
46 lines
1.3 KiB
C++
#ifndef TJDUI_APP_VOICEASSISTANT_PRESENTER_H
|
|
#define TJDUI_APP_VOICEASSISTANT_PRESENTER_H
|
|
|
|
#include "Presenter.h"
|
|
#include "components/ui_view.h"
|
|
#include "root_view.h"
|
|
#include "TjdUiScreenDrag.h"
|
|
|
|
|
|
enum VoiceAssistantIndex
|
|
{
|
|
VOICEASSISTANT_MAINVIEW,
|
|
VOICEASSISTANT_AWAKENIEW,
|
|
VOICEASSISTANT_MAXTHVIEW
|
|
};
|
|
|
|
namespace TJD {
|
|
|
|
class TjdUiAppVoiceAssistantView;
|
|
class TjdUiAppVoiceAssistantPresenter : public OHOS::Presenter<TjdUiAppVoiceAssistantView>,
|
|
public TjdUiScreenDragListener,
|
|
public OHOS::RootView::OnKeyActListener,
|
|
public OHOS::RootView::OnClickListener
|
|
{
|
|
public:
|
|
TjdUiAppVoiceAssistantPresenter();
|
|
virtual ~TjdUiAppVoiceAssistantPresenter();
|
|
static TjdUiAppVoiceAssistantPresenter *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 ExitVoiceAssistantView(void);
|
|
void ViewExitEvent(bool isSwipe);
|
|
void VocAssistDeal(int flag);
|
|
|
|
private:
|
|
bool isExit_{false};
|
|
int16_t dragStartX_{0};
|
|
int16_t dragCurrentX_{0};
|
|
int32_t dragDistance_{0};
|
|
};
|
|
|
|
} // namespace TJD
|
|
|
|
#endif |