Sync with tizen 2.4
[platform/core/messaging/msg-service.git] / plugin / sms_plugin / include / SmsPluginSetting.h
index 1c27a1f..05e39d1 100755 (executable)
@@ -1,20 +1,17 @@
 /*
- * msg-service
- *
- * Copyright (c) 2000 - 2014 Samsung Electronics Co., Ltd. All rights reserved
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- *
 */
 
 #ifndef SMS_PLUGIN_SETTING_H
 ==================================================================================================*/
 #include "MsgMutex.h"
 #include "MsgSettingTypes.h"
+#include <list>
 
+extern "C"
+{
+       #include <tapi_common.h>
+}
 
 /*==================================================================================================
                                      CLASS DEFINITIONS
@@ -36,64 +38,88 @@ class SmsPluginSetting
 public:
        static SmsPluginSetting* instance();
 
-       void initConfigData(MSG_SIM_STATUS_T SimStatus);
-
        void setConfigData(const MSG_SETTING_S *pSetting);
        void getConfigData(MSG_SETTING_S *pSetting);
+       void getMeImei(char *pImei);
 
        void setParamCntEvent(int ParamCnt);
-       void setParamEvent(const MSG_SMSC_DATA_S *pSmscData, int RecordIdx, bool bSuccess);
-       void setCbConfigEvent(const MSG_CBMSG_OPT_S *pCbOpt, bool bSuccess);
-       void setMailboxInfoEvent(SMS_SIM_MAILBOX_LIST_S *pVoiceOpt, bool bSuccess);
-       void setMwiInfo(MSG_SUB_TYPE_T type, int count);
-       void setMwiInfoEvent(SMS_SIM_MWI_INFO_S *pMwiInfo, bool bSuccess);
+       void setParamEvent(struct tapi_handle *handle, const MSG_SMSC_DATA_S *pSmscData, int RecordIdx, bool bSuccess);
+       void setCbConfigEvent(struct tapi_handle *handle, const MSG_CBMSG_OPT_S *pCbOpt, bool bSuccess);
+       void setMailboxInfoEvent(struct tapi_handle *handle, SMS_SIM_MAILBOX_LIST_S *pVoiceOpt, bool bSuccess, bool bMbdn);
+       void setMwiInfo(int simIndex, MSG_SUB_TYPE_T type, int count);
+       void setMwiInfoEvent(struct tapi_handle *handle, SMS_SIM_MWI_INFO_S *pMwiInfo, bool bSuccess);
        void setResultFromSim(bool bResult);
+       void setResultImei(bool bResult, char *pImei);
+
+       void setSmscInfo(const MSG_SMSC_LIST_S *pSmscList);
+
+       void setSimChangeStatus(struct tapi_handle *handle, bool bInitializing);
+       void getSmscListInfo(int simIndex, MSG_SMSC_LIST_S *pSmscList);
+       void SimRefreshCb(struct tapi_handle *handle);
 
 private:
        SmsPluginSetting();
        ~SmsPluginSetting();
 
-       msg_error_t addSMSCList(MSG_SMSC_LIST_S *pSmscList);
+       void updateSimStatus(struct tapi_handle *handle);
+
+       void initConfigData(struct tapi_handle *handle);
+       static void* init_config_data(void *data);
+       static void* initSimInfo(void *data);
+       void* processInitSimInfo(void *data);
+
+       void addSMSCList(MSG_SMSC_LIST_S *pSmscList);
 
        msg_error_t addCbOpt(MSG_CBMSG_OPT_S *pCbOpt);
-       void getCbOpt(MSG_SETTING_S *pSetting);
+       void getCbOpt(MSG_SETTING_S *pSetting, int simIndex);
 
        void setParamList(const MSG_SMSC_LIST_S *pSMSCList);
        void getParamList(MSG_SMSC_LIST_S *pSMSCList);
 
-       int getParamCount();
-       bool getParam(int Index, MSG_SMSC_DATA_S *pSmscData);
+       int getParamCount(struct tapi_handle *handle);
+       bool getParam(struct tapi_handle *handle, int Index, MSG_SMSC_DATA_S *pSmscData);
 
        bool setCbConfig(const MSG_CBMSG_OPT_S *pCbOpt);
        bool getCbConfig(MSG_CBMSG_OPT_S *pCbOpt);
 
        void setVoiceMailInfo(const MSG_VOICEMAIL_OPT_S *pVoiceOpt);
-       bool getVoiceMailInfo(MSG_VOICEMAIL_OPT_S *pVoiceOpt);
-       bool getMwiInfo(void);
-       bool getMsisdnInfo(void);
+       bool getVoiceMailInfo(struct tapi_handle *handle);
+
+       bool getMwiInfo(struct tapi_handle *handle);
+       bool getMsisdnInfo(struct tapi_handle *handle);
+       bool getSimServiceTable(struct tapi_handle *handle);
+       bool getResultImei(char *pImei);
 
        int getParamCntEvent();
-       bool getParamEvent(MSG_SMSC_DATA_S *pSmscData);
+       bool getParamEvent(struct tapi_handle *handle, MSG_SMSC_DATA_S *pSmscData);
        bool getCbConfigEvent(MSG_CBMSG_OPT_S *pCbOpt);
 
-       bool getMailboxInfoEvent(MSG_VOICEMAIL_OPT_S *pVoiceOpt);
+       bool getMailboxInfoEvent();
 
        bool getResultFromSim();
 
        SMS_PID_T convertPid(MSG_SMS_PID_T pid);
+       void deliverVoiceMsgNoti(int simIndex, int mwiCnt);
 
        static SmsPluginSetting* pInstance;
-
-       MSG_SMSC_DATA_S         smscData;
-       MSG_CBMSG_OPT_S         cbOpt;
-
-       /* Message Waiting Indicator */
-       SMS_SIM_MAILBOX_LIST_S  simMailboxList;
-       SMS_SIM_MWI_INFO_S      simMwiInfo;
-
-       bool            bTapiResult;
+       std::list<TapiHandle *> tel_handle_list;
+
+       /* Setting values for keeping in setting instance */
+       MSG_SMSC_LIST_S         smscList[MAX_TELEPHONY_HANDLE_CNT+1];
+       MSG_SIM_STATUS_T        simStatus[MAX_TELEPHONY_HANDLE_CNT+1];
+       MSG_SMSC_DATA_S         smscData[MAX_TELEPHONY_HANDLE_CNT+1];
+       SMS_SIM_MAILBOX_LIST_S  simMailboxList[MAX_TELEPHONY_HANDLE_CNT+1];
+       SMS_SIM_MWI_INFO_S      simMwiInfo[MAX_TELEPHONY_HANDLE_CNT+1];
+       MSG_CBMSG_OPT_S cbOpt[MAX_TELEPHONY_HANDLE_CNT+1];
+
+       /* Local values for getting from SIM(TAPI) */
+       bool    bTapiResult;
        int             paramCnt;
        int             selectedParam;
+       int     selectedSimIndex;
+       char    meImei[MAX_ME_IMEI_LEN + 1];
+
+       bool    bMbdnEnable[MAX_TELEPHONY_HANDLE_CNT];
 
        Mutex mx;
        CndVar cv;