creator/inc/creator_landmark.h
branchRCL_3
changeset 20 fad26422216a
parent 0 d6fe6244b863
equal deleted inserted replaced
19:b3cee849fa46 20:fad26422216a
       
     1 /*
       
     2 * Copyright (c) 2008 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:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef LANDMARKS_H_
       
    21 #define LANDMARKS_H_
       
    22 
       
    23 #include "creator_model.h"
       
    24 #include "creator_modulebase.h"
       
    25 
       
    26 #include <e32base.h>
       
    27 #include <EPos_Landmarks.h>
       
    28 
       
    29 class CLandmarkParameters;
       
    30 class CPosLandmarkDatabase;
       
    31 class CPosLmOperation;
       
    32 
       
    33 static const TInt KLandmarkFieldLength = 256;
       
    34 
       
    35 class CCreatorLandmarks : public CBase, public MCreatorModuleBase
       
    36     {
       
    37 public: 
       
    38     static CCreatorLandmarks* NewL(CCreatorEngine* aEngine);
       
    39     static CCreatorLandmarks* NewLC(CCreatorEngine* aEngine);
       
    40     ~CCreatorLandmarks();
       
    41 
       
    42 private:
       
    43     CCreatorLandmarks();
       
    44     void ConstructL(CCreatorEngine* aEngine); // from MCreatorModuleBase    
       
    45     TPosLmItemId GetCategoryIdL( TPosLmGlobalCategory aGlobalCategoryID );
       
    46 
       
    47 public:
       
    48     TBool AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries); // from MCreatorModuleBase
       
    49     TInt CreateLandmarkEntryL(CLandmarkParameters *aParameters);
       
    50     static TPosLmGlobalCategory GetCategoryIdL(const TDesC& aCategoryStr);
       
    51     void DeleteAllL();
       
    52     void DeleteAllCreatedByCreatorL();
       
    53 
       
    54 private:
       
    55     CPosLandmarkDatabase* iLandmarkDb;    
       
    56     CLandmarkParameters* iParameters;
       
    57     CPosLmOperation* iLmOperation;
       
    58     RArray<TPosLmItemId> iEntryIds; // TPosLmItemId (==TUint32) CPosLandmark::LandmarkId()
       
    59 public:
       
    60     };
       
    61 
       
    62 
       
    63 class CLandmarkParameters : public CCreatorModuleBaseParameters
       
    64     {
       
    65 public: 
       
    66     HBufC*              iName;
       
    67     RArray<TUint>       iCategories;
       
    68     HBufC*              iStreet;
       
    69     HBufC*              iCity;    
       
    70     HBufC*              iState;
       
    71     HBufC*              iCountry;
       
    72     HBufC*              iPostCode;    
       
    73     HBufC*              iDescription;
       
    74     HBufC*              iPhonenumber;
       
    75     HBufC*              iUrl;
       
    76     TReal64             iLatitude;
       
    77     TReal64             iLongitude;
       
    78     TReal32             iPositionAccuracy;
       
    79     TReal32             iAltitude;
       
    80     TReal32             iAltitudeAccuracy;
       
    81     
       
    82     void SetRandomNameL(CCreatorEngine& aEngine);
       
    83     void SetRandomUrlL(CCreatorEngine& aEngine);
       
    84     void AddRandomCategoryL(CCreatorEngine& aEngine);
       
    85     void SetRandomStreetL(CCreatorEngine& aEngine);
       
    86     void SetRandomCityL(CCreatorEngine& aEngine);
       
    87     void SetRandomStateL(CCreatorEngine& aEngine);
       
    88     void SetRandomCountryL(CCreatorEngine& aEngine);
       
    89     void SetRandomPostCodeL(CCreatorEngine& aEngine);
       
    90     void SetRandomLatitudeL(CCreatorEngine& aEngine);
       
    91     void SetRandomLongitudeL(CCreatorEngine& aEngine);
       
    92     void SetRandomPositionAccuracyL(CCreatorEngine& aEngine);
       
    93     void SetRandomAltitudeL(CCreatorEngine& aEngine);
       
    94     void SetRandomAltitudeAccuracyL(CCreatorEngine& aEngine);
       
    95     void SetRandomDescriptionL(CCreatorEngine& aEngine);
       
    96     void SetRandomPhoneNumberL(CCreatorEngine& aEngine);
       
    97     
       
    98 private:
       
    99     
       
   100 public:
       
   101     CLandmarkParameters();
       
   102     ~CLandmarkParameters();
       
   103     };
       
   104 #endif /*LANDMARKS_H_*/