loc_pub/landmarks_ui_selector_api/inc/CLmkCategorySelectorDlg.h
branchRCL_3
changeset 17 1fc85118c3ae
parent 16 8173571d354e
child 18 870918037e16
equal deleted inserted replaced
16:8173571d354e 17:1fc85118c3ae
     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 categories.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 #ifndef CLMKCATEGORYSELECTORDLG_H
       
    26 #define CLMKCATEGORYSELECTORDLG_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 // FORWARD DECLARATIONS
       
    34 //class CPosLandmarkDatabase;
       
    35 class CLmkDlgSelectorImplBase;
       
    36 class MObjectProvider;
       
    37 
       
    38 // For multiple database support
       
    39 class TLmkItemIdDbCombiInfo;
       
    40 
       
    41 // CLASS DECLARATION
       
    42 
       
    43 /**
       
    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.
       
    50 */
       
    51 class CLmkCategorySelectorDlg : public CBase
       
    52     {
       
    53     public:  // Constructors and destructor
       
    54         /**
       
    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.
       
    57         *
       
    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
       
    63         */
       
    64         IMPORT_C static CLmkCategorySelectorDlg* NewL(TBool aShowEmptyCategories = EFalse );
       
    65 
       
    66         /**
       
    67         * Destructor.
       
    68         */
       
    69         IMPORT_C ~CLmkCategorySelectorDlg();
       
    70 
       
    71     public: // New functions
       
    72         /**
       
    73         * This function sets the context - that is, the enclosing parent control - for this control.
       
    74         *
       
    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.
       
    78         */
       
    79         IMPORT_C void SetMopParent( MObjectProvider* aParent );
       
    80 
       
    81         /**
       
    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.
       
    90         */
       
    91         IMPORT_C TInt ExecuteLD( TLmkItemIdDbCombiInfo& aSelected );
       
    92 
       
    93         /**
       
    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.
       
   100         *
       
   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.
       
   107         */
       
   108         IMPORT_C TInt ExecuteLD( RArray<TLmkItemIdDbCombiInfo>& aSelectedItems );
       
   109 
       
   110     private:
       
   111         /**
       
   112         * C++ default constructor.
       
   113         * @return newly instantiated object
       
   114         */
       
   115         CLmkCategorySelectorDlg();
       
   116 
       
   117         /**
       
   118         * By default Symbian 2nd phase constructor is private.
       
   119         * @param aShowEmptyCategories
       
   120         */
       
   121         void ConstructL( TBool aShowEmptyCategories );
       
   122 
       
   123     private:    // Data
       
   124         // ETrue if executed in multiple item selector mode
       
   125         TBool iIsMultiSelector;
       
   126 
       
   127         ///Own: Search implementor object
       
   128         CLmkDlgSelectorImplBase* iSelector;
       
   129 
       
   130         //Own: Set to ETrue in destructor
       
   131         TBool* iDestroyedPtr;
       
   132 
       
   133         // Multiple database support
       
   134         RPointerArray <CPosLandmarkDatabase> iDbs;
       
   135 
       
   136     };
       
   137 
       
   138 #endif      // CLMKCATEGORYSELECTORDLG_H
       
   139 
       
   140 // End of File