phoneapp/phoneuicontrol/inc/cphonestatehandle.h
changeset 37 ba76fc04e6c2
child 51 f39ed5e045e0
equal deleted inserted replaced
36:2eacb6118286 37:ba76fc04e6c2
       
     1 /*
       
     2 * Copyright (c) 2005 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: 
       
    15 *     Singleton class for handling states and their transitions.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef CPHONESTATEHANDLE_H
       
    21 #define CPHONESTATEHANDLE_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <pevirtualengine.h>
       
    25 #include "mphonestatemachine.h"
       
    26 #include "cphoneresourceresolverbase.h"
       
    27 #include "mphoneviewcommandhandle.h"
       
    28 #include "cphoneuistatemachinefactorybase.h"
       
    29 #include <coemain.h>
       
    30 
       
    31 // FORWARD DECLARATIONS
       
    32 class MPhoneState;
       
    33 class CPhoneErrorMessagesHandler;
       
    34 
       
    35 // CLASS DECLARATION
       
    36 
       
    37 /**
       
    38 *  Singleton class for handling states and their transitions
       
    39 */
       
    40 class CPhoneStateHandle : public CCoeStatic
       
    41     {
       
    42     public: 
       
    43 
       
    44         /**
       
    45         * First call initializes the singleton object. Subsequent calls panic. 
       
    46         * Singleton must be initialized only once and then Instance() method 
       
    47         * must be used to get handle to instance.
       
    48         * @return the created instance.
       
    49         */
       
    50         static CPhoneStateHandle* CreateL( 
       
    51             MPhoneViewCommandHandle* aViewCommandHandle,
       
    52             const TDesC& aFileName, 
       
    53             const TUid aFactoryUid );
       
    54     
       
    55         /**
       
    56         * Returns an instance of this class.
       
    57         * @return A pointer to CPhoneStateHandle class 
       
    58         */
       
    59         IMPORT_C static CPhoneStateHandle* Instance();
       
    60 
       
    61         /**
       
    62         * Destructor.
       
    63         */
       
    64         virtual ~CPhoneStateHandle();
       
    65         
       
    66         /**
       
    67         * Returns the state machine
       
    68         * @return State machine
       
    69         */
       
    70         IMPORT_C MPhoneStateMachine* StateMachine();
       
    71         
       
    72         /**
       
    73         * Returns the view command handle
       
    74         * @return view command handle
       
    75         */
       
    76         IMPORT_C MPhoneViewCommandHandle* ViewCommandHandle();
       
    77 
       
    78     private:
       
    79 
       
    80         /**
       
    81         * Loads handle to GSM or VoIP factory
       
    82         * @return pointer to Phone Engine Info
       
    83         */
       
    84         void LoadLibraryHandleL( 
       
    85             const TDesC& aFileName,
       
    86             const TUid aFactoryUid );
       
    87 
       
    88         /**
       
    89         * Default constructor is private because we are using the
       
    90         * Singleton design pattern.
       
    91         */
       
    92         CPhoneStateHandle(
       
    93             MPhoneViewCommandHandle* aViewCommandHandle );
       
    94 
       
    95         /**
       
    96         * By default EPOC constructor is private.
       
    97         */
       
    98         void ConstructL(
       
    99             const TDesC& aFileName, 
       
   100             const TUid aFactoryUid );
       
   101 
       
   102     private:
       
   103 
       
   104         /**
       
   105         * View's command handle
       
   106         */
       
   107         MPhoneViewCommandHandle* iViewCommandHandle;
       
   108 
       
   109         /**
       
   110         * Pointer to GSM or VoIP specific state machine
       
   111         */
       
   112         MPhoneStateMachine* iPhoneStateMachine;
       
   113 
       
   114         /**
       
   115         * Pointer to GSM or VoIP specific resource resolver
       
   116         */
       
   117         CPhoneResourceResolverBase*   iPhoneResourceResolver;
       
   118         
       
   119         /**
       
   120         * Pointer to GSM or VoIP specific error messages handler
       
   121         */
       
   122         CPhoneErrorMessagesHandler* iPhoneErrorMessagesHandler;
       
   123 
       
   124         /**
       
   125         * Pointer to GSM or VoIP specific factory.
       
   126         */
       
   127         CPhoneUIStateMachineFactoryBase* iStateMachineFactory;
       
   128 
       
   129         TLibraryFunction iEntry;
       
   130 
       
   131         RLibrary iFactoryLibrary;
       
   132 
       
   133     };
       
   134 
       
   135 #endif // CPHONESTATEHANDLE_H
       
   136             
       
   137 // End of File