2 * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef SMS_PLUGIN_SETTING_H
18 #define SMS_PLUGIN_SETTING_H
21 /*==================================================================================================
23 ==================================================================================================*/
25 #include "MsgSettingTypes.h"
31 #include <tapi_common.h>
34 typedef map <int, MSG_SMSC_LIST_S> smscListMap;
35 typedef map <int, SMS_SIM_MAILBOX_LIST_S> smsSimMailboxListMap;
36 typedef map <int, SMS_SIM_MWI_INFO_S> simMwiInfoMap;
37 typedef map <int, MSG_CBMSG_OPT_S> cbOptMap;
39 /*==================================================================================================
41 ==================================================================================================*/
42 class SmsPluginSetting
45 static SmsPluginSetting* instance();
47 void setConfigData(const MSG_SETTING_S *pSetting);
48 void getConfigData(MSG_SETTING_S *pSetting);
49 void getMeImei(char *pImei);
51 void setParamCntEvent(int ParamCnt);
52 void setParamEvent(TapiHandle *handle, const MSG_SMSC_DATA_S *pSmscData, int RecordIdx, bool bSuccess);
53 void setCbConfigEvent(TapiHandle *handle, const MSG_CBMSG_OPT_S *pCbOpt, bool bSuccess);
54 void setMailboxInfoEvent(TapiHandle *handle, SMS_SIM_MAILBOX_LIST_S *pVoiceOpt, bool bSuccess, bool bMbdn);
55 void setMwiInfo(int simIndex, MSG_SUB_TYPE_T type, int count);
56 void setMwiInfoEvent(TapiHandle *handle, SMS_SIM_MWI_INFO_S *pMwiInfo, bool bSuccess);
57 void setResultFromSim(bool bResult);
58 void setResultImei(bool bResult, char *pImei);
60 void setSmscInfo(const MSG_SMSC_LIST_S *pSmscList);
62 void setSimChangeStatus(TapiHandle *handle, bool bInitializing);
63 void getSmscListInfo(int simIndex, MSG_SMSC_LIST_S *pSmscList);
64 void SimRefreshCb(TapiHandle *handle);
70 void updateSimStatus(TapiHandle *handle);
72 void initConfigData(TapiHandle *handle);
73 static void* init_config_data(void *data);
74 static void* initSimInfo(void *data);
75 void* processInitSimInfo(void *data);
77 void addSMSCList(MSG_SMSC_LIST_S *pSmscList);
79 msg_error_t addCbOpt(MSG_CBMSG_OPT_S *pCbOpt);
80 void getCbOpt(MSG_SETTING_S *pSetting, int simIndex);
82 void setParamList(const MSG_SMSC_LIST_S *pSMSCList);
83 void getParamList(MSG_SMSC_LIST_S *pSMSCList);
85 int getParamCount(TapiHandle *handle);
86 bool getParam(TapiHandle *handle, int Index, MSG_SMSC_DATA_S *pSmscData);
88 bool setCbConfig(const MSG_CBMSG_OPT_S *pCbOpt);
89 bool getCbConfig(MSG_CBMSG_OPT_S *pCbOpt);
91 void setVoiceMailInfo(const MSG_VOICEMAIL_OPT_S *pVoiceOpt);
92 bool getVoiceMailInfo(TapiHandle *handle);
94 bool getMwiInfo(TapiHandle *handle);
95 bool getMsisdnInfo(TapiHandle *handle);
96 bool getSimServiceTable(TapiHandle *handle);
97 bool getResultImei(char *pImei);
99 int getParamCntEvent();
100 bool getParamEvent(TapiHandle *handle, MSG_SMSC_DATA_S *pSmscData);
101 bool getCbConfigEvent(MSG_CBMSG_OPT_S *pCbOpt);
103 bool getMailboxInfoEvent();
105 bool getResultFromSim();
107 SMS_PID_T convertPid(MSG_SMS_PID_T pid);
108 void deliverVoiceMsgNoti(int simIndex, int mwiCnt);
110 static SmsPluginSetting* pInstance;
111 std::list<TapiHandle *> tel_handle_list;
113 /* Setting values for keeping in setting instance */
114 smscListMap smscList;
115 MSG_SIM_STATUS_T simStatus[MAX_TELEPHONY_HANDLE_CNT+1];
116 MSG_SMSC_DATA_S smscData[MAX_TELEPHONY_HANDLE_CNT+1];
117 smsSimMailboxListMap simMailboxList;
118 simMwiInfoMap simMwiInfo;
121 /* Local values for getting from SIM(TAPI) */
125 int selectedSimIndex;
126 char meImei[MAX_ME_IMEI_LEN + 1];
128 bool bMbdnEnable[MAX_TELEPHONY_HANDLE_CNT];
134 #endif /* SMS_PLUGIN_SETTING_H */