epoc32/include/mw/akniconarray.h
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
     1.1 --- a/epoc32/include/mw/akniconarray.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/mw/akniconarray.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,120 @@
     1.4 -akniconarray.h
     1.5 +/*
     1.6 +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
     1.7 +* All rights reserved.
     1.8 +* This component and the accompanying materials are made available
     1.9 +* 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
    1.10 +* which accompanies this distribution, and is available
    1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.12 +*
    1.13 +* Initial Contributors:
    1.14 +* Nokia Corporation - initial contribution.
    1.15 +*
    1.16 +* Contributors:
    1.17 +*
    1.18 +* Description: 
    1.19 +*     Icon array helper class
    1.20 +*
    1.21 +*
    1.22 +*/
    1.23 +
    1.24 +
    1.25 +#ifndef     __AKNICONARRAY_H__
    1.26 +#define     __AKNICONARRAY_H__
    1.27 +
    1.28 +
    1.29 +//  INCLUDES
    1.30 +#include <e32base.h>
    1.31 +
    1.32 +
    1.33 +//  FORWARD DECLARATIONS
    1.34 +class CGulIcon;
    1.35 +class TResourceReader;
    1.36 +
    1.37 +
    1.38 +// CLASS DECLARATION
    1.39 +
    1.40 +/**
    1.41 + * Icon array helper class. Extends CArrayPtrFlat<CGulIcon> to make it easier
    1.42 + * to load icons for a listbox. This class IS-A CArrayPtrFlat<CGulIcon>, but 
    1.43 + * owns the CGulIcons it contains for leave-safety.
    1.44 + */
    1.45 +class CAknIconArray : public CArrayPtrFlat<CGulIcon>
    1.46 +    {
    1.47 +    public:  // Constructors and destructor
    1.48 +        /**
    1.49 +         * C++ Constructor.
    1.50 +         */
    1.51 +        IMPORT_C CAknIconArray(TInt aGranurality);
    1.52 +
    1.53 +        /**
    1.54 +         * Second phase constructor: loads contents of array from resources.
    1.55 +         *
    1.56 +         * @param aResId    id of a AKN_ICON_ARRAY resource.
    1.57 +         */
    1.58 +        IMPORT_C void ConstructFromResourceL(TInt aResId);
    1.59 +
    1.60 +        /**
    1.61 +         * Second phase constructor: loads contents of array from resources.
    1.62 +         *
    1.63 +         * @param aReader   resource reader pointed to a 
    1.64 +         *                  AKN_ICON_ARRAY resource.
    1.65 +         */
    1.66 +        IMPORT_C void ConstructFromResourceL(TResourceReader& aReader);
    1.67 +
    1.68 +        /**
    1.69 +         * Destructor. Destroys all icons in the array.
    1.70 +         */
    1.71 +        IMPORT_C ~CAknIconArray();
    1.72 +
    1.73 +    public:  // interface
    1.74 +        /**
    1.75 +         * Append icons from a resource to this array.
    1.76 +         *
    1.77 +         * @param aResId    id of a AKN_ICON_ARRAY resource.
    1.78 +         */
    1.79 +        IMPORT_C void AppendFromResourceL(TInt aResId);
    1.80 +
    1.81 +        /**
    1.82 +         * Append icons from a resource to this array.
    1.83 +         *
    1.84 +         * @param aReader   resource reader pointed to a 
    1.85 +         *                  AKN_ICON_ARRAY resource
    1.86 +         */
    1.87 +        IMPORT_C void AppendFromResourceL(TResourceReader& aReader);
    1.88 +	
    1.89 +	private: // implementation 
    1.90 +		/**
    1.91 +		 * Search for bitmap file on all connected drives
    1.92 +		 *
    1.93 +		 * Read bitmap file name from resource. This may or may
    1.94 +		 * not have a drive specified. If the drive has been specified,
    1.95 +		 * the bitmap file is first searched in that drive.
    1.96 +         * Otherwise, the drive search order is from y: to a: and then z:
    1.97 +         * as the last drive. Therefore, ROM apps should
    1.98 +		 * hard code the Z: drive in order to improve performance. 
    1.99 +		 *
   1.100 +		 * Security warning: third parties can replace the bitmap files
   1.101 +		 * by adding another file, with the same name and path, on a 
   1.102 +		 * drive which has a letter higher than the drive the existing
   1.103 +		 * file is installed on (e.g. file on MMC drive overrides file
   1.104 +		 * on C: drive). This can be prevented by hard-coding the drive
   1.105 +		 * letter. 
   1.106 +		 *
   1.107 +		 * Leave with KErrNotFound if the file specified is not found on
   1.108 +		 * any connected drive
   1.109 +		 *
   1.110 +		 * @param aReader   resource reader pointed to a 
   1.111 +         *                  AKN_ICON_ARRAY resource
   1.112 +		 *
   1.113 +		 * @return			The bitmap file name
   1.114 +		 */
   1.115 +		 HBufC* GetBmpNameLC(TResourceReader& aReader);
   1.116 +
   1.117 +    };
   1.118 +
   1.119 +
   1.120 +#endif  // __AKNICONARRAY_H__
   1.121 +            
   1.122 +
   1.123 +// End of File
   1.124 +