1 /* |
|
2 * Copyright (c) 2002 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: |
|
15 * This class encapsulates a name and value pair. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef _CWPNameValue_H_ |
|
22 #define _CWPNameValue_H_ |
|
23 |
|
24 // INCLUDES |
|
25 |
|
26 #include <e32base.h> // CBase |
|
27 |
|
28 // CLASS DECLARATION |
|
29 |
|
30 /** |
|
31 * Class holds name and value text pairs. |
|
32 */ |
|
33 class CWPNameValue : public CBase |
|
34 { |
|
35 public: // construction |
|
36 |
|
37 /** |
|
38 * Two phased constructor. |
|
39 * @param aName The field name. |
|
40 * @param aValue The field value. |
|
41 * @return The newly constructed object. |
|
42 */ |
|
43 IMPORT_C static CWPNameValue* NewL( HBufC* aName, HBufC* aValue ); |
|
44 IMPORT_C static CWPNameValue* NewL(const TDesC& aName, const TDesC& aValue); |
|
45 IMPORT_C static CWPNameValue* NewLC(const TDesC& aName, const TDesC& aValue); |
|
46 |
|
47 /// Destructor |
|
48 ~CWPNameValue(); |
|
49 |
|
50 public: // new functions |
|
51 |
|
52 /// @return Name or KNullDesC |
|
53 IMPORT_C const TDesC& Name() const; |
|
54 /// @return Value or KNullDesC |
|
55 IMPORT_C const TDesC& Value() const; |
|
56 |
|
57 private: // construction |
|
58 |
|
59 /** |
|
60 * Second phase constructor. |
|
61 * @param aName The field name. |
|
62 * @param aValue The field value. |
|
63 */ |
|
64 void ConstructL( const TDesC& aName, const TDesC& aValue ); |
|
65 |
|
66 /** |
|
67 * Second phase constructor. |
|
68 * @param aName The field name. |
|
69 * @param aValue The field value. |
|
70 */ |
|
71 void ConstructL( HBufC* aName, HBufC* aValue ); |
|
72 |
|
73 private: // hidden |
|
74 |
|
75 /// Default constructor. |
|
76 CWPNameValue(); |
|
77 |
|
78 /// Another constructor |
|
79 CWPNameValue( HBufC* aName, HBufC* aValue ); |
|
80 |
|
81 /// Copy contructor prohibited. |
|
82 CWPNameValue(const CWPNameValue& aSource); |
|
83 |
|
84 /// Assignment operator prohibited. |
|
85 const CWPNameValue& operator=(const CWPNameValue& aSource); |
|
86 |
|
87 private: |
|
88 |
|
89 /// Own. Pointer to the name. |
|
90 HBufC* iName; |
|
91 |
|
92 /// Own. Pointer to the value. |
|
93 HBufC* iValue; |
|
94 }; |
|
95 |
|
96 #endif // _CWPNameValue_H_ |
|
97 |
|
98 // End of file |
|