466b5881fbbf720933d7a0943c15538ecc26a66e
[platform/core/messaging/msg-service.git] / plugin / sms_cdma_plugin / include / SmsCdmaPluginSetting.h
1 /*
2  * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
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_CDMA_PLUGIN_SETTING_H
18 #define SMS_CDMA_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 setSimChangeStatus();
37
38         void setConfigData(const MSG_SETTING_S *pSetting);
39         void getConfigData(MSG_SETTING_S *pSetting);
40         void getMeImei(char *pImei);
41
42         void setCbConfigEvent(const MSG_CBMSG_OPT_S *pCbOpt, bool bSuccess);
43
44         void setResultImei(bool bResult, char *pImei);
45         void setResultFromEvent(bool bResult);
46         void setResultFromSim(bool bResult);
47
48         void setMwiInfo(MSG_SUB_TYPE_T type, int count);
49         void SimRefreshCb();
50
51         bool getUpdateVoicemailByMdn();
52
53 private:
54         SmsPluginSetting();
55         ~SmsPluginSetting();
56
57         void updateSimStatus();
58
59         void initConfigData();
60         static void* init_config_data(void *data);
61         static void* initSimInfo(void *data);
62
63         msg_error_t addCbOpt(MSG_CBMSG_OPT_S *pCbOpt);
64         void getCbOpt(MSG_SETTING_S *pSetting);
65
66         void setVoiceMailInfo(const MSG_VOICEMAIL_OPT_S *pVoiceOpt);
67         bool setCbConfig(const MSG_CBMSG_OPT_S *pCbOpt);
68         bool getCbConfig(MSG_CBMSG_OPT_S *pCbOpt);
69
70         bool getMsisdnInfo(void);
71
72         bool getResultImei(char *pImei);
73
74         bool getCbConfigEvent(MSG_CBMSG_OPT_S *pCbOpt);
75
76         bool getResultFromSim();
77
78         static SmsPluginSetting* pInstance;
79
80         MSG_SMSC_DATA_S         smscData;
81         MSG_CBMSG_OPT_S         cbOpt;
82
83         bool            bTapiResult;
84         bool            bUpdateVoicemailByMdn;
85
86         char    meImei[MAX_ME_IMEI_LEN + 1];
87
88         Mutex mx;
89         CndVar cv;
90 };
91
92 #endif /* SMS_CDMA_PLUGIN_SETTING_H */