classicui_plat/personalisation_framework_api/inc/PslnFWIconHelper.h
changeset 37 89c890c70182
parent 34 6b5204869ed5
child 45 667edd0b8678
equal deleted inserted replaced
34:6b5204869ed5 37:89c890c70182
     1 /*
       
     2 * Copyright (c) 2005-2007 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:  Utility class to get icons to setting lists and 
       
    15 *                   help with loc strings.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef C_PSLNFWICONHELPER_H
       
    21 #define C_PSLNFWICONHELPER_H
       
    22 
       
    23 #include <e32base.h>
       
    24 
       
    25 class CCoeEnv;
       
    26 class CEikTextListBox;
       
    27 class CAknIconArray;
       
    28 class TAknsItemID;
       
    29 
       
    30 // Icons in list views.
       
    31 _LIT( KPslnFWNonActiveListItemFormat, "0\t" );
       
    32 _LIT( KPslnFWActiveListItemFormat, "1\t" );
       
    33 _LIT( KPslnFWEmbeddedLinkListItemFormat, "2\t" );
       
    34 _LIT( KPslnFWListItemFormatMMCSuffix, "\t3" );
       
    35 _LIT( KPslnFWListItemFormatDRMProtectedSuffix, "\t4" );
       
    36 _LIT( KPslnFWListItemFormatDRMExpiredSuffix, "\t5" );
       
    37 _LIT( KPslnFWListItemFormatMassDriveSuffix, "\t6" );
       
    38 
       
    39 /**
       
    40  *  Utility class to get icons to setting lists and help with loc strings.
       
    41  *
       
    42  *  @lib PslnFramework.lib
       
    43  *  @since S60 v3.1
       
    44  */
       
    45 NONSHARABLE_CLASS( CPslnFWIconHelper ) : public CBase
       
    46     {
       
    47 
       
    48 public:
       
    49 
       
    50     /**
       
    51     * Two-phased constructor.
       
    52     */
       
    53     IMPORT_C static CPslnFWIconHelper* NewL();
       
    54     
       
    55     /**
       
    56     * Destructor.
       
    57     */
       
    58     IMPORT_C virtual ~CPslnFWIconHelper();
       
    59     
       
    60     /**
       
    61     * Adds icon array to a given listbox.
       
    62     * 
       
    63     * @param aAll ETrue if adding all the available icons.
       
    64     * @param aMaxIndexToAdd if aAll is EFalse, indicates the max index
       
    65     *        of icon to add to the icon array.
       
    66     * @param aListBox listbox that the icon array is added.
       
    67     */
       
    68     IMPORT_C void AddIconsToSettingItemsL( 
       
    69         TBool aAll, 
       
    70         TInt aMaxIndexToAdd, 
       
    71         CEikTextListBox* aListBox );
       
    72 
       
    73     /**
       
    74     * Gets localized string from given loc-file.
       
    75     * 
       
    76     * @param aPath path and filename of the loc-file.
       
    77     * @param aResourceID resource ID of the string to load.
       
    78     * @param aCoeEnv control environment.
       
    79     * @return localized version of given resource.
       
    80     */
       
    81     IMPORT_C HBufC* GetLocalizedStringLC( 
       
    82         const TDesC& aPath, 
       
    83         TInt aResourceID, 
       
    84         CCoeEnv* aCoeEnv );
       
    85 
       
    86 private:
       
    87 
       
    88     /**
       
    89     * C++ default constructor.
       
    90     */
       
    91     CPslnFWIconHelper();
       
    92 
       
    93     /**
       
    94     * Adds new icon to icon array.
       
    95     */
       
    96     void AddIconL(
       
    97         CAknIconArray* aIcons,
       
    98         const TAknsItemID& aSkinId,
       
    99         const TDesC& aFileName, 
       
   100         TInt aBitmapId,
       
   101         TInt aMaskId, 
       
   102         TBool aColorIcon = EFalse );
       
   103 
       
   104     /**
       
   105     * Returns path to file containing icons.
       
   106     */
       
   107     void GetIconFilePath( TDes& aPath );
       
   108 
       
   109     };
       
   110 
       
   111 #endif // C_PSLNFWICONHELPER_H
       
   112 
       
   113 // End of File