1 /* |
|
2 * Copyright (c) 2009 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: Utility class for map and navigation test provider |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef MNTP_DUMP_H |
|
19 #define MNTP_DUMP_H |
|
20 |
|
21 #include <e32base.h> |
|
22 #include <e32property.h> |
|
23 |
|
24 #include <epos_landmarks.h> |
|
25 |
|
26 #ifdef RD_MAPNAV_BITMAP_ACCESS |
|
27 #include <mnmapimage.h> |
|
28 #endif |
|
29 |
|
30 const TInt KPropCategoryUid = 0x0313200B; |
|
31 const TInt KPropKeyErrorCode = 1; |
|
32 const TInt KPropKeyAction = 2; |
|
33 const TInt KPropKeyProcessId = 3; |
|
34 |
|
35 enum |
|
36 { |
|
37 EServerActionNone, |
|
38 EServerActionBaseComplete, |
|
39 EServerActionCompleteGeocoding, |
|
40 EServerActionCompleteSelectionFree, |
|
41 EServerActionCompleteSelectionIndex, |
|
42 EServerActionCompleteSelectionNegativeIndex, |
|
43 EServerActionCompleteSelectionLinked, |
|
44 EServerActionCompleteSelectionWrongLinked, |
|
45 EServerActionCompleteSelectionNegativeDbIndex, |
|
46 EServerActionDelayCompletion, |
|
47 EServerActionExit, |
|
48 EServerActionDisableDump, |
|
49 EServerActionCompleteRendering, |
|
50 }; |
|
51 |
|
52 class CPosLandmark; |
|
53 class CAiwGenericParamList; |
|
54 class RProperty; |
|
55 |
|
56 #ifdef RD_MAPNAV_BITMAP_ACCESS |
|
57 struct TMapImageOptions |
|
58 { |
|
59 TMnMapImageParams iParams; |
|
60 CMnMapImage::TShowOptions iShowOptions; |
|
61 TPoint iTargetOrigin; |
|
62 TSize iBitmapSize; |
|
63 TInt iBitmapHandle; |
|
64 }; |
|
65 #endif |
|
66 |
|
67 class CTestProviderDump : public CBase |
|
68 { |
|
69 public: |
|
70 static CTestProviderDump* NewLC(); |
|
71 |
|
72 void AddTimeStampL(); |
|
73 void AddRunModeL( TBool aIsChainedMode ); |
|
74 |
|
75 void AddLandmarkL( const CPosLandmark& aLandmark ); |
|
76 void AddLandmarkL( const TDesC& aUri, TPosLmItemId aId ); |
|
77 void AddLandmarkListL( const TDesC& aUri, TArray<TPosLmItemId> aItemIds ); |
|
78 |
|
79 void AddGeocodingOptionsL( TUint32 aOptions ); |
|
80 void AddMapViewOptionsL( |
|
81 TUint32 aOptions, |
|
82 TUint32 aCurrentLocationOption, |
|
83 TReal aRadius, |
|
84 TCoordinate iCenterPoint ); |
|
85 |
|
86 #ifdef RD_MAPNAV_BITMAP_ACCESS |
|
87 void AddMapImageOptionsL( TMapImageOptions& aOptions ); |
|
88 #endif |
|
89 void AddRequestTextL( const TDesC& aText ); |
|
90 void AddAddressL( const TDesC& aAddress ); |
|
91 |
|
92 void CommitL(); |
|
93 |
|
94 ~CTestProviderDump(); |
|
95 |
|
96 protected: |
|
97 |
|
98 void ConstructL(); |
|
99 CTestProviderDump(); |
|
100 |
|
101 private: |
|
102 CAiwGenericParamList* iList; |
|
103 }; |
|
104 |
|
105 class CTestCommandListener : public CActive |
|
106 { |
|
107 public: |
|
108 CTestCommandListener( TCallBack aCallback ) : CActive ( CActive::EPriorityStandard ) |
|
109 { |
|
110 iCallback = aCallback; |
|
111 iProperty.Attach( TUid::Uid( KPropCategoryUid ), KPropKeyAction ); |
|
112 CActiveScheduler::Add( this ); |
|
113 }; |
|
114 |
|
115 ~CTestCommandListener() |
|
116 { |
|
117 iProperty.Close(); |
|
118 }; |
|
119 |
|
120 void Start() |
|
121 { |
|
122 iProperty.Subscribe( iStatus ); |
|
123 SetActive(); |
|
124 }; |
|
125 |
|
126 void RunL() |
|
127 { |
|
128 Start(); |
|
129 iCallback.CallBack(); |
|
130 }; |
|
131 |
|
132 void DoCancel() |
|
133 { |
|
134 iProperty.Cancel(); |
|
135 }; |
|
136 |
|
137 RProperty& Property() |
|
138 { |
|
139 return iProperty; |
|
140 }; |
|
141 |
|
142 protected: |
|
143 RProperty iProperty; |
|
144 TCallBack iCallback; |
|
145 }; |
|
146 |
|
147 #endif // MNTP_DUMP_H |
|
148 |
|