|
1 /* |
|
2 * Copyright (c) 2002-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: Interface class for CXnNewsticker. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef _XNNEWSTICKER_H |
|
20 #define _XNNEWSTICKER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include "xncomponent.h" |
|
24 #include "mxncomponentinterface.h" |
|
25 |
|
26 class CGulIcon; |
|
27 |
|
28 // CLASS DECLARATION |
|
29 /** |
|
30 * Component UI factory interface for creating newsticker text element. |
|
31 * |
|
32 * @lib xnnewstickerfactory.dll |
|
33 * @since Series 60 3.2 |
|
34 */ |
|
35 namespace XnNewstickerInterface |
|
36 { |
|
37 _LIT8(KType, "newsticker"); |
|
38 |
|
39 class MXnNewstickerCallbackInterface |
|
40 { |
|
41 public: // New functions |
|
42 |
|
43 /** |
|
44 * Called when the title has been shown and is now offscreen. |
|
45 * @param aTitleIndex The title that has been completely shown. |
|
46 */ |
|
47 virtual void TitleScrolled(TInt aTitleIndex) = 0; |
|
48 |
|
49 }; |
|
50 |
|
51 class MXnNewstickerInterface : public XnComponentInterface::MXnComponentInterface |
|
52 { |
|
53 public: // New functions |
|
54 |
|
55 static inline const TDesC8& Type() |
|
56 { |
|
57 return KType; |
|
58 } |
|
59 |
|
60 /** |
|
61 * Append new title to the end of the title list. |
|
62 * @param aTitle The new title to add. |
|
63 */ |
|
64 virtual void AppendTitleL(const TDesC& aTitle) = 0; |
|
65 |
|
66 /** |
|
67 * Insert new title to the end of the title list. |
|
68 * @param aTitle The new title to add. |
|
69 * @param aIndex The place to add the title. |
|
70 */ |
|
71 virtual void InsertTitleL(const TDesC& aTitle, TInt aIndex) = 0; |
|
72 |
|
73 /** |
|
74 * Update title text. |
|
75 * @param aTitle The new title to add. |
|
76 * @param aIndex The place to update the title. |
|
77 */ |
|
78 virtual void UpdateTitleL(const TDesC& aTitle, TInt aIndex) = 0; |
|
79 |
|
80 /** |
|
81 * Delete the title. |
|
82 * @param aIndex The title index to delete. |
|
83 */ |
|
84 virtual void DeleteTitle(TInt aIndex) = 0; |
|
85 |
|
86 /** |
|
87 * Returns index of the currently selected title. |
|
88 * @return The index of the current title. |
|
89 */ |
|
90 virtual TInt CurrentTitleIndex() = 0; |
|
91 |
|
92 /** |
|
93 * Return the title of the given index. |
|
94 * @param aIndex The index to return the title. |
|
95 * @return The title of the given index. |
|
96 */ |
|
97 virtual const TDesC& Title(TInt aIndex) = 0; |
|
98 |
|
99 /** |
|
100 * Set the separator image for all titles. |
|
101 * @param aIcon The separator image. This must be mif icon. |
|
102 * @return KErrNone if successful, KErrArgument if the icon is not mif. |
|
103 */ |
|
104 virtual TInt SetSeparatorImageL(CGulIcon* aIcon) = 0; |
|
105 |
|
106 /** |
|
107 * Delete all titles. |
|
108 */ |
|
109 virtual void ClearTitles() = 0; |
|
110 |
|
111 /** |
|
112 * Append the SVG title to be shown. |
|
113 * @param aByteData The SVG data. |
|
114 */ |
|
115 virtual void AppendSvgTitleL(const TDesC8& aByteData) = 0; |
|
116 |
|
117 /** |
|
118 * Insert the SVG title to be shown. |
|
119 * @param aByteData The SVG data. |
|
120 */ |
|
121 virtual void InsertSvgTitleL(const TDesC8& aByteData, TInt aIndex) = 0; |
|
122 |
|
123 /** |
|
124 * Set callback interface. |
|
125 * @param aCallback The callback interface pointer. |
|
126 */ |
|
127 virtual void SetCallbackInterfaceL(MXnNewstickerCallbackInterface* aCallback) = 0; |
|
128 }; |
|
129 } |
|
130 |
|
131 /** |
|
132 * @ingroup group_xnnewstickerfactory |
|
133 * |
|
134 * Newsticker class implementation. |
|
135 * |
|
136 * @lib xnnewstickerfactory.dll |
|
137 * @since Series 60 3.2 |
|
138 */ |
|
139 class CXnNewsticker : public CXnComponent, public XnNewstickerInterface::MXnNewstickerInterface |
|
140 { |
|
141 public: |
|
142 /** |
|
143 * 2 phase construction. |
|
144 */ |
|
145 static CXnNewsticker* NewL(); |
|
146 |
|
147 /** |
|
148 * Destructor. |
|
149 */ |
|
150 virtual ~CXnNewsticker(); |
|
151 |
|
152 public: |
|
153 // Routed from MXnNewstickerInterface. |
|
154 |
|
155 /** |
|
156 * Append new title to the end of the title list. |
|
157 * @param aTitle The new title to add. |
|
158 */ |
|
159 void AppendTitleL(const TDesC& aTitle); |
|
160 |
|
161 /** |
|
162 * Insert new title to the end of the title list. |
|
163 * @param aTitle The new title to add. |
|
164 * @param aIndex The place to add the title. |
|
165 */ |
|
166 void InsertTitleL(const TDesC& aTitle, TInt aIndex); |
|
167 |
|
168 /** |
|
169 * Update title text. |
|
170 * @param aTitle The new title to add. |
|
171 * @param aIndex The place to update the title. |
|
172 */ |
|
173 void UpdateTitleL(const TDesC& aTitle, TInt aIndex); |
|
174 |
|
175 /** |
|
176 * Delete the title. |
|
177 * @param aIndex The title index to delete. |
|
178 */ |
|
179 void DeleteTitle(TInt aIndex); |
|
180 |
|
181 /** |
|
182 * Returns index of the currently selected title. |
|
183 * @return The index of the current title. |
|
184 */ |
|
185 TInt CurrentTitleIndex(); |
|
186 |
|
187 /** |
|
188 * Return the title of the given index. |
|
189 * @param aIndex The index to return the title. |
|
190 * @return The title of the given index. |
|
191 */ |
|
192 const TDesC& Title(TInt aIndex); |
|
193 |
|
194 /** |
|
195 * Set the separator image for all titles. |
|
196 * @param aIcon The separator image. This must be mif icon. |
|
197 * @return KErrNone if successful, KErrArgument if the icon is not mif. |
|
198 */ |
|
199 TInt SetSeparatorImageL(CGulIcon* aIcon); |
|
200 |
|
201 /** |
|
202 * Delete all titles. |
|
203 */ |
|
204 void ClearTitles(); |
|
205 |
|
206 /** |
|
207 * Append the SVG title to be shown. |
|
208 * @param aByteData The SVG data. |
|
209 */ |
|
210 void AppendSvgTitleL(const TDesC8& aByteData); |
|
211 |
|
212 /** |
|
213 * Insert the SVG title to be shown. |
|
214 * @param aByteData The SVG data. |
|
215 */ |
|
216 void InsertSvgTitleL(const TDesC8& aByteData, TInt aIndex); |
|
217 |
|
218 /** |
|
219 * Set callback interface. |
|
220 * @param aCallback The callback interface pointer. |
|
221 */ |
|
222 void SetCallbackInterfaceL( |
|
223 XnNewstickerInterface::MXnNewstickerCallbackInterface* aCallback); |
|
224 |
|
225 /** |
|
226 * Create a component interface according to the given type. |
|
227 * @param aType Type of the interface to create |
|
228 * @return Created interface or NULL if the provided type is not supported. |
|
229 */ |
|
230 virtual XnComponentInterface::MXnComponentInterface* MakeInterfaceL( |
|
231 const TDesC8& aType); |
|
232 |
|
233 private: |
|
234 |
|
235 CXnNewsticker(); |
|
236 |
|
237 void ConstructL(); |
|
238 }; |
|
239 |
|
240 |
|
241 #endif // _XNNEWSTICKER_H |
|
242 |
|
243 // End of File |