|
1 /* |
|
2 * Copyright (c) 2005 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 the License "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: Translates CFolderItems back to opml. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef OPML_WRITER_H |
|
20 #define OPML_WRITER_H |
|
21 |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <f32file.h> |
|
26 #include <libxml2_parser.h> |
|
27 #include <libxml2_encoding.h> |
|
28 #include "libxml2_xmlwriter.h" |
|
29 |
|
30 #include "FeedsDatabase.h" |
|
31 #include "CleanupLibXml2.h" |
|
32 #include "XmlUtils.h" |
|
33 |
|
34 |
|
35 |
|
36 // CONSTANTS |
|
37 |
|
38 // MACROS |
|
39 |
|
40 // DATA TYPES |
|
41 |
|
42 // FUNCTION PROTOTYPES |
|
43 |
|
44 // FORWARD DECLARATIONS |
|
45 |
|
46 // CLASS DECLARATION |
|
47 |
|
48 |
|
49 /** |
|
50 * Translates CFolderItems back to opml. |
|
51 * |
|
52 * \b Library: FeedsEngine.lib |
|
53 * |
|
54 * @since 3.0 |
|
55 */ |
|
56 class OpmlWriter |
|
57 { |
|
58 public: // New Methods |
|
59 /** |
|
60 * Writes the Folder Items (as opml) to the given file -- using utf-8 |
|
61 * for the char-encoding. |
|
62 * |
|
63 * @since 3.2 |
|
64 * @param aFolderItemIDs The array of aFolderItemIDs |
|
65 * @param aExportFileName The file the folder-item will be written to. aFile |
|
66 * must be opened prior to making this call. |
|
67 * @return void |
|
68 */ |
|
69 static void ExportL(RArray<TInt> &aFolderItemIDs, const TDesC& aExportFileName); |
|
70 |
|
71 private: |
|
72 /** |
|
73 * Writes the FolderItem and all of its child to the given file. |
|
74 * |
|
75 * @since 3.0 |
|
76 * @param aWriter The xml writer into which the folder is written into. |
|
77 * @param aFolderItemId The folder item id which has to be written. |
|
78 * @param aFeedsDatabase The Feeds Database where all the feelds/folders are stored. |
|
79 * @return void |
|
80 */ |
|
81 static void WriteFolderItemL(xmlTextWriterPtr aWriter, TInt aFolderItemId, CFeedsDatabase &aFeedsDatabase); |
|
82 |
|
83 /** |
|
84 * Writes out a attribute. |
|
85 * |
|
86 * @since 3.0 |
|
87 * @param aWriter The writer the folder is written into. |
|
88 * @param aName The name of the attribute. |
|
89 * @param aValue The value of the attribute. |
|
90 * @return void |
|
91 */ |
|
92 static void WriteAttributeL(xmlTextWriterPtr aWriter, const TDesC8& aName, |
|
93 const TDesC& aValue); |
|
94 }; |
|
95 |
|
96 #endif // OPML_WRITER_H |
|
97 |
|
98 // End of File |