epoc32/include/lbsrequestor.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 #ifndef __LBSREQUESTOR_H__
    17 #define __LBSREQUESTOR_H__
    18 
    19 #include <e32base.h>
    20 
    21 // Forward declarations
    22 class RReadStream;
    23 class RWriteStream;
    24 
    25 
    26 class CRequestorBase : public CBase
    27 /**
    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.
    35 
    36 @publishedAll
    37 @released
    38  */
    39 	{
    40 public:
    41 	/** defined type for TRequestorType */
    42 	typedef TInt TRequestorType;
    43 
    44 	/** 
    45 	TRequestorType
    46 	 */
    47 	enum _TRequestorType
    48 		{
    49 		/** Unknown Requestor */
    50 		ERequestorUnknown,
    51 		/** Requestor of type Service */
    52 		ERequestorService,
    53 		/** Requestor of type Contact */
    54 		ERequestorContact
    55 		};
    56 
    57 	/** defined type for TRequestorFormat */
    58 	typedef TInt TRequestorFormat;
    59 
    60 	/** 
    61 	TRequestorFormat
    62 	 */
    63 	enum _TRequestorFormat
    64 		{
    65 		/** Requestor format unknown */
    66 		EFormatUnknown,
    67 		/** EFormatApplication */
    68 		EFormatApplication,
    69 		/** EFormatTelephone */
    70 		EFormatTelephone,
    71 		/** EFormatUrl */
    72 		EFormatUrl,
    73 		/** EFormatMail */
    74 		EFormatMail
    75 		};
    76 
    77 	IMPORT_C ~CRequestorBase();
    78 
    79 	IMPORT_C void SetRequestorL(TRequestorType aType,
    80 	                            TRequestorFormat aFormat,
    81 	                            const TDesC& aData);
    82 	IMPORT_C void GetRequestor(TRequestorType& aType,
    83 	                           TRequestorFormat& aFormat,
    84 	                           TPtrC& aData) const;
    85 
    86 	IMPORT_C TRequestorType RequestorType() const;
    87 	IMPORT_C TRequestorFormat RequestorFormat() const;
    88 	IMPORT_C TDesC& RequestorData() const;
    89 
    90 	IMPORT_C virtual void InternalizeL(RReadStream& aStream);
    91 	IMPORT_C virtual void ExternalizeL(RWriteStream& aStream) const;
    92 
    93 protected:
    94 	IMPORT_C CRequestorBase();
    95 
    96 	IMPORT_C void ConstructL(TRequestorType aType,
    97 							 TRequestorFormat aFormat,
    98 							 const TDesC& aData);
    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);
   102 
   103 protected:
   104 	/** Requestor type */
   105 	TRequestorType   iRequestorType;
   106 	/** Requestor format */
   107 	TRequestorFormat iFormat;
   108 private:
   109 	/** This is owned by the CRequestor */
   110 	HBufC* iData;
   111 	/** Reserved data for future extension */
   112 	TAny* iBaseReservedPtr;
   113 	};
   114 
   115 
   116 class CRequestor : public CRequestorBase
   117 /**
   118 CRequestor class for LBS clients
   119 @see CRequestorBase 
   120 @publishedAll
   121 @released
   122  */
   123 	{
   124 public:
   125 	IMPORT_C static CRequestor* New(TRequestorType aType,
   126 	                                TRequestorFormat aFormat,
   127 	                                const TDesC& aData);
   128 	IMPORT_C static CRequestor* NewL(TRequestorType aType,
   129 	                                 TRequestorFormat aFormat,
   130 	                                 const TDesC& aData);
   131 	IMPORT_C static CRequestor* NewLC(TRequestorType aType,
   132 	                                  TRequestorFormat aFormat,
   133 	                                  const TDesC& aData);
   134 	IMPORT_C static CRequestor* NewL(RReadStream& aStream);
   135 
   136 	/**
   137 	Destructor for CRequestor.
   138 	*/
   139 	~CRequestor();
   140 
   141 private:
   142 	CRequestor();
   143 	};
   144 
   145 class RRequestorStack : public RPointerArray<CRequestor>
   146 /**
   147 Most standard applications will not use the RRequestorStack. Instead,
   148 they will call the simpler RPositioner::SetRequestor() method to
   149 identify themselves.
   150 
   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.
   155 
   156 @see RPointerArray
   157 @publishedAll
   158 @released
   159  */
   160 	{
   161 public:
   162 	IMPORT_C void InternalizeL(RReadStream& aStream);
   163 	IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
   164 
   165 private:
   166 	static void CleanupResetAndDestroy(TAny* aArray);
   167 
   168 private:
   169 	/** Unused variable for future expansion. */
   170 	TUint8 iReserved[8];
   171 	};
   172 
   173 #endif //__LBSREQUESTOR_H__