2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
8 // http://floralicense.org/license/
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.
18 * @file CalllogManager.h
19 * @brief This is the header file for the %CallLogManager class.
21 * This header file contains the declarations for %CallLogManager, %CallLogDetails, %LogListComparer class.
24 #ifndef _PHN_CALL_LOG_MANAGER_H_
25 #define _PHN_CALL_LOG_MANAGER_H_
29 #include "CallTypes.h"
30 #include "CallICalllogChangeListener.h"
35 * @class LogListComparer
36 * @brief LogListComparer provides comparison functions used to
37 * sort an arraylist of CallLogDetails.
41 : public Tizen::Base::Collection::IComparerT<CallLogDetails>
45 virtual ~LogListComparer() {};
46 result Compare (const CallLogDetails& obj1, const CallLogDetails& obj2, int& cmp) const;
50 * @class CallLogDetails
51 * @brief CallLogDetails used to store information call logs.
55 : public Tizen::Base::Object
59 virtual ~CallLogDetails();
60 bool operator ==(const CallLogDetails& rhs) const;
61 bool operator !=(const CallLogDetails& rhs) const;
62 CallLogDetails& operator =(const CallLogDetails& rhs);
64 void SetCalllogDbId(int id);
65 int GetCalllogDbId(void);
66 void SetCalllogType(contacts_phone_log_type_e type);
67 CallLogType GetCalllogType(void);
68 void SetContactDbId(int id);
69 int GetContactDbId(void);
70 void SetFirstName(char* name);
71 char* GetFirstName(void);
72 void SetLastName(char* name);
73 char* GetLastName(void);
74 void SetDisplayName(char* name);
75 char* GetDisplayName(void);
76 void SetContactImagePath(char* path);
77 char* GetContactImagePath(void);
78 void SetPhoneNumber(char* number);
79 char* GetPhoneNumber(void);
80 void SetShortMessage(char* message);
81 char* GetShortMessage(void);
82 void SetStartTime(time_t time);
83 time_t GetStartTime(void);
84 void SetDuration(int duration);
85 int GetDuration(void);
86 void ConvertTimetoDateTime(void);
87 Tizen::Base::DateTime GetDateTime(void);
90 //TODO: Naming conventions to be followed.
91 //NOTE: Below fields are not owned.
92 int calllog_db_id; /**< Call log entry id */
93 CallLogType calllog_type; /**< Call log entry type */
94 int contact_db_id; /**< Contact's id in database */
95 char* first_name; /**< Contact's first name (also known as given name) */
96 char* last_name; /**< Contact's last name (also known as family name) */
97 char* display_name; /**< Display name (how contact's name should be presented) */
98 char* contact_image_path; /**< Path to image with contact's picture */
99 // contact_number_type_e phone_number_type; /**< Phone number type (i.e.: work, cell) */
100 char* phone_number; /**< Phone number */
101 char* short_message; /**< Short message for this log */
102 time_t startTime; /**< Timestamp of this change */
104 Tizen::Base::DateTime dateTime;
109 * @class CallLogManager
110 * @brief CallLogManager is a singleton class used to save and retrieve call log related data.
116 static CallLogManager* GetInstance(void);
119 CallLogManager(void);
120 virtual ~CallLogManager(void);
121 result Construct(void);
122 static void CreateInstance(void);
123 static void DestroyInstance(void);
124 unsigned long GetDuration(long long start_time);
126 result AddCallogInfoToDatabase(CallInfo* calllogInfo);
128 static CallLogManager* __pCallogManager;
132 #endif // _PHN_CALL_LOG_MANAGER_H_