1 /* |
|
2 * Copyright (c) 2008-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: Provides access to branded data. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_CCHUIPLUGINBRANDINGHANDLER_H |
|
20 #define C_CCHUIPLUGINBRANDINGHANDLER_H |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 #include "cchuicommon.hrh" |
|
25 |
|
26 class MBSAccess; |
|
27 class CFbsBitmap; |
|
28 class CBSFactory; |
|
29 class CSPSettings; |
|
30 |
|
31 |
|
32 /** |
|
33 * Branding Server handler. |
|
34 * This class handles to use of branding server. It can be used |
|
35 * to retrieve icons or complete files by brand id. |
|
36 * |
|
37 * @code |
|
38 * CCchUiPluginBrandingHandler* handler = |
|
39 * CCchUiPluginBrandingHandler::NewLC( aSpSettings ); |
|
40 * CFbsBitmap* bitmap = NULL; |
|
41 * CFbsBitmap* mask = NULL; |
|
42 * handler->RetrieveServiceIconL( aServiceId, *bitmap, *mask ); |
|
43 * // Handle bitmap, mask here. You still own those. |
|
44 * CleanupStack::PopAndDestroy( handler ); |
|
45 * @endcode |
|
46 * |
|
47 * @lib cchuinotif.lib |
|
48 * @since S60 5.0 |
|
49 */ |
|
50 NONSHARABLE_CLASS( CCchUiPluginBrandingHandler ): public CBase |
|
51 { |
|
52 public: |
|
53 |
|
54 /** |
|
55 * Two-phased constructor. |
|
56 * |
|
57 * @since S60 5.0 |
|
58 * @param aServiceId Service id. |
|
59 */ |
|
60 static CCchUiPluginBrandingHandler* NewL( |
|
61 CSPSettings& aSpSettings ); |
|
62 |
|
63 /** |
|
64 * Two-phased constructor. |
|
65 * |
|
66 * @since S60 5.0 |
|
67 * @param aServiceId Service id. |
|
68 */ |
|
69 static CCchUiPluginBrandingHandler* NewLC( |
|
70 CSPSettings& aSpSettings ); |
|
71 |
|
72 /** |
|
73 * Destructor. |
|
74 */ |
|
75 virtual ~CCchUiPluginBrandingHandler(); |
|
76 |
|
77 /** |
|
78 * Retrieves specific branded service icon from branding server. |
|
79 * |
|
80 * @since S60 5.0 |
|
81 * @param aServiceId service id |
|
82 * @param aBitmap stores retrieved icon |
|
83 * @param aMask stores retrieved icon mask |
|
84 */ |
|
85 void RetrieveServiceIconL( |
|
86 TUint32 aServiceId, |
|
87 CFbsBitmap*& aBitmap, |
|
88 CFbsBitmap*& aMask ); |
|
89 |
|
90 private: |
|
91 |
|
92 CCchUiPluginBrandingHandler( CSPSettings& aSpSettings ); |
|
93 |
|
94 void ConstructL(); |
|
95 |
|
96 |
|
97 /** |
|
98 * Prepares branding access. |
|
99 * |
|
100 * @since S60 5.0 |
|
101 * @param aServiceId Service id. |
|
102 */ |
|
103 void PrepareBrandingAccessL( TUint32 aServiceId ); |
|
104 |
|
105 /** |
|
106 * Releases branding access. |
|
107 * |
|
108 * @since S60 5.0 |
|
109 */ |
|
110 void ReleaseBrandingAccess(); |
|
111 |
|
112 |
|
113 private: // data |
|
114 |
|
115 /** |
|
116 * Reference to service provider settings. |
|
117 * Not own. |
|
118 */ |
|
119 CSPSettings& iSpSettings; |
|
120 |
|
121 /** |
|
122 * Branding server factory. |
|
123 * Own. |
|
124 */ |
|
125 CBSFactory* iFactory; |
|
126 |
|
127 /** |
|
128 * Branding server access. |
|
129 * Own. |
|
130 */ |
|
131 MBSAccess* iAccess; |
|
132 |
|
133 CCHUI_UNIT_TEST( T_CchUiPluginBrandingHandler ) |
|
134 }; |
|
135 |
|
136 #endif // C_CCHUIPLUGINBRANDINGHANDLER_H |
|