1 /* |
|
2 * Copyright (c) 2007-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: ES Protocol Framework branding manager interface definition |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CFSMAILBRANDMANAGER_H |
|
20 #define CFSMAILBRANDMANAGER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <barsc.h> |
|
25 |
|
26 #include "MFSMailBrandManager.h" |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class TResourceReader; |
|
30 class CFSMailClient; |
|
31 class CFSMailBox; |
|
32 class CFSMailBrand; |
|
33 |
|
34 /** |
|
35 * Branding manager implementation header. |
|
36 * |
|
37 * @lib FSFWCommonLib |
|
38 * @since S60 v3.1 |
|
39 */ |
|
40 NONSHARABLE_CLASS ( CFSMailBrandManagerImpl ) : public CBase, public MFSMailBrandManager |
|
41 { |
|
42 public: |
|
43 |
|
44 /** |
|
45 * Two-phased constructor. |
|
46 * |
|
47 */ |
|
48 static CFSMailBrandManagerImpl* NewL( CFSMailClient& aMailClient ); |
|
49 |
|
50 /** |
|
51 * Two-phased constructor. |
|
52 * |
|
53 */ |
|
54 static CFSMailBrandManagerImpl* NewLC( CFSMailClient& aMailClient ); |
|
55 |
|
56 /** |
|
57 * Destructor. |
|
58 */ |
|
59 virtual ~CFSMailBrandManagerImpl(); |
|
60 |
|
61 private: // From MFSMailBrandManager |
|
62 |
|
63 /** |
|
64 * @see MFSMailBrandManager::GetGraphicL |
|
65 */ |
|
66 CGulIcon* GetGraphicL( TFSBrandElement aElement, |
|
67 const TFSMailMsgId& aMailboxId ); |
|
68 |
|
69 /** |
|
70 * @see MFSMailBrandManager::GetGraphicL, overloaded with brandid |
|
71 */ |
|
72 CGulIcon* GetGraphicL( TFSBrandElement aElement, const TDesC& aBrandId ); |
|
73 |
|
74 |
|
75 /** |
|
76 * @see MFSMailBrandManager::GetTextL |
|
77 */ |
|
78 TPtrC GetTextL( TFSBrandElement aElement, |
|
79 const TFSMailMsgId& aMailboxId ); |
|
80 |
|
81 /** |
|
82 * @see MFSMailBrandManager::GetTextL |
|
83 */ |
|
84 TPtrC GetTextL( TFSBrandElement aElement, |
|
85 const TDesC& aBrandId ); |
|
86 |
|
87 |
|
88 /** |
|
89 * @see MFSMailBrandManager::GetColorL |
|
90 */ |
|
91 TInt GetColorL( TFSBrandElement aElement, |
|
92 const TFSMailMsgId& aMailboxId, |
|
93 TRgb& aColor ); |
|
94 |
|
95 /** |
|
96 * @see MFSMailBrandManager::UpdateMailboxNamesL |
|
97 */ |
|
98 void UpdateMailboxNamesL( const TFSMailMsgId aMailboxId ); |
|
99 |
|
100 /** |
|
101 * @see MFSMailBrandManager::GetGraphicIdsL |
|
102 */ |
|
103 TInt GetGraphicIdsL( TFSBrandElement aElement, |
|
104 const TFSMailMsgId& aMailboxId, |
|
105 TDes& aIconIds ); |
|
106 |
|
107 /** |
|
108 * @see MFSMailBrandManager::GetGraphicIdsL |
|
109 */ |
|
110 TInt GetGraphicIdsL( TFSBrandElement aElement, |
|
111 const TDesC& aBrandId, |
|
112 TDes& aIconIds ); |
|
113 |
|
114 private: |
|
115 |
|
116 /** |
|
117 * costructor |
|
118 */ |
|
119 CFSMailBrandManagerImpl( CFSMailClient& aMailClient ); |
|
120 |
|
121 /** |
|
122 * Two-phased constructor. |
|
123 */ |
|
124 void ConstructL(); |
|
125 |
|
126 /** |
|
127 * Function which constructs brands used by this class from given |
|
128 * resource file. |
|
129 * |
|
130 * @param aReader Resource reader that can be used to read branding data. |
|
131 */ |
|
132 void ConstructFromResourceL( TResourceReader& aReader ); |
|
133 |
|
134 /** |
|
135 * Function which maps brand id received from a mailbox to a brand |
|
136 * object. |
|
137 * |
|
138 * @param aBrandId Id to identify the brand object. |
|
139 */ |
|
140 CFSMailBrand* FindMatchingBrandL( const TDesC& aBrandId ); |
|
141 |
|
142 /** |
|
143 * Function which goes through the mail boxes and finds the one whose |
|
144 * brand matches the given brand id. |
|
145 * |
|
146 * @param aBrandId Id identifying the brand. |
|
147 */ |
|
148 CFSMailBox* MailboxMatchingBrandIdL( const TDesC& aBrandId ) const; |
|
149 |
|
150 // <gmail_brand_issue> |
|
151 void GetMCCValueL( TDes& aMcc ) const; |
|
152 |
|
153 void GetMCCValueFromSIML( TDes& aMcc ) const; |
|
154 |
|
155 TUint8 GetCurrentCountryL() const; |
|
156 |
|
157 void VerifyMailAccountName( TPtrC& aBrandedName ) const; |
|
158 // </gmail_brand_issue> |
|
159 |
|
160 private: // data |
|
161 |
|
162 /** |
|
163 * Mail client reference. |
|
164 */ |
|
165 CFSMailClient& iMailClient; |
|
166 |
|
167 /** |
|
168 * Array containing all brands. |
|
169 * Own. |
|
170 */ |
|
171 CArrayPtrSeg< CFSMailBrand >* iBrands; |
|
172 |
|
173 /** |
|
174 * File server session used for example for reading brand resource file. |
|
175 */ |
|
176 RFs iFsSession; |
|
177 |
|
178 /** |
|
179 * RResourceFile used to read a resource file into buffer. Used |
|
180 * for example to read the resource file containing the branding data. |
|
181 */ |
|
182 RResourceFile iResourceFile; |
|
183 |
|
184 }; |
|
185 |
|
186 |
|
187 #endif CFSMAILBRANDMANAGER_H |
|