|
1 // consoleextensions.inl |
|
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 // Dummy class used to allow calls into protected Extension_ in a CBase derived class. |
|
14 class CBaseExtensionDummy : public CBase |
|
15 { |
|
16 public: |
|
17 using CBase::Extension_; |
|
18 }; |
|
19 |
|
20 TInt ConsoleMode::Set(CBase* aConsole, ConsoleMode::TMode aMode) |
|
21 { |
|
22 TAny* ignore; |
|
23 return ((CBaseExtensionDummy*)aConsole)->Extension_(KSetConsoleModeExtension, ignore, reinterpret_cast<TAny*>(aMode)); |
|
24 } |
|
25 |
|
26 TInt UnderlyingConsole::Set(CBase* aConsole, CConsoleBase* aUnderlyingConsole) |
|
27 { |
|
28 TAny* ignore; |
|
29 return ((CBaseExtensionDummy*)aConsole)->Extension_(KSetUnderlyingConsoleExtension, ignore, aUnderlyingConsole); |
|
30 } |
|
31 |
|
32 ConsoleAttributes::TAttributes::TAttributes(TUint aAttributes, TColor aForegroundColor, TColor aBackgroundColor) |
|
33 : iAttributes(aAttributes), iForegroundColor(aForegroundColor), iBackgroundColor(aBackgroundColor) |
|
34 { |
|
35 } |
|
36 |
|
37 TInt ConsoleAttributes::Set(CBase* aConsole, const TAttributes& aAttributes) |
|
38 { |
|
39 TAny* ignore; |
|
40 return ((CBaseExtensionDummy*)aConsole)->Extension_(KSetConsoleAttributesExtension, ignore, (TAny*)&aAttributes); |
|
41 } |
|
42 |
|
43 TBool LazyConsole::IsLazy(CBase* aConsole) |
|
44 { |
|
45 TBool constructed = EFalse; |
|
46 TAny* ignore; |
|
47 TInt err = ((CBaseExtensionDummy*)aConsole)->Extension_(KLazyConsoleExtension, ignore, (TAny*)&constructed); |
|
48 return (err==KErrNone); |
|
49 } |
|
50 |
|
51 TBool LazyConsole::IsConstructed(CBase* aConsole) |
|
52 { |
|
53 TBool constructed = EFalse; |
|
54 TAny* ignore; |
|
55 TInt err = ((CBaseExtensionDummy*)aConsole)->Extension_(KLazyConsoleExtension, ignore, (TAny*)&constructed); |
|
56 return (err==KErrNone) && (constructed); |
|
57 } |
|
58 |
|
59 TInt ConsoleStdErr::Write(CBase* aConsole, const TDesC& aDes) |
|
60 { |
|
61 TAny* ignore; |
|
62 return ((CBaseExtensionDummy*)aConsole)->Extension_(KWriteStdErrConsoleExtension, ignore, const_cast<TAny*>((const TAny*)&aDes)); |
|
63 } |