Modify flora license version.
[platform/core/messaging/msg-service.git] / plugin / sms_plugin / include / SmsPluginSetting.h
1 /*
2 * Copyright 2012-2013  Samsung Electronics Co., Ltd
3 *
4 * Licensed under the Flora License, Version 1.1 (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
7 *
8 *    http://floralicense.org/license/
9 *
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.
15 */
16
17 #ifndef SMS_PLUGIN_SETTING_H
18 #define SMS_PLUGIN_SETTING_H
19
20
21 /*==================================================================================================
22                                          INCLUDE FILES
23 ==================================================================================================*/
24 #include "MsgMutex.h"
25 #include "MsgSettingTypes.h"
26
27
28 /*==================================================================================================
29                                      CLASS DEFINITIONS
30 ==================================================================================================*/
31 class SmsPluginSetting
32 {
33 public:
34         static SmsPluginSetting* instance();
35
36         void initConfigData(MSG_SIM_STATUS_T SimStatus);
37
38         void setConfigData(const MSG_SETTING_S *pSetting);
39         void getConfigData(MSG_SETTING_S *pSetting);
40
41         void setParamCntEvent(int ParamCnt);
42         void setParamEvent(const MSG_SMSC_DATA_S *pSmscData, int RecordIdx, bool bSuccess);
43         void setCbConfigEvent(const MSG_CBMSG_OPT_S *pCbOpt, bool bSuccess);
44         void setMailboxInfoEvent(SMS_SIM_MAILBOX_LIST_S *pVoiceOpt, bool bSuccess);
45         void setMwiInfo(MSG_SUB_TYPE_T type, int count);
46         void setMwiInfoEvent(SMS_SIM_MWI_INFO_S *pMwiInfo, bool bSuccess);
47         void setResultFromSim(bool bResult);
48
49 private:
50         SmsPluginSetting();
51         ~SmsPluginSetting();
52
53         msg_error_t addSMSCList(MSG_SMSC_LIST_S *pSmscList);
54
55         msg_error_t addCbOpt(MSG_CBMSG_OPT_S *pCbOpt);
56         void getCbOpt(MSG_SETTING_S *pSetting);
57
58         void setParamList(const MSG_SMSC_LIST_S *pSMSCList);
59         void getParamList(MSG_SMSC_LIST_S *pSMSCList);
60
61         int getParamCount();
62         bool getParam(int Index, MSG_SMSC_DATA_S *pSmscData);
63
64         bool setCbConfig(const MSG_CBMSG_OPT_S *pCbOpt);
65         bool getCbConfig(MSG_CBMSG_OPT_S *pCbOpt);
66
67         void setVoiceMailInfo(const MSG_VOICEMAIL_OPT_S *pVoiceOpt);
68         bool getVoiceMailInfo(MSG_VOICEMAIL_OPT_S *pVoiceOpt);
69         bool getMwiInfo(void);
70         bool getMsisdnInfo(void);
71
72         int getParamCntEvent();
73         bool getParamEvent(MSG_SMSC_DATA_S *pSmscData);
74         bool getCbConfigEvent(MSG_CBMSG_OPT_S *pCbOpt);
75
76         bool getMailboxInfoEvent(MSG_VOICEMAIL_OPT_S *pVoiceOpt);
77
78         bool getResultFromSim();
79
80         SMS_PID_T convertPid(MSG_SMS_PID_T pid);
81
82         static SmsPluginSetting* pInstance;
83
84         MSG_SMSC_DATA_S         smscData;
85         MSG_CBMSG_OPT_S         cbOpt;
86
87         /* Message Waiting Indicator */
88         SMS_SIM_MAILBOX_LIST_S  simMailboxList;
89         SMS_SIM_MWI_INFO_S      simMwiInfo;
90
91         bool            bTapiResult;
92         int             paramCnt;
93         int             selectedParam;
94
95         Mutex mx;
96         CndVar cv;
97 };
98
99 #endif //SMS_PLUGIN_SETTING_H
100