00001 /* 00002 * ============================================================================== 00003 * Name : EPos_CPosLandmark.h 00004 * Part of : Mobile Location Framework/Landmarks 00005 * Interface : SDK/S60, Landmarks API 00006 * Description : CPosLandmark class 00007 * Version : %version: 2 % 00008 * 00009 * Copyright © 2005-2006 Nokia. All rights reserved. 00010 * This material, including documentation and any related computer 00011 * programs, is protected by copyright controlled by Nokia. All 00012 * rights are reserved. Copying, including reproducing, storing, 00013 * adapting or translating, any or all of this material requires the 00014 * prior written consent of Nokia. This material also contains 00015 * confidential information which may not be disclosed to others 00016 * without the prior written consent of Nokia. 00017 * ============================================================================ 00018 * Template version: 4.0 00019 */ 00020 00021 #ifndef CPOSLANDMARK_H 00022 #define CPOSLANDMARK_H 00023 00024 #include <e32base.h> 00025 #include <LbsFields.h> 00026 #include <badesca.h> 00027 00028 #include "EPos_Landmarks.h" 00029 00030 class TLocality; 00031 00032 00057 class CPosLandmark : public CBase 00058 { 00059 public: 00060 00065 typedef TUint32 TAttributes; 00066 00071 enum _TAttributes 00072 { 00073 ENoAttribute = 0x0000 , 00075 ELandmarkName = 0x0001 , 00077 EPosition = 0x0002 , 00079 ECoverageRadius = 0x0004 , 00081 ECategoryInfo = 0x0008 , 00083 EIcon = 0x0010 , 00085 EDescription = 0x0020 , 00087 EAllAttributes = 0xFFFF 00089 }; 00090 00091 public: 00092 00098 IMPORT_C static CPosLandmark* NewLC(); 00099 00105 IMPORT_C static CPosLandmark* NewL(); 00106 00113 IMPORT_C static CPosLandmark* NewLC( 00114 const CPosLandmark& aLandmark 00115 ); 00116 00123 IMPORT_C static CPosLandmark* NewL( 00124 const CPosLandmark& aLandmark 00125 ); 00126 00130 virtual ~CPosLandmark(); 00131 00132 public: 00133 00141 IMPORT_C TPosLmItemId LandmarkId() const; 00142 00157 IMPORT_C TBool IsPartial() const; 00158 00174 IMPORT_C TInt GetLandmarkName( 00175 TPtrC& aLandmarkName 00176 ) const; 00177 00189 IMPORT_C void SetLandmarkNameL( 00190 const TDesC& aLandmarkName 00191 ); 00192 00200 IMPORT_C TInt GetPosition( 00201 TLocality& aPosition 00202 ) const; 00203 00216 IMPORT_C void SetPositionL( 00217 const TLocality& aPosition 00218 ); 00219 00230 IMPORT_C TInt GetCoverageRadius( 00231 TReal32& aCoverageRadius 00232 ) const; 00233 00245 IMPORT_C void SetCoverageRadius( 00246 TReal32 aCoverageRadius 00247 ); 00248 00256 IMPORT_C void AddCategoryL( 00257 TPosLmItemId aCategoryId 00258 ); 00259 00267 IMPORT_C void RemoveCategory( 00268 TPosLmItemId aCategoryId 00269 ); 00270 00278 IMPORT_C void GetCategoriesL( 00279 RArray<TPosLmItemId>& aCategoryIdArray 00280 ) const; 00281 00289 IMPORT_C TBool IsPositionFieldAvailable( 00290 TPositionFieldId aFieldId 00291 ) const; 00292 00298 IMPORT_C TUint NumOfAvailablePositionFields() const; 00299 00310 IMPORT_C TPositionFieldId FirstPositionFieldId() const; 00311 00333 IMPORT_C TPositionFieldId NextPositionFieldId( 00334 TPositionFieldId aFieldId 00335 ) const; 00336 00345 IMPORT_C TInt GetPositionField( 00346 TPositionFieldId aFieldId, 00347 TPtrC& aFieldValue 00348 ) const; 00349 00359 IMPORT_C void SetPositionFieldL( 00360 TPositionFieldId aFieldId, 00361 const TDesC& aFieldValue 00362 ); 00363 00372 IMPORT_C void RemovePositionField( 00373 TPositionFieldId aFieldId 00374 ); 00375 00396 IMPORT_C void SetIconL( 00397 const TDesC& aIconFileName, 00398 TInt aIconIndex, 00399 TInt aIconMaskIndex 00400 ); 00401 00421 IMPORT_C TInt GetIcon( 00422 TPtrC& aIconFileName, 00423 TInt& aIconIndex, 00424 TInt& aIconMaskIndex 00425 ) const; 00426 00442 IMPORT_C TInt GetLandmarkDescription( 00443 TPtrC& aLandmarkDescription 00444 ) const; 00445 00458 IMPORT_C void SetLandmarkDescriptionL( 00459 const TDesC& aLandmarkDescription 00460 ); 00461 00468 IMPORT_C void RemoveLandmarkAttributes( 00469 TAttributes aAttributes 00470 ); 00471 00474 /* 00475 * Sets the partial update flag to the landmark. 00476 * This flag is used to indicate if only partial information is included 00477 * in the landmark object. 00478 * 00479 * @param aPartial @p EFalse if the landmark contains all the landmark 00480 * information, otherwise @p ETrue. 00481 */ 00482 void SetPartialL( 00483 TBool aPartial 00484 ); 00485 00488 /* 00489 * Sets the landmark ID to the landmark. 00490 * 00491 * @param aId The landmark ID to set. 00492 */ 00493 void SetLandmarkIdL( 00494 TPosLmItemId aId 00495 ); 00496 00497 private: 00498 00499 // C++ constructor. 00500 CPosLandmark(); 00501 00502 // Prohibit copy constructor 00503 CPosLandmark(const CPosLandmark&); 00504 00505 // Prohibit assigment operator 00506 CPosLandmark& operator= (const CPosLandmark&); 00507 00508 void ConstructL(); 00509 void ConstructL(const CPosLandmark& aLandmark); 00510 00511 private: 00512 00513 // Landmark ID 00514 TPosLmItemId iId; 00515 00516 // Partial landmark flag 00517 TBool iIsPartial; 00518 00519 // Landmark name 00520 HBufC* iLandmarkName; 00521 00522 // Landmark position information 00523 TLocality* iPosition; 00524 00525 // Landmark coverage radius 00526 TReal32 iCoverageRadius; 00527 00528 // Landmark categories 00529 RArray<TPosLmItemId> iCategoryArray; 00530 00531 // Landmark position field IDs 00532 RArray<TUint> iPositionFieldIds; 00533 00534 // Landmark position field strings 00535 CDesCArray* iPositionFieldStrings; 00536 00537 // Landmark icon filename 00538 HBufC* iIconFileName; 00539 00540 // Landmark icon index 00541 TInt iIconIndex; 00542 00543 // Landmark icon mask index 00544 TInt iIconMaskIndex; 00545 00546 // Landmark description 00547 HBufC* iLandmarkDescription; 00548 }; 00549 00550 // CPOSLANDMARK_H 00551 #endif 00552 00553