plugins/consoles/guicons/s60/inc/GuiConsAppUi.h
changeset 0 7f656887cf89
equal deleted inserted replaced
-1:000000000000 0:7f656887cf89
       
     1 // GuiConsAppUi.h
       
     2 // 
       
     3 // Copyright (c) 2009 - 2010 Accenture. All rights reserved.
       
     4 // This component and the accompanying materials are made available
       
     5 // under the terms of the "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 // Accenture - Initial contribution
       
    11 //
       
    12 
       
    13 #ifndef __GUICONSAPPUI_H__
       
    14 #define __GUICONSAPPUI_H__
       
    15 
       
    16 #include <aknappui.h>
       
    17 #include <aknnavide.h>
       
    18 #include <eikedwin.h>
       
    19 #include <akntabobserver.h>
       
    20 
       
    21 #include <fshell/guicons.h>
       
    22 #include <fshell/settings.h>
       
    23 #include <fshell/qr3dll.h>
       
    24 
       
    25 class CGuiConsAppView;
       
    26 class CAknTabGroup;
       
    27 class CConsoleState;
       
    28 class CCommandText;
       
    29 
       
    30 class CGuiConsAppUi : public CAknAppUi
       
    31 					, public MConsoleUi
       
    32 					, public MAknTabObserver
       
    33 					, public MCaptureInterface
       
    34 	{
       
    35 public:
       
    36 	void ConstructL();
       
    37 	CGuiConsAppUi();
       
    38 	virtual ~CGuiConsAppUi();
       
    39 	
       
    40 	void SetNaviPaneTextL(const TDesC& aText);
       
    41 	// from CCoeAppUi:
       
    42 	virtual TKeyResponse HandleKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
       
    43 	// from MConsoleUi
       
    44 	virtual void HandleNewConsoleL(CConsoleControl* aConsole);
       
    45 	virtual void HandleConsoleClosed(CConsoleControl* aConsole);
       
    46 	virtual void ConsoleTitleChangedL(const CConsoleControl*, const TDesC&);
       
    47 	virtual TInt GetConsoleBufferSize();
       
    48 	virtual const TDesC& GetConsoleFont();
       
    49 private:
       
    50 	enum TState
       
    51 		{
       
    52 		ENoConsole,
       
    53 		EConsoleActive,
       
    54 		EEdwinActive,
       
    55 		EConsoleClosed,
       
    56 		};
       
    57 private:
       
    58 	void HandleCommandL(TInt aCommand);
       
    59 	void HandleStatusPaneSizeChange();
       
    60 	void SetMenuItemDimmed(TInt aCommandId, CEikMenuPane* aMenuPane);
       
    61 	void DynInitMenuPaneL(TInt aMenuId, CEikMenuPane* aMenuPane);
       
    62 	TBool CommandValidInCurrentState(TInt aCommandId);
       
    63 	
       
    64 	void SetStateL(TState aNewState);
       
    65 	void SetSoftkeysL();
       
    66 	
       
    67 	void NewFshellProcessL(const TDesC& aArgs);
       
    68 	CConsoleState* StateForConsole(const CConsoleControl* aControl);
       
    69 	void SetStateToPreferredL();
       
    70 	void DeleteCurrentConsoleL();
       
    71 	void SwitchTabL(TInt aTabIdx);
       
    72 	void SetCapturingLongPressesL(TBool aEnable);
       
    73 	void InputTextL(const TDesC& aText);
       
    74 	void LoadCommandsL();
       
    75 	
       
    76 	void DisplayMessageL(TRefByValue<const TDesC> aFmt, ...);
       
    77 
       
    78 private: // From MAknTabObserver
       
    79 	void TabChangedL(TInt aIndex);
       
    80 private: // From MCaptureInterface
       
    81 	void CapturedKeyPressedL(TInt aIdentifier);
       
    82 
       
    83 private:
       
    84 	TState iState;
       
    85 	TBool iEdwinWasLastRunningState;
       
    86 	CGuiConsAppView* iAppView;
       
    87 	CAknNavigationDecorator* iNaviDecorator;
       
    88 	CAknNavigationControlContainer* iNaviPane;
       
    89 	CAknTabGroup* iTabGroup;
       
    90 	RPointerArray<CConsoleState> iTabs;
       
    91 	TBool iShouldDisplayOnscreenNav;
       
    92 	
       
    93 	CServer2* iConsoleServer;
       
    94 
       
    95 	CConsoleControl* iConsole; // The currently displayed console. Not owned
       
    96 	CConsoleState* iTempState; // Used in case we get a call to SetTitle before HandleNewConsole
       
    97 	RPointerArray<CCommandText> iCommands;
       
    98 	
       
    99 	LtkUtils::CIniFile* iIniFile;
       
   100 	};
       
   101 	
       
   102 class CBlankControl : public CCoeControl
       
   103 	{
       
   104 public:
       
   105 	virtual void Draw(const TRect& aRect) const;
       
   106 	};
       
   107 
       
   108 class CConsoleState : public CBase
       
   109 	{
       
   110 public:
       
   111 	CConsoleState(CConsoleControl* aControl);
       
   112 	~CConsoleState();
       
   113 
       
   114 	CConsoleControl* iControl;
       
   115 	TBool iConsoleClosed;
       
   116 	TBuf<32> iTitle;
       
   117 	};
       
   118 
       
   119 class CCommandText : public CBase
       
   120 	{
       
   121 public:
       
   122 	CCommandText(TInt aOrder);
       
   123 	~CCommandText();
       
   124 	static TInt Order(const CCommandText& aLeft, const CCommandText& aRight);
       
   125 public:
       
   126 	TInt iOrder;
       
   127 	TBuf<16> iName;
       
   128 	HBufC* iValue;
       
   129 	};
       
   130 	
       
   131 #endif // __GUICONSAPPUI_H__