Example Application Guide

- Main Page
- Classes
- Files

# geoprofile.h

    00001 /*
    00002 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
    00003 * All rights reserved.
    00004 * This component and the accompanying materials are made available
    00005 * under the terms of the License "Eclipse Public License v1.0"
    00006 * which accompanies this distribution, and is available
    00007 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    00008 *
    00009 * Initial Contributors:
    00010 * Nokia Corporation - initial contribution.
    00011 *
    00012 * Contributors:
    00013 *
    00014 * Description:  Geo Profile Structure
    00015 *
    00016 */
    00017
    00018
    00019 #ifndef C_GEOPROFILE_H
    00020 #define C_GEOPROFILE_H
    00021
    00022 // SYSTEM INCLUDES
    00023 #include <e32base.h>
    00024 #include <s32strm.h>
    00025 #include <LbsPosition.h>
    00026
    00027 // FORWARD DECLARATIONS
    00028
    00029 /**
    00030  * Geo Profile Exchange Structure
    00031  */
    00032 class CGeoProfile : public CBase
    00033     {
    00034 public:
    00035     enum TGeoPlaceType
    00036         {
    00037         EUndefined,
    00038         ECoordinate,
    00039         ENetworkCell
    00040         };
    00041
    00042     enum TGeoTriggerType
    00043         {
    00044         EEntryTrigger,
    00045         EExitTrigger
    00046         };
    00047 public:
    00048     /**
    00049      * Constructs a new instance of CGeoProfile Entry
    00050      */
    00051     static CGeoProfile* NewL();
    00052
    00053     /**
    00054      * Constructs a new instance of CGeoProfile Entry.
    00055      */
    00056     static CGeoProfile* NewL( const TDesC&       aGeoPlaceName,
    00057                                     TLocality&   aPositionInfo,
    00058                                     TInt         aGeoProfileId = 0,
    00059                                     TInt         aProfileRadius = 100,
    00060                                     TInt         aTriggerId = -1,
    00061                                     TInt         aTriggerType = EEntryTrigger );
    00062
    00063     /**
    00064      * C++ Destructor.
    00065      * Frees all the resources
    00066      */
    00067     virtual ~CGeoProfile();
    00068
    00069     /**
    00070      * Accessor method for obtaining the Geo-Profile Name
    00071      */
    00072     TPtrC GeoPlaceName();
    00073
    00074     /**
    00075      * Accessor method for obtaining the Profile Name
    00076      */
    00077     TPtrC ProfileName();
    00078
    00079     /**
    00080      * Accessor method for obtaining the Item Id
    00081      */
    00082     TInt GeoProfileId();
    00083
    00084     /**
    00085      * Accessor method for setting the Profile Name
    00086      */
    00087     void SetGeoProfileIdL( TInt               aGeoProfileId );
    00088
    00089     /**
    00090      * Location Information Type
    00091      */
    00092     TInt GeoPositionType();
    00093
    00094     /**
    00095      * Location Information
    00096      */
    00097     TLocality& GeoPositionInfo();
    00098
    00099     /**
    00100      * Accessor method for setting Location Information
    00101      */
    00102     void SetGeoPositionInfoL( const TDesC&       aGeoPlaceName,
    00103                                     TLocality&   aPositionInfo );
    00104
    00105     /**
    00106      * Accessor method for obtaining the radius
    00107      */
    00108     TInt GeoProfileRadius();
    00109
    00110     /**
    00111      * Accessor method for setting the radius
    00112      */
    00113     void SetGeoProfileRadius( TInt  aRadius );
    00114
    00115     /**
    00116      * Accessor method for obtaining the Trigger Id
    00117      */
    00118     TInt TriggerId();
    00119
    00120     /**
    00121      * Accessor method for setting the Trigger Id
    00122      */
    00123     void SetTriggerId( TInt  aTriggerId );
    00124
    00125     /**
    00126      * Accessor method for obtaining the Trigger Type
    00127      */
    00128     TInt TriggerType();
    00129
    00130     /**
    00131      * Accessor method for setting the Trigger Type
    00132      */
    00133     void SetTriggerType( TInt  aTriggerType );
    00134
    00135     /**
    00136      * Internalized the information available from the buffer
    00137      * The buffer must be in following format
    00138      * 1. Profile ID ( Integer )
    00139      * 2. Location Type ( Integer )
    00140      * 3. Horizontal Accuracy ( Integer )
    00141      * 4. Radius ( Integer )
    00142      */
    00143     void PartialInternalizeL( const TDesC&   aInputBuffer );
    00144
    00145     /**
    00146      * Partially externalizes the contents of the Geo Profile to
    00147      * a buffer
    00148      * The following fields are externalized and in the following
    00149      * format
    00150      * 1. Profile ID ( Integer )
    00151      * 2. Location Type ( Integer )
    00152      * 3. Horizontal Accuracy ( Integer )
    00153      * 4. Radius ( Integer )
    00154      */
    00155     HBufC* PartialExternalizeLC();
    00156
    00157 private:
    00158     /**
    00159      * C++ Constructor
    00160      */
    00161     CGeoProfile();
    00162
    00163     /**
    00164      * Second phase of two phase construction
    00165      */
    00166     void ConstructL( const TDesC&       aGeoPlaceName,
    00167                            TInt         aGeoProfileId,
    00168                            TLocality&   aPositionInfo,
    00169                            TInt         aProfileRadius,
    00170                            TInt         aTriggerId,
    00171                            TInt         aTriggerType );
    00172
    00173     /**
    00174      * Accessor method for setting the Profile Name
    00175      */
    00176     void SetProfileNameL( const TDesC&       aProfileName );
    00177
    00178
    00179     /**
    00180      * Accessor method for setting Location Information
    00181      */
    00182     void SetGeoPositionType( TInt         aPositionType );
    00183
    00184     /**
    00185      * Accessor method for setting Location name
    00186      */
    00187     void SetGeoPlaceNameL( const TDesC&   aGeoPlaceName );
    00188
    00189
    00190 private: // Member Variables
    00191
    00192     /**
    00193      * Geo Profile Name
    00194      * Owns
    00195      */
    00196     HBufC*       iGeoPlaceName;
    00197
    00198     /**
    00199      * Profile Name
    00200      * Owns
    00201      */
    00202     HBufC*       iProfileName;
    00203
    00204     /**
    00205      * Geo Profile Identifier
    00206      */
    00207     TInt         iGeoProfileId;
    00208
    00209     /**
    00210      * Geo Profile Location
    00211      */
    00212     TLocality    iPositionInfo;
    00213
    00214     /**
    00215      * Position Type
    00216      */
    00217     TInt        iPositionType;
    00218
    00219     /**
    00220      * Radius of the profile
    00221      */
    00222     TInt        iProfileRadius;
    00223
    00224     /**
    00225      * Trigger Id
    00226      */
    00227     TInt        iTriggerId;
    00228
    00229     /**
    00230      * Trigger Type
    00231      */
    00232     TInt        iTriggerType;
    00233     };
    00234
    00235 #endif // C_GEOPROFILE_H

© Nokia 2009 |