13 * |
13 * |
14 * Description: |
14 * Description: |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 |
18 // System includes |
19 #include <aipropertyextension.h> |
19 |
|
20 // User includes |
|
21 #include <hscontentpublisher.h> |
|
22 #include <hspublisherinfo.h> |
|
23 |
20 #include "ainativerenderer.h" |
24 #include "ainativerenderer.h" |
21 #include "ainativeuiplugins.h" |
25 #include "ainativeuiplugins.h" |
22 |
26 |
23 using namespace AiNativeUiController; |
27 using namespace AiNativeUiController; |
24 |
28 |
25 |
29 // ======== MEMBER FUNCTIONS ======== |
|
30 // ---------------------------------------------------------------------------- |
|
31 // CAiNativeRenderer::CAiNativeRenderer() |
|
32 // |
|
33 // ---------------------------------------------------------------------------- |
|
34 // |
26 CAiNativeRenderer::~CAiNativeRenderer() |
35 CAiNativeRenderer::~CAiNativeRenderer() |
27 { |
36 { |
28 } |
37 } |
29 |
38 |
30 |
39 // ---------------------------------------------------------------------------- |
31 TInt CAiNativeRenderer::Publish( MAiPropertyExtension& aPlugin, TInt aContent, |
40 // CAiNativeRenderer::Publish() |
32 TInt aResource, TInt aIndex ) |
41 // |
|
42 // ---------------------------------------------------------------------------- |
|
43 // |
|
44 TInt CAiNativeRenderer::Publish( CHsContentPublisher& aPlugin, TInt aContent, |
|
45 TInt aResource, TInt aIndex ) |
33 { |
46 { |
34 TRAPD( err, DoMimeTypeCheckL( aPlugin, aContent ) ); |
47 TRAPD( err, DoMimeTypeCheckL( aPlugin, aContent ) ); |
35 |
48 |
36 if( err != KErrNone ) |
49 if( err != KErrNone ) |
37 { |
50 { |
38 return err; |
51 return err; |
39 } |
52 } |
40 |
53 |
41 TRAP( err, DoPublishL( aPlugin, aContent, aResource, aIndex ) ); |
54 TRAP( err, DoPublishL( aPlugin, aContent, aResource, aIndex ) ); |
42 return err; |
55 |
43 } |
56 return err; |
44 |
57 } |
45 |
58 |
46 TInt CAiNativeRenderer::Publish( MAiPropertyExtension& aPlugin, TInt aContent, |
59 // ---------------------------------------------------------------------------- |
47 const TDesC16& aText, TInt aIndex ) |
60 // CAiNativeRenderer::Publish() |
|
61 // |
|
62 // ---------------------------------------------------------------------------- |
|
63 // |
|
64 TInt CAiNativeRenderer::Publish( CHsContentPublisher& aPlugin, TInt aContent, |
|
65 const TDesC16& aText, TInt aIndex ) |
48 { |
66 { |
49 TRAPD( err, DoMimeTypeCheckL( aPlugin, aContent ) ); |
67 TRAPD( err, DoMimeTypeCheckL( aPlugin, aContent ) ); |
50 |
68 |
51 if( err != KErrNone ) |
69 if( err != KErrNone ) |
52 { |
70 { |
53 return err; |
71 return err; |
54 } |
72 } |
55 |
73 |
56 TRAP( err, DoPublishL( aPlugin, aContent, aText, aIndex ) ); |
74 TRAP( err, DoPublishL( aPlugin, aContent, aText, aIndex ) ); |
57 return err; |
75 |
58 } |
76 return err; |
59 |
77 } |
60 |
78 |
61 TInt CAiNativeRenderer::Publish( MAiPropertyExtension& aPlugin, TInt aContent, |
79 // ---------------------------------------------------------------------------- |
62 const TDesC8& aBuf, TInt aIndex ) |
80 // CAiNativeRenderer::Publish() |
|
81 // |
|
82 // ---------------------------------------------------------------------------- |
|
83 // |
|
84 TInt CAiNativeRenderer::Publish( CHsContentPublisher& aPlugin, TInt aContent, |
|
85 const TDesC8& aBuf, TInt aIndex ) |
63 { |
86 { |
64 TRAPD( err, DoMimeTypeCheckL( aPlugin, aContent ) ); |
87 TRAPD( err, DoMimeTypeCheckL( aPlugin, aContent ) ); |
65 |
88 |
66 if( err != KErrNone ) |
89 if( err != KErrNone ) |
67 { |
90 { |
68 return err; |
91 return err; |
69 } |
92 } |
70 |
93 |
71 TRAP( err, DoPublishL( aPlugin, aContent, aBuf, aIndex ) ); |
94 TRAP( err, DoPublishL( aPlugin, aContent, aBuf, aIndex ) ); |
72 return err; |
95 |
73 } |
96 return err; |
74 |
97 } |
75 |
98 |
76 TInt CAiNativeRenderer::Publish( MAiPropertyExtension& aPlugin, TInt aContent, |
99 // ---------------------------------------------------------------------------- |
77 RFile& aFile, TInt aIndex ) |
100 // CAiNativeRenderer::Publish() |
|
101 // |
|
102 // ---------------------------------------------------------------------------- |
|
103 // |
|
104 TInt CAiNativeRenderer::Publish( CHsContentPublisher& aPlugin, TInt aContent, |
|
105 RFile& aFile, TInt aIndex ) |
78 { |
106 { |
79 TRAPD( err, DoMimeTypeCheckL( aPlugin, aContent ) ); |
107 TRAPD( err, DoMimeTypeCheckL( aPlugin, aContent ) ); |
80 |
108 |
81 if( err != KErrNone ) |
109 if( err != KErrNone ) |
82 { |
110 { |
83 return err; |
111 return err; |
84 } |
112 } |
85 |
113 |
86 TRAP( err, DoPublishL( aPlugin, aContent, aFile, aIndex ) ); |
114 TRAP( err, DoPublishL( aPlugin, aContent, aFile, aIndex ) ); |
87 return err; |
115 |
88 } |
116 return err; |
89 |
117 } |
90 |
118 |
91 TInt CAiNativeRenderer::Clean( MAiPropertyExtension& aPlugin, TInt aContent ) |
119 // ---------------------------------------------------------------------------- |
|
120 // CAiNativeRenderer::Clean() |
|
121 // |
|
122 // ---------------------------------------------------------------------------- |
|
123 // |
|
124 TInt CAiNativeRenderer::Clean( CHsContentPublisher& aPlugin, TInt aContent ) |
92 { |
125 { |
93 TRAPD( err, DoMimeTypeCheckL( aPlugin, aContent ) ); |
126 TRAPD( err, DoMimeTypeCheckL( aPlugin, aContent ) ); |
94 |
127 |
95 if( err != KErrNone ) |
128 if( err != KErrNone ) |
96 { |
129 { |
97 return err; |
130 return err; |
98 } |
131 } |
99 |
132 |
100 TRAP( err, DoCleanL( aPlugin, aContent ) ); |
133 TRAP( err, DoCleanL( aPlugin, aContent ) ); |
101 return err; |
134 |
102 } |
135 return err; |
103 |
136 } |
104 |
137 |
105 void CAiNativeRenderer::DoPublishL |
138 // ---------------------------------------------------------------------------- |
106 ( MAiPropertyExtension& /*aPlugin*/, TInt /*aContent*/, TInt /*aResource*/, TInt /*aIndex*/ ) |
139 // CAiNativeRenderer::DoPublishL() |
|
140 // |
|
141 // ---------------------------------------------------------------------------- |
|
142 // |
|
143 void CAiNativeRenderer::DoPublishL( CHsContentPublisher& /*aPlugin*/, |
|
144 TInt /*aContent*/, TInt /*aResource*/, TInt /*aIndex*/ ) |
107 { |
145 { |
108 // Default implementation, overridden in subclass if needed. |
146 // Default implementation, overridden in subclass if needed. |
109 User::Leave( KErrNotFound ); |
147 User::Leave( KErrNotFound ); |
110 } |
148 } |
111 |
149 |
112 |
150 // ---------------------------------------------------------------------------- |
113 void CAiNativeRenderer::DoPublishL |
151 // CAiNativeRenderer::DoPublishL() |
114 ( MAiPropertyExtension& /*aPlugin*/, TInt /*aContent*/, const TDesC16& /*aText*/, TInt /*aIndex*/ ) |
152 // |
115 { |
153 // ---------------------------------------------------------------------------- |
116 // Default implementation, overridden in subclass if needed. |
154 // |
117 User::Leave( KErrNotFound ); |
155 void CAiNativeRenderer::DoPublishL( CHsContentPublisher& /*aPlugin*/, |
118 } |
156 TInt /*aContent*/, const TDesC16& /*aText*/, TInt /*aIndex*/ ) |
119 |
157 { |
120 |
158 // Default implementation, overridden in subclass if needed. |
121 void CAiNativeRenderer::DoPublishL |
159 User::Leave( KErrNotFound ); |
122 ( MAiPropertyExtension& /*aPlugin*/, TInt /*aContent*/, const TDesC8& /*aBuf*/, TInt /*aIndex*/ ) |
160 } |
123 { |
161 |
124 // Default implementation, overridden in subclass if needed. |
162 // ---------------------------------------------------------------------------- |
125 User::Leave( KErrNotFound ); |
163 // CAiNativeRenderer::DoPublishL() |
126 } |
164 // |
127 |
165 // ---------------------------------------------------------------------------- |
128 |
166 // |
129 void CAiNativeRenderer::DoPublishL |
167 void CAiNativeRenderer::DoPublishL( CHsContentPublisher& /*aPlugin*/, |
130 ( MAiPropertyExtension& /*aPlugin*/, TInt /*aContent*/, RFile& /*aFile*/, TInt /*aIndex*/ ) |
168 TInt /*aContent*/, const TDesC8& /*aBuf*/, TInt /*aIndex*/ ) |
131 { |
169 { |
132 // Default implementation, overridden in subclass if needed. |
170 // Default implementation, overridden in subclass if needed. |
133 User::Leave( KErrNotFound ); |
171 User::Leave( KErrNotFound ); |
134 } |
172 } |
135 |
173 |
136 |
174 // ---------------------------------------------------------------------------- |
137 void CAiNativeRenderer::DoCleanL |
175 // CAiNativeRenderer::DoPublishL() |
138 ( MAiPropertyExtension& /*aPlugin*/, TInt /*aContent*/ ) |
176 // |
139 { |
177 // ---------------------------------------------------------------------------- |
140 // Default implementation, overridden in subclass if needed. |
178 // |
141 User::Leave( KErrNotFound ); |
179 void CAiNativeRenderer::DoPublishL( CHsContentPublisher& /*aPlugin*/, |
142 } |
180 TInt /*aContent*/, RFile& /*aFile*/, TInt /*aIndex*/ ) |
143 |
181 { |
144 |
182 // Default implementation, overridden in subclass if needed. |
|
183 User::Leave( KErrNotFound ); |
|
184 } |
|
185 |
|
186 // ---------------------------------------------------------------------------- |
|
187 // CAiNativeRenderer::DoCleanL() |
|
188 // |
|
189 // ---------------------------------------------------------------------------- |
|
190 // |
|
191 void CAiNativeRenderer::DoCleanL( CHsContentPublisher& /*aPlugin*/, |
|
192 TInt /*aContent*/ ) |
|
193 { |
|
194 // Default implementation, overridden in subclass if needed. |
|
195 User::Leave( KErrNotFound ); |
|
196 } |
|
197 |
|
198 // ---------------------------------------------------------------------------- |
|
199 // CAiNativeRenderer::GetIntContentId() |
|
200 // |
|
201 // ---------------------------------------------------------------------------- |
|
202 // |
145 TInt CAiNativeRenderer::GetIntContentId( const TDesC& aCid ) const |
203 TInt CAiNativeRenderer::GetIntContentId( const TDesC& aCid ) const |
146 { |
204 { |
147 for( TInt i( 0 ); i < KAiDeviceStatusContentCount; i++ ) |
205 for( TInt i( 0 ); i < KAiDeviceStatusContentCount; i++ ) |
148 { |
206 { |
149 const TAiContentItem& item = KAiDeviceStatusContent[i]; |
207 const TAiContentItem& item = KAiDeviceStatusContent[i]; |