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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: LandmarksUi Content File - This class provides functionality for selecting either one or
15 * multiple categories.
25 #ifndef CLMKCATEGORYSELECTORDLG_H
26 #define CLMKCATEGORYSELECTORDLG_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>
33 // FORWARD DECLARATIONS
34 //class CPosLandmarkDatabase;
35 class CLmkDlgSelectorImplBase;
36 class MObjectProvider;
38 // For multiple database support
39 class TLmkItemIdDbCombiInfo;
44 * This is a dialog class, which is used to launch category selector dialog and
45 * to get the selected category ids.It displays the categories present in landmarks
46 * database,as a list.The dialog can be a single selector or multiple selector dialog,
47 * depending upon argument passed by the client (in ExecuteLD function) at the time
48 * when it is launched.Based on whether it is a single selector or multiple selector
49 * dialog, user can select single category or multiple categories.
51 class CLmkCategorySelectorDlg : public CBase
53 public: // Constructors and destructor
55 * This is a static function, which create and return an instance of this class.
56 * Categories present in the landmark database, are shown in selector.
58 * @param [in] aShowEmptyCategories specifies whether categories without
59 * landmarks are shown or not
60 * @leave Leaves with KErrNotSupported if framework functionality is not available.
61 * @panic Panics with system-wide panic codes.
62 * @return new instance of this class
64 IMPORT_C static CLmkCategorySelectorDlg* NewL(TBool aShowEmptyCategories = EFalse );
69 IMPORT_C ~CLmkCategorySelectorDlg();
71 public: // New functions
73 * This function sets the context - that is, the enclosing parent control - for this control.
75 * @param [in] aParent The parent object which is the context for the control.
76 * @panic Panics with KLmkPanicNullMember, if the selector is not
77 * constructed properly.
79 IMPORT_C void SetMopParent( MObjectProvider* aParent );
82 * This function launches the category selector dialog.Client use this function
83 * to launch single category selector dialog.
84 * This object is destroyed when this function returns or leaves.
85 * @param [in/out] aSelected Passed as reference and when the function returns,
86 * contains the selected category id.
87 * @leave Leaves with system-wide leave codes.
88 * @panic Panics with KLmkPanicNullMember, if the selector is not constructed properly.
89 * @return Returns non-zero if accepted, else zero.
91 IMPORT_C TInt ExecuteLD( TLmkItemIdDbCombiInfo& aSelected );
94 * This function launches the category selector dialog.Client use this function
95 * to launch multiple category selector dialog.
96 * This object is destroyed when this function returns or leaves.
97 * If the array(aSelectedItems) is passed with already filled cateogry ids, then
98 * such categories will be shown as selected when the dialog is launched,but if
99 * any of these ids do not exist in landmarks database,will be ignored.
101 * @param [in/out] aSelectedItems Passed as reference,either filled with category
102 * ids for pre-selection or an empty array.On return of the function
103 * contains the selected category ids.
104 * @leave Leaves with system-wide leave codes.
105 * @panic Panics with KLmkPanicNullMember, if the selector is not constructed properly.
106 * @return Returns non-zero if accepted, else zero.
108 IMPORT_C TInt ExecuteLD( RArray<TLmkItemIdDbCombiInfo>& aSelectedItems );
112 * C++ default constructor.
113 * @return newly instantiated object
115 CLmkCategorySelectorDlg();
118 * By default Symbian 2nd phase constructor is private.
119 * @param aShowEmptyCategories
121 void ConstructL( TBool aShowEmptyCategories );
124 // ETrue if executed in multiple item selector mode
125 TBool iIsMultiSelector;
127 ///Own: Search implementor object
128 CLmkDlgSelectorImplBase* iSelector;
130 //Own: Set to ETrue in destructor
131 TBool* iDestroyedPtr;
133 // Multiple database support
134 RPointerArray <CPosLandmarkDatabase> iDbs;
138 #endif // CLMKCATEGORYSELECTORDLG_H