|
1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef __CPNPSERVICEPARAM_H_ |
|
17 #define __CPNPSERVICEPARAM_H_ |
|
18 |
|
19 #include <e32cmn.h> |
|
20 #include "cupnpproperty.h" |
|
21 |
|
22 class CUPnPAction; |
|
23 class CUPnPStateVariable; |
|
24 class CUPnPArgument; |
|
25 class CUPnPAllowedValue; |
|
26 |
|
27 /** |
|
28 Container for action and service state objects |
|
29 |
|
30 @publishedPartner |
|
31 @prototype */ |
|
32 |
|
33 class CUPnPServiceDescription: public CUPnPProperty |
|
34 { |
|
35 |
|
36 public: |
|
37 IMPORT_C static CUPnPServiceDescription* NewL(); |
|
38 IMPORT_C ~CUPnPServiceDescription(); |
|
39 |
|
40 |
|
41 inline void SetMinorNumberL(const TInt aValue); |
|
42 inline const TInt MinorNumber () const; |
|
43 |
|
44 inline void SetMajorNumberL(const TInt aValue); |
|
45 inline const TInt MajorNumber () const; |
|
46 |
|
47 inline void AppendToActionList(const CUPnPAction* aValue); |
|
48 inline TInt CountOfActionList () const; |
|
49 inline const CUPnPAction* AtActionList( TInt aIndex) const ; |
|
50 |
|
51 inline void AppendToServiceStateTable(const CUPnPStateVariable* aValue); |
|
52 inline TInt CountOfServiceStateTable () const; |
|
53 inline const CUPnPStateVariable* AtServiceStateTable(const TInt aIndex) const; |
|
54 |
|
55 TBool Validate(const RStringPool& aStringPool, const TStringTable& aStringTable ) const; |
|
56 private : |
|
57 |
|
58 CUPnPServiceDescription(); |
|
59 void ConstructL(); |
|
60 |
|
61 private : |
|
62 TVersion iVersion; |
|
63 RPointerArray<CUPnPAction> iActionList; |
|
64 RPointerArray<CUPnPStateVariable> iServiceStateTable; |
|
65 }; |
|
66 |
|
67 |
|
68 /* |
|
69 Following class store the service action information. |
|
70 */ |
|
71 class CUPnPAction: public CUPnPProperty |
|
72 { |
|
73 |
|
74 public: |
|
75 static CUPnPAction* NewL(); |
|
76 ~CUPnPAction(); |
|
77 |
|
78 |
|
79 inline void AppendL(const CUPnPArgument* aValue); |
|
80 inline TInt Count () const; |
|
81 inline CUPnPArgument* At(TInt aIndex) const; |
|
82 |
|
83 |
|
84 TBool Validate(const RStringPool& aStringPool, const TStringTable& aStringTable ) const; |
|
85 |
|
86 private : |
|
87 |
|
88 CUPnPAction(); |
|
89 void ConstructL(); |
|
90 |
|
91 private : |
|
92 RPointerArray<CUPnPArgument> iArgumentList; |
|
93 }; |
|
94 /* |
|
95 Following class store argument object information. |
|
96 */ |
|
97 |
|
98 class CUPnPArgument: public CUPnPProperty |
|
99 { |
|
100 |
|
101 public: |
|
102 static CUPnPArgument* NewL(); |
|
103 ~CUPnPArgument(); |
|
104 TBool Validate(const RStringPool& aStringPool, const TStringTable& aStringTable ) const; |
|
105 void SetRetVal( TBool aValue ); |
|
106 TBool RetVal(); |
|
107 private : |
|
108 |
|
109 CUPnPArgument(); |
|
110 void ConstructL(); |
|
111 TBool iRetVal; |
|
112 private: |
|
113 }; |
|
114 /* |
|
115 Following structure store state varibale information. |
|
116 */ |
|
117 class CUPnPStateVariable: public CUPnPProperty |
|
118 { |
|
119 |
|
120 public: |
|
121 static CUPnPStateVariable* NewL(); |
|
122 ~CUPnPStateVariable(); |
|
123 |
|
124 inline void SetAllowedValuesL( CUPnPAllowedValue *aValue); |
|
125 inline const CUPnPAllowedValue* AllowedValues () const; |
|
126 inline void SetAllowedValueType ( TBool aStatus ); |
|
127 inline TBool AllowedValueType ( ) const ; |
|
128 TBool Validate(const RStringPool& aStringPool, const TStringTable& aStringTable ) const; |
|
129 |
|
130 private : |
|
131 CUPnPStateVariable(); |
|
132 void ConstructL(); |
|
133 TBool isValue; |
|
134 CUPnPAllowedValue* iAllowedValue; |
|
135 }; |
|
136 /* |
|
137 Following structure is the base class for allowed list or range objects. |
|
138 */ |
|
139 |
|
140 class CUPnPAllowedValue: public CUPnPProperty |
|
141 { |
|
142 public: |
|
143 enum TAllowedValueType |
|
144 { |
|
145 EArgValueList, |
|
146 EArgValueRange, |
|
147 }; |
|
148 TAllowedValueType iType; |
|
149 |
|
150 }; |
|
151 /* |
|
152 Following structure stores information about argument value list. |
|
153 */ |
|
154 class CUPnPArgValueList: public CUPnPAllowedValue |
|
155 { |
|
156 |
|
157 public: |
|
158 static CUPnPArgValueList* NewL(); |
|
159 ~CUPnPArgValueList(); |
|
160 |
|
161 inline void AppendL(const TDesC8& aValue); |
|
162 inline TInt Count () const; |
|
163 inline const TDesC8& At(const TInt aIndex) const; |
|
164 private : |
|
165 |
|
166 CUPnPArgValueList(); |
|
167 void ConstructL(); |
|
168 private : |
|
169 RArray<RBuf8> iAllowedValueList; |
|
170 }; |
|
171 |
|
172 /* |
|
173 CUPnPValueRange stores the upnp argument value range. |
|
174 */ |
|
175 class CUPnPValueRange: public CUPnPAllowedValue |
|
176 { |
|
177 public: |
|
178 IMPORT_C static CUPnPValueRange* NewL(); |
|
179 IMPORT_C ~CUPnPValueRange(); |
|
180 |
|
181 private : |
|
182 |
|
183 CUPnPValueRange(); |
|
184 void ConstructL(); |
|
185 |
|
186 }; |
|
187 |
|
188 #include "cpnpserviceparam.inl" |
|
189 #endif /*CPNPSERVICEPARAM_H_*/ |