systemswstubs/startupadaptationstub/inc/StartupAdaptationStubModel.h
changeset 39 65e91466a14b
parent 31 931072794a66
child 40 b7e5ed8c1342
equal deleted inserted replaced
31:931072794a66 39:65e91466a14b
     1 /*
       
     2 * Copyright (c) 2004-2006 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:  CStartupAdaptationStubModel class declaration.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __STARTUPADAPTATIONSTUBMODEL_H__
       
    20 #define __STARTUPADAPTATIONSTUBMODEL_H__
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <startupadaptationcommands.h>
       
    24 
       
    25 const TInt KNumResponseLists = 16;
       
    26 
       
    27 /**
       
    28 *  A model containing data used by the StartupAdaptationStub.
       
    29 *
       
    30 *  @lib StartupAdaptationStub.lib
       
    31 *  @since Series 60 3.0
       
    32 */
       
    33 NONSHARABLE_CLASS( CStartupAdaptationStubModel ) : public CBase
       
    34     {
       
    35     public:  // Constructors and destructor
       
    36 
       
    37         /**
       
    38         * Two-phased constructor.
       
    39         */
       
    40         static CStartupAdaptationStubModel* NewL();
       
    41 
       
    42         /**
       
    43         * Destructor.
       
    44         */
       
    45         virtual ~CStartupAdaptationStubModel();
       
    46 
       
    47     public: // New functions
       
    48 
       
    49         TInt GetGlobalStateChangeResponse();
       
    50         void GetSecurityStateChangeResponse(
       
    51             StartupAdaptation::TSecurityStateResponse& aResponse );
       
    52         void GetStartupModeResponse(
       
    53             StartupAdaptation::TGlobalStartupModeResponse& aResponse );
       
    54         TInt GetSelftestResponse();
       
    55         void GetLanguageListResponse(
       
    56             StartupAdaptation::RLanguageListResponse& aResponse );
       
    57         TInt GetRTCTimeValidityResponse();
       
    58         void GetSimChangedResponse(
       
    59             StartupAdaptation::TBooleanResponse& aResponse );
       
    60         void GetSimOwnedResponse(
       
    61             StartupAdaptation::TBooleanResponse& aResponse );
       
    62         TInt GetSetAlarmResponse();
       
    63         TInt GetCancelAlarmResponse();
       
    64         TInt GetResetResponse();
       
    65         TInt GetShutdownResponse();
       
    66         TInt GetRFSResponse();
       
    67         TInt GetActivateRfResponse();
       
    68         TInt GetDeactivateRfResponse();
       
    69         void GetHiddenResetResponse(
       
    70             StartupAdaptation::TBooleanResponse& aResponse );
       
    71 
       
    72         TInt GetDurationForNextCall( const TInt aCommandId );
       
    73 
       
    74     private:
       
    75 
       
    76         typedef CArrayFixFlat<TInt> CStructuredList;
       
    77 
       
    78         /**
       
    79         * C++ default constructor.
       
    80         */
       
    81         CStartupAdaptationStubModel();
       
    82 
       
    83         /**
       
    84         * By default Symbian 2nd phase constructor is private.
       
    85         */
       
    86         void ConstructL();
       
    87 
       
    88         /**
       
    89         * Read settings from config file.
       
    90         */
       
    91         void ReadConfigFileL();
       
    92 
       
    93         /**
       
    94         * Initialize to default values (if config file does not exist or is
       
    95         * corrupted).
       
    96         */
       
    97         void InitToDefaultL();
       
    98 
       
    99         TInt GetSimpleResponse( const TInt aIndex );
       
   100         TInt CalculateCurrentBaseIndex( const TInt aIndex );
       
   101         void UpdateCounter( const TInt aIndex );
       
   102 
       
   103         static void ReadStructuredListL(
       
   104             const TInt aNumParts,
       
   105             TLex& aLexer,
       
   106             CStructuredList& aList );
       
   107 
       
   108         static TInt ReadDurationL( TLex& aLexer );
       
   109 
       
   110     private:    // Data
       
   111 
       
   112         struct TResponseData
       
   113             {
       
   114             TInt iParts;
       
   115             TInt iCounter;
       
   116             CStructuredList* iList; // Not owned
       
   117             };
       
   118 
       
   119         TResponseData iResponses[KNumResponseLists];
       
   120 
       
   121     };
       
   122 
       
   123 // CLASS DECLARATION
       
   124 
       
   125 #endif // __STARTUPADAPTATIONSTUBMODEL_H__
       
   126 
       
   127 // End of File