Fix for 42792
[apps/osp/Call.git] / inc / CallInfo.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                CallInfo.h
19  * @brief               This is the header file for the %CallInfo class.
20  *
21  * This header file contains the declarations for %CallInfo class.
22  */
23 #ifndef _PHN_CALL_INFO_H_
24 #define _PHN_CALL_INFO_H_
25
26 #include <FBase.h>
27 #include <FSocial.h>
28 #include <FSclTypes.h>
29 #include "CallTypes.h"
30
31 /**
32  * @class CallInfo
33  * @brief This class holds information about currently active Single party,
34  * mutli-party or conference calls.
35  *
36  */
37 class AppCallInfo
38         : public Tizen::Base::Object
39 {
40 public:
41         enum CallType
42         {
43                 VOICE_CALL,
44                 VIDEO_CALL, // Currently not supported
45         };
46
47 public:
48         // Default Constructor.
49         AppCallInfo(void);
50         virtual ~AppCallInfo(void);
51
52         //returns if a call is conference call or not
53         bool IsConferenceCall(void);
54         //Sets the conferenceflag for a call
55         void SetConference(bool isConferenceCall);
56         //returns if a call is emergency call or not
57         bool IsEmergency(void);
58         //Sets if a call is emergency call
59         void SetEmergency(bool isEmergency);
60         //get the call Handle
61         Tizen::Base::Long* GetCallHandle(void);
62         //Set the call handle
63         void SetCallHandle(unsigned int handle);
64         //Get for Contact Number for the call
65         Tizen::Base::String& GetContactNumber(void);
66         //Set the contact number for the call
67         void SetContactNumber(Tizen::Base::String& contactNumber);
68         void ResetContactNumber(Tizen::Base::String* contactNumber);
69         void ResetContactInfo(const Tizen::Social::Contact* contact);
70         //Sets the contact info for the call
71         void SetContactInfo(const Tizen::Social::Contact& contact);
72         //returns contact info if present in contacts db
73         const Tizen::Social::Contact* GetContactInfo(void);
74         //returns if a call is held call or not
75         bool IsOnHold(void);
76         //Sets the held call for the call
77         void SetOnHold(bool onHold);
78         //get the connected time for the call
79         long long GetCallConnectTime(void);
80         //Sets the connected time when call started
81         void SetCallConnectTime(long long connectTime);
82         //get the notified / dialed time when call started
83         long long GetCallNotificationTime(void);
84         //Sets the notified / dialed time when call started
85         void SetCallNotificationTime(long long callNotificationTime);
86         //gets the end call cause
87         Tizen::Base::String& GetEndCallCause(void);
88         //Sets the end call cause
89         void SetEndCallCause(Tizen::Base::String& pEndCause);
90         //gets the caller list for a conference call
91         Tizen::Base::Collection::IListT<AppCallInfo>* GetCallerList(void);
92         //Adds a call to conference call list
93         result AddCallToCallerList(AppCallInfo& callInfo);
94         //removes a call from the conference call list
95         result RemoveCallFromCallerList(int index);
96         //returns the number of calls in conference
97         int GetCallerListCount(void);
98         //sets the type of the call for the logs application
99         void SetCalllogType(CallLogType callLogType);
100         //returns the type of the call log
101         CallLogType GetCalllogType(void);
102         /**
103          * This is the equality operator for this CallInfo.
104          * returns true, if both have same value for call handle.
105          *
106          * @param[in]   rhs     A reference to the %CallInfo instance
107          */
108         bool operator ==(const AppCallInfo& rhs) const;
109
110         /**
111          * This is the InEquality operator for this CallInfo.
112          * returns true, if value for call handle is different.
113          *
114          * @param[in]   rhs     A reference to the %CallInfo instance
115          */
116         bool operator !=(const AppCallInfo& rhs) const;
117
118         /**
119          * This is the assignment operator for this class.
120          * @param[in]   rhs     A reference to the %CallInfo instance
121          */
122         AppCallInfo& operator =(const AppCallInfo& rhs);
123
124         // this funtion fetches the contact person's name.
125         Tizen::Base::String* FetchCallerNameN(void);
126         //Returns the latest Caller Name for a Number from address book
127         Tizen::Base::String* FetchLatestCallerNameN(const Tizen::Base::String& phoneNumber);
128         // this funtion fetches the contact person's photo id, if present.
129         Tizen::Graphics::Bitmap* FetchCallerPhotoN(void);
130         //Returns the latest Caller Photo for a Number from address book
131         Tizen::Graphics::Bitmap* FetchLatestCallerPhotoN(const Tizen::Base::String& phoneNumber);
132         //Returns the Contact Matched for the PhoneNumber from address book
133         Tizen::Social::Contact* FetchContactN(const Tizen::Base::String& phoneNumber);
134
135
136
137 private:
138         bool __isConfCall;
139         CallType __callType;
140
141         ///Calllog type information like outgoing, incoming, missed call
142         CallLogType __calllogType;
143
144         //To uniquely identify both Single / Conf. Call.
145         Tizen::Base::Long* __pCallHandle;
146
147         bool __isEmergency;
148
149         //applicable only for Single Call
150         Tizen::Base::String __contactNumber;
151
152         //call is held
153         bool __isOnHold;
154
155         //system time when call connected
156         long long __callConnectTime;
157
158         //system time when the call was notified / dialed
159         long long __callNotificationTime;
160
161         //end call cause
162         Tizen::Base::String* __pEndCallCause;
163
164         //callHandles for individual callers in conf. calls
165         Tizen::Base::Collection::ArrayListT<AppCallInfo>* __pParticipantCallHandles;
166
167         //used to store previously fetched contact.
168         Tizen::Social::Contact* __pContact;
169         // having the address book here
170         Tizen::Social::Addressbook* __pAddressBook;
171 };
172
173 #endif // _PHN_CALL_INFO_H_