|
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 - This class provides functionality for selecting either one or |
|
15 * multiple landmarks. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 #ifndef CLMKLANDMARKSELECTORDLG_H |
|
26 #define CLMKLANDMARKSELECTORDLG_H |
|
27 |
|
28 // INCLUDES |
|
29 #include <e32base.h> // CBase |
|
30 #include <e32std.h> //RArray and RPointerArray |
|
31 #include <EPos_Landmarks.h> // Lm typedefs, constants etc. |
|
32 #include <EPos_CPosLandmarkDatabase.h> |
|
33 |
|
34 // FORWARD DECLARATIONS |
|
35 //class CPosLandmarkDatabase; |
|
36 class CLmkDlgSelectorImplBase; |
|
37 class MObjectProvider; |
|
38 |
|
39 // For multiple database support |
|
40 class TLmkItemIdDbCombiInfo; |
|
41 |
|
42 // CLASS DECLARATION |
|
43 |
|
44 /** |
|
45 * This is a dialog class, which is used to launch landmark selector dialog and |
|
46 * to get the selected landmark ids.It displays the landmarks present in landmarks |
|
47 * database,as a list.The dialog can be a single selector or multiple selector dialog, |
|
48 * depending upon argument passed by the client (in ExecuteLD function) at the time |
|
49 * when it is launched.Based on whether it is a single selector or multiple selector |
|
50 * dialog, user can select single landmark or multiple landmarks. |
|
51 */ |
|
52 class CLmkLandmarkSelectorDlg : public CBase |
|
53 { |
|
54 public: // Constructors and destructor |
|
55 /** |
|
56 * This is a static function, which creates and returns an instance of this class. |
|
57 * All the landmarks present in the landmark database are shown in the selector. |
|
58 * |
|
59 * @leave Leaves with KErrNotSupported if framework functionality is not available. |
|
60 * @panic Panics with system-wide panic codes. |
|
61 * @return new instance of this class |
|
62 */ |
|
63 IMPORT_C static CLmkLandmarkSelectorDlg* NewL(); |
|
64 |
|
65 /** |
|
66 * This is a static function, which creates and returns an instance of this class. |
|
67 * All the landmarks present in the user specified landmark database are shown in the selector. |
|
68 * @param[in] aDatabaseUri The URI of the databases to open. |
|
69 * |
|
70 * @leave Leaves with KErrNotSupported if framework functionality is not available or |
|
71 * the protocol specified in URI is not supported. |
|
72 * @leave Leaves with KErrArgument if an empty string is passed as argument or |
|
73 * extension of the local database name is not "ldb". |
|
74 * @panic Panics with system-wide panic codes. |
|
75 * @return new instance of this class |
|
76 */ |
|
77 IMPORT_C static CLmkLandmarkSelectorDlg* NewL( const TDesC& aDatabaseUri ); |
|
78 |
|
79 /** |
|
80 * Destructor. |
|
81 */ |
|
82 IMPORT_C ~CLmkLandmarkSelectorDlg(); |
|
83 |
|
84 public: // New functions |
|
85 /** |
|
86 * This function sets the context - that is, the enclosing parent control - for this control. |
|
87 * |
|
88 * @param [in] aParent The parent object which is the context for the control. |
|
89 * @panic Panics with KLmkPanicNullMember, if the selector is not |
|
90 * constructed properly. |
|
91 */ |
|
92 IMPORT_C void SetMopParent( MObjectProvider* aParent ); |
|
93 |
|
94 /** |
|
95 * This function launches the landmark selector dialog. Client uses this function |
|
96 * to launch single landmark selector dialog. |
|
97 * This object is destroyed when this function returns or leaves. |
|
98 * @param [in/out] aSelected Passed as reference and when the function returns, |
|
99 * contains the selected landmark id. |
|
100 * @leave Leaves with system-wide leave codes. |
|
101 * @panic Panics with KLmkPanicNullMember, if the selector is not constructed properly. |
|
102 * @return Returns non-zero if accepted, else zero. |
|
103 */ |
|
104 IMPORT_C TInt ExecuteLD( TLmkItemIdDbCombiInfo& aSelected ); |
|
105 |
|
106 /** |
|
107 * This function launches the landmark selector dialog. Client uses this function |
|
108 * to launch multiple landmark selector dialog. |
|
109 * This object is destroyed when this function returns or leaves. |
|
110 * If the array(aSelectedItems) is passed with already filled landmark ids, then |
|
111 * such landmarks will be shown as selected when the dialog is launched, but if |
|
112 * any of these ids do not exist in landmarks database, it will be ignored. |
|
113 * |
|
114 * @param [in/out] aSelectedItems Passed as reference, either filled with landmark |
|
115 * ids for pre-selection or an empty array. On return of the function |
|
116 * contains the selected landmark ids. |
|
117 * @leave Leaves with system-wide leave codes. |
|
118 * @panic Panics with KLmkPanicNullMember, if the selector is not constructed properly. |
|
119 * @return Returns non-zero if accepted, else zero. |
|
120 */ |
|
121 IMPORT_C TInt ExecuteLD( RArray<TLmkItemIdDbCombiInfo>& aSelectedItems ); |
|
122 |
|
123 /** |
|
124 * This function sets the title string of the landmark selector dialog. |
|
125 * This function has to be called before ExecuteLD() to make the set title appear on ui. |
|
126 * Calling this api after ExecuteLD() will not have any impact. |
|
127 * |
|
128 * @param [in] aTitle The title string of the selector dialog. |
|
129 * @panic Panics with KLmkPanicNullMember, if the selector is not |
|
130 * constructed properly. |
|
131 */ |
|
132 IMPORT_C void SetDialogTitleL(const TDesC& aTitle ); |
|
133 |
|
134 private: |
|
135 /** |
|
136 * C++ default constructor. |
|
137 * @return newly instantiated object |
|
138 */ |
|
139 CLmkLandmarkSelectorDlg(); |
|
140 |
|
141 /** |
|
142 * By default Symbian 2nd phase constructor is private. |
|
143 */ |
|
144 |
|
145 void ConstructL( ); |
|
146 |
|
147 |
|
148 private: // Data |
|
149 // ETrue if executed in multiple item selector mode |
|
150 TBool iIsMultiSelector; |
|
151 |
|
152 // User defined database set to be viewed in selector |
|
153 HBufC* iDatabaseUri; |
|
154 |
|
155 /// Own: Search implementor object |
|
156 CLmkDlgSelectorImplBase* iSelector; |
|
157 |
|
158 // Set to ETrue in destructor |
|
159 TBool* iDestroyedPtr; |
|
160 |
|
161 // For multiple database support |
|
162 RPointerArray <CPosLandmarkDatabase> iDbs; // |
|
163 |
|
164 |
|
165 }; |
|
166 |
|
167 #endif // CLMKLANDMARKSELECTORDLG_H |
|
168 |
|
169 // End of File |