|
1 /* |
|
2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "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 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: The container class for ConnTest |
|
15 * Shows status line and notification text editor |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef CONNTESTCONTAINER_H |
|
20 #define CONNTESTCONTAINER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <coecntrl.h> |
|
24 #include "uinotify.h" |
|
25 |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class CRichText; |
|
29 class CParaFormatLayer; |
|
30 class CCharFormatLayer; |
|
31 class CEikRichTextEditor; |
|
32 class CEikLabel; |
|
33 |
|
34 |
|
35 // CLASS DECLARATION |
|
36 |
|
37 /** |
|
38 * CConnTestContainer container control class. |
|
39 * |
|
40 */ |
|
41 class CConnTestContainer : public CCoeControl, public MCoeControlObserver, public MUINotify |
|
42 { |
|
43 public: // Constructors and destructor |
|
44 |
|
45 /** |
|
46 * EPOC default constructor. |
|
47 * @param aRect Frame rectangle for container. |
|
48 */ |
|
49 void ConstructL(const TRect& aRect); |
|
50 |
|
51 /** |
|
52 * Destructor. |
|
53 */ |
|
54 ~CConnTestContainer(); |
|
55 |
|
56 public: // New functions |
|
57 |
|
58 /** |
|
59 * Clear the output window. |
|
60 */ |
|
61 void ClearOutputWindow(); |
|
62 |
|
63 public: // Functions from base classes |
|
64 |
|
65 // From MUINotify |
|
66 |
|
67 /** |
|
68 * Display text on output window |
|
69 * @param aDes text to display |
|
70 * @param aFontStyle style (italic/bold/etc) for this text |
|
71 */ |
|
72 void PrintNotify(const TDesC& aDes, TUint aFontStyle = 0); |
|
73 void PrintNotify(const TDesC8& aDes, TUint aFontStyle = 0); |
|
74 |
|
75 /** |
|
76 * Display integer as text on output window |
|
77 * @param aInt integer to display |
|
78 */ |
|
79 void PrintNotify(TInt aInt); |
|
80 |
|
81 /** |
|
82 * Notify user of an error |
|
83 * @param aErrMessage message associated with error |
|
84 * @param aErrCode error code |
|
85 */ |
|
86 void ErrorNotify(const TDesC& aErrMessage, TInt aErrCode); |
|
87 |
|
88 /** |
|
89 * Notify user with a message |
|
90 * @param aMessage message associated with error |
|
91 */ |
|
92 void CConnTestContainer::PopupNotify(const TDesC& aMessage); |
|
93 |
|
94 /** |
|
95 * Change 'status' display. |
|
96 * @param aStatus new status text to display |
|
97 */ |
|
98 void SetStatus(const TDesC& aStatus); |
|
99 |
|
100 private: // Functions from base classes |
|
101 |
|
102 /** |
|
103 * From CoeControl. Calls SizeChangedL with TRAP. |
|
104 */ |
|
105 void SizeChanged(); |
|
106 |
|
107 /** |
|
108 * From CoeControl. |
|
109 */ |
|
110 TInt CountComponentControls() const; |
|
111 |
|
112 /** |
|
113 * From CCoeControl. |
|
114 */ |
|
115 CCoeControl* ComponentControl(TInt aIndex) const; |
|
116 |
|
117 /** |
|
118 * Event handling section, e.g Listbox events. |
|
119 */ |
|
120 void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType); |
|
121 |
|
122 /** |
|
123 * From CCoeControl,Draw. |
|
124 */ |
|
125 void Draw(const TRect& aRect) const; |
|
126 |
|
127 /** |
|
128 * Key event handler. Handles up and down arrow keys, so that |
|
129 * output window can be scrolled. |
|
130 */ |
|
131 TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); |
|
132 |
|
133 /** |
|
134 * Change font style for subsequent text |
|
135 * @param aFontStyle new font style |
|
136 */ |
|
137 void SetFontStyle(TUint aFontStyle); |
|
138 |
|
139 /** |
|
140 * Set or clear an individual font attribute if necessary, |
|
141 * so that it matches the required style |
|
142 * @param aFontStyle required font style |
|
143 * @param aAttribute the individual attribute to correct |
|
144 */ |
|
145 void UpdateFontAttribute(TUint aFontStyle, TInt aAttribute); |
|
146 |
|
147 |
|
148 private: //data |
|
149 CParaFormatLayer* iParaFormat; // Used by CEikRichTextEditor |
|
150 CCharFormatLayer* iCharFormat; // Used by CEikRichTextEditor |
|
151 CRichText* iRichText; // Used by CEikRichTextEditor |
|
152 CEikRichTextEditor* iOutputWindow; // CRichText object for use as our output window |
|
153 CEikLabel* iStatusWindow; // Single line of text to display connection status |
|
154 TUint iFontStyle; // Current style in use by output window |
|
155 }; |
|
156 |
|
157 #endif |
|
158 |
|
159 // End of File |