2.0_beta
[platform/core/messaging/msg-service.git] / plugin / sms_plugin / include / SmsPluginSetting.h
1 /*
2 * Copyright 2012  Samsung Electronics Co., Ltd
3 *
4 * Licensed under the Flora License, Version 1.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.tizenopensource.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 setResultFromSim(bool bResult);
45
46 private:
47         SmsPluginSetting();
48         ~SmsPluginSetting();
49
50         msg_error_t addSMSCList(MSG_SMSC_LIST_S *pSmscList);
51
52         msg_error_t addCbOpt(MSG_CBMSG_OPT_S *pCbOpt);
53         void getCbOpt(MSG_SETTING_S *pSetting);
54
55         void setParamList(const MSG_SMSC_LIST_S *pSMSCList);
56         void getParamList(MSG_SMSC_LIST_S *pSMSCList);
57
58         int getParamCount();
59         bool getParam(int Index, MSG_SMSC_DATA_S *pSmscData);
60
61         bool setCbConfig(const MSG_CBMSG_OPT_S *pCbOpt);
62         bool getCbConfig(MSG_CBMSG_OPT_S *pCbOpt);
63
64         int getParamCntEvent();
65         bool getParamEvent(MSG_SMSC_DATA_S *pSmscData);
66         bool getCbConfigEvent(MSG_CBMSG_OPT_S *pCbOpt);
67         bool getResultFromSim();
68
69         SMS_PID_T convertPid(MSG_SMS_PID_T pid);
70
71         static SmsPluginSetting* pInstance;
72
73         MSG_SMSC_DATA_S         smscData;
74         MSG_CBMSG_OPT_S         cbOpt;
75
76         bool            bTapiResult;
77         int             paramCnt;
78         int             selectedParam;
79
80         Mutex mx;
81         CndVar cv;
82 };
83
84 #endif //SMS_PLUGIN_SETTING_H
85