|
1 /* |
|
2 * Copyright (c) 2009 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: Header declaration |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 #ifndef SENATOMFEED_H_ |
|
24 #define SENATOMFEED_H_ |
|
25 |
|
26 /** |
|
27 * Provides object and methods to manipulate <feed> tag from atom-pub API. |
|
28 * |
|
29 * @lib SenMessages.DLL |
|
30 * @since 5.0 |
|
31 */ |
|
32 |
|
33 |
|
34 |
|
35 // INCLUDES |
|
36 #include <e32base.h> |
|
37 #include <e32cmn.h> |
|
38 |
|
39 #include "senatommessage.h" |
|
40 |
|
41 |
|
42 class CSenAtomEntry; |
|
43 class CDesC16ArrayFlat; |
|
44 |
|
45 |
|
46 // CLASS DECLARATION |
|
47 |
|
48 |
|
49 class CSenAtomFeed : public CSenAtomMessage |
|
50 { |
|
51 public: |
|
52 // Constructors and destructor |
|
53 |
|
54 /** |
|
55 * Two-phased constructor. |
|
56 */ |
|
57 IMPORT_C static CSenAtomFeed* NewL(TInt64 aId = 0); |
|
58 |
|
59 /** |
|
60 * Two-phased constructor. |
|
61 */ |
|
62 IMPORT_C static CSenAtomFeed* NewLC(TInt64 aId = 0); |
|
63 |
|
64 /** |
|
65 * Destructor. |
|
66 */ |
|
67 IMPORT_C ~CSenAtomFeed(); |
|
68 |
|
69 /* |
|
70 * Method returns count of entries in the feed. |
|
71 * @return - number of tries |
|
72 * |
|
73 */ |
|
74 IMPORT_C TInt EntryCount() ;//const; |
|
75 |
|
76 /* |
|
77 * Method returns an entry at specified index from the feed. Index is made from inserting order or from order in the feed xml |
|
78 * in case of parsing. |
|
79 * @param aIndex - index of returned entry |
|
80 * @return - entry at index position |
|
81 */ |
|
82 IMPORT_C CSenAtomEntry* Entry( TInt aIndex ) const; |
|
83 |
|
84 /* |
|
85 * Method adds the entry to the feed. |
|
86 * @param aEntry - entry to insert |
|
87 * @return - error code |
|
88 */ |
|
89 IMPORT_C TInt AddEntryL(CSenAtomEntry& aEntry); |
|
90 |
|
91 /* |
|
92 * Method removes from the feed an entry with 'id' tag specified as @aEntryId parameter. |
|
93 * @param aEntryId - id of an entry to remove |
|
94 */ |
|
95 IMPORT_C void RemoveEntryL( const TDesC8& aEntryId ); |
|
96 |
|
97 /* |
|
98 * Method removes from the feed first entry specified as @aEntry parameter. Distincion is made basing on 'id' tag of an entry. |
|
99 * @param aEntry - entry to remove |
|
100 */ |
|
101 IMPORT_C void RemoveEntryL( CSenAtomEntry& aEntry); |
|
102 |
|
103 /* |
|
104 * Method returns content of "subtitle" tag. |
|
105 * @return - descriptor containing value of subtitle. |
|
106 */ |
|
107 IMPORT_C const TDesC8& SubtitleL(); |
|
108 |
|
109 /* |
|
110 * Method sets content of "subtitle" tag |
|
111 * @param aSubtitle - descriptor that contains value of subtitle. |
|
112 */ |
|
113 IMPORT_C void SetSubtitleL( const TDesC8& aTitle ); |
|
114 |
|
115 /* |
|
116 * Method sets content of "icon" tag |
|
117 * @param aUri - descriptor that contains value of icon's uri. |
|
118 */ |
|
119 IMPORT_C void SetIconL( const TDesC8& aUri); |
|
120 |
|
121 /* |
|
122 * Method returns content of "icon" tag. |
|
123 * @return - descriptor containing value of icon's uri. |
|
124 */ |
|
125 IMPORT_C const TDesC8& IconL(); |
|
126 |
|
127 /* |
|
128 * Method sets content of "logo" tag |
|
129 * @param aUri - descriptor that contains value of logo tag. |
|
130 */ |
|
131 IMPORT_C void SetLogoL( const TDesC8& logo); |
|
132 |
|
133 /* |
|
134 * Method returns content of "logo" tag. |
|
135 * @return - descriptor containing value of logo. |
|
136 */ |
|
137 IMPORT_C const TDesC8& LogoL(); |
|
138 |
|
139 /* |
|
140 * Method returns whole content of "generator" tag as TXmlEngElement. |
|
141 * @return - generator tag as TXmlEngElement |
|
142 */ |
|
143 IMPORT_C TXmlEngElement GetGeneratorL(); |
|
144 |
|
145 /* |
|
146 * Method sets content of "generator" tag. Provided parameters correspond in name with subtags of the tag. |
|
147 * @param aUri - uri value |
|
148 * @param aVersion - version value |
|
149 * @param aText - text value |
|
150 */ |
|
151 IMPORT_C void SetGeneratorL( const TDesC8& aUri, const TDesC8& aVersion, const TDesC8& aText); |
|
152 |
|
153 |
|
154 //CALLBACK |
|
155 IMPORT_C virtual void OnStartElementL(const RTagInfo& aElement, |
|
156 const RAttributeArray& aAttributes, |
|
157 TInt aErrorCode); |
|
158 //CALLBACK |
|
159 IMPORT_C virtual void OnEndElementL(const RTagInfo& aElement, |
|
160 TInt aErrorCode); |
|
161 //CALLBACK |
|
162 IMPORT_C virtual void OnContentL(const TDesC8& aBytes, TInt aErrorCode); |
|
163 |
|
164 |
|
165 protected: |
|
166 |
|
167 IMPORT_C CSenAtomFeed(); |
|
168 IMPORT_C void BaseConstructL(); |
|
169 IMPORT_C void ParseEntryL(const RTagInfo& aElement, const RAttributeArray& aAttributes); |
|
170 |
|
171 protected: // Data |
|
172 CSenFragmentBase* ipEntryFragment; |
|
173 RPointerArray<CSenAtomEntry> iEntries; |
|
174 CSenAtomEntry* iEntry; |
|
175 TXmlEngElement* ipGroupFragment; |
|
176 |
|
177 }; |
|
178 #endif /*SENATOMFEED_H_*/ |