williamr@2: /* williamr@2: * Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@4: * under the terms of "Eclipse Public License v1.0" williamr@2: * which accompanies this distribution, and is available williamr@4: * at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: LandmarksUi Content File - This class provides functionality for selecting either one or williamr@2: * multiple categories. williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: #ifndef CLMKCATEGORYSELECTORDLG_H williamr@2: #define CLMKCATEGORYSELECTORDLG_H williamr@2: williamr@2: // INCLUDES williamr@2: #include // CBase williamr@2: #include //RArray and RPointerArray williamr@2: #include // Lm typedefs, constants etc. williamr@2: #include williamr@2: // FORWARD DECLARATIONS williamr@2: //class CPosLandmarkDatabase; williamr@2: class CLmkDlgSelectorImplBase; williamr@2: class MObjectProvider; williamr@2: williamr@2: // For multiple database support williamr@2: class TLmkItemIdDbCombiInfo; williamr@2: williamr@2: // CLASS DECLARATION williamr@2: williamr@2: /** williamr@2: * This is a dialog class, which is used to launch category selector dialog and williamr@2: * to get the selected category ids.It displays the categories present in landmarks williamr@2: * database,as a list.The dialog can be a single selector or multiple selector dialog, williamr@2: * depending upon argument passed by the client (in ExecuteLD function) at the time williamr@2: * when it is launched.Based on whether it is a single selector or multiple selector williamr@2: * dialog, user can select single category or multiple categories. williamr@2: */ williamr@2: class CLmkCategorySelectorDlg : public CBase williamr@2: { williamr@2: public: // Constructors and destructor williamr@2: /** williamr@2: * This is a static function, which create and return an instance of this class. williamr@2: * Categories present in the landmark database, are shown in selector. williamr@2: * williamr@2: * @param [in] aShowEmptyCategories specifies whether categories without williamr@2: * landmarks are shown or not williamr@2: * @leave Leaves with KErrNotSupported if framework functionality is not available. williamr@2: * @panic Panics with system-wide panic codes. williamr@2: * @return new instance of this class williamr@2: */ williamr@2: IMPORT_C static CLmkCategorySelectorDlg* NewL(TBool aShowEmptyCategories = EFalse ); williamr@2: williamr@2: /** williamr@2: * Destructor. williamr@2: */ williamr@2: IMPORT_C ~CLmkCategorySelectorDlg(); williamr@2: williamr@2: public: // New functions williamr@2: /** williamr@2: * This function sets the context - that is, the enclosing parent control - for this control. williamr@2: * williamr@2: * @param [in] aParent The parent object which is the context for the control. williamr@2: * @panic Panics with KLmkPanicNullMember, if the selector is not williamr@2: * constructed properly. williamr@2: */ williamr@2: IMPORT_C void SetMopParent( MObjectProvider* aParent ); williamr@2: williamr@2: /** williamr@2: * This function launches the category selector dialog.Client use this function williamr@2: * to launch single category selector dialog. williamr@2: * This object is destroyed when this function returns or leaves. williamr@2: * @param [in/out] aSelected Passed as reference and when the function returns, williamr@2: * contains the selected category id. williamr@2: * @leave Leaves with system-wide leave codes. williamr@2: * @panic Panics with KLmkPanicNullMember, if the selector is not constructed properly. williamr@2: * @return Returns non-zero if accepted, else zero. williamr@2: */ williamr@2: IMPORT_C TInt ExecuteLD( TLmkItemIdDbCombiInfo& aSelected ); williamr@2: williamr@2: /** williamr@2: * This function launches the category selector dialog.Client use this function williamr@2: * to launch multiple category selector dialog. williamr@2: * This object is destroyed when this function returns or leaves. williamr@2: * If the array(aSelectedItems) is passed with already filled cateogry ids, then williamr@2: * such categories will be shown as selected when the dialog is launched,but if williamr@2: * any of these ids do not exist in landmarks database,will be ignored. williamr@2: * williamr@2: * @param [in/out] aSelectedItems Passed as reference,either filled with category williamr@2: * ids for pre-selection or an empty array.On return of the function williamr@2: * contains the selected category ids. williamr@2: * @leave Leaves with system-wide leave codes. williamr@2: * @panic Panics with KLmkPanicNullMember, if the selector is not constructed properly. williamr@2: * @return Returns non-zero if accepted, else zero. williamr@2: */ williamr@2: IMPORT_C TInt ExecuteLD( RArray& aSelectedItems ); williamr@2: williamr@2: private: williamr@2: /** williamr@2: * C++ default constructor. williamr@2: * @return newly instantiated object williamr@2: */ williamr@2: CLmkCategorySelectorDlg(); williamr@2: williamr@2: /** williamr@2: * By default Symbian 2nd phase constructor is private. williamr@2: * @param aShowEmptyCategories williamr@2: */ williamr@2: void ConstructL( TBool aShowEmptyCategories ); williamr@2: williamr@2: private: // Data williamr@2: // ETrue if executed in multiple item selector mode williamr@2: TBool iIsMultiSelector; williamr@2: williamr@2: ///Own: Search implementor object williamr@2: CLmkDlgSelectorImplBase* iSelector; williamr@2: williamr@2: //Own: Set to ETrue in destructor williamr@2: TBool* iDestroyedPtr; williamr@2: williamr@2: // Multiple database support williamr@2: RPointerArray iDbs; williamr@2: williamr@2: }; williamr@2: williamr@2: #endif // CLMKCATEGORYSELECTORDLG_H williamr@2: williamr@2: // End of File