|
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: Implementation for the interface class CXnNewsticker. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <gulicon.h> |
|
20 |
|
21 #include "xnnewsticker.h" |
|
22 #include "xnnewstickeradapter.h" |
|
23 |
|
24 // ============================ MEMBER FUNCTIONS =============================== |
|
25 |
|
26 // ----------------------------------------------------------------------------- |
|
27 // CXnNewsticker::NewL |
|
28 // Symbian static 1st phase constructor |
|
29 // ----------------------------------------------------------------------------- |
|
30 // |
|
31 CXnNewsticker* CXnNewsticker::NewL() |
|
32 { |
|
33 CXnNewsticker* self = new(ELeave) CXnNewsticker; |
|
34 CleanupStack::PushL(self); |
|
35 self->ConstructL(); |
|
36 CleanupStack::Pop(); |
|
37 return self; |
|
38 } |
|
39 |
|
40 // ----------------------------------------------------------------------------- |
|
41 // CXnNewsticker::ConstructL |
|
42 // Symbian 2nd phase constructor can leave. |
|
43 // ----------------------------------------------------------------------------- |
|
44 // |
|
45 void CXnNewsticker::ConstructL() |
|
46 { |
|
47 CXnComponent::ConstructL(); |
|
48 } |
|
49 |
|
50 // ----------------------------------------------------------------------------- |
|
51 // CXnNewsticker::CXnNewsticker |
|
52 // C++ default constructor |
|
53 // ----------------------------------------------------------------------------- |
|
54 // |
|
55 CXnNewsticker::CXnNewsticker() |
|
56 { |
|
57 } |
|
58 |
|
59 // ----------------------------------------------------------------------------- |
|
60 // CXnNewsticker::~CXnNewsticker |
|
61 // C++ destructor |
|
62 // ----------------------------------------------------------------------------- |
|
63 // |
|
64 CXnNewsticker::~CXnNewsticker() |
|
65 { |
|
66 } |
|
67 |
|
68 |
|
69 // --------------------------------------------------------- |
|
70 // CXnNewsticker::AppendTitleL |
|
71 // --------------------------------------------------------- |
|
72 // |
|
73 void CXnNewsticker::AppendTitleL(const TDesC& aTitle) |
|
74 { |
|
75 (static_cast<CXnNewstickerAdapter*> |
|
76 (ControlAdapter()))->AppendTitleL(aTitle); |
|
77 } |
|
78 |
|
79 |
|
80 // --------------------------------------------------------- |
|
81 // CXnNewsticker::InsertTitleL |
|
82 // --------------------------------------------------------- |
|
83 // |
|
84 void CXnNewsticker::InsertTitleL(const TDesC& aTitle, TInt aIndex) |
|
85 { |
|
86 (static_cast<CXnNewstickerAdapter*> |
|
87 (ControlAdapter()))->InsertTitleL(aTitle, aIndex); |
|
88 } |
|
89 |
|
90 // --------------------------------------------------------- |
|
91 // CXnNewsticker::UpdateTitleL |
|
92 // --------------------------------------------------------- |
|
93 // |
|
94 void CXnNewsticker::UpdateTitleL(const TDesC& aTitle, TInt aIndex) |
|
95 { |
|
96 (static_cast<CXnNewstickerAdapter*> |
|
97 (ControlAdapter()))->UpdateTitleL(aTitle, aIndex); |
|
98 } |
|
99 |
|
100 |
|
101 // --------------------------------------------------------- |
|
102 // CXnNewsticker::DeleteTitle |
|
103 // --------------------------------------------------------- |
|
104 // |
|
105 void CXnNewsticker::DeleteTitle(TInt aIndex) |
|
106 { |
|
107 CXnNewstickerAdapter* adapter = |
|
108 static_cast<CXnNewstickerAdapter*>(ControlAdapter()); |
|
109 TRAP_IGNORE(adapter->DeleteTitleL(aIndex)); |
|
110 } |
|
111 |
|
112 |
|
113 // --------------------------------------------------------- |
|
114 // CXnNewsticker::CurrentTitleIndex |
|
115 // --------------------------------------------------------- |
|
116 // |
|
117 TInt CXnNewsticker::CurrentTitleIndex() |
|
118 { |
|
119 return (static_cast<CXnNewstickerAdapter*> |
|
120 (ControlAdapter()))->CurrentTitleIndex(); |
|
121 } |
|
122 |
|
123 |
|
124 // --------------------------------------------------------- |
|
125 // CXnNewsticker::Title |
|
126 // --------------------------------------------------------- |
|
127 // |
|
128 const TDesC& CXnNewsticker::Title(TInt aIndex) |
|
129 { |
|
130 return (static_cast<CXnNewstickerAdapter*> |
|
131 (ControlAdapter()))->Title(aIndex); |
|
132 } |
|
133 |
|
134 |
|
135 // --------------------------------------------------------- |
|
136 // CXnNewsticker::SetSeparatorImageL |
|
137 // --------------------------------------------------------- |
|
138 // |
|
139 TInt CXnNewsticker::SetSeparatorImageL(CGulIcon* aIcon) |
|
140 { |
|
141 return (static_cast<CXnNewstickerAdapter*> |
|
142 (ControlAdapter()))->SetSeparatorImageL(aIcon); |
|
143 } |
|
144 |
|
145 |
|
146 // --------------------------------------------------------- |
|
147 // CXnNewsticker::ClearTitles |
|
148 // --------------------------------------------------------- |
|
149 // |
|
150 void CXnNewsticker::ClearTitles() |
|
151 { |
|
152 (static_cast<CXnNewstickerAdapter*> |
|
153 (ControlAdapter()))->ClearTitles(); |
|
154 } |
|
155 |
|
156 |
|
157 // --------------------------------------------------------- |
|
158 // CXnNewsticker::AppendSvgTitleL |
|
159 // --------------------------------------------------------- |
|
160 // |
|
161 void CXnNewsticker::AppendSvgTitleL(const TDesC8& aByteData) |
|
162 { |
|
163 (static_cast<CXnNewstickerAdapter*> |
|
164 (ControlAdapter()))->AppendSvgTitleL(aByteData); |
|
165 } |
|
166 |
|
167 // --------------------------------------------------------- |
|
168 // CXnNewsticker::InsertSvgTitleL |
|
169 // --------------------------------------------------------- |
|
170 // |
|
171 void CXnNewsticker::InsertSvgTitleL(const TDesC8& aByteData, TInt aIndex) |
|
172 { |
|
173 (static_cast<CXnNewstickerAdapter*> |
|
174 (ControlAdapter()))->InsertSvgTitleL(aByteData, aIndex); |
|
175 } |
|
176 |
|
177 // --------------------------------------------------------- |
|
178 // CXnNewsticker::SetCallbackInterfaceL |
|
179 // --------------------------------------------------------- |
|
180 // |
|
181 void CXnNewsticker::SetCallbackInterfaceL( |
|
182 XnNewstickerInterface::MXnNewstickerCallbackInterface* aCallback) |
|
183 { |
|
184 (static_cast<CXnNewstickerAdapter*> |
|
185 (ControlAdapter()))->SetCallbackInterfaceL(aCallback); |
|
186 } |
|
187 |
|
188 // --------------------------------------------------------- |
|
189 // CXnNewsticker::MakeInterfaceL |
|
190 // --------------------------------------------------------- |
|
191 // |
|
192 XnComponentInterface::MXnComponentInterface* CXnNewsticker::MakeInterfaceL(const TDesC8& aType) |
|
193 { |
|
194 if (aType != XnNewstickerInterface::KType) |
|
195 { |
|
196 return NULL; |
|
197 } |
|
198 XnNewstickerInterface::MXnNewstickerInterface* newstickerintr = |
|
199 static_cast<XnNewstickerInterface::MXnNewstickerInterface*>(this); |
|
200 return newstickerintr; |
|
201 } |
|
202 |
|
203 // End of File |