Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
2 * Copyright (c) 2003-2005 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Declares common constants, types, classes etc. to be used both
15 * consumer and provider side.
27 #include <aiwcommon.hrh>
29 #include <aiwgenericparam.h>
35 // FUNCTION PROTOTYPES
37 // FORWARD DECLARATIONS
39 class CAiwGenericParamList;
45 * This class encapsulates an AIW criteria item. Criteria items are building
46 * blocks for AIW interests, i.e. an interest is a list of criteria items.
47 * A criteria item can be defined dynamically (by using this class) or
50 * @lib ServiceHandler.lib
51 * @since Series 60 2.6
53 class CAiwCriteriaItem : public CBase
55 public: // Constructors and destructor
57 * Constructs a criteria item instance with null items.
59 * @return A pointer to the new object.
61 IMPORT_C static CAiwCriteriaItem* NewL();
64 * Constructs a criteria item instance with null items. Leaves the
65 * pointer to the cleanup stack.
67 * @return A pointer to the new object.
69 IMPORT_C static CAiwCriteriaItem* NewLC();
72 * Constructs a criteria item instance.
74 * @param aCriteriaId The criteria ID.
75 * @param aServiceCmd The service command.
76 * @param aContentType The content type.
77 * @return A pointer to the new object.
79 IMPORT_C static CAiwCriteriaItem* NewL(
82 const TDesC8& aContentType);
85 * Constructs a criteria item instance. Leaves the pointer to the
88 * @param aCriteriaId The criteria ID.
89 * @param aServiceCmd The service command.
90 * @param aContentType The content type.
91 * @return A pointer to the new object.
93 IMPORT_C static CAiwCriteriaItem* NewLC(
96 const TDesC8& aContentType);
101 IMPORT_C virtual ~CAiwCriteriaItem();
103 public: // New functions
105 * Sets the criteria ID.
107 * @param aId The criteria ID.
109 IMPORT_C void SetId(TInt aId);
112 * Sets the service class.
114 * @param aServiceUid The service class, see TAiwServiceClass.
116 IMPORT_C void SetServiceClass(const TUid& aServiceUid);
119 * Sets the service command UID.
121 * @param aServiceCmd The AIW service command, see TAiwServiceCommands.
123 IMPORT_C void SetServiceCmd(TInt aServiceCmd);
126 * Sets the content type. Makes a copy of the string data.
128 * @param aContentType Content MIME type, event type or any agreed one.
130 IMPORT_C void SetContentTypeL(const TDesC8& aContentType);
133 * Gets the criteria ID, 0 if not defined.
135 * @return The criteria ID.
137 IMPORT_C TInt Id() const;
140 * Gets the service class UID.
142 * @return The service class UID, see TAiwServiceClass.
144 IMPORT_C const TUid& ServiceClass() const;
147 * Gets the service command UID. KNullUid, if not defined.
149 * @return The service command UID, see TAiwServiceCommands.
151 IMPORT_C TInt ServiceCmd() const;
154 * Gets the content type.
156 * @return The content type.
158 IMPORT_C const TDesC8& ContentType() const;
163 * @param aOptions Options.
165 IMPORT_C void SetOptions(TUint aOptions);
172 IMPORT_C TUint Options() const;
175 * Maximum number of providers allowed for this criteria item.
177 * @return Maximum number of providers allowed for this criteria item.
179 IMPORT_C TInt MaxProviders() const;
182 * Reads a criteria item from a resource.
184 * @param aReader A resource reader pointing to a criteria item.
186 IMPORT_C void ReadFromResoureL(TResourceReader& aReader);
189 * Returns the default provider.
191 * @return The default provider UID.
193 IMPORT_C TUid DefaultProvider() const;
196 * Sets the default provider.
198 * @param aDefault The UID of a default provider.
200 IMPORT_C void SetDefaultProvider(TInt aDefault);
203 * Equality operator. Two criteria items are considered equal only if all
204 * parameters match. The parameters are: criteria id, service command,
205 * content type, service class, default provider, max providers and options).
207 * @param aItem Criteria item to compare.
208 * @return ETrue if criteria items are equal, EFalse otherwise.
210 IMPORT_C TBool operator==(const CAiwCriteriaItem& aItem);
213 * Sets the maximum number of providers.
215 * @param aMaxProviders The maximum number of providers.
217 IMPORT_C void SetMaxProviders(TInt aMaxProviders);
221 * If set, only ROM based providers can be attached to this criteria.
223 * @return ETrue if AIW_OPTIONS_ROM_ONLY bit is set, EFalse otherwise.
225 inline TBool RomOnly() const;
229 * C++ default constructor.
234 * By default Symbian 2nd phase constructor is private.
239 * By default Symbian 2nd phase constructor is private.
244 const TDesC8& aContentType);
251 // Service command UID
253 // Content type (MIME type).
254 HBufC8* iContentType;
255 // Additional options
256 TAiwVariant iOptions;
257 //Default provider implementation uid
258 TUid iDefaultProvider;
260 TAiwVariant iReserved;
266 inline TBool CAiwCriteriaItem::RomOnly() const
268 return (Options() & AIW_OPTIONS_ROM_ONLY) != 0;
273 * Interest is an array of criteria items.
275 typedef RPointerArray<CAiwCriteriaItem> RCriteriaArray;
278 * Abstract callback interface to handle callbacks or events
279 * from providers. This callback is needed when
280 * - Consumer wants to pre-check output parameters before returning
281 * synchronous Handle*Cmd.
282 * - Asynchronous Handle*Cmd is used.
283 * - An asynchronous event occurs in the system.
285 * @lib ServiceHandler.lib
286 * @since Series 60 2.6
288 class MAiwNotifyCallback
292 * Handles notifications caused by an asynchronous Execute*CmdL call
295 * @param aCmdId The service command associated to the event.
296 * @param aEventId Occured event, see AiwCommon.hrh.
297 * @param aEventParamList Event parameters, if any, as defined per
299 * @param aInParamList Input parameters, if any, given in the
300 * related HandleCommmandL.
301 * @return Error code for the callback.
303 virtual TInt HandleNotifyL(
306 CAiwGenericParamList& aEventParamList,
307 const CAiwGenericParamList& aInParamList) = 0;
310 #endif // AIW_COMMON_H