1.1 --- a/epoc32/include/lbsrequestor.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/lbsrequestor.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,170 @@
1.4 -lbsrequestor.h
1.5 +// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +// All rights reserved.
1.7 +// This component and the accompanying materials are made available
1.8 +// 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
1.9 +// which accompanies this distribution, and is available
1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +//
1.12 +// Initial Contributors:
1.13 +// Nokia Corporation - initial contribution.
1.14 +//
1.15 +// Contributors:
1.16 +//
1.17 +// Description:
1.18 +//
1.19 +
1.20 +#ifndef __LBSREQUESTOR_H__
1.21 +#define __LBSREQUESTOR_H__
1.22 +
1.23 +#include <e32base.h>
1.24 +
1.25 +// Forward declarations
1.26 +class RReadStream;
1.27 +class RWriteStream;
1.28 +
1.29 +
1.30 +class CRequestorBase : public CBase
1.31 +/**
1.32 +Each instance of a CRequestor class is used to hold the identity of one
1.33 +of the parties involved requesting the location. The class contains three
1.34 +data fields that indicate:
1.35 +(1) If the requesting party is a "service" or an actual person ("contact").
1.36 +(2) A descriptor that identifiers the requestor and
1.37 +(3) a field that indicates which format the information is in
1.38 + - for example, a telephone number, URL or email address.
1.39 +
1.40 +@publishedAll
1.41 +@released
1.42 + */
1.43 + {
1.44 +public:
1.45 + /** defined type for TRequestorType */
1.46 + typedef TInt TRequestorType;
1.47 +
1.48 + /**
1.49 + TRequestorType
1.50 + */
1.51 + enum _TRequestorType
1.52 + {
1.53 + /** Unknown Requestor */
1.54 + ERequestorUnknown,
1.55 + /** Requestor of type Service */
1.56 + ERequestorService,
1.57 + /** Requestor of type Contact */
1.58 + ERequestorContact
1.59 + };
1.60 +
1.61 + /** defined type for TRequestorFormat */
1.62 + typedef TInt TRequestorFormat;
1.63 +
1.64 + /**
1.65 + TRequestorFormat
1.66 + */
1.67 + enum _TRequestorFormat
1.68 + {
1.69 + /** Requestor format unknown */
1.70 + EFormatUnknown,
1.71 + /** EFormatApplication */
1.72 + EFormatApplication,
1.73 + /** EFormatTelephone */
1.74 + EFormatTelephone,
1.75 + /** EFormatUrl */
1.76 + EFormatUrl,
1.77 + /** EFormatMail */
1.78 + EFormatMail
1.79 + };
1.80 +
1.81 + IMPORT_C ~CRequestorBase();
1.82 +
1.83 + IMPORT_C void SetRequestorL(TRequestorType aType,
1.84 + TRequestorFormat aFormat,
1.85 + const TDesC& aData);
1.86 + IMPORT_C void GetRequestor(TRequestorType& aType,
1.87 + TRequestorFormat& aFormat,
1.88 + TPtrC& aData) const;
1.89 +
1.90 + IMPORT_C TRequestorType RequestorType() const;
1.91 + IMPORT_C TRequestorFormat RequestorFormat() const;
1.92 + IMPORT_C TDesC& RequestorData() const;
1.93 +
1.94 + IMPORT_C virtual void InternalizeL(RReadStream& aStream);
1.95 + IMPORT_C virtual void ExternalizeL(RWriteStream& aStream) const;
1.96 +
1.97 +protected:
1.98 + IMPORT_C CRequestorBase();
1.99 +
1.100 + IMPORT_C void ConstructL(TRequestorType aType,
1.101 + TRequestorFormat aFormat,
1.102 + const TDesC& aData);
1.103 + // Reserved for future expansion - derived classes should see documentation
1.104 + // on how this is to be used.
1.105 + IMPORT_C virtual TAny* ExtendedInterface(TInt aFunctionNumber, TAny* aPtr1, TAny* aPtr2);
1.106 +
1.107 +protected:
1.108 + /** Requestor type */
1.109 + TRequestorType iRequestorType;
1.110 + /** Requestor format */
1.111 + TRequestorFormat iFormat;
1.112 +private:
1.113 + /** This is owned by the CRequestor */
1.114 + HBufC* iData;
1.115 + /** Reserved data for future extension */
1.116 + TAny* iBaseReservedPtr;
1.117 + };
1.118 +
1.119 +
1.120 +class CRequestor : public CRequestorBase
1.121 +/**
1.122 +CRequestor class for LBS clients
1.123 +@see CRequestorBase
1.124 +@publishedAll
1.125 +@released
1.126 + */
1.127 + {
1.128 +public:
1.129 + IMPORT_C static CRequestor* New(TRequestorType aType,
1.130 + TRequestorFormat aFormat,
1.131 + const TDesC& aData);
1.132 + IMPORT_C static CRequestor* NewL(TRequestorType aType,
1.133 + TRequestorFormat aFormat,
1.134 + const TDesC& aData);
1.135 + IMPORT_C static CRequestor* NewLC(TRequestorType aType,
1.136 + TRequestorFormat aFormat,
1.137 + const TDesC& aData);
1.138 + IMPORT_C static CRequestor* NewL(RReadStream& aStream);
1.139 +
1.140 + ~CRequestor();
1.141 +
1.142 +private:
1.143 + CRequestor();
1.144 + };
1.145 +
1.146 +class RRequestorStack : public RPointerArray<CRequestor>
1.147 +/**
1.148 +Most standard applications will not use the RRequestorStack. Instead,
1.149 +they will call the simpler RPositioner::SetRequestor() method to
1.150 +identify themselves.
1.151 +
1.152 +RRequestorStack will typically only be used if the application needs to
1.153 +identify a chain of requestors. For example, a remote party is requesting
1.154 +the location and this is routed through a local application. In this
1.155 +situation, the application should identify both itself and the remote party.
1.156 +
1.157 +@see RPointerArray
1.158 +@publishedAll
1.159 +@released
1.160 + */
1.161 + {
1.162 +public:
1.163 + IMPORT_C void InternalizeL(RReadStream& aStream);
1.164 + IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
1.165 +
1.166 +private:
1.167 + static void CleanupResetAndDestroy(TAny* aArray);
1.168 +
1.169 +private:
1.170 + /** Unused variable for future expansion. */
1.171 + TUint8 iReserved[8];
1.172 + };
1.173 +
1.174 +#endif //__LBSREQUESTOR_H__