Initialize Tizen 2.3
[apps/osp/Dial.git] / inc / PhnCallLogPresentationModel.h
1 //
2 // Copyright (c) 2012 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 /**
18  * @file                PhnCallLogPresentationModel.h
19  * @brief               This is the header file for the %CalLogPresentationModel class.
20  *
21  * This header file contains the declarations for %CalLogPresentationModel class.
22  */
23
24 #ifndef PHNLOGPRESENTATIONMODEL_H_
25 #define PHNLOGPRESENTATIONMODEL_H_
26
27 #include <FApp.h>
28 #include <FTelephony.h>
29 #include "PhnCalllogManager.h"
30 #include "PhnICalllogChangeListener.h"
31 #include "PhnTypes.h"
32
33 class CallLogManager;
34
35 class CalLogPresentationModel: public Tizen::App::IAppControlResponseListener
36 {
37 public:
38         //create a singleton instance
39         static CalLogPresentationModel* GetInstance(void);
40
41         void AddCalllogChangeListener(ICalllogChangeListener& listner);
42         void DeleteCalllogByDbId(int dbId);
43         void DeleteItemAtGroupIndex(int groupIndex, int itemIndex);\r
44         void RemoveCalllogChangeListner(ICalllogChangeListener& listner);
45         void ResetAndNotifyCalllogData(void);
46         int GetAllCallLogCount(void);\r
47         int GetCallLogsViewedCount(void);\r
48         Tizen::Base::Collection::ArrayListT<CallLogDetails>* GetCallogListByNumberFromDatabaseN(char* pNumber);
49         int GetCalllogCountByNumber(void);
50         void GetCalllogContactName(Tizen::Base::String number, Tizen::Base::String& name);
51         Tizen::Base::Collection::IListT<CallLogDetails>*        GetCalllogListByNumValues(void);
52         //result GetCallLogItemAtIndex(int index, CallLogDetails* calllogInfo);\r
53         //Used to make an outgoing call
54         ErrorCodes DialCall(const Tizen::Base::String& contactNumber);
55         result LaunchAddContactsAppControl(Tizen::Base::String& contactNumber);
56         //Called when the application control is completed.
57         virtual void OnAppControlCompleteResponseReceived(const Tizen::App::AppId& appId, const Tizen::Base::String& operationId, Tizen::App::AppCtrlResult appControlResult, const Tizen::Base::Collection::IMap* pExtraData);
58
59         //Set the seen status
60         void SetMissedCallSeenStatus(CallLogDetails* pDetails);
61         void UpdateCallLogList(void);
62         int GetUnknownLogCount(int dbId);
63         Tizen::Base::Collection::ArrayList* GetCallLogGroups(void);
64
65         //API to check if the database is updated
66         bool IsDataUpdated(void);\r
67 \r
68         static void setCallLogViewbyID(CallLogType id);\r
69         static int getCallLogViewbyID();\r
70 private:
71         CalLogPresentationModel();
72         virtual ~CalLogPresentationModel();
73
74         result Construct(void);
75         static void CreateInstance(void);
76         static void DestroyInstance(void);
77         //used to make an outgoing call request using call appcontrol
78         result LaunchCallAppControl(const Tizen::Base::String& contactNumber);
79         // Get the sim info
80         result GetSimInfo(void);
81         bool IsSimAvailable(void);
82
83 private:
84         static CalLogPresentationModel* __pInstance;
85         CallLogManager* __pCallMgr;
86         //used to check if call AppControl is already running
87         bool __isCallAppControlRunning;
88
89 };
90
91 #endif /* PHNLOGPRESENTATIONMODEL_H_ */