|
1 /* |
|
2 * Copyright (c) 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: SIMPLE data document |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef M_simpledocument_H |
|
22 #define M_simpledocument_H |
|
23 |
|
24 #include <e32std.h> |
|
25 #include <S32strm.h> |
|
26 #include <msimpleelement.h> |
|
27 |
|
28 // FORWARD DECLARATION |
|
29 class MSimpleNamespace; |
|
30 class MSimpleContent; |
|
31 |
|
32 |
|
33 /** |
|
34 * MSimpleDocument |
|
35 * |
|
36 * SIMPLE data document |
|
37 * |
|
38 * @lib simplexmlutils |
|
39 * @since S60 3.2 |
|
40 */ |
|
41 |
|
42 class MSimpleDocument : public MSimpleElement |
|
43 { |
|
44 |
|
45 public: |
|
46 |
|
47 /** |
|
48 * Entity's URI getter. URI is specified in a factory method |
|
49 * |
|
50 * @since S60 3.2 |
|
51 * @return URI, ownership is not transferred. |
|
52 */ |
|
53 virtual const TDesC8* EntityURI() = 0; |
|
54 |
|
55 /** |
|
56 * Entity's URI setter. |
|
57 * |
|
58 * @since S60 3.2 |
|
59 * @param aValue entity URI |
|
60 * @return URI |
|
61 */ |
|
62 virtual void SetEntityURIL( const TDesC8& aValue ) = 0; |
|
63 |
|
64 /** |
|
65 * Document's default namespace accessor. It is PIDF namespace. |
|
66 * |
|
67 * @since S60 3.2 |
|
68 * @return default namespace URI |
|
69 */ |
|
70 virtual TPtrC8 DefaultNamespace() = 0; |
|
71 |
|
72 /** |
|
73 * Add new newspace |
|
74 * |
|
75 * @since S60 3.2 |
|
76 * @param aPrefix: Namespace prefix |
|
77 * @param aUri: Namespace URI |
|
78 */ |
|
79 virtual void AddNamespaceL( const TDesC8& aPrefix, |
|
80 const TDesC8& aUri) = 0; |
|
81 |
|
82 /** |
|
83 * Gets all namespaces of this element in an array. |
|
84 * |
|
85 * @since S60 3.2 |
|
86 * @return array of namespaces. Array will be empty if element has |
|
87 * no namespaces. |
|
88 * Do NOT call ResetAndDestroy() for the array, |
|
89 * you may call Reset() only. The array is valid only till |
|
90 * the next call of this method in this entity. |
|
91 * AddNamespaceL() modifications are not visible without |
|
92 * new call of this method. |
|
93 */ |
|
94 virtual RPointerArray<MSimpleNamespace>& NamespacesL() = 0; |
|
95 |
|
96 /** |
|
97 * Externalize the document into write stream. |
|
98 * |
|
99 * @since S60 3.2 |
|
100 * @param aStream write stream |
|
101 */ |
|
102 virtual void ExternalizeL( RWriteStream& aStream ) = 0; |
|
103 |
|
104 /** |
|
105 * Get direct contents |
|
106 * @param aContents array of contents [out]. |
|
107 * This is walid till the AddDirectContentL method. |
|
108 */ |
|
109 virtual void GetDirectContentsL( |
|
110 RPointerArray<MSimpleContent>& aContents ) = 0; |
|
111 |
|
112 /** |
|
113 * Add content |
|
114 * @param aContent content, the data content is copied into document |
|
115 * @param aCopyContent ETrue if buffer of each content is copied or |
|
116 * ownership is transferred just without copy. |
|
117 */ |
|
118 virtual void AddDirectContentL( MSimpleContent& aContent, TBool aCopyContent ) = 0; |
|
119 |
|
120 |
|
121 }; |
|
122 |
|
123 #endif |
|
124 |
|
125 // End of File |