|
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: project specification |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CWPCHARACTERISTIC_H |
|
20 #define CWPCHARACTERISTIC_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include "mwpelement.h" |
|
25 #include "mwpvisitor.h" |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class CWPParameter; |
|
29 |
|
30 // CLASS DECLARATION |
|
31 |
|
32 /** |
|
33 * CWPCharacteristic contains one characteristic. |
|
34 * |
|
35 * @lib ProvisioningEngine |
|
36 * @since 2.0 |
|
37 */ |
|
38 class CWPCharacteristic : public CBase, public MWPElement |
|
39 { |
|
40 public: // Constructors and destructor |
|
41 |
|
42 /** |
|
43 * Two-phased constructor. |
|
44 */ |
|
45 static CWPCharacteristic* NewL( TInt aType ); |
|
46 |
|
47 /** |
|
48 * Two-phased constructor. |
|
49 */ |
|
50 static CWPCharacteristic* NewLC( TInt aType ); |
|
51 |
|
52 /** |
|
53 * Destructor. |
|
54 */ |
|
55 ~CWPCharacteristic(); |
|
56 |
|
57 public:// New functions |
|
58 |
|
59 /** |
|
60 * Inserts a parameter to the characteristic. Ownership is tranferred. |
|
61 * @param aParameter Parameter to insert. |
|
62 */ |
|
63 IMPORT_C void InsertL(MWPElement* aElement); |
|
64 |
|
65 /** |
|
66 * Sets the characteristic's name. |
|
67 * @param aName Characteristic's new name |
|
68 */ |
|
69 IMPORT_C void SetNameL( const TDesC& aValue ); |
|
70 |
|
71 /** |
|
72 * Returns the characteristic's name. |
|
73 * @return Characteristic's name |
|
74 */ |
|
75 IMPORT_C const TDesC& Name() const; |
|
76 |
|
77 /** |
|
78 * Accepts a visitor for the parameters in characteristic. |
|
79 * @param aVisitor The visitor to be called for each element. |
|
80 */ |
|
81 IMPORT_C void AcceptL(MWPVisitor& aVisitor); |
|
82 |
|
83 public: // From MWPElement |
|
84 |
|
85 void CallVisitorL( MWPVisitor& aVisitor ); |
|
86 |
|
87 TInt Type() const; |
|
88 |
|
89 void ExternalizeL(RWriteStream& aStream) const; |
|
90 |
|
91 void InternalizeL(RReadStream& aStream); |
|
92 |
|
93 |
|
94 private: |
|
95 /** |
|
96 * C++ default constructor. |
|
97 */ |
|
98 CWPCharacteristic( TInt aType ); |
|
99 |
|
100 /** |
|
101 * By default Symbian 2nd phase constructor is private. |
|
102 */ |
|
103 void ConstructL(); |
|
104 |
|
105 private: |
|
106 /// The type of the CHARACTERISTIC |
|
107 TInt iType; |
|
108 |
|
109 /// The name of the CHARACTERISTIC |
|
110 HBufC* iName; |
|
111 |
|
112 RPointerArray<MWPElement> iElements; |
|
113 }; |
|
114 |
|
115 #endif /* CWPCHARACTERISTIC_H */ |