lbsrequestor.h

Go to the documentation of this file.
00001 /*
00002 * ==============================================================================
00003 *  Name        : LbsRequestor.h
00004 *  Part of     : Location Framework/Location FW
00005 *  Interface   : Location Acquisition API
00006 *  Description : Requestor classes
00007 *  Version     : %version: 3 %
00008 *
00009 *  Copyright (c) 2002-2006 Nokia Corporation.
00010 *  This material, including documentation and any related
00011 *  computer programs, is protected by copyright controlled by
00012 *  Nokia Corporation. All rights are reserved. Copying,
00013 *  including reproducing, storing, adapting or translating, any
00014 *  or all of this material requires the prior written consent of
00015 *  Nokia Corporation. This material also contains confidential
00016 *  information which may not be disclosed to others without the
00017 *  prior written consent of Nokia Corporation.
00018 * ==============================================================================
00019 */
00020 
00021 #ifndef __LBSREQUESTOR_H__
00022 #define __LBSREQUESTOR_H__
00023 
00024 #include <e32base.h>
00025 
00026 // Forward declarations
00027 class RReadStream;
00028 class RWriteStream;
00029 
00030 
00034 class CRequestorBase : public CBase
00035         {
00036 public:
00042         typedef TInt TRequestorType;
00043 
00045         enum _TRequestorType
00046                 {
00048                 ERequestorUnknown,
00054                 ERequestorService,
00059                 ERequestorContact
00060                 };
00061 
00067         typedef TInt TRequestorFormat;
00068 
00070         enum _TRequestorFormat
00071                 {
00073                 EFormatUnknown,
00078                 EFormatApplication,
00083                 EFormatTelephone,
00085                 EFormatUrl,
00087                 EFormatMail
00088                 };
00089 
00093         IMPORT_C ~CRequestorBase();
00094 
00107         IMPORT_C void SetRequestorL(TRequestorType aType,
00108                                     TRequestorFormat aFormat,
00109                                     const TDesC& aData);
00121         IMPORT_C void GetRequestor(TRequestorType& aType,
00122                                    TRequestorFormat& aFormat,
00123                                    TPtrC& aData) const;
00124 
00130         IMPORT_C TRequestorType RequestorType() const;
00131 
00137         IMPORT_C TRequestorFormat RequestorFormat() const;
00138 
00144         IMPORT_C TDesC& RequestorData() const;
00145 
00150         IMPORT_C virtual void InternalizeL(RReadStream& aStream);
00151 
00156         IMPORT_C virtual void ExternalizeL(RWriteStream& aStream) const;
00157 
00158 protected:
00162         IMPORT_C CRequestorBase();
00163 
00167         IMPORT_C void ConstructL(TRequestorType aType,
00168                                                          TRequestorFormat aFormat,
00169                                                          const TDesC& aData);
00170         // Reserved for future expansion - derived classes should see documentation
00171         // on how this is to be used.
00172         IMPORT_C virtual TAny* ExtendedInterface(TInt aFunctionNumber, TAny* aPtr1, TAny* aPtr2);
00173 
00174 protected:
00176         TRequestorType   iRequestorType;
00178         TRequestorFormat iFormat;
00179 private:
00181         HBufC* iData;
00183         TAny* iBaseReservedPtr;
00184         };
00185 
00186 
00196 class CRequestor : public CRequestorBase
00197         {
00198 public:
00214         IMPORT_C static CRequestor* New(TRequestorType aType,
00215                                         TRequestorFormat aFormat,
00216                                         const TDesC& aData);
00217 
00232         IMPORT_C static CRequestor* NewL(TRequestorType aType,
00233                                          TRequestorFormat aFormat,
00234                                          const TDesC& aData);
00235 
00251         IMPORT_C static CRequestor* NewLC(TRequestorType aType,
00252                                           TRequestorFormat aFormat,
00253                                           const TDesC& aData);
00254 
00266         IMPORT_C static CRequestor* NewL(RReadStream& aStream);
00267 
00271         ~CRequestor();
00272 
00273 private:
00274         CRequestor();
00275         };
00276 
00290 class RRequestorStack : public RPointerArray<CRequestor>
00291         {
00292 public:
00297         IMPORT_C void InternalizeL(RReadStream& aStream);
00298 
00303         IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
00304 
00305 private:
00309         static void CleanupResetAndDestroy(TAny* aArray);
00310 
00311 private:
00313         TUint8 iReserved[8];
00314         };
00315 
00316 //__LBSREQUESTOR_H__
00317 #endif

Copyright © Nokia Corporation 2001-2008
Back to top