author | Tom Sutcliffe <thomas.sutcliffe@accenture.com> |
Thu, 12 Aug 2010 16:38:42 +0100 | |
changeset 30 | 35cb3fe43f60 |
child 100 | 706c7a69e448 |
permissions | -rw-r--r-- |
30
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
1 |
// consoleextensions.cpp |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
2 |
// |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
3 |
// Copyright (c) 2010 Accenture. All rights reserved. |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
4 |
// This component and the accompanying materials are made available |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
5 |
// under the terms of the "Eclipse Public License v1.0" |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
6 |
// which accompanies this distribution, and is available |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
7 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html". |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
8 |
// |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
9 |
// Initial Contributors: |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
10 |
// Accenture - Initial contribution |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
11 |
// |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
12 |
|
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
13 |
#include <fshell/consoleextensions.h> |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
14 |
#include <e32debug.h> |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
15 |
#include <e32cons.h> |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
16 |
|
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
17 |
class TOverflowTruncate : public TDes16Overflow |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
18 |
{ |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
19 |
public: |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
20 |
virtual void Overflow(TDes16&) {} |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
21 |
}; |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
22 |
_LIT(KNewLine, "\r\n"); |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
23 |
|
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
24 |
|
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
25 |
EXPORT_C void MIosrvConsoleHelper::Message(TVerbosity aVerbosity, TRefByValue<const TDesC> aFmt, ...) |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
26 |
{ |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
27 |
if (Debug() || (aVerbosity == EInformation) || (aVerbosity == EError)) |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
28 |
{ |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
29 |
TOverflowTruncate overflow; |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
30 |
VA_LIST list; |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
31 |
VA_START(list, aFmt); |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
32 |
TBuf<0x100> buf; |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
33 |
buf.AppendFormatList(aFmt, list, &overflow); |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
34 |
|
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
35 |
if (iUnderlyingConsole) |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
36 |
{ |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
37 |
iUnderlyingConsole->Write(buf); |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
38 |
iUnderlyingConsole->Write(KNewLine); |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
39 |
} |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
40 |
else |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
41 |
{ |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
42 |
// Cover all the bases as best we can |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
43 |
User::InfoPrint(buf); |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
44 |
RDebug::Print(buf); |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
45 |
} |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
46 |
} |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
47 |
} |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
48 |
|
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
49 |
EXPORT_C TBool MIosrvConsoleHelper::Debug() const |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
50 |
{ |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
51 |
return iDebug; |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
52 |
} |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
53 |
|
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
54 |
EXPORT_C void MIosrvConsoleHelper::SetDebug(TBool aDebug) |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
55 |
{ |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
56 |
iDebug = aDebug; |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
57 |
} |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
58 |
|
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
59 |
EXPORT_C TInt MIosrvConsoleHelper::WriteStdErr(const TDesC& /*aDes*/) |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
60 |
{ |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
61 |
return KErrExtensionNotSupported; |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
62 |
} |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
63 |
|
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
64 |
EXPORT_C TInt MIosrvConsoleHelper::MIosrvConsoleHelper_Extension(TUint aExtensionId, TAny*& /*a0*/, TAny* a1) |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
65 |
{ |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
66 |
if (aExtensionId == UnderlyingConsole::KSetUnderlyingConsoleExtension) |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
67 |
{ |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
68 |
iUnderlyingConsole = (CConsoleBase*)a1; |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
69 |
return KErrNone; |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
70 |
} |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
71 |
else if (aExtensionId == ConsoleStdErr::KWriteStdErrConsoleExtension) |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
72 |
{ |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
73 |
const TDesC* des = (const TDesC*)a1; |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
74 |
return WriteStdErr(*des); |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
75 |
} |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
76 |
else |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
77 |
{ |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
78 |
return KErrExtensionNotSupported; |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
79 |
} |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
80 |
} |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
81 |
|
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
82 |
EXPORT_C void MIosrvConsoleHelper::HandleConsoleCreationError(const TDesC& aConsoleName, TInt aError) |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
83 |
{ |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
84 |
if (aError) |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
85 |
{ |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
86 |
TBuf<512> message; |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
87 |
message.Format(_L("Failed to create console %S (%d)."), &aConsoleName, aError); |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
88 |
|
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
89 |
if (iUnderlyingConsole && (LazyConsole::IsConstructed(iUnderlyingConsole) || !LazyConsole::IsLazy(iUnderlyingConsole))) |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
90 |
// if we have an underlyconsole, which is either not lazy or is lazy but already constructed, then print the error to it. |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
91 |
{ |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
92 |
iUnderlyingConsole->Write(message); |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
93 |
iUnderlyingConsole->Write(KNewLine); |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
94 |
} |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
95 |
else |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
96 |
// else display a dialog |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
97 |
{ |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
98 |
RNotifier notifier; |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
99 |
if (notifier.Connect() == KErrNone) |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
100 |
{ |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
101 |
TInt buttonVal; |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
102 |
TRequestStatus notifierStatus; |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
103 |
notifier.Notify(aConsoleName, message, _L("OK"), KNullDesC, buttonVal, notifierStatus); |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
104 |
User::WaitForRequest(notifierStatus); |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
105 |
notifier.Close(); |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
106 |
} |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
107 |
} |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
108 |
} |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
109 |
Message(EDebug, _L("%S console create completed with err=%d"), &aConsoleName, aError); |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
110 |
} |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
111 |
|
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
112 |
EXPORT_C void MIosrvConsoleHelper::CleanupUnderlyingConsole() |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
113 |
{ |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
114 |
delete iUnderlyingConsole; // In case of leave during construction, this might still be non-null |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
115 |
iUnderlyingConsole = NULL; |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
116 |
} |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
117 |
|
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
118 |
EXPORT_C CConsoleBase* MIosrvConsoleHelper::UnderlyingConsole() const |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
119 |
{ |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
120 |
return iUnderlyingConsole; |
35cb3fe43f60
Refactored CVtcConsoleBase::Message() into separate helper for use by non-VT100 consoles
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
121 |
} |