sysstatemgmt/ssmpolicyplugins/ssmpolicybase/inc/ssmpolicybase.h
changeset 0 4e1aa6a622a0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 /*
       
     2 * Copyright (c) 2009 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: Declaration of CSsmPolicyBase class.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef C_SSMPOLICYBASE_H
       
    19 #define C_SSMPOLICYBASE_H
       
    20 
       
    21 #include <e32base.h>
       
    22 #include <f32file.h>
       
    23 #include <ssm/ssmconditionalcallback.h>
       
    24 
       
    25 class CConditionEvaluate;
       
    26 class CSsmCommandListResourceReader;
       
    27 class CSsmMapperUtility;
       
    28 class TSsmState;
       
    29 
       
    30 /**
       
    31 *  Base class for SSM policy plugins
       
    32 *
       
    33 */
       
    34 class CSsmPolicyBase : public CBase, public MSsmConditionalCallback
       
    35     {
       
    36 
       
    37 public:
       
    38 
       
    39     /**
       
    40     * First phase constructor.
       
    41     */
       
    42     IMPORT_C CSsmPolicyBase();
       
    43 
       
    44     /**
       
    45     * Destructor.
       
    46     */
       
    47     IMPORT_C virtual ~CSsmPolicyBase();
       
    48 
       
    49 protected: // from MSsmConditionalCallback
       
    50 
       
    51     /**
       
    52     * @see MSsmConditionalCallback
       
    53     */
       
    54 	IMPORT_C TBool ConditionalCommandAllowedL(
       
    55 	    CResourceFile& aResourceFile,
       
    56 	    TInt aResourceId );
       
    57 
       
    58 protected:
       
    59 
       
    60     /**
       
    61     * Getter for policy-specific command list path.
       
    62     *
       
    63     * @param aCmdListPath On return contains the command list path.
       
    64     */
       
    65     virtual void GetCommandListPathL( TDes& aCmdListPath ) = 0;
       
    66 
       
    67 protected:
       
    68 
       
    69     /**
       
    70     * Getter for current system state.
       
    71     *
       
    72     * @param aState On return contains current system state.
       
    73     */
       
    74     IMPORT_C TInt GetCurrentState( TSsmState& aState ) const;
       
    75 
       
    76 protected:
       
    77 
       
    78     /**
       
    79     * Second phase constructor.
       
    80     */
       
    81     IMPORT_C void BaseConstructL();
       
    82 
       
    83     /**
       
    84     * Read, increment and update reset counter in Cenrep.
       
    85     *
       
    86     * @return ETrue if the reset counter in Cenrep is greater than or equal to
       
    87     * the reset limit.
       
    88     */
       
    89     IMPORT_C TBool ResetLimitReached();
       
    90 
       
    91 private:
       
    92 
       
    93     TBool ResetLimitReachedL();
       
    94 
       
    95 protected: // data
       
    96 
       
    97     /** File server session for the use of derived classes. */
       
    98 	RFs iFs;
       
    99 
       
   100     /** 
       
   101     * Mapper utility instance for the use of base and all derived classes.
       
   102     * Own. Not NULL. 
       
   103     */
       
   104 	CSsmMapperUtility* iUtil;
       
   105 
       
   106 	/** Resource reader. Own. Not NULL. */
       
   107 	CSsmCommandListResourceReader* iCommandListResourceReader;
       
   108 
       
   109 private: // data
       
   110 
       
   111     /** Used to evaluate conditions in command lists. Not NULL. Own. */
       
   112     CConditionEvaluate* iEvaluator;
       
   113 
       
   114     };
       
   115 
       
   116 #endif // C_SSMPOLICYBASE_H