Fix for N_SE-28854 N_SE-29290 N_SE-27358 N_SE-25429 N_SE-25498 N_SE-25689 N_SE-27155...
[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.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                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 "CallTypes.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 contact info if present in contacts db
70         const Tizen::Social::Contact* GetContactInfo(void);
71         //returns if a call is held call or not
72         bool IsOnHold(void);
73         //Sets the held call for the call
74         void SetOnHold(bool onHold);
75         //get the connected time for the call
76         long long GetCallConnectTime(void);
77         //Sets the connected time when call started
78         void SetCallConnectTime(long long connectTime);
79         //get the notified / dialed time when call started
80         long long GetCallNotificationTime(void);
81         //Sets the notified / dialed time when call started
82         void SetCallNotificationTime(long long callNotificationTime);
83         //gets the end call cause
84         Tizen::Base::String& GetEndCallCause(void);
85         //Sets the end call cause
86         void SetEndCallCause(Tizen::Base::String& pEndCause);
87         //gets the caller list for a conference call
88         Tizen::Base::Collection::IListT<CallInfo>* GetCallerList(void);
89         //Adds a call to conference call list
90         result AddCallToCallerList(CallInfo& callInfo);
91         //removes a call from the conference call list
92         result RemoveCallFromCallerList(int index);
93         //returns the number of calls in conference
94         int GetCallerListCount(void);
95         //sets the type of the call for the logs application
96         void SetCalllogType(CallLogType callLogType);
97         //returns the type of the call log
98         CallLogType GetCalllogType(void);
99         /**
100          * This is the equality operator for this CallInfo.
101          * returns true, if both have same value for call handle.
102          *
103          * @param[in]   rhs     A reference to the %CallInfo instance
104          */
105         bool operator ==(const CallInfo& rhs) const;
106
107         /**
108          * This is the InEquality operator for this CallInfo.
109          * returns true, if value for call handle is different.
110          *
111          * @param[in]   rhs     A reference to the %CallInfo instance
112          */
113         bool operator !=(const CallInfo& rhs) const;
114
115         /**
116          * This is the assignment operator for this class.
117          * @param[in]   rhs     A reference to the %CallInfo instance
118          */
119         CallInfo& operator =(const CallInfo& rhs);
120
121         // this funtion fetches the contact person's name.
122         Tizen::Base::String* FetchCallerNameN(void);
123         // this funtion fetches the contact person's photo id, if present.
124         Tizen::Graphics::Bitmap* FetchCallerPhotoN(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_