ipsservices/ipssossettings/inc/ipssetutilsflags.h
branchRCL_3
changeset 64 3533d4323edc
parent 0 8466d47a6819
equal deleted inserted replaced
63:d189ee25cf9d 64:3533d4323edc
       
     1 /*
       
     2 * Copyright (c) 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: This file defines class TIpsSetUtilsFlags.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef TIPSSETUTILSFLAGS_H
       
    20 #define TIPSSETUTILSFLAGS_H
       
    21 
       
    22 
       
    23 /**
       
    24  * Helper class for flags.
       
    25  *
       
    26  * @since FS v1.0
       
    27  * @lib IpsSosSettings.lib
       
    28  */
       
    29 class TIpsSetUtilsFlags
       
    30     {
       
    31     public:
       
    32         /**
       
    33          * constructor
       
    34          */
       
    35         TIpsSetUtilsFlags( const TUint64 aFlags = 0 );
       
    36 
       
    37         /**
       
    38          * Sets flag on
       
    39          * @param aFlag: flag to be set
       
    40          */
       
    41         inline void SetFlag( const TUint64 aFlag );
       
    42 
       
    43         /**
       
    44          * Clear flag on
       
    45          * @param aFlag: flag to be cleared
       
    46          */
       
    47         inline void ClearFlag( const TUint64 aFlag );
       
    48 
       
    49         /**
       
    50          * Query for the flag
       
    51          * @param aFlag: flag to be checked
       
    52          */
       
    53         inline TBool Flag( const TUint64 aFlag ) const;
       
    54 
       
    55         /**
       
    56          * Sets flag on. Converts the flag to 64-bit and move 32 steps.
       
    57          * @param aFlag: flag to be set
       
    58          */
       
    59         inline void SetFlag32( const TUint32 aFlag );
       
    60 
       
    61         /**
       
    62          * Clear flag on. Converts the flag to 64-bit and move 32 steps.
       
    63          * @param aFlag: flag to be cleared
       
    64          */
       
    65         inline void ClearFlag32( const TUint32 aFlag );
       
    66 
       
    67         /**
       
    68          * Query for the flag. Converts the flag to 64-bit and move 32 steps.
       
    69          * @param aFlag: flag to be checked
       
    70          */
       
    71         inline TBool Flag32( const TUint32 aFlag ) const;
       
    72 
       
    73         /**
       
    74          * Modifies the state of the flag
       
    75          */
       
    76         inline void ChangeFlag(
       
    77             const TUint64 aFlag,
       
    78             const TBool aNewState );
       
    79 
       
    80         /**
       
    81          * Returns value based on flag status.
       
    82          *
       
    83          * @param aFlag 32-bit version of flag
       
    84          * @param aTrue Value, when flag is set
       
    85          * @param aFalse Value, when flag is not set
       
    86          */
       
    87         TInt ValueForFlag(
       
    88             const TUint32 aFlag,
       
    89             const TInt aTrue,
       
    90             const TInt aFalse ) const;
       
    91 
       
    92         /**
       
    93          * Copies the flags
       
    94          */
       
    95         TIpsSetUtilsFlags& operator=( const TIpsSetUtilsFlags& aFlags );
       
    96 
       
    97         /**
       
    98          * Copies the flags
       
    99          */
       
   100         TIpsSetUtilsFlags& operator=( const TUint64 aFlags );
       
   101 
       
   102     private:
       
   103 
       
   104         /**
       
   105          * Storage for flags
       
   106          */
       
   107         TUint64 iFlags;
       
   108     };
       
   109 
       
   110 #include "ipssetutilsflags.inl"
       
   111 
       
   112 #endif /* TIPSSETUTILSFLAGS_H */
       
   113 
       
   114 // End of File
       
   115