plugins/consoles/common/consoleextensions.h
changeset 0 7f656887cf89
child 30 35cb3fe43f60
equal deleted inserted replaced
-1:000000000000 0:7f656887cf89
       
     1 // consoleextensions.h
       
     2 // 
       
     3 // Copyright (c) 2008 - 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 __CONSOLEEXTENSIONS_H__
       
    14 #define __CONSOLEEXTENSIONS_H__
       
    15 
       
    16 #include <e32base.h>
       
    17 
       
    18 class ConsoleMode
       
    19 	{
       
    20 public:
       
    21 	enum TMode
       
    22 		{
       
    23 		EBinary,
       
    24 		EText,
       
    25 		};
       
    26 	static const TUint KSetConsoleModeExtension = 0x10285e15;
       
    27 public:
       
    28 	/**
       
    29 	A console implementation that does not support different mode or a CBase derived class
       
    30 	that does not derive from CConsoleBase will return KErrExtensionNotSupported if passed
       
    31 	into this function.
       
    32 	*/
       
    33 	static inline TInt Set(CBase* aConsole, TMode aMode);
       
    34 	};
       
    35 
       
    36 class UnderlyingConsole
       
    37 	{
       
    38 public:
       
    39 	static const TUint KSetUnderlyingConsoleExtension = 0x10287199;
       
    40 public:
       
    41 	/**
       
    42 	Set the underlying console of another console. The underlying console may be used during construction
       
    43 	of the actual console to display information or error messages, such as the IP address to connect to
       
    44 	in the case of a TCP console implementation.
       
    45 	
       
    46 	Note, for consoles loaded within the IO server, the underlying console is write only. Attempting to
       
    47 	read from it will cause a panic.
       
    48 	*/
       
    49 	static inline TInt Set(CBase* aConsole, CConsoleBase* aUnderlyingConsole);
       
    50 	};
       
    51 
       
    52 class ConsoleAttributes
       
    53 	{
       
    54 public:
       
    55 	// Note these are also defined in win32cons.h
       
    56 	enum TAttribute
       
    57 		{
       
    58 		ENone			= 0x0001,
       
    59 		EBold			= 0x0002,
       
    60 		EUnderscore		= 0x0004,
       
    61 		EBlink			= 0x0008,
       
    62 		EInverse		= 0x0010,
       
    63 		EConceal		= 0x0020
       
    64 		};
       
    65 	enum TColor
       
    66 		{
       
    67 		EBlack,
       
    68 		ERed,
       
    69 		EGreen,
       
    70 		EYellow,
       
    71 		EBlue,
       
    72 		EMagenta,
       
    73 		ECyan,
       
    74 		EWhite,
       
    75 		EReset,
       
    76 		EUnchanged
       
    77 		};
       
    78 	class TAttributes
       
    79 		{
       
    80 	public:
       
    81 		inline TAttributes(TUint aAttributes, TColor aForegroundColor = EUnchanged, TColor aBackgroundColor = EUnchanged);
       
    82 	public:
       
    83 		TUint iAttributes;
       
    84 		TColor iForegroundColor;
       
    85 		TColor iBackgroundColor;
       
    86 		};
       
    87 	static const TUint KSetConsoleAttributesExtension = 0x10286B6E;
       
    88 public:
       
    89 	/**
       
    90 	A console implementation that does not support different mode or a CBase derived class
       
    91 	that does not derive from CConsoleBase will return KErrExtensionNotSupported if passed
       
    92 	into this function.
       
    93 	*/
       
    94 	static inline TInt Set(CBase* aConsole, const TAttributes& aAttributes);
       
    95 	};
       
    96 	
       
    97 class LazyConsole
       
    98 	{
       
    99 public:
       
   100 	static const TUint KLazyConsoleExtension = 0x1028719e;
       
   101 public:
       
   102 	/**
       
   103 	Returns true if the console is lazy.
       
   104 	*/
       
   105 	static inline TBool IsLazy(CBase* aConsole);
       
   106 	/**
       
   107 	Returns true if he console is lazy, AND it's been constructed.
       
   108 	*/
       
   109 	static inline TBool IsConstructed(CBase* aConsole);
       
   110 	};
       
   111 
       
   112 class ConsoleStdErr
       
   113 	{
       
   114 public:
       
   115 	static const TInt KWriteStdErrConsoleExtension = 0x10286aaa;
       
   116 public:
       
   117 	/**
       
   118 	Write to StdErr of the underlying console if the console supports this.
       
   119 	*/
       
   120 	static inline TInt Write(CBase* aConsole, const TDesC& aDes);
       
   121 	};
       
   122 	
       
   123 #include <fshell/consoleextensions.inl>
       
   124 	
       
   125 #endif //__CONSOLEEXTENSIONS_H__