landmarksui/engine/inc/CLmkParseAllWrapper.h
branchRCL_3
changeset 17 1fc85118c3ae
parent 16 8173571d354e
child 18 870918037e16
equal deleted inserted replaced
16:8173571d354e 17:1fc85118c3ae
     1 /*
       
     2 * Copyright (c) 2004 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 -    CLmkParseAllWrapper class parses all landmarks and
       
    15 *                maintains an index.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 #ifndef CLMKPARSEALLWRAPPER_H
       
    27 #define CLMKPARSEALLWRAPPER_H
       
    28 
       
    29 //  INCLUDES
       
    30 #include <e32std.h>
       
    31 #include "MLmkAOOperationObserver.h"
       
    32 #include "CLmkLandMarkCategoriesName.h"
       
    33 #include "CLmkLandmark.h"
       
    34 
       
    35 // FORWARD DECLARATIONS
       
    36 class CLmkAOOperation;
       
    37 class CPosLandmarkParser;
       
    38 class CPosLandmark;
       
    39 
       
    40 class CPosLandmarkDatabase;
       
    41 // CLASS DECLARATION
       
    42 
       
    43 /**
       
    44 * CLmkParseAllWrapper class.
       
    45 * This class parses all landmarks and maintains an index.
       
    46 * It becomes obsolete once CPosLandmarkParser supports indexed parsing.
       
    47 */
       
    48 class CLmkParseAllWrapper
       
    49 : public CBase, public MLmkAOOperationObserver
       
    50     {
       
    51     public:  // Constructors and destructor
       
    52         /**
       
    53         * Creates CLmkParseAllWrapper
       
    54         * @param aParser
       
    55         * @param aObserver
       
    56         * @return newly instantiated object
       
    57         */
       
    58 
       
    59         static CLmkParseAllWrapper* NewL( CPosLandmarkParser& aParser,
       
    60                                           MLmkAOOperationObserver& aObserver,
       
    61                                           CPosLandmarkDatabase& aDb );
       
    62 
       
    63         /**
       
    64         * Destructor.
       
    65         */
       
    66         ~CLmkParseAllWrapper();
       
    67 
       
    68     public: // New functions
       
    69 
       
    70         /**
       
    71         * Asynchronous method for parsing all landmarks.
       
    72         */
       
    73         void ParseAllL();
       
    74 
       
    75         /**
       
    76         * Returns parsed landmark, ownership is transferred.
       
    77         * @param aLandmarkIndex
       
    78         * @return landmark
       
    79         */
       
    80         CPosLandmark* LandmarkLC( TUint aLandmarkIndex );
       
    81 
       
    82 		TInt NumOfLandmarks();
       
    83         CPosLandmark* Landmark( TUint aLandmarkIndex );
       
    84         CLmkLandMarkCategoriesName* CategoryNameLC( TUint aLandmarkIndex );
       
    85 
       
    86         /**
       
    87         * Gets the CLmkLandmark object
       
    88         * @param aLandmarkIndex
       
    89         */
       
    90         CLmkLandmark* LmkLandmarkLC( TInt aLandmarkIndex );
       
    91     protected: // From MLmkAOOperationObserver
       
    92         void HandleOperationL( TOperationTypes aType,
       
    93                               TReal32 aProgress,
       
    94                               TInt aStatus );
       
    95 
       
    96     protected:  // Constructors and destructor
       
    97         /**
       
    98         * C++ constructor.
       
    99         * @param aParser
       
   100         * @param aObserver
       
   101         * @return newly instantiated object
       
   102         */
       
   103         CLmkParseAllWrapper( CPosLandmarkParser& aParser,
       
   104                              MLmkAOOperationObserver& aObserver,
       
   105                              CPosLandmarkDatabase& aDb);
       
   106 
       
   107         /**
       
   108         * By default Symbian 2nd phase constructor is private.
       
   109         */
       
   110         void ConstructL();
       
   111     private:    // Data
       
   112 
       
   113         // Parsed landmarks
       
   114         RPointerArray<CLmkLandmark> iLmkLandmarks;
       
   115         RPointerArray<CLmkLandMarkCategoriesName> iCategoriesNames;
       
   116 
       
   117         ///Ref:
       
   118         CPosLandmarkParser& iParser;
       
   119 
       
   120         MLmkAOOperationObserver& iObserver;
       
   121 
       
   122         ///Own:
       
   123         CLmkAOOperation* iAOOperation;
       
   124         //Ref
       
   125          CPosLandmarkDatabase& iDb;
       
   126     };
       
   127 
       
   128 #endif      // CLMKPARSEALLWRAPPER_H
       
   129 
       
   130 // End of File