williamr@2
|
1 |
/*
|
williamr@2
|
2 |
* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
3 |
* All rights reserved.
|
williamr@2
|
4 |
* This component and the accompanying materials are made available
|
williamr@4
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
williamr@2
|
6 |
* which accompanies this distribution, and is available
|
williamr@4
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
williamr@2
|
8 |
*
|
williamr@2
|
9 |
* Initial Contributors:
|
williamr@2
|
10 |
* Nokia Corporation - initial contribution.
|
williamr@2
|
11 |
*
|
williamr@2
|
12 |
* Contributors:
|
williamr@2
|
13 |
*
|
williamr@2
|
14 |
* Description: LandmarksUi Content File - This class provides functionality for selecting either one or
|
williamr@2
|
15 |
* multiple categories.
|
williamr@2
|
16 |
*
|
williamr@2
|
17 |
*/
|
williamr@2
|
18 |
|
williamr@2
|
19 |
|
williamr@2
|
20 |
|
williamr@2
|
21 |
|
williamr@2
|
22 |
|
williamr@2
|
23 |
|
williamr@2
|
24 |
|
williamr@2
|
25 |
#ifndef CLMKCATEGORYSELECTORDLG_H
|
williamr@2
|
26 |
#define CLMKCATEGORYSELECTORDLG_H
|
williamr@2
|
27 |
|
williamr@2
|
28 |
// INCLUDES
|
williamr@2
|
29 |
#include <e32base.h> // CBase
|
williamr@2
|
30 |
#include <e32std.h> //RArray and RPointerArray
|
williamr@2
|
31 |
#include <EPos_Landmarks.h> // Lm typedefs, constants etc.
|
williamr@2
|
32 |
#include <EPos_CPosLandmarkDatabase.h>
|
williamr@2
|
33 |
// FORWARD DECLARATIONS
|
williamr@2
|
34 |
//class CPosLandmarkDatabase;
|
williamr@2
|
35 |
class CLmkDlgSelectorImplBase;
|
williamr@2
|
36 |
class MObjectProvider;
|
williamr@2
|
37 |
|
williamr@2
|
38 |
// For multiple database support
|
williamr@2
|
39 |
class TLmkItemIdDbCombiInfo;
|
williamr@2
|
40 |
|
williamr@2
|
41 |
// CLASS DECLARATION
|
williamr@2
|
42 |
|
williamr@2
|
43 |
/**
|
williamr@2
|
44 |
* This is a dialog class, which is used to launch category selector dialog and
|
williamr@2
|
45 |
* to get the selected category ids.It displays the categories present in landmarks
|
williamr@2
|
46 |
* database,as a list.The dialog can be a single selector or multiple selector dialog,
|
williamr@2
|
47 |
* depending upon argument passed by the client (in ExecuteLD function) at the time
|
williamr@2
|
48 |
* when it is launched.Based on whether it is a single selector or multiple selector
|
williamr@2
|
49 |
* dialog, user can select single category or multiple categories.
|
williamr@2
|
50 |
*/
|
williamr@2
|
51 |
class CLmkCategorySelectorDlg : public CBase
|
williamr@2
|
52 |
{
|
williamr@2
|
53 |
public: // Constructors and destructor
|
williamr@2
|
54 |
/**
|
williamr@2
|
55 |
* This is a static function, which create and return an instance of this class.
|
williamr@2
|
56 |
* Categories present in the landmark database, are shown in selector.
|
williamr@2
|
57 |
*
|
williamr@2
|
58 |
* @param [in] aShowEmptyCategories specifies whether categories without
|
williamr@2
|
59 |
* landmarks are shown or not
|
williamr@2
|
60 |
* @leave Leaves with KErrNotSupported if framework functionality is not available.
|
williamr@2
|
61 |
* @panic Panics with system-wide panic codes.
|
williamr@2
|
62 |
* @return new instance of this class
|
williamr@2
|
63 |
*/
|
williamr@2
|
64 |
IMPORT_C static CLmkCategorySelectorDlg* NewL(TBool aShowEmptyCategories = EFalse );
|
williamr@2
|
65 |
|
williamr@2
|
66 |
/**
|
williamr@2
|
67 |
* Destructor.
|
williamr@2
|
68 |
*/
|
williamr@2
|
69 |
IMPORT_C ~CLmkCategorySelectorDlg();
|
williamr@2
|
70 |
|
williamr@2
|
71 |
public: // New functions
|
williamr@2
|
72 |
/**
|
williamr@2
|
73 |
* This function sets the context - that is, the enclosing parent control - for this control.
|
williamr@2
|
74 |
*
|
williamr@2
|
75 |
* @param [in] aParent The parent object which is the context for the control.
|
williamr@2
|
76 |
* @panic Panics with KLmkPanicNullMember, if the selector is not
|
williamr@2
|
77 |
* constructed properly.
|
williamr@2
|
78 |
*/
|
williamr@2
|
79 |
IMPORT_C void SetMopParent( MObjectProvider* aParent );
|
williamr@2
|
80 |
|
williamr@2
|
81 |
/**
|
williamr@2
|
82 |
* This function launches the category selector dialog.Client use this function
|
williamr@2
|
83 |
* to launch single category selector dialog.
|
williamr@2
|
84 |
* This object is destroyed when this function returns or leaves.
|
williamr@2
|
85 |
* @param [in/out] aSelected Passed as reference and when the function returns,
|
williamr@2
|
86 |
* contains the selected category id.
|
williamr@2
|
87 |
* @leave Leaves with system-wide leave codes.
|
williamr@2
|
88 |
* @panic Panics with KLmkPanicNullMember, if the selector is not constructed properly.
|
williamr@2
|
89 |
* @return Returns non-zero if accepted, else zero.
|
williamr@2
|
90 |
*/
|
williamr@2
|
91 |
IMPORT_C TInt ExecuteLD( TLmkItemIdDbCombiInfo& aSelected );
|
williamr@2
|
92 |
|
williamr@2
|
93 |
/**
|
williamr@2
|
94 |
* This function launches the category selector dialog.Client use this function
|
williamr@2
|
95 |
* to launch multiple category selector dialog.
|
williamr@2
|
96 |
* This object is destroyed when this function returns or leaves.
|
williamr@2
|
97 |
* If the array(aSelectedItems) is passed with already filled cateogry ids, then
|
williamr@2
|
98 |
* such categories will be shown as selected when the dialog is launched,but if
|
williamr@2
|
99 |
* any of these ids do not exist in landmarks database,will be ignored.
|
williamr@2
|
100 |
*
|
williamr@2
|
101 |
* @param [in/out] aSelectedItems Passed as reference,either filled with category
|
williamr@2
|
102 |
* ids for pre-selection or an empty array.On return of the function
|
williamr@2
|
103 |
* contains the selected category ids.
|
williamr@2
|
104 |
* @leave Leaves with system-wide leave codes.
|
williamr@2
|
105 |
* @panic Panics with KLmkPanicNullMember, if the selector is not constructed properly.
|
williamr@2
|
106 |
* @return Returns non-zero if accepted, else zero.
|
williamr@2
|
107 |
*/
|
williamr@2
|
108 |
IMPORT_C TInt ExecuteLD( RArray<TLmkItemIdDbCombiInfo>& aSelectedItems );
|
williamr@2
|
109 |
|
williamr@2
|
110 |
private:
|
williamr@2
|
111 |
/**
|
williamr@2
|
112 |
* C++ default constructor.
|
williamr@2
|
113 |
* @return newly instantiated object
|
williamr@2
|
114 |
*/
|
williamr@2
|
115 |
CLmkCategorySelectorDlg();
|
williamr@2
|
116 |
|
williamr@2
|
117 |
/**
|
williamr@2
|
118 |
* By default Symbian 2nd phase constructor is private.
|
williamr@2
|
119 |
* @param aShowEmptyCategories
|
williamr@2
|
120 |
*/
|
williamr@2
|
121 |
void ConstructL( TBool aShowEmptyCategories );
|
williamr@2
|
122 |
|
williamr@2
|
123 |
private: // Data
|
williamr@2
|
124 |
// ETrue if executed in multiple item selector mode
|
williamr@2
|
125 |
TBool iIsMultiSelector;
|
williamr@2
|
126 |
|
williamr@2
|
127 |
///Own: Search implementor object
|
williamr@2
|
128 |
CLmkDlgSelectorImplBase* iSelector;
|
williamr@2
|
129 |
|
williamr@2
|
130 |
//Own: Set to ETrue in destructor
|
williamr@2
|
131 |
TBool* iDestroyedPtr;
|
williamr@2
|
132 |
|
williamr@2
|
133 |
// Multiple database support
|
williamr@2
|
134 |
RPointerArray <CPosLandmarkDatabase> iDbs;
|
williamr@2
|
135 |
|
williamr@2
|
136 |
};
|
williamr@2
|
137 |
|
williamr@2
|
138 |
#endif // CLMKCATEGORYSELECTORDLG_H
|
williamr@2
|
139 |
|
williamr@2
|
140 |
// End of File
|