00001 /* 00002 * ============================================================================ 00003 * Name : TPbkIconInfo from PbkIconInfo.h 00004 * Part of : PbkView.dll 00005 * 00006 * Description: 00007 * Phonebook icon info class definition. 00008 * Version: 00009 * 00010 * Copyright (C) 2002 Nokia Corporation. 00011 * This material, including documentation and any related 00012 * computer programs, is protected by copyright controlled by 00013 * Nokia Corporation. All rights are reserved. Copying, 00014 * including reproducing, storing, adapting or translating, any 00015 * or all of this material requires the prior written consent of 00016 * Nokia Corporation. This material also contains confidential 00017 * information which may not be disclosed to others without the 00018 * prior written consent of Nokia Corporation. 00019 * ============================================================================ 00020 */ 00021 00022 #ifndef __PbkIconInfo_H__ 00023 #define __PbkIconInfo_H__ 00024 00025 // INCLUDES 00026 #include <e32base.h> // CBase 00027 #include <PbkIconId.hrh> // TPbkIconId 00028 #include <AknsItemID.h> // TAknsItemID 00029 00030 // FORWARD DECLARATIONS 00031 class TResourceReader; 00032 class CCoeEnv; 00033 class CGulIcon; 00034 class CPbkIconInfoContainer; 00035 class MAknsSkinInstance; 00036 00037 // CLASS DECLARATION 00038 00044 class TPbkIconInfo 00045 { 00046 public: // interface 00051 IMPORT_C TPbkIconId PbkIconInfoId() const; 00052 00057 IMPORT_C const TDesC& MbmFileName() const; 00058 00063 IMPORT_C TInt IconId() const; 00064 00069 IMPORT_C TInt MaskId() const; 00070 00075 IMPORT_C TAknsItemID SkinId() const; 00076 00081 TAknsItemID ColorId() const; 00082 00087 TInt ColorIndex() const; 00088 00093 TInt DefaultColorIndex() const; 00094 00095 private: // Interface for CPbkIconInfoContainer 00096 friend class CPbkIconInfoContainer; 00097 TPbkIconInfo(); 00098 ~TPbkIconInfo(); 00099 void ReadFromResourceLC(TResourceReader& aReader); 00100 void Destroy(); 00101 00102 private: // Unimplemented functions 00104 TPbkIconInfo(const TPbkIconInfo&); 00106 TPbkIconInfo& operator=(const TPbkIconInfo&); 00107 00108 private: // data members 00109 // Own: unique phonebook icon id 00110 TPbkIconId iPbkIconInfoId; 00111 // Own: Icon bitmap 00112 TInt iIconId; 00113 // Own: mask bitmap 00114 TInt iMaskId; 00115 // Ref: Mbm file name 00116 HBufC* iMbmFileName; 00118 TAknsItemID iSkinId; 00120 TAknsItemID iColorId; 00122 TInt iColorIndex; 00124 TInt iDefaultColorIndex; 00125 }; 00126 00127 00133 class CPbkIconInfoContainer : public CBase 00134 { 00135 public: // Constructors and destructor 00145 IMPORT_C static CPbkIconInfoContainer* NewL(CCoeEnv* aCoeEnv=NULL); 00146 00154 IMPORT_C static CPbkIconInfoContainer* NewL(TResourceReader& aReader); 00155 00167 IMPORT_C static CPbkIconInfoContainer* NewL 00168 (TInt aResourceId, CCoeEnv* aCoeEnv=NULL); 00169 00173 ~CPbkIconInfoContainer(); 00174 00175 public: // Interface 00182 IMPORT_C const TPbkIconInfo* Find(TPbkIconId aIconId) const; 00183 00192 IMPORT_C CGulIcon* LoadBitmapL(TPbkIconId aIconId) const; 00193 00200 IMPORT_C void AppendIconsFromResourceL(TInt aResourceId); 00201 00202 private: // Implementation 00203 CPbkIconInfoContainer(); 00204 void ConstructL(TResourceReader& aReader); 00205 void DoAppendIconsFromResourceL(TResourceReader& aReader); 00206 00207 private: // data members 00209 RArray<TPbkIconInfo> iIconArray; 00210 }; 00211 00216 class PbkIconUtils 00217 { 00218 public: 00226 IMPORT_C static void CreateIconL( 00227 MAknsSkinInstance* aSkin, 00228 CFbsBitmap*& aBitmap, 00229 CFbsBitmap*& aMask, 00230 const TPbkIconInfo& aIconInfo); 00231 00239 IMPORT_C static void CreateIconLC( 00240 MAknsSkinInstance* aSkin, 00241 CFbsBitmap*& aBitmap, 00242 CFbsBitmap*& aMask, 00243 const TPbkIconInfo& aIconInfo); 00244 private: 00245 PbkIconUtils(); 00246 ~PbkIconUtils(); 00247 }; 00248 00249 00250 // __PbkIconInfo_H__ 00251 #endif 00252 00253 // End of File