96 lines
2.7 KiB
C++
96 lines
2.7 KiB
C++
/*
|
|
* Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved.
|
|
* Description: CallerLogModel.h
|
|
* Author:
|
|
* Create: 2021-10-12
|
|
*/
|
|
#ifndef CALLER_LOG_MODEL_H
|
|
#define CALLER_LOG_MODEL_H
|
|
|
|
#include "string"
|
|
#include "PhoneService.h"
|
|
#include "AppViewIDs.h"
|
|
#include "message.h"
|
|
#include "msg_center.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef enum {
|
|
CHANGE_STATUS = 0,
|
|
SCO_STATUS,
|
|
ERROR_MESSAGE
|
|
} MessageType;
|
|
|
|
enum PhoneStatus {
|
|
PHONE_MULTI_STATUS = 0,
|
|
PHONE_SINGLE_STATUS
|
|
};
|
|
|
|
bool MulitplePhoneTextReplaces();
|
|
bool FindCallListInfoAndSetPriorityNumber();
|
|
void PhoneScoStatausCallback(hfp_sco_connect_state_t state);
|
|
void PhoneChangeStatusCallback(const PhoneCallInfo *phoneCall);
|
|
void PhoneErrorCallback(PhoneServiceErrorType type, int volume);
|
|
void UsingPhoneScoStatausCallback(hfp_sco_connect_state_t state);
|
|
void UsingPhoneChangeStatusCallback(const PhoneCallInfo *phoneCall);
|
|
void UsingPhoneErrorCallback(PhoneServiceErrorType type);
|
|
|
|
namespace OHOS {
|
|
class CallerLogModel {
|
|
public:
|
|
void InitPhoneService();
|
|
static CallerLogModel *GetInstance(void);
|
|
|
|
std::string GetPhoneNumber(void);
|
|
void SetoperateNumber(const char *number, char number_len);
|
|
|
|
bool GetPhoneStatus();
|
|
void SetMakePhoneStatus(bool status);
|
|
|
|
bool GetVolumeScreenStatus();
|
|
void SetVolumeScreenStatus(bool status);
|
|
|
|
bool GetCallStatus();
|
|
void SetCallStatus(bool status);
|
|
|
|
bool GetWaitingStatus();
|
|
void SetWaitingStatus(bool status);
|
|
|
|
bool GetMulitplePhoneStatus();
|
|
void SetMulitplePhoneStatus(bool status);
|
|
|
|
std::string GetDialingStatus(void);
|
|
void SetDialingStatus(const char *text);
|
|
|
|
std::string InitDateHourTime();
|
|
std::string& DisplayCallDuration();
|
|
int CurrCallNum();
|
|
|
|
bool GetNotifyFlag(void);
|
|
void SetNotifyFlag(bool flag);
|
|
bool IsMulitplePhoneStatus(void);
|
|
private:
|
|
CallerLogModel();
|
|
CallerLogModel(const CallerLogModel &);
|
|
CallerLogModel &operator=(const CallerLogModel &);
|
|
virtual ~CallerLogModel();
|
|
|
|
std::string dialingStatus; // 拨号状态
|
|
std::string timers; // 时间显示
|
|
std::string callDuration; // 通话时长
|
|
std::string phoneNumber; // 电话号码
|
|
bool mulitplePhoneStatus{false}; // 判断是否多路通话界面
|
|
bool waitingStatus{false}; // 判断是否等待提醒界面
|
|
bool volumeStatus{false}; // 判断是否音量界面
|
|
bool phoneStatus{false}; // 判断是拨打界面还是呼入界面
|
|
bool callStatus{false}; // 判断是否正在接听电话
|
|
bool notifyFlag{false}; // 判断是否来电呼入 由notify生成界面
|
|
};
|
|
}
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif |