landmarksui/engine/inc/CLmkLocationService.h
branchRCL_3
changeset 17 1fc85118c3ae
parent 16 8173571d354e
child 18 870918037e16
equal deleted inserted replaced
16:8173571d354e 17:1fc85118c3ae
     1 /*
       
     2 * Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:    LandmarksUi Content File -    Implements methods for interfacing with Location Acquisition API.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 #ifndef __CLMKLOCATIONSERVICE_H__
       
    25 #define __CLMKLOCATIONSERVICE_H__
       
    26 
       
    27 //  INCLUDES
       
    28 #include <lbs.h>
       
    29 
       
    30 // FORWARD DECLARATION
       
    31 class MLmkLocationObserver;
       
    32 class TPosition;
       
    33 class RPositionServer;
       
    34 class RPositioner;
       
    35 class TPositionInfo;
       
    36 
       
    37 
       
    38 // CLASS DECLARATION
       
    39 /**
       
    40 *  Implements entry point class to LmkEng.dll
       
    41 */
       
    42 class CLmkLocationService : public CActive
       
    43     {
       
    44     public:
       
    45         /**
       
    46         * Two-phased constructor.
       
    47         * @param location service requester name
       
    48         *        (Landmarks Application's name)
       
    49         *        which is passed to Location framework as a parameter to Location Acquisition API
       
    50         *        It is maintained by Location Framework for privacy rules and logging purposes
       
    51         * @return CLmkLocationService object.
       
    52         */
       
    53         IMPORT_C static CLmkLocationService* NewL(const TDesC& aSrvName);
       
    54 
       
    55         /**
       
    56         * Destructor.
       
    57         */
       
    58         virtual ~CLmkLocationService();
       
    59 
       
    60     private:
       
    61         /**
       
    62         * By default Symbian 2nd phase constructor is private.
       
    63         * @param location service requester name
       
    64         *        (Landmarks Application's name)
       
    65         *        which is passed to Location framework as a parameter to Location Acquisition API
       
    66         *        It is maintained by Location Framework for privacy rules and logging purposes
       
    67         */
       
    68         void ConstructL(const TDesC& aSrvName);
       
    69 
       
    70         /**
       
    71         * C++ default constructor.
       
    72         * @param newly instantiated object
       
    73         */
       
    74         CLmkLocationService();
       
    75 
       
    76     public: //new functions
       
    77         /**
       
    78         * Set observer
       
    79         * The calling class sets itself as observer to CLmkLocationService class
       
    80         * @param the calling class which sets itself as observer to this class
       
    81         */
       
    82         IMPORT_C void SetObserver(MLmkLocationObserver& aObserver);
       
    83 
       
    84         /**
       
    85         * Remove observer
       
    86         */
       
    87         IMPORT_C void RemoveModelObserver();
       
    88 
       
    89         /**
       
    90         * Request current location
       
    91         */
       
    92         IMPORT_C void LocationRequestL();
       
    93 
       
    94         /**
       
    95         * Get current location
       
    96         * @return TPosition reference
       
    97         */
       
    98         IMPORT_C TPosition& CurrentPosition();
       
    99 
       
   100         /**
       
   101         * Cancel location request
       
   102         */
       
   103         IMPORT_C void CancelRequest();
       
   104 
       
   105     private: // from CActive
       
   106         void RunL();
       
   107         void DoCancel();
       
   108         TInt RunError(TInt aError);
       
   109 
       
   110     private:    // data
       
   111         /// Own: iServer
       
   112         RPositionServer iServer;
       
   113 
       
   114         ///Ref:
       
   115         MLmkLocationObserver* iObserver;
       
   116 
       
   117         ///  RPositioner
       
   118         RPositioner iPositioner;
       
   119 
       
   120         ///  TPosition
       
   121         TPosition iPosition;
       
   122 
       
   123         TPositionInfo iPositionInfo;
       
   124 
       
   125     };
       
   126 
       
   127 #endif // __CLMKLOCATIONSERVICE_H__
       
   128 
       
   129 // End of File