phoneapp/phoneuicontrol/inc/cphoneuicontroller.h
changeset 0 5f000ab63145
child 15 2a26698d78ba
child 21 92ab7f8d0eab
equal deleted inserted replaced
-1:000000000000 0:5f000ab63145
       
     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 *     Phone UI controller class.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef CPHONEUICONTROLLER_H
       
    21 #define CPHONEUICONTROLLER_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <e32std.h>
       
    26 
       
    27 #include "mphonekeyeventhandler.h"
       
    28 #include "mphonemenuandcbaevents.h"
       
    29 #include "mphonesystemeventhandler.h"
       
    30 #include "mphonestatemachine.h"
       
    31 
       
    32 // FORWARD DECLARATIONS
       
    33 class CPhoneEngineHandler;
       
    34 class MPhoneKeyEventHandler;
       
    35 class CPhoneSystemEventHandler;
       
    36 class MPhoneViewCommandHandle;
       
    37 class MPhoneStateMachine;
       
    38 class CPhoneStateHandle;
       
    39 class CPEPhoneModel;
       
    40 class CPhoneRemoteControlHandler;
       
    41 class CPhoneKeyEventForwarder;
       
    42 
       
    43 class CPhoneUIController : 
       
    44     public CBase, 
       
    45     public MEngineMonitor,
       
    46     public MPhoneKeyEventHandler,
       
    47     public MPhoneSystemEventHandler,
       
    48     public MPhoneMenuAndCbaEvents
       
    49     {
       
    50     public:
       
    51 
       
    52         /**
       
    53         * Two-phased constructor.
       
    54         */
       
    55         IMPORT_C static CPhoneUIController* NewL( 
       
    56             MPhoneViewCommandHandle* aViewCommandHandle );
       
    57         
       
    58         /**
       
    59         * Destructor.
       
    60         */
       
    61         IMPORT_C virtual ~CPhoneUIController();
       
    62 
       
    63         /**
       
    64         * HandleMessage
       
    65         * Creates a trap for leaves from message handling functions and 
       
    66         * calls DoHandleMessage to handle the message.
       
    67         * @param aMessage: a message Id from phone application engine
       
    68         * @param aCallId: a Id of the call
       
    69         * @return 
       
    70         */
       
    71         IMPORT_C void HandleMessage( 
       
    72             const TInt aMessage, 
       
    73             const TInt aCallId );
       
    74             
       
    75         /**
       
    76         * HandleError
       
    77         * Implements error handling framework
       
    78         * @param aErrorInfo: the error info
       
    79         */
       
    80         IMPORT_C void HandleError( const TPEErrorInfo& aErrorInfo );
       
    81 
       
    82         IMPORT_C TKeyResponse HandleKeyEventL(
       
    83             const TKeyEvent& aKeyEvent,
       
    84             TEventCode aEventCode );
       
    85 
       
    86         /**
       
    87         * From CAknAppUi, initialise a menupane (dynamic).
       
    88         *
       
    89         * @param aResourceId It is the resource id for the pane.
       
    90         * @param aMenuPane It is the menu pane corresponding to the resource.
       
    91         */
       
    92         IMPORT_C void DynInitMenuPaneL( 
       
    93             TInt aResourceId, 
       
    94             CEikMenuPane* aMenuPane );
       
    95 
       
    96         /**
       
    97         * From CAknAppUi, initialise a menubar (dynamic).
       
    98         *
       
    99         * @param aResourceId It is the resource id for the bar.
       
   100         * @param aMenuBar It is the menu bar corresponding to the resource.
       
   101         */
       
   102         IMPORT_C void DynInitMenuBarL( 
       
   103             TInt aResourceId, 
       
   104             CEikMenuBar* aMenuBar );
       
   105 
       
   106         /**
       
   107         * From CEikAppUi. For Idle indicator
       
   108         */
       
   109         IMPORT_C void HandleSystemEventL(
       
   110             const TWsEvent& aEvent );
       
   111 
       
   112         /**
       
   113         * From CAknAppUi, indicates when app ui is on the foreground.
       
   114         * @param aForeground It is true if app is on the foreground.
       
   115         */
       
   116         IMPORT_C void HandleForegroundEventL( TBool aForeground );
       
   117 
       
   118         /**
       
   119         * Indicates when the Phone app is in the foreground.
       
   120         */
       
   121         IMPORT_C virtual void HandlePhoneForegroundEventL();
       
   122 
       
   123         /**
       
   124         * Indicates when the Phone app is losing focus.
       
   125         */
       
   126         IMPORT_C virtual void HandlePhoneFocusLostEventL();
       
   127         
       
   128         /**
       
   129         * Indicates when the Idle app is in the foreground.
       
   130         */
       
   131         IMPORT_C virtual void HandleIdleForegroundEventL();
       
   132 
       
   133         /**
       
   134         * Handle environment changes.
       
   135         * @param aChanges environment changes which may be reported by
       
   136         *  a change notifier through the RChangeNotifier interface.
       
   137         */
       
   138         IMPORT_C void HandleEnvironmentChangeL( const TInt aChanges );
       
   139 
       
   140         /**
       
   141         * Handles startup of the phone application 
       
   142         */
       
   143         IMPORT_C void HandlePhoneStartupL();
       
   144 
       
   145         /**
       
   146         * Handles commands.
       
   147         * @param aCommand It is the code of the command to be handled.
       
   148         * @returns boolean value was the command handled by the state 
       
   149         *          (ETrue) or not (EFalse)
       
   150         */
       
   151         IMPORT_C TBool HandleCommandL( TInt aCommand );
       
   152 
       
   153         /**
       
   154         * Process command.
       
   155         * @param aCommand It is the code of the command to be handled.
       
   156         * @returns boolean value was the command handled by the state 
       
   157         *          (ETrue) or not (EFalse)
       
   158         */
       
   159         IMPORT_C TBool ProcessCommandL( TInt aCommand );
       
   160 
       
   161         /**
       
   162         * Handles keylock events
       
   163         * @param aCommand It is the code of the command to be handled.
       
   164         */
       
   165         IMPORT_C void HandleKeyLockEnabled( TBool aKeylockEnabled );
       
   166         
       
   167         
       
   168     private:
       
   169         
       
   170         /**
       
   171         * C++ default constructor.
       
   172         */
       
   173         CPhoneUIController();
       
   174 
       
   175         /**
       
   176         * By default EPOC constructor is private.
       
   177         */
       
   178         void ConstructL( MPhoneViewCommandHandle* aViewCommandHandle );
       
   179         
       
   180         /**
       
   181         * Creates correct protocol DLL depending of the variation.
       
   182         */
       
   183         void CreateProtocolDllL( MPhoneViewCommandHandle* aViewCommandHandle );
       
   184         /**
       
   185         * CallBack for Phone Number Editor
       
   186         */
       
   187         static TInt HandlePhoneNumberEditorCallBack( TAny* aAny );
       
   188         
       
   189         /**
       
   190         * Handles the CallBack for Phone Number Editor
       
   191         */
       
   192         void DoHandlePhoneNumberEditorCallBack();
       
   193         
       
   194     private:    // Data
       
   195 
       
   196         /**
       
   197         * CPEPhoneModel
       
   198         */
       
   199         MPEPhoneModel*  iPhoneEngine;
       
   200 
       
   201         /**
       
   202         * MPEEngineInfo
       
   203         */
       
   204         MPEEngineInfo*  iEngineInfo;
       
   205 
       
   206         /**
       
   207         * iEngineHandler : 
       
   208         */
       
   209         CPhoneEngineHandler* iEngineHandler;
       
   210 
       
   211         /**
       
   212         * iKeyEventHandler : 
       
   213         */
       
   214         MPhoneKeyEventHandler* iKeyEventHandler;
       
   215 
       
   216         /**
       
   217         * iSystemEventHandler : 
       
   218         */
       
   219         CPhoneSystemEventHandler* iSystemEventHandler;
       
   220         
       
   221         /**
       
   222         * iRemoteControlHandler : 
       
   223         */
       
   224         CPhoneRemoteControlHandler* iRemoteControlHandler;
       
   225 
       
   226         /**
       
   227         * MPhoneStateMachine
       
   228         */
       
   229         CPhoneStateHandle* iStateHandle;
       
   230 
       
   231         /**
       
   232         * MPhoneStateMachine
       
   233         */
       
   234         MPhoneStateMachine* iStateMachine;  // NOT OWNED
       
   235         
       
   236         /**
       
   237         * iKeyEventForwarder
       
   238         */
       
   239         CPhoneKeyEventForwarder* iKeyEventForwarder;
       
   240         
       
   241     };
       
   242 
       
   243 #endif      // CPHONEUICONTROLLER_H   
       
   244             
       
   245 // End of File