1 /* |
|
2 * Copyright (c) 2005-2006 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: CMnNavigator class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef MN_NAVIGATOR_H |
|
20 #define MN_NAVIGATOR_H |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 class CApaServerAppExitMonitor; |
|
25 class MAknServerAppExitObserver; |
|
26 class CMnProvider; |
|
27 class CPosLandmark; |
|
28 class RMnNavigationServiceClient; |
|
29 |
|
30 /** @brief Provides navigation features. |
|
31 * |
|
32 * To create an instance of the class, use @ref NewL or @ref NewChainedL methods. They |
|
33 * require instance of CMnProvider, defined in Map and Navigation Provider Discovery API. |
|
34 * |
|
35 * @since 3.1 |
|
36 * @lib mnclientlib.dll |
|
37 * @ingroup MapNavAPI |
|
38 */ |
|
39 class CMnNavigator : public CBase |
|
40 { |
|
41 public : |
|
42 /** Destructor */ |
|
43 IMPORT_C ~CMnNavigator(); |
|
44 |
|
45 /** @brief Creates new instance of the class. Provider Application |
|
46 * will be executed standalone. |
|
47 * |
|
48 * @param[in] aProvider Provider Application to be used for navigation. |
|
49 * @return Pointer to new instance of the class. |
|
50 * |
|
51 * @leave KErrNotSupported Selected Provider Application does not support |
|
52 * navigation services (CMnProvider::EServiceNavigation). |
|
53 */ |
|
54 IMPORT_C static CMnNavigator* NewL( CMnProvider& aProvider ); |
|
55 |
|
56 /** @brief Creates new instance of the class. Provider Application |
|
57 * will be executed chained (unless Provider Application defines that |
|
58 * it should be started in background). |
|
59 * |
|
60 * @param[in] aProvider Provider Application to be used for navigation. |
|
61 * @return Pointer to new instance of the class. |
|
62 * |
|
63 * @leave KErrNotSupported Selected Provider Application does not support |
|
64 * navigation services (CMnProvider::EServiceNavigation). |
|
65 */ |
|
66 IMPORT_C static CMnNavigator* NewChainedL( CMnProvider& aProvider ); |
|
67 |
|
68 /** @brief Starts navigation from current location to specified destination. |
|
69 * |
|
70 * This method completes as soon as navigation request reaches Provider |
|
71 * Application. Navigation is held then in Provider Application's process. |
|
72 * |
|
73 * Navigation destination is specified as landmark. This landmark |
|
74 * does not have to contain coordinate information, in which case |
|
75 * its address information will be used, if present. If neither |
|
76 * coordinate nor address information is present in the landmark, |
|
77 * then this method leaves with KErrArgument. |
|
78 * |
|
79 * This is synchronous request. It is completed as soon as navigation |
|
80 * starts on Provider Application side. |
|
81 * |
|
82 * @param[in] aDestination Navigation destination. |
|
83 * |
|
84 * @leave KErrArgument if neither coordinate nor address information is present in the landmark |
|
85 */ |
|
86 IMPORT_C void NavigateToL( const CPosLandmark& aDestination ); |
|
87 |
|
88 /** @brief Sets observer of provider application lifetime. |
|
89 * Client will receive exit event from provider application. |
|
90 * By default exit events from provider application are not monitored. |
|
91 * @param[in] aObserver Exit observer. |
|
92 * @leave KErrAlreadyExists if observer is already set. |
|
93 */ |
|
94 IMPORT_C void SetExitObserverL( MAknServerAppExitObserver& aObserver ); |
|
95 |
|
96 /** @brief Removes observer of provider application lifetime. */ |
|
97 IMPORT_C void RemoveExitObserver(); |
|
98 |
|
99 private : |
|
100 /** C++ constructor */ |
|
101 CMnNavigator(); |
|
102 |
|
103 void ConstructCommonL( CMnProvider& aProvider ); |
|
104 void ConstructNewL( CMnProvider& aProvider ); |
|
105 void ConstructChainedL( CMnProvider& aProvider ); |
|
106 |
|
107 private : |
|
108 |
|
109 RMnNavigationServiceClient* iSession; |
|
110 CApaServerAppExitMonitor* iExitMonitor; |
|
111 }; |
|
112 |
|
113 #endif // MN_NAVIGATOR_H |
|
114 |
|