34
|
1 |
/*
|
|
2 |
* Copyright (c) 2005,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: Represent single xmluiml attribute
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
#ifndef XN_DOM_ATTRIBUTE_H
|
|
21 |
#define XN_DOM_ATTRIBUTE_H
|
|
22 |
|
|
23 |
// INCLUDES
|
|
24 |
#include <e32base.h>
|
|
25 |
#include <s32strm.h>
|
|
26 |
#include "mxndomlistitem.h"
|
|
27 |
|
|
28 |
//CLASS FORWARD
|
|
29 |
|
|
30 |
class CXnDomStringPool;
|
|
31 |
|
|
32 |
// CLASS DECLARATION
|
|
33 |
|
|
34 |
/**
|
|
35 |
* @ingroup group_domdocument
|
|
36 |
* Represent attribute name and value as strings.
|
|
37 |
*
|
|
38 |
* @lib xndomdocument.lib
|
|
39 |
* @since Series 60 3.1
|
|
40 |
*/
|
|
41 |
class CXnDomAttribute : public CBase, public MXnDomListItem
|
|
42 |
{
|
|
43 |
public: // Constructors and destructor
|
|
44 |
|
|
45 |
/**
|
|
46 |
* Two-phased constructor 8 bit.
|
|
47 |
*/
|
|
48 |
IMPORT_C static CXnDomAttribute* NewL(
|
|
49 |
const TDesC8& aName,
|
|
50 |
CXnDomStringPool* aStringPool );
|
|
51 |
|
|
52 |
/**
|
|
53 |
* Two-phased stream constructor.
|
|
54 |
*/
|
|
55 |
static CXnDomAttribute* NewL(
|
|
56 |
RReadStream& aStream,
|
|
57 |
CXnDomStringPool* aStringPool );
|
|
58 |
/**
|
|
59 |
* Destructor.
|
|
60 |
*/
|
|
61 |
IMPORT_C virtual ~CXnDomAttribute();
|
|
62 |
|
|
63 |
public: // New functions
|
|
64 |
/**
|
|
65 |
* Makes a copy from original attribute.
|
|
66 |
* @since Series 60 3.1
|
|
67 |
* @return Pointer to attribute. Attribute ownership is transferred to a caller
|
|
68 |
*/
|
|
69 |
IMPORT_C CXnDomAttribute* CloneL();
|
|
70 |
|
|
71 |
/**
|
|
72 |
* Makes a copy from original property.
|
|
73 |
* @since Series 60 3.1
|
|
74 |
* @param Original string pool clone.
|
|
75 |
* @return Pointer to an attribute. Ownership is transferred to a caller.
|
|
76 |
*/
|
|
77 |
CXnDomAttribute* CloneL( CXnDomStringPool& aStringPool );
|
|
78 |
|
|
79 |
/**
|
|
80 |
* Get the attribute value.
|
|
81 |
* @since Series 60 3.1
|
|
82 |
* @return Pointer to a attribute value string. If value is not set KNullDesC8 is returned.
|
|
83 |
*/
|
|
84 |
IMPORT_C const TDesC8& Value();
|
|
85 |
|
|
86 |
/**
|
|
87 |
* Set attribute value.
|
|
88 |
* @since Series 60 3.1
|
|
89 |
* @param aValue Attribute string value
|
|
90 |
*/
|
|
91 |
IMPORT_C void SetValueL( const TDesC8& aValue );
|
|
92 |
|
|
93 |
/**
|
|
94 |
* Get the attributes name string pool index.
|
|
95 |
* @since Series 60 3.1
|
|
96 |
* @return String pool index.
|
|
97 |
*/
|
|
98 |
IMPORT_C TInt16 NameStringPoolIndex()const;
|
|
99 |
|
|
100 |
/**
|
|
101 |
* Get the attributes value string pool index.
|
|
102 |
* @since Series 60 3.1
|
|
103 |
* @return String pool index.
|
|
104 |
*/
|
|
105 |
IMPORT_C TInt16 ValueStringPoolIndex()const;
|
|
106 |
|
|
107 |
/**
|
|
108 |
* Swap used string pool.
|
|
109 |
*
|
|
110 |
* @param aStringPool New string pool to be used.
|
|
111 |
* Ownership not transferred!
|
|
112 |
*/
|
|
113 |
IMPORT_C void SwapStringPoolL( CXnDomStringPool* aStringPool );
|
|
114 |
|
|
115 |
public: //From CXnDomListItem
|
|
116 |
|
|
117 |
/**
|
|
118 |
* Documented in CXnDomListItem::Size
|
|
119 |
*/
|
|
120 |
IMPORT_C const TDesC8& Name();
|
|
121 |
|
|
122 |
|
|
123 |
/**
|
|
124 |
* Documented in CXnDomListItem::Size
|
|
125 |
*/
|
|
126 |
TInt Size() const;
|
|
127 |
|
|
128 |
/**
|
|
129 |
* Documented in CXnDomListItem::Size
|
|
130 |
*/
|
|
131 |
void ExternalizeL( RWriteStream& aStream ) const;
|
|
132 |
|
|
133 |
/**
|
|
134 |
* Internalize property.
|
|
135 |
* @since Series 60 3.1
|
|
136 |
* @param aStream Input stream
|
|
137 |
*/
|
|
138 |
void InternalizeL( RReadStream& aStream );
|
|
139 |
private:
|
|
140 |
|
|
141 |
/**
|
|
142 |
* C++ default constructor.
|
|
143 |
*/
|
|
144 |
CXnDomAttribute( CXnDomStringPool* aStringPool );
|
|
145 |
|
|
146 |
/**
|
|
147 |
* By default Symbian 2nd phase constructor is private.
|
|
148 |
*/
|
|
149 |
void ConstructL( const TDesC8& aName );
|
|
150 |
|
|
151 |
|
|
152 |
private: // Data
|
|
153 |
//String pool to get string for references, not owned
|
|
154 |
CXnDomStringPool* iStringPool;
|
|
155 |
|
|
156 |
//Attribute name reference
|
|
157 |
TInt16 iNameRef;
|
|
158 |
|
|
159 |
//Attribute value reference
|
|
160 |
TInt16 iValueRef;
|
|
161 |
|
|
162 |
};
|
|
163 |
|
|
164 |
#endif // XN_DOM_ATTRIBUTE_H
|
|
165 |
|
|
166 |
// End of File
|