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