backsteppingsrv/inc/bsconfiguration.h
branchv5backport
changeset 16 66e84aa0ed46
parent 12 2f40063dfb5c
child 17 c9bafd575d88
equal deleted inserted replaced
12:2f40063dfb5c 16:66e84aa0ed46
     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:  Class keeps BS configuration
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef BSCONFIGURATION_H
       
    20 #define BSCONFIGURATION_H
       
    21 
       
    22 #include <xcfwengine.h>
       
    23 
       
    24 class CXCFWTree;
       
    25 class MXCFWNode;
       
    26 class CGECODefaultObject;
       
    27 
       
    28 /**
       
    29  *  Class keeps configuration of BS.
       
    30  *  Configuration is stored in XML in private folder of Back Stepping engine.
       
    31  *  This class is responsible for reading the XML
       
    32  *  @since S60 3.2
       
    33  */
       
    34 class CBSConfiguration : public CBase, public MXCFWEngineObserver
       
    35     {
       
    36 public:
       
    37 
       
    38     static CBSConfiguration* NewL();
       
    39     static CBSConfiguration* NewLC();
       
    40 
       
    41     /**
       
    42      * Destructor.
       
    43      */
       
    44     ~CBSConfiguration();
       
    45 
       
    46     // from base class MXCFWEngineObserver
       
    47 
       
    48     /**
       
    49      * From MXCFWEngineObserver.
       
    50      * Called when Engine parsing / saving state changes
       
    51      * User can do desired actions on corresponding events.
       
    52      *
       
    53      * @param aEvent Engine event.
       
    54      */
       
    55     virtual void HandleEngineEventL( TXCFWEngineEvent aEvent );
       
    56 
       
    57     /**
       
    58      * From MXCFWEngineObserver.
       
    59      * Called when there's an error during parsing / saving
       
    60      *
       
    61      * @param aErrorCode Error code from engine
       
    62      */
       
    63     virtual void HandleEngineErrorL( TInt aErrorCode );
       
    64 
       
    65     /**
       
    66      * Check if application with given UID is in reset list.
       
    67      * Application from that the list should reset BS stack
       
    68      *
       
    69      * @since S60 3.2
       
    70      * @param aApp
       
    71      * @return ETrue if application is in the list, otherwise EFalse
       
    72      */
       
    73     TBool IsReset( TUid aApp );
       
    74 
       
    75     /**
       
    76      * Check if application with given UID is in ignored list.
       
    77      * Application from that the list should be ignored in BS
       
    78      *
       
    79      * @since S60 3.2
       
    80      * @param aApp
       
    81      * @return ETrue if application is in the list, otherwise EFalse
       
    82      */
       
    83     TBool IsIgnored( TUid aApp );
       
    84 
       
    85     /**
       
    86      * Check if application with given UID is in additional ignored list.
       
    87      * Application that is started from applicaton from the list 
       
    88      * should ignore BS stack
       
    89      *
       
    90      * @since S60 3.2
       
    91      * @param aApp
       
    92      * @return ETrue if application is in the list, otherwise EFalse
       
    93      */
       
    94     TBool IsIgnoredIfStartedFrom( TUid aApp );
       
    95 
       
    96     /**
       
    97      * Returns list of application that should reset BS stack, 
       
    98      * if any application was stated thru them (i.e. FastSwap)
       
    99      *
       
   100      * @since S60 3.2     
       
   101      * @return list of UIDs
       
   102      */
       
   103     RArray<TInt>& ResetIfThruList();
       
   104 
       
   105 private:
       
   106 
       
   107     CBSConfiguration();
       
   108 
       
   109     void ConstructL();
       
   110 
       
   111     /**
       
   112      * Convert descriptor to integer.
       
   113      * It detects if format is hexadecimal
       
   114      *
       
   115      * @since S60 3.2
       
   116      * @param aStr descriptor to convert
       
   117      * @return converted intereger, 
       
   118      * if there will be problem wiht convertion return is KErrArgument
       
   119      */
       
   120     TInt Str2Int( const TDesC& aStr );
       
   121 
       
   122     /**
       
   123      * Loads configuration from XML file
       
   124      * Read file from private folder, parse the file and 
       
   125      * fill in internal structures.
       
   126      *
       
   127      * @since S60 3.2
       
   128      */
       
   129     void LoadConfigurationL();
       
   130 
       
   131 private:
       
   132     // data
       
   133 
       
   134     /**
       
   135      * List of application that should reset BS stack
       
   136      */
       
   137     RArray<TInt> iResetApps;
       
   138 
       
   139     /**
       
   140      * List of application that should be ignoresd from BS stack
       
   141      */
       
   142     RArray<TInt> iIgnoredApps;
       
   143 
       
   144     /**
       
   145      * List of application that should deactive BS 
       
   146      * if application was started/activated from them
       
   147      */
       
   148     RArray<TInt> iIgnoredIfStartedFrom;
       
   149 
       
   150     /**
       
   151      * List of application that should reset BS 
       
   152      * if any application was started/activated thu them
       
   153      */
       
   154     RArray<TInt> iResetIfThru;
       
   155 
       
   156     /**
       
   157      * Content tree
       
   158      * Own. 
       
   159      */
       
   160     CXCFWTree* iContentTree;
       
   161 
       
   162     /**
       
   163      * Content parsing engine
       
   164      * Own. 
       
   165      */
       
   166     CXCFWEngine* iContentEngine;
       
   167 
       
   168     };
       
   169 
       
   170 #endif // BSCONFIGURATION_H