skins/AknSkins/srvinc/AknsSrvExclusion.h
changeset 0 05e9090e2422
equal deleted inserted replaced
-1:000000000000 0:05e9090e2422
       
     1 /*
       
     2 * Copyright (c) 2002-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:  Exclusion query class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef AKNSSRVEXCLUSIONUTILS_H
       
    20 #define AKNSSRVEXCLUSIONUTILS_H
       
    21 
       
    22 // INCLUDE FILES
       
    23 
       
    24 #include <AknsItemID.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 
       
    28 class CAknsSrvExclusionList;
       
    29 
       
    30 // CLASS DECLARATION
       
    31 
       
    32 /**
       
    33 * Exclusion query class can be used to check whether the given item is excluded
       
    34 * based on the parameters set in the query object.
       
    35 *
       
    36 * @since 2.0
       
    37 */
       
    38 class TAknsSrvExclusionQuery
       
    39     {
       
    40     public:
       
    41         /**
       
    42         * Constructor.
       
    43         *
       
    44         * @param aList Exclusion query list to be used for concrete queries.
       
    45         */
       
    46         TAknsSrvExclusionQuery( CAknsSrvExclusionList* aList );
       
    47 
       
    48     public:
       
    49         /**
       
    50         * Sets the parameters used in the query.
       
    51         *
       
    52         * @param aArabic ETrue if Arabic language is currently active,
       
    53         *   EFalse otherwise.
       
    54         *
       
    55         * @param aHebrew ETrue if Hebrew language is currently active,
       
    56         *   EFalse otherwise.
       
    57         */
       
    58         void SetParameters( const TBool aArabic, const TBool aHebrew );
       
    59 
       
    60         /**
       
    61         * Sets the highlight animation enable/disable status. Status is read
       
    62         * from AknSkins CenRep key (as SkinExclusions.ini is not used for
       
    63         * variation).
       
    64         */
       
    65         void SetHighlightAnimEnabled( const TBool aValue );
       
    66 
       
    67         /**
       
    68         * The current enable/disable status of highlight animation.
       
    69         *
       
    70         * @return ETrue if highlight animation is enabled, EFalse otherwise.
       
    71         */
       
    72         TBool IsHighlightAnimEnabled() const;
       
    73 
       
    74         /**
       
    75         * Checks whether the given item is currently excluded.
       
    76         *
       
    77         * @param aIID Item ID of the item to be checked.
       
    78         *
       
    79         * @return ETrue if item is currently excluded, EFalse otherwise.
       
    80         */
       
    81         TBool IsExcluded( const TAknsItemID& aIID ) const;
       
    82 
       
    83         /**
       
    84         * Checks whether the given item should be mapped to another item,
       
    85         * and performs remapping.
       
    86         *
       
    87         * @param aIID Item ID of the item to be checked. If remapping is
       
    88         *   performed, this value is modified accordingly.
       
    89         *
       
    90         * @return ETrue if the item has been remapped, EFalse otherwise.
       
    91         */
       
    92         TBool MapIID( TAknsItemID& aIID ) const;
       
    93 
       
    94     private:
       
    95         CAknsSrvExclusionList* iList;
       
    96         TBool iArabicEnabled;
       
    97         TBool iHebrewEnabled;
       
    98         TBool iHighlightAnimEnabled;
       
    99     };
       
   100 
       
   101 /**
       
   102 * Exclusion list entry class.
       
   103 */
       
   104 struct TAknsSrvExclusionListEntry
       
   105     {
       
   106     public:
       
   107         TAknsItemID iIID;
       
   108         TInt iFlags;
       
   109         TAknsItemID iTargetIID;
       
   110 
       
   111     public:
       
   112         static TInt LinearOrder(
       
   113             const TAknsSrvExclusionListEntry& aFirst,
       
   114             const TAknsSrvExclusionListEntry& aSecond );
       
   115     };
       
   116 
       
   117 /**
       
   118 * Exclusion list is used to store the array of the items that are excluded,
       
   119 * as well as the item-specific exclusion parameters.
       
   120 *
       
   121 * @since 2.0
       
   122 */
       
   123 NONSHARABLE_CLASS( CAknsSrvExclusionList ) : public CBase
       
   124     {
       
   125     public:
       
   126         /**
       
   127         * Static constructor.
       
   128         *
       
   129         * @return Newly constructed exclusion list object.
       
   130         */
       
   131         static CAknsSrvExclusionList* NewL();
       
   132 
       
   133         /**
       
   134         * Destructor.
       
   135         */
       
   136         ~CAknsSrvExclusionList();
       
   137 
       
   138     public:
       
   139         /**
       
   140         * Loads the exclusion list from the file.
       
   141         */
       
   142         void LoadDefaultListFromFileL( RFs& aRFs );
       
   143 
       
   144         /**
       
   145         * Finds the specified exclusion list entry.
       
   146         *
       
   147         * @param aIID Item ID of the item to be searched for.
       
   148         *
       
   149         * @return Pointer to the item, or @c NULL if not found.
       
   150         */
       
   151         TAknsSrvExclusionListEntry* FindEntry(
       
   152             const TAknsItemID& aIID );
       
   153 
       
   154     private:
       
   155         /**
       
   156         * Private constructor.
       
   157         */
       
   158         CAknsSrvExclusionList();
       
   159 
       
   160     private:
       
   161         RArray<TAknsSrvExclusionListEntry> iArray;
       
   162     };
       
   163 
       
   164 #endif