epoc32/include/app/clmklandmarkselectordlg.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
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 landmarks.
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 CLMKLANDMARKSELECTORDLG_H
williamr@2
    26
#define CLMKLANDMARKSELECTORDLG_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
williamr@2
    34
// FORWARD DECLARATIONS
williamr@2
    35
//class CPosLandmarkDatabase;
williamr@2
    36
class CLmkDlgSelectorImplBase;
williamr@2
    37
class MObjectProvider;
williamr@2
    38
williamr@2
    39
// For multiple database support
williamr@2
    40
class TLmkItemIdDbCombiInfo;
williamr@2
    41
williamr@2
    42
// CLASS DECLARATION
williamr@2
    43
williamr@2
    44
/**
williamr@2
    45
*  This is a dialog class, which is used to launch landmark selector dialog and
williamr@2
    46
*  to get the selected landmark ids.It displays the landmarks present in landmarks
williamr@2
    47
*  database,as a list.The dialog can be a single selector or multiple selector dialog,
williamr@2
    48
*  depending upon argument passed by the client (in ExecuteLD function)  at the time
williamr@2
    49
*  when it is launched.Based on whether it is a single selector or multiple selector
williamr@2
    50
*  dialog, user can select single landmark or multiple landmarks.
williamr@2
    51
*/
williamr@2
    52
