88 lines
2.7 KiB
C++
88 lines
2.7 KiB
C++
#ifndef TJD_UI_APP_LEFUN_AI_PRESENTER_H
|
|
#define TJD_UI_APP_LEFUN_AI_PRESENTER_H
|
|
|
|
#include "Presenter.h"
|
|
#include "TjdUiAppLefunAiAdapter.h"
|
|
#include "TjdUiScreenDrag.h"
|
|
#include "components/root_view.h"
|
|
#include "components/ui_slider.h"
|
|
#include "components/ui_view.h"
|
|
#include "graphic_timer.h"
|
|
#include "ui_list.h"
|
|
#include <audio_manager.h>
|
|
#include <string>
|
|
|
|
namespace TJD {
|
|
|
|
#define MAIN_VIEW_ID "btnMainView"
|
|
#define MAIN_VIEW_HISTORY_BTN_ID "btnHistoryImg"
|
|
#define RECORDING_VIEW_ID "btnRecordingView"
|
|
#define TIMEOUT_VIEW_RETRY_ID "btnTimeoutViewRetry"
|
|
#define TIMEOUT_VIEW_CANCEL_ID "btnTimeoutViewCancel"
|
|
#define ANSWER_VIEW_ID "btnAnswerView"
|
|
#define NO_CONTENT_VIEW_ID "btnNoContentView"
|
|
#define HISTORT_VIEW_ID "btnHistoryView"
|
|
|
|
enum LefunAiView
|
|
{
|
|
LEFUN_AI_VIEW_MAIN = 0,
|
|
LEFUN_AI_VIEW_RECORDING_VIEW,
|
|
LEFUN_AI_VIEW_HISTORY_VIEW,
|
|
LEFUN_AI_VIEW_NO_CONNECT_VIEW,
|
|
LEFUN_AI_VIEW_ANALYSIS_VIEW,
|
|
LEFUN_AI_VIEW_TIME_OUT_VIEW,
|
|
LEFUN_AI_VIEW_ANSWER_VIEW,
|
|
LEFUN_AI_VIEW_NO_CONTENT_VIEW,
|
|
LEFUN_AI_VIEW_COUNT
|
|
};
|
|
|
|
class LefunAiInterruptListener : public Audio::InterruptListener
|
|
{
|
|
public:
|
|
void OnInterrupt(int32_t type, int32_t hint);
|
|
};
|
|
|
|
class TjdUiAppLefunAiView;
|
|
class TjdUiAppLefunAiPresenter : public OHOS::Presenter<TjdUiAppLefunAiView>,
|
|
public OHOS::UIView::OnClickListener,
|
|
public TjdUiScreenDragListener,
|
|
public OHOS::RootView::OnKeyActListener,
|
|
public OHOS::ListScrollListener
|
|
{
|
|
public:
|
|
TjdUiAppLefunAiPresenter();
|
|
virtual ~TjdUiAppLefunAiPresenter();
|
|
static TjdUiAppLefunAiPresenter *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(view); }
|
|
bool OnKeyAct(OHOS::UIView &view, const OHOS::KeyEvent &event);
|
|
void OnClickTrans(OHOS::UIView &view);
|
|
void ViewExitEvent(OHOS::UIView &view);
|
|
void OnClickedEventDistribute(const char *viewId);
|
|
void DeleteJumpTimer();
|
|
void MainViewHistoryBtnClick();
|
|
void MainViewConfirmBtnClick();
|
|
void RecordingViewBtnClick();
|
|
void TimeoutViewRetryBtnClick();
|
|
void TimeoutViewCancelBtnClick();
|
|
void AnswerViewBtnClick();
|
|
void NoContentViewBtnClick();
|
|
void HistoryViewBtnClick();
|
|
|
|
void StartJumpTimer(LefunAiView jumpView);
|
|
osTimerId_t jumpTimerId_{nullptr};
|
|
|
|
private:
|
|
bool initFlag_{false};
|
|
bool isExit_{true};
|
|
// TjdLefunAiItemView *itemViewSele{nullptr};
|
|
// TjdLefunAiItemView *preItemViewSele{nullptr};
|
|
};
|
|
|
|
} // namespace TJD
|
|
|
|
#endif |