|
1 /* |
|
2 * Copyright (c) 2007-2008 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: message extention class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef _CIMCVAPPMESSAGEEXTENSIONSHANDLER_H |
|
21 #define _CIMCVAPPMESSAGEEXTENSIONSHANDLER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32std.h> |
|
25 #include <e32base.h> |
|
26 |
|
27 #include "mimcvappmessageextension.h" |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class CEikRichTextEditor; |
|
31 class TCursorSelection; |
|
32 class CIMCVAppUi; |
|
33 class MIMCVAppUi; |
|
34 class MIMCVUiAppSkinVariant; |
|
35 class MIMCVEngineFactory; |
|
36 class CIMCVEngine; |
|
37 // CLASS DECLARATION |
|
38 |
|
39 /** |
|
40 * Message extensions handler |
|
41 * @since 5.0 |
|
42 */ |
|
43 class CIMCVAppMessageExtensionsHandler : public CBase |
|
44 { |
|
45 public: |
|
46 |
|
47 /** |
|
48 * Two-phased constructor |
|
49 * @param aAddSmileyHandler |
|
50 * @since 5.0 |
|
51 */ |
|
52 static CIMCVAppMessageExtensionsHandler* NewL( |
|
53 MIMCVUiAppSkinVariant& aSkinVariant, |
|
54 MIMCVAppUi& aAppUi, |
|
55 MIMCVEngineFactory& aEngineFactory, |
|
56 TBool aAddSmileyHandler = ETrue ); |
|
57 |
|
58 /** |
|
59 * Destructor |
|
60 * @since 5.0 |
|
61 */ |
|
62 ~CIMCVAppMessageExtensionsHandler(); |
|
63 |
|
64 private: |
|
65 /** |
|
66 * Symbian OS Constructor |
|
67 * @since 5.0 |
|
68 */ |
|
69 void ConstructL(); |
|
70 |
|
71 /** |
|
72 * Constructor |
|
73 * @since 5.0 |
|
74 */ |
|
75 CIMCVAppMessageExtensionsHandler(MIMCVUiAppSkinVariant& aSkinVariant, |
|
76 MIMCVAppUi& aAppUi, |
|
77 MIMCVEngineFactory& aEngineFactory ); |
|
78 |
|
79 public: |
|
80 /* |
|
81 * new service has been installed |
|
82 */ |
|
83 void CreateServiceSmileyL( TInt aServiceId ); |
|
84 /* |
|
85 * service has been deleted |
|
86 */ |
|
87 void DeleteServiceSmileyL( TInt aServiceId ); |
|
88 |
|
89 public: |
|
90 |
|
91 |
|
92 /** |
|
93 * Process editor messages for sending them as characters. |
|
94 * Resets extensions. |
|
95 * @param aEditor Editor which contains message. |
|
96 * @since 5.0 |
|
97 * @return Ownership of message returned is passed to caller. |
|
98 */ |
|
99 HBufC* ProcessMessageLC( CEikRichTextEditor& aEditor, TInt aServiceId ); |
|
100 |
|
101 /** |
|
102 * Convert extensions to characters. |
|
103 * @param aEditor Editor which contains message. |
|
104 * @since 5.0 |
|
105 * @return Ownership of message returned is passed to caller. |
|
106 */ |
|
107 HBufC* ExtensionToStringLC( CEikRichTextEditor& aEditor, TInt aServiceId ); |
|
108 |
|
109 |
|
110 /** |
|
111 * Delete extension from editor |
|
112 * @param aEditor Editor which contains message. |
|
113 * @since 5.0 |
|
114 */ |
|
115 void DeleteExtensionL( CEikRichTextEditor& aEditor, |
|
116 TInt aServiceId, |
|
117 TMessageExtensionTypes aType, TInt aPos ); |
|
118 |
|
119 /** |
|
120 * Converts all the extensions in selection area from |
|
121 * strings to extensions. |
|
122 * @since 2.6 |
|
123 * @param aEditor, used editor |
|
124 */ |
|
125 void ConvertSelectionToExtensionL( CEikRichTextEditor& aEditor, TInt aServiceId); |
|
126 |
|
127 /** |
|
128 * Converts all the extensions in selection area from |
|
129 * strings to extensions. |
|
130 * @since 3.0 |
|
131 * @param aRichText Rich text to be converted |
|
132 * @param aSelection Selection area |
|
133 */ |
|
134 void ConvertSelectionToExtensionL( CRichText& aRichText, |
|
135 TCursorSelection& aSelection , |
|
136 TInt aServiceId ); |
|
137 |
|
138 /** |
|
139 * Converts all the extensions in selection area from |
|
140 * extensions to strings |
|
141 * @since 2.6 |
|
142 * @param aEditor, used editor |
|
143 * @param aPreserve, should we preserve original extension status. |
|
144 * Are they strings or extensions. |
|
145 */ |
|
146 void ConvertSelectionToStringL( CEikRichTextEditor& aEditor, |
|
147 TInt aServiceId, |
|
148 TBool aPreserve = EFalse ); |
|
149 |
|
150 /** |
|
151 * Informs the extensions about changed size |
|
152 * @param aSize |
|
153 * @since 3.0 |
|
154 */ |
|
155 void SizeChanged( TSize& aSize, TInt aServiceId ); |
|
156 |
|
157 /** |
|
158 * Converts all the extensions in selection area from |
|
159 * extensions to strings. |
|
160 * @since S60 v3.1 |
|
161 * @param aEditor Used editor. |
|
162 * @param aResultString Descriptor for converted string, |
|
163 * caller is responsible to provide |
|
164 * large enough descriptor. |
|
165 * @param aSelectionAfterConversion Cursor selection after |
|
166 * extensions are converted to strings. |
|
167 * @param aPreserve Should we preserve original extension status. |
|
168 */ |
|
169 void ConvertSelectionToStringL( |
|
170 CEikRichTextEditor& aEditor, |
|
171 TInt aServiceId, |
|
172 TDes& aResultString, |
|
173 TCursorSelection& aSelectionAfterConversion, |
|
174 TBool aPreserve ); |
|
175 |
|
176 /** |
|
177 * Insert extension to editor |
|
178 * @param aEditor Editor which contains message. |
|
179 * @param aType Type of extension needed. |
|
180 * @param aCancelled ETrue after method returns if |
|
181 * extension insertion was cancelled, |
|
182 * EFalse otherwise |
|
183 * @since 2.1 |
|
184 */ |
|
185 void InsertExtensionL( CEikRichTextEditor& aEditor, |
|
186 TInt aServiceId, |
|
187 TMessageExtensionTypes aType,TBool& aCancelled, TSize size ); |
|
188 |
|
189 private: |
|
190 // not owns |
|
191 MIMCVUiAppSkinVariant& iSkinVariant; |
|
192 // not owns |
|
193 MIMCVAppUi& iAppUi; |
|
194 // not owns |
|
195 MIMCVEngineFactory& iEngineFactory; |
|
196 // owned , Array of extensions |
|
197 RPointerArray<MIMCVAppMessageExtension> iExtensionArray; |
|
198 |
|
199 |
|
200 }; |
|
201 |
|
202 #endif // _CIMCVAPPMESSAGEEXTENSIONSHANDLER_H |
|
203 |
|
204 // End of File |