class CLmkLandmarkSelectorDlg : public CBase
williamr@2
    53
    {
williamr@2
    54
    public:  // Constructors and destructor
williamr@2
    55
        /**
williamr@2
    56
        * This is a static function, which creates and returns an instance of this class.
williamr@2
    57
        * All the landmarks present in the landmark database are shown in the selector.
williamr@2
    58
    	*
williamr@2
    59
        * @leave  Leaves with KErrNotSupported if framework functionality is not available.
williamr@2
    60
        * @panic  Panics with system-wide panic codes.
williamr@2
    61
        * @return new instance of this class
williamr@2
    62
        */
williamr@2
    63
        IMPORT_C static CLmkLandmarkSelectorDlg* NewL();
williamr@4
    64
        
williamr@4
    65
        /**
williamr@4
    66
        * This is a static function, which creates and returns an instance of this class.
williamr@4
    67
        * All the landmarks present in the user specified landmark database are shown in the selector.
williamr@4
    68
        * @param[in] aDatabaseUri The URI of the databases to open.
williamr@4
    69
    		*
williamr@4
    70
        * @leave  Leaves with KErrNotSupported if framework functionality is not available or
williamr@4
    71
        *					the protocol specified in URI is not supported.
williamr@4
    72
        * @leave  Leaves with KErrArgument if an empty string is passed as argument or
williamr@4
    73
        *					extension of the local database name is not "ldb".
williamr@4
    74
        * @panic  Panics with system-wide panic codes.
williamr@4
    75
        * @return new instance of this class
williamr@4
    76
        */
williamr@4
    77
        IMPORT_C static CLmkLandmarkSelectorDlg* NewL( const TDesC&  aDatabaseUri );
williamr@2
    78
williamr@2
    79
        /**
williamr@2
    80
        * Destructor.
williamr@2
    81
        */
williamr@2
    82
        IMPORT_C ~CLmkLandmarkSelectorDlg();
williamr@2
    83
williamr@2
    84
    public: // New functions
williamr@2
    85
        /**
williamr@2
    86
        * This function sets the context - that is, the enclosing parent control - for this control.
williamr@2
    87
        *
williamr@2
    88
        * @param [in] aParent The parent object which is the context for the control.
williamr@2
    89
        * @panic Panics with KLmkPanicNullMember, if the selector is not
williamr@2
    90
        *        constructed properly.
williamr@2
    91
        */
williamr@2
    92
        IMPORT_C void SetMopParent( MObjectProvider* aParent );
williamr@2
    93
williamr@2
    94
        /**
williamr@2
    95
        * This function launches the landmark selector dialog. Client uses this function
williamr@2
    96
        * to launch single landmark selector dialog.
williamr@2
    97
        * This object is destroyed when this function returns or leaves.
williamr@2
    98
        * @param [in/out] aSelected Passed as reference and when the function returns,
williamr@2
    99
        *                contains the selected landmark id.
williamr@2
   100
        * @leave Leaves with system-wide leave codes.
williamr@2
   101
        * @panic Panics with KLmkPanicNullMember, if the selector is not constructed properly.
williamr@2
   102
        * @return Returns non-zero if accepted, else zero.
williamr@2
   103
        */
williamr@2
   104
        IMPORT_C TInt ExecuteLD( TLmkItemIdDbCombiInfo& aSelected );
williamr@2
   105
williamr@2
   106
        /**
williamr@2
   107
        * This function launches the landmark selector dialog. Client uses this function
williamr@2
   108
        * to launch multiple landmark selector dialog.
williamr@2
   109
        * This object is destroyed when this function returns or leaves.
williamr@2
   110
        * If the array(aSelectedItems) is passed with already filled landmark ids, then
williamr@2
   111
        * such landmarks will be shown as selected when the dialog is launched, but if
williamr@2
   112
        * any of these ids do not exist in landmarks database, it will be ignored.
williamr@2
   113
        *
williamr@2
   114
        * @param [in/out] aSelectedItems Passed as reference, either filled with landmark
williamr@2
   115
        *                ids for pre-selection or an empty array. On return of the function
williamr@2
   116
        *                contains the selected landmark ids.
williamr@2
   117
	    * @leave Leaves with system-wide leave codes.
williamr@2
   118
	    * @panic Panics with KLmkPanicNullMember, if the selector is not constructed properly.
williamr@2
   119
        * @return Returns non-zero if accepted, else zero.
williamr@2
   120
        */
williamr@2
   121
        IMPORT_C TInt ExecuteLD( RArray<TLmkItemIdDbCombiInfo>& aSelectedItems );
williamr@4
   122
williamr@4
   123
        /**
williamr@4
   124
        * This function sets the title string of the landmark selector dialog.
williamr@4
   125
        * This function has to be called before ExecuteLD() to make the set title appear on ui. 
williamr@4
   126
        * Calling this api after ExecuteLD() will not have any impact.
williamr@4
   127
        *
williamr@4
   128
        * @param [in] aTitle The title string of the selector dialog. 
williamr@4
   129
        * @panic Panics with KLmkPanicNullMember, if the selector is not
williamr@4
   130
        *        constructed properly.
williamr@4
   131
        */
williamr@4
   132
        IMPORT_C void SetDialogTitleL(const TDesC& aTitle );
williamr@4
   133
williamr@2
   134
    private:
williamr@2
   135
        /**
williamr@2
   136
        * C++ default constructor.
williamr@2
   137
        * @return newly instantiated object
williamr@2
   138
        */
williamr@2
   139
        CLmkLandmarkSelectorDlg();
williamr@2
   140
williamr@2
   141
        /**
williamr@2
   142
        * By default Symbian 2nd phase constructor is private.
williamr@2
   143
        */
williamr@2
   144
williamr@2
   145
        void ConstructL( );
williamr@2
   146
williamr@2
   147
williamr@2
   148
    private:    // Data
williamr@2
   149
        // ETrue if executed in multiple item selector mode
williamr@2
   150
        TBool iIsMultiSelector;
williamr@2
   151
williamr@4
   152
        // User defined database set to be viewed in selector
williamr@4
   153
        HBufC* iDatabaseUri;
williamr@4
   154
williamr@2
   155
        /// Own: Search implementor object
williamr@2
   156
        CLmkDlgSelectorImplBase* iSelector;
williamr@2
   157
williamr@2
   158
        // Set to ETrue in destructor
williamr@2
   159
        TBool* iDestroyedPtr;
williamr@2
   160
williamr@2
   161
        // For multiple database support
williamr@2
   162
        RPointerArray <CPosLandmarkDatabase> iDbs; //
williamr@2
   163
williamr@2
   164
williamr@2
   165
    };
williamr@2
   166
williamr@2
   167
#endif      // CLMKLANDMARKSELECTORDLG_H
williamr@2
   168
williamr@2
   169
// End of File