|
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: Bubble extension plugin wrapper |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <telbubbleextension.h> |
|
20 #include <bmbubblemanager.h> |
|
21 |
|
22 #include "phonebubbleextension.h" |
|
23 |
|
24 // ======== MEMBER FUNCTIONS ======== |
|
25 |
|
26 // --------------------------------------------------------------------------- |
|
27 // Two-phased constructor. |
|
28 // --------------------------------------------------------------------------- |
|
29 // |
|
30 CPhoneBubbleExtension* CPhoneBubbleExtension::NewL( |
|
31 CBubbleManager& aBubbleManager, |
|
32 TUid aUid, |
|
33 TUint8 aPriority ) |
|
34 { |
|
35 CPhoneBubbleExtension* self = |
|
36 CPhoneBubbleExtension::NewLC( aBubbleManager, aUid, aPriority ); |
|
37 CleanupStack::Pop( self ); |
|
38 return self; |
|
39 } |
|
40 |
|
41 |
|
42 // --------------------------------------------------------------------------- |
|
43 // Two-phased constructor. |
|
44 // --------------------------------------------------------------------------- |
|
45 // |
|
46 CPhoneBubbleExtension* CPhoneBubbleExtension::NewLC( |
|
47 CBubbleManager& aBubbleManager, |
|
48 TUid aUid, |
|
49 TUint8 aPriority ) |
|
50 { |
|
51 CPhoneBubbleExtension* self = |
|
52 new( ELeave ) CPhoneBubbleExtension( aBubbleManager, aUid, aPriority ); |
|
53 CleanupStack::PushL( self ); |
|
54 self->ConstructL(); |
|
55 return self; |
|
56 } |
|
57 |
|
58 // --------------------------------------------------------------------------- |
|
59 // Destructor |
|
60 // --------------------------------------------------------------------------- |
|
61 // |
|
62 CPhoneBubbleExtension::~CPhoneBubbleExtension() |
|
63 { |
|
64 delete iPlugin; |
|
65 } |
|
66 |
|
67 // -------------------------------------------------------------------------- |
|
68 // From class MTelBubbleExtensionObserver. |
|
69 // |
|
70 // -------------------------------------------------------------------------- |
|
71 // |
|
72 void CPhoneBubbleExtension::StartChanges() |
|
73 { |
|
74 iBubbleManager.StartChanges(); |
|
75 } |
|
76 |
|
77 // -------------------------------------------------------------------------- |
|
78 // From class MTelBubbleExtensionObserver. |
|
79 // |
|
80 // -------------------------------------------------------------------------- |
|
81 // |
|
82 void CPhoneBubbleExtension::EndChanges() |
|
83 { |
|
84 iBubbleManager.EndChanges(); |
|
85 } |
|
86 |
|
87 // -------------------------------------------------------------------------- |
|
88 // From class MTelBubbleExtensionObserver. |
|
89 // Attaches element to bubble. Causes redraw. |
|
90 // -------------------------------------------------------------------------- |
|
91 // |
|
92 inline void CPhoneBubbleExtension::AttachElement( |
|
93 TInt aBubbleId, |
|
94 CTelBubbleCustomElement* aElement ) |
|
95 { |
|
96 ReplaceElement( aBubbleId, NULL, aElement); |
|
97 } |
|
98 |
|
99 // --------------------------------------------------------------------------- |
|
100 // From class MTelBubbleExtensionObserver. |
|
101 // Replaces element in bubble. Causes redraw. |
|
102 // --------------------------------------------------------------------------- |
|
103 // |
|
104 void CPhoneBubbleExtension::ReplaceElement( |
|
105 TInt aBubbleId, |
|
106 CTelBubbleCustomElement* aOld, |
|
107 CTelBubbleCustomElement* aNew ) |
|
108 { |
|
109 iBubbleManager.StartChanges(); |
|
110 if ( aOld ) |
|
111 { |
|
112 iBubbleManager.RemoveCustomElement( aBubbleId, aOld ); |
|
113 } |
|
114 if ( aNew ) |
|
115 { |
|
116 iBubbleManager.AddCustomElement( aBubbleId, aNew, iPriority ); |
|
117 } |
|
118 iBubbleManager.EndChanges(); |
|
119 } |
|
120 |
|
121 // -------------------------------------------------------------------------- |
|
122 // From class MTelBubbleExtensionObserver. |
|
123 // Detaches element in bubble. Causes redraw. |
|
124 // -------------------------------------------------------------------------- |
|
125 // |
|
126 inline void CPhoneBubbleExtension::DetachElement( |
|
127 TInt aBubbleId, |
|
128 CTelBubbleCustomElement* aElement ) |
|
129 { |
|
130 ReplaceElement( aBubbleId, aElement, NULL); |
|
131 } |
|
132 |
|
133 // --------------------------------------------------------------------------- |
|
134 // From class MTelBubbleExtensionInterface. |
|
135 // Notifies that a new customizable bubble is available |
|
136 // --------------------------------------------------------------------------- |
|
137 // |
|
138 inline void CPhoneBubbleExtension::StartCustomizedBubble( |
|
139 MTelBubbleExtensionData& aCallData ) |
|
140 { |
|
141 iPlugin->StartCustomizedBubble( aCallData ); |
|
142 } |
|
143 |
|
144 // --------------------------------------------------------------------------- |
|
145 // From class MTelBubbleExtensionInterface. |
|
146 // Notifies that a customizable bubble has been removed |
|
147 // --------------------------------------------------------------------------- |
|
148 // |
|
149 inline void CPhoneBubbleExtension::StopCustomizedBubble( |
|
150 MTelBubbleExtensionData& aCallData ) |
|
151 { |
|
152 iPlugin->StopCustomizedBubble( aCallData ); |
|
153 } |
|
154 |
|
155 // --------------------------------------------------------------------------- |
|
156 // From class MTelBubbleExtensionInterface. |
|
157 // Indicates that currently bubble drawing is started. |
|
158 // --------------------------------------------------------------------------- |
|
159 // |
|
160 inline void CPhoneBubbleExtension::BubbleUpdating() |
|
161 { |
|
162 iPlugin->BubbleUpdating(); |
|
163 } |
|
164 |
|
165 // --------------------------------------------------------------------------- |
|
166 // First phase constructor. |
|
167 // --------------------------------------------------------------------------- |
|
168 // |
|
169 CPhoneBubbleExtension::CPhoneBubbleExtension( |
|
170 CBubbleManager& aBubbleManager, |
|
171 TUid aUid, |
|
172 TUint8 aPriority ) |
|
173 : iBubbleManager(aBubbleManager), iUid(aUid), iPriority(aPriority) |
|
174 { |
|
175 // no implementation needed |
|
176 } |
|
177 |
|
178 |
|
179 // --------------------------------------------------------------------------- |
|
180 // Second phase constructor |
|
181 // --------------------------------------------------------------------------- |
|
182 // |
|
183 void CPhoneBubbleExtension::ConstructL() |
|
184 { |
|
185 iPlugin = CTelBubbleExtension::NewL( iUid ); |
|
186 iPlugin->InitializeL( *this ); |
|
187 } |
|
188 |
|
189 |
|
190 |