|
1 /* |
|
2 * Copyright (c) 2008 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: Wraps extension control and binds it to UI element. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef TELBUBBLECUSTOMELEMENT_H |
|
20 #define TELBUBBLECUSTOMELEMENT_H |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 class CTelBubbleAnim; |
|
25 class CTelBubbleLabel; |
|
26 class CTelBubbleImage; |
|
27 class CCoeControl; |
|
28 class CTelBubbleCallImage; |
|
29 |
|
30 /** |
|
31 * Wraps extension control and binds it to UI element. |
|
32 * |
|
33 * |
|
34 * @lib BMCustomization.lib |
|
35 * @since S60 v5.0 |
|
36 * |
|
37 * |
|
38 * Usage: |
|
39 * |
|
40 * // Display custom icon in big call indicator position |
|
41 * CTelBubbleImage* image = CTelBubbleImage::NewL(); |
|
42 * image->SetPicture( bitmap, mask ); |
|
43 * CTelBubbleCustomElement* element = |
|
44 * CTelBubbleCustomElement::NewL( |
|
45 * image, |
|
46 * CTelBubbleCustomElement::EBigCallIndicator ); |
|
47 * |
|
48 */ |
|
49 NONSHARABLE_CLASS( CTelBubbleCustomElement ) : public CBase |
|
50 { |
|
51 public: |
|
52 // Customized UI element |
|
53 enum TElementType |
|
54 { |
|
55 // Handset icon in initializing call states |
|
56 EBigCallIndicator = 0, |
|
57 // Number type icon ( ie. internet or video call ) |
|
58 ENumberTypeIcon, |
|
59 // Handset icon |
|
60 ESmallCallIndicator, |
|
61 // Icon in call bubble (placeholder) |
|
62 EBrandImage, |
|
63 // Contact or default picture in main pane |
|
64 ECallImage, |
|
65 // Keep this last |
|
66 ECustomElementCount |
|
67 }; |
|
68 |
|
69 // Custom control type |
|
70 enum TControlType |
|
71 { |
|
72 // CTelBubbleImage based control |
|
73 EBubbleImage, |
|
74 // CTelBubbleAnim based control |
|
75 EBubbleAnimation, |
|
76 // CCoeControl based control |
|
77 EBubbleControl, |
|
78 // CTelBubbleLabel based control |
|
79 EBubbleLabel, |
|
80 // CTelBubbleCallImage based control |
|
81 EBubbleCallImage |
|
82 }; |
|
83 |
|
84 public: |
|
85 /** |
|
86 * Two phase constructor |
|
87 * @param aControl Sets owned control, ownership is transferred |
|
88 * @param aElement Sets place where control is shown |
|
89 * @return New instance |
|
90 */ |
|
91 IMPORT_C static CTelBubbleCustomElement* NewL( |
|
92 CCoeControl* aControl, TElementType aElement ); |
|
93 IMPORT_C static CTelBubbleCustomElement* NewL( |
|
94 CTelBubbleAnim* aControl, TElementType aElement ); |
|
95 IMPORT_C static CTelBubbleCustomElement* NewL( |
|
96 CTelBubbleLabel* aControl, TElementType aElement ); |
|
97 IMPORT_C static CTelBubbleCustomElement* NewL( |
|
98 CTelBubbleImage* aControl, TElementType aElement ); |
|
99 IMPORT_C static CTelBubbleCustomElement* NewL( |
|
100 CTelBubbleCallImage* aControl, TElementType aElement ); |
|
101 |
|
102 /** Destructor */ |
|
103 IMPORT_C virtual ~CTelBubbleCustomElement(); |
|
104 |
|
105 public: |
|
106 /** |
|
107 * Returns custom control. |
|
108 */ |
|
109 IMPORT_C CCoeControl* Control() const; |
|
110 |
|
111 /** |
|
112 * Returns control type. |
|
113 */ |
|
114 IMPORT_C TControlType ControlType() const; |
|
115 |
|
116 /** |
|
117 * Return constomized UI element. |
|
118 */ |
|
119 IMPORT_C TElementType ElementType() const; |
|
120 |
|
121 private: |
|
122 // C++ constructors |
|
123 CTelBubbleCustomElement( CCoeControl* aControl, |
|
124 TElementType aElement ); |
|
125 CTelBubbleCustomElement( CTelBubbleAnim* aControl, |
|
126 TElementType aElement ); |
|
127 CTelBubbleCustomElement( CTelBubbleLabel* aControl, |
|
128 TElementType aElement ); |
|
129 CTelBubbleCustomElement( CTelBubbleImage* aControl, |
|
130 TElementType aElement ); |
|
131 CTelBubbleCustomElement( CTelBubbleCallImage* aControl, |
|
132 TElementType aElement ); |
|
133 |
|
134 private: |
|
135 CCoeControl* iControl; // owned |
|
136 TControlType iControlType; |
|
137 TElementType iElementType; |
|
138 }; |
|
139 |
|
140 #endif // TELBUBBLECUSTOMELEMENT_H |
|
141 |
|
142 // end of file |