S60 3rd Edition SDK for Symbian OS
Example Applications Guide

SIPExAppUi.h

00001 /*
00002 * ==============================================================================
00003 *  Name        : SIPExAppUi.h
00004 *  Part of     : SIPEx
00005 *  Interface   : 
00006 *  Description : 
00007 *  Version     : 
00008 *
00009 *  Copyright (c) 2004-2006 Nokia Corporation.
00010 *  This material, including documentation and any related 
00011 *  computer programs, is protected by copyright controlled by 
00012 *  Nokia Corporation.
00013 * ==============================================================================
00014 */
00015 
00016 #ifndef __CSIPEXAPPUI_H__
00017 #define __CSIPEXAPPUI_H__
00018 
00019 //  INCLUDES
00020 
00021 #include "SIPExGameObserver.h"
00022 #include "SIPExGameConstants.h"
00023 #include "SIPExGameEngine.h"
00024 #include "SIPExStateViewNotifier.h"
00025 #include <aknviewappui.h> // View AppUi adds View handling to AppUi
00026 #include <akntabgrp.h>          // For handling tabs
00027 #include <aknnavide.h>
00028 
00029 // FORWARD DECLARATIONS
00030 class CSIPExEngine;
00031 class CSIPExGameContainer;
00032 class CSIPExLogContainer;
00033 
00034 // CLASS DECLARATION
00035 /**
00036 * Application user interface class.
00037 * User interface part of the CKON application framework 
00038 * for the SIPEx game.
00039 */
00040 class CSIPExAppUi 
00041 :   public CAknViewAppUi, 
00042     public MSIPExGameObserver,
00043     public MSIPExStateViewNotifier   
00044     {
00045     public:  // Constructors and destructor
00046 
00047         /**
00048         * C++ default constructor. This needs to be public due to the way 
00049         * the framework constructs the AppUi.
00050         */
00051         CSIPExAppUi();
00052 
00053         /**
00054         * 2nd phase constructor. This needs to be public due to the way 
00055         * the framework constructs the AppUi 
00056         */
00057         void ConstructL();
00058         
00059         /**
00060         * Destructor.
00061         */
00062         virtual ~CSIPExAppUi();
00063 
00064     public: // Functions from base classes
00065 
00066         /**
00067         * From CEikAppUi, handles key events.
00068         * @param aKeyEvent Event to handled.
00069         * @param aType Type of the key event. 
00070         * @return Response code (EKeyWasConsumed, EKeyWasNotConsumed). 
00071         */
00072         TKeyResponse HandleKeyEventL( const TKeyEvent& aKeyEvent,TEventCode aType );
00073             
00074         /**
00075         * From CEikAppUi handles the user interaction.
00076         * @param aCommand Id of the initiated command        
00077         */
00078         void HandleCommandL( TInt aCommand );   
00079 
00080 
00081         // From MSIPExGameObserver
00082         void GameStateChanged( CSIPExEngine::TEngineState aState );
00083         TBool AcceptInvitationL( const TDesC& aFrom );
00084         void  IMReceivedL( const TDesC8& aFrom, const TDesC8& aMsg );
00085         
00086         // From MSIPExStateViewNotifier
00087         void ShowStatusInfoL( const TDesC& aText );
00088         void ShowInfoL( const TDesC& aText );
00089         void ShowInfoL( const TDesC8& aText );
00090         
00091     public:
00092     
00093         /**
00094         * Return current state of the engine
00095         */
00096         const CSIPExEngine::TEngineState EngineState();
00097         
00098         /**
00099         * Return true if currently active view is the GameView, false otherwise
00100         */
00101         TBool GameViewActive();
00102         
00103         /**
00104         * Return true if currently active view is the LogView, false otherwise
00105         */
00106         TBool LogViewActive();
00107         
00108         /**
00109         * Return true if currently active view is matching with aViewUid
00110         */
00111         TBool IsViewActive( TUid aViewUid );
00112         
00113         /**
00114         * Return pointer to game container, ownership is not transferred
00115         */
00116         CSIPExGameContainer* GameContainer();
00117         
00118         /**
00119         * Return pointer to log container, ownership is not transferred
00120         */
00121         CSIPExLogContainer* LogContainer();
00122         
00123 
00124     private: // New functions
00125     
00126         
00127     private:    // Data
00128     
00129         // Not owned: pointer to the application engine.
00130         CSIPExEngine* iEngine;
00131         // The address field. The app remembers the last address.
00132         TBuf< KMaxSIPAddressLength > iAddress;
00133         // The state of the game.
00134         CSIPExEngine::TEngineState iState;
00135         
00136         CAknNavigationControlContainer* iNaviPane;
00137         CAknTabGroup* iTabGroup;
00138         CAknNavigationDecorator* iDecoratedTabGroup;
00139     };
00140 
00141 #endif      // __CSIPEXAPPUI_H__
00142             
00143 // End of File

© Nokia 2006

Back to top