2 * Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: LandmarksUi Content File - This class provides functionality for selecting either one or
25 #ifndef CLMKLANDMARKSELECTORDLG_H
26 #define CLMKLANDMARKSELECTORDLG_H
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>
34 // FORWARD DECLARATIONS
35 //class CPosLandmarkDatabase;
36 class CLmkDlgSelectorImplBase;
37 class MObjectProvider;
39 // For multiple database support
40 class TLmkItemIdDbCombiInfo;
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.
52 class CLmkLandmarkSelectorDlg : public CBase
54 public: // Constructors and destructor
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.
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
63 IMPORT_C static CLmkLandmarkSelectorDlg* NewL();
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.
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
77 IMPORT_C static CLmkLandmarkSelectorDlg* NewL( const TDesC& aDatabaseUri );
82 IMPORT_C ~CLmkLandmarkSelectorDlg();
84 public: // New functions
86 * This function sets the context - that is, the enclosing parent control - for this control.
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.
92 IMPORT_C void SetMopParent( MObjectProvider* aParent );
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.
104 IMPORT_C TInt ExecuteLD( TLmkItemIdDbCombiInfo& aSelected );
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.
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.
121 IMPORT_C TInt ExecuteLD( RArray<TLmkItemIdDbCombiInfo>& aSelectedItems );
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.
128 * @param [in] aTitle The title string of the selector dialog.
129 * @panic Panics with KLmkPanicNullMember, if the selector is not
130 * constructed properly.
132 IMPORT_C void SetDialogTitleL(const TDesC& aTitle );
136 * C++ default constructor.
137 * @return newly instantiated object
139 CLmkLandmarkSelectorDlg();
142 * By default Symbian 2nd phase constructor is private.
149 // ETrue if executed in multiple item selector mode
150 TBool iIsMultiSelector;
152 // User defined database set to be viewed in selector
155 /// Own: Search implementor object
156 CLmkDlgSelectorImplBase* iSelector;
158 // Set to ETrue in destructor
159 TBool* iDestroyedPtr;
161 // For multiple database support
162 RPointerArray <CPosLandmarkDatabase> iDbs; //
167 #endif // CLMKLANDMARKSELECTORDLG_H