2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * Icon array helper class
21 #ifndef __AKNICONARRAY_H__
22 #define __AKNICONARRAY_H__
29 // FORWARD DECLARATIONS
31 class TResourceReader;
37 * Icon array helper class. Extends CArrayPtrFlat<CGulIcon> to make it easier
38 * to load icons for a listbox. This class IS-A CArrayPtrFlat<CGulIcon>, but
39 * owns the CGulIcons it contains for leave-safety.
41 class CAknIconArray : public CArrayPtrFlat<CGulIcon>
43 public: // Constructors and destructor
47 IMPORT_C CAknIconArray(TInt aGranurality);
50 * Second phase constructor: loads contents of array from resources.
52 * @param aResId id of a AKN_ICON_ARRAY resource.
54 IMPORT_C void ConstructFromResourceL(TInt aResId);
57 * Second phase constructor: loads contents of array from resources.
59 * @param aReader resource reader pointed to a
60 * AKN_ICON_ARRAY resource.
62 IMPORT_C void ConstructFromResourceL(TResourceReader& aReader);
65 * Destructor. Destroys all icons in the array.
67 IMPORT_C ~CAknIconArray();
71 * Append icons from a resource to this array.
73 * @param aResId id of a AKN_ICON_ARRAY resource.
75 IMPORT_C void AppendFromResourceL(TInt aResId);
78 * Append icons from a resource to this array.
80 * @param aReader resource reader pointed to a
81 * AKN_ICON_ARRAY resource
83 IMPORT_C void AppendFromResourceL(TResourceReader& aReader);
85 private: // implementation
87 * Search for bitmap file on all connected drives
89 * Read bitmap file name from resource. This may or may
90 * not have a drive specified. If the drive has been specified,
91 * the bitmap file is first searched in that drive.
92 * Otherwise, the drive search order is from y: to a: and then z:
93 * as the last drive. Therefore, ROM apps should
94 * hard code the Z: drive in order to improve performance.
96 * Security warning: third parties can replace the bitmap files
97 * by adding another file, with the same name and path, on a
98 * drive which has a letter higher than the drive the existing
99 * file is installed on (e.g. file on MMC drive overrides file
100 * on C: drive). This can be prevented by hard-coding the drive
103 * Leave with KErrNotFound if the file specified is not found on
104 * any connected drive
106 * @param aReader resource reader pointed to a
107 * AKN_ICON_ARRAY resource
109 * @return The bitmap file name
111 HBufC* GetBmpNameLC(TResourceReader& aReader);
116 #endif // __AKNICONARRAY_H__