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: Dialog for showing the Terms of Use for a chat server |
|
15 * |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef CVIMPSTUITERMSOFUSEDLG_H |
|
21 #define CVIMPSTUITERMSOFUSEDLG_H |
|
22 |
|
23 #include <AknDialog.h> |
|
24 #include <ItemFinder.h> |
|
25 #include <eiksbobs.h> |
|
26 |
|
27 class CEikRichTextEditor; |
|
28 class CParaFormatLayer; |
|
29 class CCharFormatLayer; |
|
30 class CAknsBasicBackgroundControlContext; |
|
31 class CAknTitlePane; |
|
32 class CEikScrollBar; |
|
33 |
|
34 |
|
35 /** |
|
36 * Dialog for showing the Terms of use -text |
|
37 * |
|
38 * @lib vimpstui.lib |
|
39 * @since S60 3.1u |
|
40 */ |
|
41 NONSHARABLE_CLASS( CVIMPSTUiTermsOfUseDlg ) : public CAknDialog, |
|
42 public MItemFinderObserver, |
|
43 public MEikScrollBarObserver |
|
44 { |
|
45 public: |
|
46 |
|
47 /** |
|
48 * Executes the dialog and destroys it before returning |
|
49 * @since 3.1u |
|
50 * @return EAknSoftkeyOk if user accepted. |
|
51 * EAknSoftkeyCancel if user cancelled |
|
52 */ |
|
53 TInt RunDialogLD( TInt aResourceId ); |
|
54 |
|
55 static CVIMPSTUiTermsOfUseDlg* NewL( ); |
|
56 |
|
57 static CVIMPSTUiTermsOfUseDlg* NewLC( ); |
|
58 |
|
59 virtual ~CVIMPSTUiTermsOfUseDlg(); |
|
60 |
|
61 public: // from MObjectProvider |
|
62 |
|
63 TTypeUid::Ptr MopSupplyObject(TTypeUid aId); |
|
64 |
|
65 /* |
|
66 *to set ToUString |
|
67 *owner-ship transfered |
|
68 */ |
|
69 void SetToUMsgL(HBufC* aToUMsg); |
|
70 |
|
71 |
|
72 public: //MEikScrollBarObserver |
|
73 void HandleScrollEventL(CEikScrollBar* aScrollBar, TEikScrollEvent aEventType); |
|
74 |
|
75 protected: // from CEikDialog |
|
76 |
|
77 /** |
|
78 * @see CEikDialog |
|
79 */ |
|
80 void PreLayoutDynInitL(); |
|
81 |
|
82 /** |
|
83 * @see CEikDialog |
|
84 */ |
|
85 void PostLayoutDynInitL(); |
|
86 |
|
87 /** |
|
88 * @see CEikDialog |
|
89 */ |
|
90 TBool OkToExitL( TInt aButtonId ); |
|
91 |
|
92 /** |
|
93 * @see CEikDialog |
|
94 */ |
|
95 void SetSizeAndPosition( const TSize& aSize ); |
|
96 |
|
97 /** |
|
98 * @see CEikDialog |
|
99 */ |
|
100 void SizeChanged(); |
|
101 |
|
102 protected: // From MItemFinderObserver |
|
103 |
|
104 /** |
|
105 * @see MItemFinderObserver |
|
106 */ |
|
107 void HandleParsingComplete(); |
|
108 |
|
109 protected: //from base class CCoeControl |
|
110 |
|
111 /** |
|
112 * @see CCoeControl |
|
113 */ |
|
114 TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, |
|
115 TEventCode aType ); |
|
116 |
|
117 |
|
118 /** |
|
119 * @see CCoeControl |
|
120 */ |
|
121 void HandleResourceChange( TInt aType ); |
|
122 |
|
123 |
|
124 private: |
|
125 |
|
126 CVIMPSTUiTermsOfUseDlg(); |
|
127 |
|
128 void ConstructL( ); |
|
129 |
|
130 private: // new functions |
|
131 |
|
132 /** |
|
133 * Inserts line to rich text object |
|
134 * @since 3.1u |
|
135 * @param aTextResourceId Resource for text in line |
|
136 * @param aBold Should text be bolded |
|
137 */ |
|
138 void InsertLineL( TInt aTextResourceId, TBool aBold = EFalse ); |
|
139 |
|
140 /** |
|
141 * Inserts line to rich text object |
|
142 * @since 3.1u |
|
143 * @param aText Text for line |
|
144 * @param aBold Should text be bolded |
|
145 */ |
|
146 void InsertLineL( const TDesC& aText, TBool aBold = EFalse ); |
|
147 |
|
148 /** |
|
149 * Search the LAF specified font for invite dialog |
|
150 * @since 3.1u |
|
151 * @return LAF specified font |
|
152 */ |
|
153 const CFont* GetLayoutFont(); |
|
154 |
|
155 /** |
|
156 * Gets the instance of the title pane |
|
157 * @return Title pane pointer |
|
158 * @since 3.1u |
|
159 */ |
|
160 CAknTitlePane* GetTitlePaneInstanceL() const; |
|
161 |
|
162 /** |
|
163 * Stores the old title pane text and sets a custom one |
|
164 * @since 3.1u |
|
165 */ |
|
166 void SetNewTitleTextL(); |
|
167 |
|
168 /** |
|
169 * Retores the old title pane text |
|
170 * @since 3.1u |
|
171 */ |
|
172 void RestoreTitlePaneTextL() const; |
|
173 |
|
174 /** |
|
175 * Updates CBA. |
|
176 * @since S60 v3.2 |
|
177 */ |
|
178 void UpdateCbaL(); |
|
179 |
|
180 /** |
|
181 * Helper method to update TOU message text color according to |
|
182 * current skin. |
|
183 * Note! This will not update text control |
|
184 * @since S60 v3.1u |
|
185 */ |
|
186 void UpdateTextColorL(); |
|
187 |
|
188 |
|
189 private: // data |
|
190 |
|
191 // not own |
|
192 CEikRichTextEditor* iEditor; |
|
193 |
|
194 // own |
|
195 CItemFinder* iItemFinder; |
|
196 |
|
197 // Return value of this dialog |
|
198 TInt iReturnVal; |
|
199 |
|
200 // Not Own. Paragraph formatter |
|
201 CParaFormatLayer* iParaFormatLayer; |
|
202 |
|
203 // Not Own. Character formatter |
|
204 CCharFormatLayer* iCharFormatLayer; |
|
205 |
|
206 // Own. For controlling the background image |
|
207 CAknsBasicBackgroundControlContext* iBgContext; |
|
208 |
|
209 // Own. |
|
210 HBufC* iOldTitleText; |
|
211 |
|
212 TInt* iRetVal; // Not own, return value of the dialog, |
|
213 |
|
214 HBufC* iToUText; |
|
215 |
|
216 // Own - stores the maximum position of the vertical scrollbar thumb |
|
217 TInt iThumbMaxPos; |
|
218 }; |
|
219 |
|
220 #endif // CVIMPSTUITERMSOFUSEDLG_H |
|