1 /*! |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Bubble manager's interface. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef BUBBLEMANAGERIF_H |
|
19 #define BUBBLEMANAGERIF_H |
|
20 |
|
21 #include <QtCore> |
|
22 |
|
23 class HbAction; |
|
24 class QGraphicsWidget; |
|
25 |
|
26 class BubbleManagerIF |
|
27 { |
|
28 |
|
29 public: |
|
30 |
|
31 // Call states |
|
32 enum PhoneCallState |
|
33 { |
|
34 None = 0, // Default on creation |
|
35 OnHold, |
|
36 Disconnected, |
|
37 Active, |
|
38 Incoming, |
|
39 Waiting, |
|
40 AlertToDisconnected, |
|
41 Outgoing, |
|
42 Alerting |
|
43 }; |
|
44 |
|
45 // Call Flags |
|
46 enum PhoneCallFlag |
|
47 { |
|
48 Normal = 0x00, // Default |
|
49 NoCiphering = 0x08, |
|
50 Line2 = 0x10, |
|
51 Muted = 0x20, |
|
52 Diverted = 0x40, |
|
53 Video = 0x80, |
|
54 VoIPCall = 0x100 |
|
55 }; |
|
56 Q_DECLARE_FLAGS(PhoneCallFlags, PhoneCallFlag) |
|
57 |
|
58 // Number types |
|
59 enum PhoneNumberType |
|
60 { |
|
61 NotSet = 0, // Default |
|
62 Home, |
|
63 Mobile, |
|
64 Work, |
|
65 Phone, |
|
66 FaxNumber, |
|
67 Pager, |
|
68 Car, |
|
69 Assistant |
|
70 }; |
|
71 |
|
72 // Cli shown in conference participant list |
|
73 enum ParticipantListCli |
|
74 { |
|
75 ParticipantListCliText, // Name or Call %N |
|
76 ParticipantListPhoneNumber // Phonenumber |
|
77 }; |
|
78 |
|
79 |
|
80 public: |
|
81 |
|
82 // ==================================================== |
|
83 // Must surround all the changes: |
|
84 // ==================================================== |
|
85 // |
|
86 |
|
87 /** |
|
88 * Before making any changes to bubble headers, call this function |
|
89 * so that manager can prapare for them properly. |
|
90 */ |
|
91 virtual void startChanges () = 0; |
|
92 |
|
93 /** |
|
94 * After the changes to bubble headers call this function so manager |
|
95 * can prepare bubbles to right places and check the drawing order. |
|
96 * Memory for arrays has been allocated beforehand. |
|
97 */ |
|
98 virtual void endChanges () = 0; |
|
99 |
|
100 |
|
101 // ==================================================== |
|
102 // For call headers and some for conference call |
|
103 // ==================================================== |
|
104 // |
|
105 |
|
106 /** |
|
107 * Takes a new call header in use. |
|
108 * Returns bubble idenfication number. |
|
109 */ |
|
110 virtual int createCallHeader () = 0; |
|
111 |
|
112 /** |
|
113 * Removes call header from use |
|
114 */ |
|
115 |
|
116 virtual void removeCallHeader (int bubbleId) = 0; |
|
117 |
|
118 /** |
|
119 * Sets call state to header. |
|
120 */ |
|
121 virtual void setState (int bubbleId, PhoneCallState state) = 0; |
|
122 |
|
123 /** |
|
124 * Sets text label to header. For conf also. |
|
125 * Text to be seen in bubble ( e.g. 'on hold' ) |
|
126 */ |
|
127 virtual void setLabel ( |
|
128 int bubbleId, |
|
129 const QString& text, |
|
130 Qt::TextElideMode clipDirection) = 0; |
|
131 |
|
132 /** |
|
133 * Sets caller's line identification ( name or number) to header. |
|
134 * For conf also. Caller's CLI ( e.g. 'Mother' ) |
|
135 */ |
|
136 virtual void setCli (int bubbleId, |
|
137 const QString& cliText, |
|
138 Qt::TextElideMode clipDirection) = 0; |
|
139 |
|
140 /** |
|
141 * Updates caller's line identification ( name or number) to header. |
|
142 * Caller's CLI ( e.g. 'Daddy' )- |
|
143 */ |
|
144 virtual void updateCLI ( |
|
145 int bubbleId, |
|
146 const QString& cliText, |
|
147 Qt::TextElideMode clipDirection) = 0; |
|
148 |
|
149 /** |
|
150 * Number or voip adress, when phonebook name takes Cli. |
|
151 */ |
|
152 virtual void setSecondaryCli ( |
|
153 int bubbleId, |
|
154 const QString& cliText, |
|
155 Qt::TextElideMode clipDirection = Qt::ElideLeft) = 0; |
|
156 |
|
157 /** |
|
158 * Sets call time or cost text to header. For conf also. |
|
159 */ |
|
160 virtual void setCallTime (int bubbleId, const QString& callTime) = 0; |
|
161 |
|
162 /** |
|
163 * Updates call time or cost text to header. For conf also. |
|
164 * Timer or cost text ( e.g. '00:12:34' or '£01.23' ). |
|
165 */ |
|
166 virtual void updateCallTime (int bubbleId, const QString& callTime) = 0; |
|
167 |
|
168 /** |
|
169 * Attach a call image to header. |
|
170 */ |
|
171 virtual void setCallObjectImage (int bubbleId, const QString &fileName) = 0; |
|
172 |
|
173 /** |
|
174 * Attach the theme call image to header. |
|
175 */ |
|
176 virtual void setCallObjectFromTheme (int bubbleId) = 0; |
|
177 |
|
178 /** |
|
179 * Sets call flags to header. |
|
180 */ |
|
181 virtual void setCallFlags (int bubbleId, int flags) = 0; |
|
182 |
|
183 /** |
|
184 * Sets call flags to header. |
|
185 */ |
|
186 virtual void setCallFlag (int bubbleId, BubbleManagerIF::PhoneCallFlags callFlags, bool set) = 0; |
|
187 |
|
188 /** |
|
189 * Sets number type. |
|
190 */ |
|
191 virtual void setNumberType (int bubbleId, PhoneNumberType type) = 0; |
|
192 |
|
193 // ==================================================== |
|
194 // For all bubbles |
|
195 // ==================================================== |
|
196 // |
|
197 |
|
198 /** |
|
199 * Sets phone muted/unmuted. |
|
200 * @param aIsMuted ETrue if phone is muted. |
|
201 */ |
|
202 virtual void setPhoneMuted (bool muted) = 0; |
|
203 |
|
204 |
|
205 // ==================================================== |
|
206 // For conference call |
|
207 // ==================================================== |
|
208 // |
|
209 |
|
210 /** |
|
211 * Creates a conference call based upon two calls. Bubbles must be |
|
212 * created first. |
|
213 */ |
|
214 virtual int createConference (int bubble1, int bubble2) = 0; |
|
215 |
|
216 /** |
|
217 * Splits conference call into invidual two calls. Call headers stays |
|
218 * in use. Headers' state will not be changed. |
|
219 */ |
|
220 virtual void removeConference () = 0; |
|
221 |
|
222 /** |
|
223 * Adds new call to conference call. |
|
224 */ |
|
225 virtual void addRowToConference (int bubbleId) = 0; |
|
226 |
|
227 /** |
|
228 * Takes specified call out of conference. Use RemoveConference if |
|
229 * conference has only two calls in it. Header's state is same as |
|
230 * before adding it to conference (if not changed inside the conf). |
|
231 */ |
|
232 virtual void removeRowFromConference (int bubbleId) = 0; |
|
233 |
|
234 /** |
|
235 * Counts calls in conference call. |
|
236 */ |
|
237 virtual int conferenceRowCount () const = 0; |
|
238 |
|
239 /** |
|
240 * Sets highlight to specified line in conference. |
|
241 */ |
|
242 virtual void setSelectionInConference (int rowNumber) = 0; |
|
243 |
|
244 /** |
|
245 * Sets highlight to specified bubble id in conference. |
|
246 */ |
|
247 virtual void setSelectionIdInConference (int bubbleId) = 0; |
|
248 |
|
249 /** |
|
250 * Gets highlighted item in conference. |
|
251 */ |
|
252 virtual int selectionInConference () const = 0; |
|
253 |
|
254 /** |
|
255 * Gets highlighted item in conference. |
|
256 */ |
|
257 virtual int selectionIdInConference () const = 0; |
|
258 |
|
259 /** |
|
260 * Moves highligh one up if possible |
|
261 */ |
|
262 virtual void moveHighlightOneUpInConference () = 0; |
|
263 |
|
264 /** |
|
265 * Moves highligh one down if possible |
|
266 */ |
|
267 virtual void moveHighlightOneDownInConference () = 0; |
|
268 |
|
269 /** |
|
270 * Use this function to expand or shrink conference bubble. |
|
271 */ |
|
272 virtual void setExpandedConferenceCallHeader (bool expanded) = 0; |
|
273 |
|
274 /** |
|
275 * Query: is conference expanded? |
|
276 */ |
|
277 virtual bool isConferenceExpanded () const = 0; |
|
278 |
|
279 /** |
|
280 * Number of headers shown on the screen. |
|
281 */ |
|
282 virtual int shownHeaderCount () const = 0; |
|
283 |
|
284 /** |
|
285 * Set CLI used in participant list (text or phonenumber). |
|
286 */ |
|
287 virtual void setParticipantListCli (int aBubbleId, ParticipantListCli aParticipantCli) = 0; |
|
288 |
|
289 |
|
290 // ==================================================== |
|
291 // Call bubble actions |
|
292 // ==================================================== |
|
293 // |
|
294 |
|
295 /** |
|
296 * Appends new action to call bubble |
|
297 */ |
|
298 virtual void addAction (int bubble, HbAction *action) = 0; |
|
299 |
|
300 /** |
|
301 * Removes all actions from call bubble |
|
302 */ |
|
303 virtual void clearActions (int bubble) = 0; |
|
304 |
|
305 /** |
|
306 * Gets graphics widget for action |
|
307 */ |
|
308 virtual QGraphicsWidget* graphicsWidgetForAction (HbAction *action) const = 0; |
|
309 |
|
310 /** |
|
311 * Appends new action to participant list in conference call bubble. |
|
312 */ |
|
313 virtual void addParticipantListAction (HbAction *action) = 0; |
|
314 |
|
315 /** |
|
316 * Removes participant list actions from conference call bubble. |
|
317 */ |
|
318 virtual void clearParticipantListActions () = 0; |
|
319 |
|
320 |
|
321 // ==================================================== |
|
322 // Bubble state related (multicall) |
|
323 // ==================================================== |
|
324 // |
|
325 |
|
326 /** |
|
327 * Bubble shown in expanded position. |
|
328 */ |
|
329 virtual int expandedBubble() const = 0; |
|
330 |
|
331 /** |
|
332 * Sets action that is triggered when user taps collapsed |
|
333 * call bubble and it changes to expanded. Setting null |
|
334 * pointer removes expand action. |
|
335 */ |
|
336 virtual void setExpandAction(int bubble, HbAction* action) = 0; |
|
337 |
|
338 /** |
|
339 * Bubble state (expanded/collapsed) cannot be changed when |
|
340 * disabled is set true. |
|
341 */ |
|
342 virtual void setBubbleSelectionDisabled(bool disabled) = 0; |
|
343 }; |
|
344 |
|
345 Q_DECLARE_OPERATORS_FOR_FLAGS(BubbleManagerIF::PhoneCallFlags) |
|
346 |
|
347 #endif // BUBBLEMANAGERIF_H |
|