|
1 /* |
|
2 * Copyright (c) 2005-2006 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: Operator logo publisher. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_AIOPERATORLOGOPUBLISHER_H |
|
20 #define C_AIOPERATORLOGOPUBLISHER_H |
|
21 |
|
22 // System includes |
|
23 #include <e32base.h> |
|
24 #include <e32property.h> |
|
25 #include <cenrepnotifyhandler.h> |
|
26 |
|
27 // User includes |
|
28 #include <aiutility.h> |
|
29 #include "aidevicestatuspublisher.h" |
|
30 #include "ainetworkinfoobserver.h" |
|
31 |
|
32 // Forward declarations |
|
33 class CAiNetworkInfoListener; |
|
34 class MAiDeviceStatusContentObserver; |
|
35 class CHsContentPublisher; |
|
36 class CGulIcon; |
|
37 class CCenRepNotifyHandler; |
|
38 |
|
39 |
|
40 /** |
|
41 * @ingroup group_devicestatusplugin |
|
42 * |
|
43 * Operator logo publisher. |
|
44 * |
|
45 * Listens operator logo changes (OTA and programmable) and publishes |
|
46 * the new logo when it is updated. |
|
47 * |
|
48 * @since S60 3.2 |
|
49 */ |
|
50 NONSHARABLE_CLASS( CAiOperatorLogoPublisher ) : public CBase, |
|
51 public MAiDeviceStatusPublisher, |
|
52 public MAiNetworkInfoObserver, |
|
53 public MCenRepNotifyHandlerCallback |
|
54 { |
|
55 public: |
|
56 |
|
57 static CAiOperatorLogoPublisher* NewL(); |
|
58 |
|
59 virtual ~CAiOperatorLogoPublisher(); |
|
60 |
|
61 protected: |
|
62 |
|
63 //from base class MAiDeviceStatusPublisher |
|
64 |
|
65 void ResumeL(); |
|
66 void Subscribe( MAiContentObserver& aObserver, |
|
67 CHsContentPublisher& aExtension, |
|
68 MAiPublishPrioritizer& aPrioritizer, |
|
69 MAiPublisherBroadcaster& aBroadcaster ); |
|
70 void RefreshL( TBool aClean ); |
|
71 TBool RefreshL( TInt aContentId, TBool aClean ); |
|
72 void RefreshIfActiveL( TBool aClean ); |
|
73 TBool SuspendL( TInt aContentId, TBool aClean ); |
|
74 TBool RefreshContentWithPriorityL( TInt aContentId, TInt aPriority ); |
|
75 |
|
76 |
|
77 //from base class MAiNetworkInfoObserver |
|
78 |
|
79 /** |
|
80 * From MAiNetworkInfoObserver. |
|
81 * Called when network info changes. |
|
82 */ |
|
83 void HandleNetworkInfoChange( const MNWMessageObserver::TNWMessages& aMessage, |
|
84 const TNWInfo& aInfo, |
|
85 const TBool aShowOpInd ); |
|
86 |
|
87 |
|
88 // from base class MCenRepNotifyHandlerCallback |
|
89 |
|
90 /** |
|
91 * This callback method is used to notify the client about |
|
92 * changes for integer value keys, i.e. key type is EIntKey. |
|
93 * |
|
94 * @param aId Id of the key that has changed. |
|
95 * @param aNewValue The new value of the key. |
|
96 */ |
|
97 void HandleNotifyInt( TUint32 aId, TInt aNewValue ); |
|
98 |
|
99 |
|
100 |
|
101 |
|
102 private: |
|
103 |
|
104 CAiOperatorLogoPublisher(); |
|
105 |
|
106 void ConstructL(); |
|
107 |
|
108 /** |
|
109 * Called when central repository key changes. |
|
110 * |
|
111 * @since S60 3.2 |
|
112 * @param aMCC is country code. |
|
113 * @param aMNC is network code. |
|
114 * @return pointer to loaded logo. Ownership is transferred to caller. |
|
115 */ |
|
116 CFbsBitmap* LoadLogoL( TInt aMCC, |
|
117 TInt aMNC ); |
|
118 |
|
119 /** |
|
120 * Update operator logo. |
|
121 * @param aClean ETrue if currently published logo must be cleaned. |
|
122 */ |
|
123 void UpdateOperatorLogoL( TBool aClean ); |
|
124 |
|
125 /** |
|
126 * Returns ETrue if operator logo is allowed to be displayed. |
|
127 */ |
|
128 TBool AllowToShowLogoL() const; |
|
129 |
|
130 /** |
|
131 * Create monochrome bitmaps (main & mask). |
|
132 * |
|
133 * @since S60 3.2 |
|
134 * @param aBitmap monochrome bitmap. |
|
135 * @param aNewLogoMain bitmap, ownership passed to caller. |
|
136 * @param aNewLogoMask bitmap mask, ownership passed to caller. |
|
137 */ |
|
138 void CreateMonochromeBitmapsL( |
|
139 const CFbsBitmap& aBitmap, |
|
140 CFbsBitmap*& aNewLogoMain, |
|
141 CFbsBitmap*& aNewLogoMask ); |
|
142 |
|
143 /** |
|
144 * Getter method for title pane size. |
|
145 * @param aSize Initialized with title pane size in return. |
|
146 * @return KErrNotFound if title pane is not found, KErrNone otherwise. |
|
147 */ |
|
148 TInt GetTitlePaneSize( TSize& aSize ); |
|
149 |
|
150 /** |
|
151 * Callback method for changes in operator logo. |
|
152 * Called if operator logo has been changed. |
|
153 */ |
|
154 static TInt HandleOperatorLogoUpdateL( TAny *aPtr ); |
|
155 |
|
156 |
|
157 private: // data |
|
158 |
|
159 /** Network info listener, owned */ |
|
160 CAiNetworkInfoListener* iListener; |
|
161 /** Operator logo bitmap and mask, owned */ |
|
162 CGulIcon* iIcon; |
|
163 /** Content observer, not owned */ |
|
164 MAiContentObserver* iContentObserver; |
|
165 /** Property extension, not owned */ |
|
166 CHsContentPublisher* iExtension; |
|
167 /** Content prioritizer, not owned */ |
|
168 MAiPublishPrioritizer* iPrioritizer; |
|
169 /** Publish broadcaster, not owned */ |
|
170 MAiPublisherBroadcaster* iBroadcaster; |
|
171 /** Publish-subscribe client, owned */ |
|
172 MAiPSPropertyObserver* iOperatorLogoObserver; |
|
173 /** Central repository client, owned */ |
|
174 CRepository* iCenRep; |
|
175 /** Central repository notifier, owned */ |
|
176 CCenRepNotifyHandler* iCenRepNotify; |
|
177 /** Operator logo priority, can have one of the following values: |
|
178 * |
|
179 * 1) EAiOTAOperatorLogo |
|
180 * 2) EAiProgOperatorLogo |
|
181 * 3) EAiInvalidPriority |
|
182 */ |
|
183 TInt iPriority; |
|
184 /** True if publish was successful. */ |
|
185 TBool iSuccess; |
|
186 /** Flag to indicate if the content is suspended */ |
|
187 TBool iSuspended; |
|
188 /** Show operator indicator */ |
|
189 TBool iShowOpInd; |
|
190 }; |
|
191 |
|
192 #endif // C_AIOPERATORLOGOPUBLISHER_H |
|
193 |
|
194 // End of file |