1 // Copyright (c) 2003-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef __LBSREQUESTOR_H__
17 #define __LBSREQUESTOR_H__
21 // Forward declarations
26 class CRequestorBase : public CBase
28 Each instance of a CRequestor class is used to hold the identity of one
29 of the parties involved requesting the location. The class contains three
30 data fields that indicate:
31 (1) If the requesting party is a "service" or an actual person ("contact").
32 (2) A descriptor that identifiers the requestor and
33 (3) a field that indicates which format the information is in
34 - for example, a telephone number, URL or email address.
41 /** defined type for TRequestorType */
42 typedef TInt TRequestorType;
49 /** Unknown Requestor */
51 /** Requestor of type Service */
53 /** Requestor of type Contact */
57 /** defined type for TRequestorFormat */
58 typedef TInt TRequestorFormat;
63 enum _TRequestorFormat
65 /** Requestor format unknown */
67 /** EFormatApplication */
69 /** EFormatTelephone */
77 IMPORT_C ~CRequestorBase();
79 IMPORT_C void SetRequestorL(TRequestorType aType,
80 TRequestorFormat aFormat,
82 IMPORT_C void GetRequestor(TRequestorType& aType,
83 TRequestorFormat& aFormat,
86 IMPORT_C TRequestorType RequestorType() const;
87 IMPORT_C TRequestorFormat RequestorFormat() const;
88 IMPORT_C TDesC& RequestorData() const;
90 IMPORT_C virtual void InternalizeL(RReadStream& aStream);
91 IMPORT_C virtual void ExternalizeL(RWriteStream& aStream) const;
94 IMPORT_C CRequestorBase();
96 IMPORT_C void ConstructL(TRequestorType aType,
97 TRequestorFormat aFormat,
99 // Reserved for future expansion - derived classes should see documentation
100 // on how this is to be used.
101 IMPORT_C virtual TAny* ExtendedInterface(TInt aFunctionNumber, TAny* aPtr1, TAny* aPtr2);
104 /** Requestor type */
105 TRequestorType iRequestorType;
106 /** Requestor format */
107 TRequestorFormat iFormat;
109 /** This is owned by the CRequestor */
111 /** Reserved data for future extension */
112 TAny* iBaseReservedPtr;
116 class CRequestor : public CRequestorBase
118 CRequestor class for LBS clients
125 IMPORT_C static CRequestor* New(TRequestorType aType,
126 TRequestorFormat aFormat,
128 IMPORT_C static CRequestor* NewL(TRequestorType aType,
129 TRequestorFormat aFormat,
131 IMPORT_C static CRequestor* NewLC(TRequestorType aType,
132 TRequestorFormat aFormat,
134 IMPORT_C static CRequestor* NewL(RReadStream& aStream);
137 Destructor for CRequestor.
145 class RRequestorStack : public RPointerArray<CRequestor>
147 Most standard applications will not use the RRequestorStack. Instead,
148 they will call the simpler RPositioner::SetRequestor() method to
151 RRequestorStack will typically only be used if the application needs to
152 identify a chain of requestors. For example, a remote party is requesting
153 the location and this is routed through a local application. In this
154 situation, the application should identify both itself and the remote party.
162 IMPORT_C void InternalizeL(RReadStream& aStream);
163 IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
166 static void CleanupResetAndDestroy(TAny* aArray);
169 /** Unused variable for future expansion. */
173 #endif //__LBSREQUESTOR_H__