epoc32/include/app/clmkeditordlg.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 viewing and editing
williamr@2
    15
*                landmark data.
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
#ifndef CLMKEDITORDLG_H
williamr@2
    25
#define CLMKEDITORDLG_H
williamr@2
    26
williamr@2
    27
//  INCLUDES
williamr@2
    28
#include "EPos_CPosLandmark.h"
williamr@2
    29
#include <EPos_Landmarks.h> // Lm typedefs, constants etc.
williamr@2
    30
#include <e32base.h>        // CBase
williamr@2
    31
williamr@2
    32
// FORWARD DECLARATIONS
williamr@2
    33
class CPosLandmarkDatabase;
williamr@2
    34
class CPosLandmark;
williamr@2
    35
class CLmkEditorImpl;
williamr@2
    36
class MObjectProvider;
williamr@2
    37
class TCoeHelpContext;
williamr@2
    38
class CLmkSender;
williamr@2
    39
williamr@2
    40
// TYPE DEFINITIONS
williamr@2
    41
typedef TUint32 TLmkEditorAttributes;
williamr@2
    42
typedef TInt TLmkEditorMode;
williamr@2
    43
williamr@2
    44
// CLASS DECLARATION
williamr@2
    45
/**
williamr@2
    46
*  This is a dialog class, which is used to launch landmark viewer/editor.
williamr@2
    47
*  It provides functionality for viewing and editing landmark data.
williamr@2
    48
*  By default all the fields are shown, but user can customize the total number of
williamr@2
    49
*  displayable fields. It also supports mechanism to disable map and navigation
williamr@2
    50
*  related menu option.
williamr@2
    51
*/
williamr@2
    52
class CLmkEditorDlg : public CBase
williamr@2
    53
    {
williamr@2
    54
    public: // Types
williamr@2
    55
williamr@2
    56
	      /*!
williamr@2
    57
	      @enum _TLmkEditorAttributes
williamr@2
    58
	      @discussion Defines the flag for displaying landmark fields on the viewer/editor dialog.
williamr@2
    59
          Any combination of these flags,will display those fields,when viewer/editor is launched.
williamr@2
    60
          By default the flag is set as ELmkAll.This flag is set in class TLmkEditorParams.
williamr@2
    61
       */
williamr@2
    62
williamr@2
    63
        enum _TLmkEditorAttributes
williamr@2
    64
            {
williamr@2
    65
            /**This flag allows Name field of the landmark, to be shown.*/
williamr@2
    66
            ELmkOnlyName            = 0x0000,
williamr@2
    67
            /**This flag allows the Category/Categories field of the landmark , to be shown*/
williamr@2
    68
            ELmkCategory            = 0x0001,
williamr@2
    69
            /**This flag allows the Street name field of the landmark,to be shown.*/
williamr@2
    70
            ELmkStreet              = 0x0002,
williamr@2
    71
            /**This flag allows the City name field to be shown, where the landmark belongs.*/
williamr@2
    72
            ELmkCity                = 0x0004,
williamr@2
    73
            /**This flag allows the State name field to be shown,where the landmark belongs.*/
williamr@2
    74
            ELmkStateProvince       = 0x0008,
williamr@2
    75
            /**This flag allows the Country name field to be shown, where landmark belongs.*/
williamr@2
    76
            ELmkCountry             = 0x0010,
williamr@2
    77
            /**This flag allows the Postal Zip field of the landmark, to be shown.*/
williamr@2
    78
            ELmkPostalZIP           = 0x0020,
williamr@2
    79
            /**This flag allows the Latitude field of the landmark, to be shown.*/
williamr@2
    80
            ELmkLatitude            = 0x0040,
williamr@2
    81
            /**This flag allows the Longitude field of the landmark, to be shown.*/
williamr@2
    82
            ELmkLongitude           = 0x0080,
williamr@2
    83
            /**This flag allows the Position accuracy field of the landmark, to be shown.It specifies the
williamr@2
    84
               horizontal accuracy of the landmark related to Longitude and Latitude values.
williamr@2
    85
            */
williamr@2
    86
            ELmkPositionAccuracy    = 0x0100,
williamr@2
    87
            /**This flag allows the Altitude field of the landmark, to be shown. It specifies the vertical
williamr@2
    88
               position of the landmark.*/
williamr@2
    89
            ELmkAltitude            = 0x0200,
williamr@2
    90
            /**This flag allows the Altitude accuracy field of the landmark, to be shown.It specifies the
williamr@2
    91
               vertical accuracy of the landmark related to Landmark's Altitude value.*/
williamr@2
    92
            ELmkAltitudeAccuracy    = 0x0400,
williamr@2
    93
            /**This flag allows All fields of the landmark, to be shown.*/
williamr@2
    94
            ELmkAll                 = 0xFFFF,
williamr@2
    95
            /**This flag allows the Description field of the landmark, to be shown.*/
williamr@2
    96
            ELmkDescription         = 0x0800,
williamr@2
    97
            /**This flag allows the Phone number field of the landmark, to be shown.*/
williamr@2
    98
            ELmkPhoneNumber         = 0x1000,
williamr@2
    99
            /**This flag allows the Web address field of the landmark, to be shown.*/
williamr@2
   100
            ELmkWebAddress          = 0x2000
williamr@2
   101
            };
williamr@2
   102
williamr@2
   103
        /*!
williamr@2
   104
         @enum _TLmkEditorMode
williamr@2
   105
         @discussion Defines flag, that decides the mode in which the landmark
williamr@2
   106
         dialog is launched(viewer or editor).
williamr@2
   107
         By default, the flag is set as ELmkEditor.This flag is set in class
williamr@2
   108
         TLmkEditorParams.
williamr@2
   109
        */
williamr@2
   110
	    enum _TLmkEditorMode
williamr@2
   111
            {
williamr@2
   112
            /**Landmark will be launched in editor mode. */
williamr@2
   113
            ELmkEditor,
williamr@2
   114
            /**Landmark will be launched in viewer mode. */
williamr@2
   115
            ELmkViewer  // only viewing allowed
williamr@2
   116
            };
williamr@2
   117
williamr@2
   118
        /**
williamr@2
   119
        * This class is a wrapper, around the flags @ref _TLmkEditorAttributes and @ref _TLmkEditorMode.
williamr@2
   120
        * It is used to set these flags to CLmkEditorDlg before launching the dialog.
williamr@2
   121
        * It encapsualtes _TLmkEditorAttributes & _TLmkEditorMode.
williamr@2
   122
        * It is used by class CLmkEditorDlg.
williamr@2
   123
        */
williamr@2
   124
        class TLmkEditorParams
williamr@2
   125
            {
williamr@2
   126
            public:  // Constructors and destructor
williamr@2
   127
                /**
williamr@2
   128
                * C++ Constructor.
williamr@2
   129
                * @return newly instantiated object
williamr@2
   130
                */
williamr@2
   131
                IMPORT_C TLmkEditorParams();
williamr@2
   132
williamr@2
   133
                // Compiler-generated destructor is ok for this class;
williamr@2
   134
williamr@2
   135
            private:  // Unimplemented functions
williamr@2
   136
                // Unimplemented copy constructor
williamr@2
   137
                TLmkEditorParams( const TLmkEditorParams& );
williamr@2
   138
williamr@2
   139
                // Unimplemented assignment operator
williamr@2
   140
                TLmkEditorParams& operator = ( const TLmkEditorParams& );
williamr@2
   141
williamr@2
   142
            public:  // Input parameters
williamr@2
   143
williamr@2
   144
                /**
williamr@2
   145
                * This member,specifies what all landmark attributes to be shown in editor/viewer dialog.
williamr@2
   146
                * It can have a combination of values from enum @ref _TLmkEditorAttributes.
williamr@2
   147
                * By default ELmkAll attribute is used if no value is specified.
williamr@2
   148
                */
williamr@2
   149
                TLmkEditorAttributes iAttributes;
williamr@2
   150
williamr@2
   151
                /**
williamr@2
   152
                * This member,specifies the mode (Viewer or Editor) in which the landmark dialog will be launched.
williamr@2
   153
                * It holds a value from enum @ref _TLmkEditorMode, by default ELmkEditor is used if no value is specified.
williamr@2
   154
                */
williamr@2
   155
                TLmkEditorMode iEditorMode;
williamr@2
   156
            };
williamr@2
   157
williamr@2
   158
    public:  // Constructors and destructor
williamr@2
   159
        /**
williamr@2
   160
        * This is a static function, which creates and returns an instance of this class,
williamr@2
   161
        * based on landmark id, which exists in landmark database.
williamr@2
   162
        * @param[in] aDb Reference to landmark database that includes this landmark.
williamr@2
   163
        * @param[in] aLandmark Landmark id, which exists in Landmarks database.
williamr@2
   164
        * @param[in] aParams Attribute, holds values for launching the landmark dialog
williamr@2
   165
        *			 in viewer or editor mode, and number of landmark fields to be
williamr@2
   166
        *            displayed.
williamr@2
   167
        * @panic Panics with system-wide panic codes.
williamr@2
   168
        * @leave Leaves with KErrNotFound,If the landmark does not exist in the database
williamr@2
   169
        *        Leaves with KErrNotSupported if framework functionality is not available.
williamr@2
   170
        * @return new instance of this class
williamr@2
   171
        */
williamr@2
   172
        IMPORT_C static CLmkEditorDlg* NewL( CPosLandmarkDatabase& aDb,
williamr@2
   173
                                             TPosLmItemId aLandmarkId,
williamr@2
   174
                                             TLmkEditorParams& aParams );
williamr@2
   175
williamr@2
   176
        /**
williamr@2
   177
        * This is a static function, which creates and returns an instance of this class,
williamr@2
   178
        * based on landmark object, which does not exist in landmark database.
williamr@2
   179
        * @param[in] aDb reference to landmark database, where new landmark will be created,
williamr@2
   180
        *            if launched in edit mode.
williamr@2
   181
        * @param [in\out] aLandmark  pre-filled landmarks object. In case of edit mode,
williamr@2
   182
        *  				 the passed aLandmark is updated with the information entered
williamr@2
   183
        *                by the user along with the landmark id, which can be obtained
williamr@2
   184
        *                by calling LandmarkId() method of CPosLandmark.
williamr@2
   185
        * @param[in] aParams aParams attributes whether to launch landmark in viewer mode
williamr@2
   186
        *            or editor mode.
williamr@2
   187
        * @panic Panics with system-wide panic codes.
williamr@2
   188
        * @leave Leaves with KErrNotSupported if framework functionality is not available.
williamr@2
   189
        * @return new instance of this class
williamr@2
   190
        */
williamr@2
   191
        IMPORT_C static CLmkEditorDlg* NewL( CPosLandmarkDatabase& aDb,
williamr@2
   192
                                             CPosLandmark& aLandmark,
williamr@2
   193
                                             TLmkEditorParams& aParams );
williamr@2
   194
williamr@2
   195
        /**
williamr@2
   196
        * Destructor.
williamr@2
   197
        */
williamr@2
   198
        IMPORT_C ~CLmkEditorDlg();
williamr@2
   199
williamr@2
   200
    public: // New functions
williamr@2
   201
        /**
williamr@2
   202
        * This method sets the context - that is, the enclosing parent control - for this control.
williamr@2
   203
        * @param[in] aParent The parent object which is the context for the control.
williamr@2
   204
        */
williamr@2
   205
        IMPORT_C void SetMopParent( MObjectProvider* aParent );
williamr@2
   206
williamr@2
   207
        /**
williamr@2
   208
        * This method sets help context. There are many applications using landmark editor
williamr@2
   209
        * and they may have an own help topic to be shown, when editor's help
williamr@2
   210
        * is launched. With this command it is possible to define the used
williamr@2
   211
        * help content. Landmark's own help context is used as default.
williamr@2
   212
        * @param[in] aContext help context to use
williamr@2
   213
        */
williamr@2
   214
        IMPORT_C void SetHelpContext( TCoeHelpContext aContext );
williamr@2
   215
williamr@2
   216
        /**
williamr@2
   217
        * This function launches the landmark dialog.It launches the dialog either in viewer
williamr@2
   218
        * or editor mode , depending upon the flag set.
williamr@2
   219
        *
williamr@2
   220
        * Editor mode:
williamr@2
   221
        * 	When the dialog is launched in edit mode, the user can edit the landmark fields (some or all)
williamr@2
   222
        * 	and can save the Landmark.
williamr@2
   223
        * 	On closing the dialog, the landmark is saved to the landmark database. If saving a
williamr@2
   224
        * 	landmark fails due to less memory, the user is notified with an information note. If any
williamr@2
   225
        * 	of the landmark fields are filled and landmark name is not provided, user is asked to
williamr@2
   226
        * 	provide the landmark name, else if nothing is entered the dialog will close without saving
williamr@2
   227
        *   the landmark.
williamr@2
   228
        *   In case of new landmark creation, once the dialog is closed and the application returns
williamr@2
   229
        *   from ExecuteLD() method, client applications can obtain the landmark id of the newly
williamr@2
   230
        *   created landmark by calling LandmarkId() method from CPosLandmark class.
williamr@2
   231
        *
williamr@2
   232
        * Viewer mode:
williamr@2
   233
        * The user can view the Landmark contents by accepting the dialog
williamr@2
   234
        *                      Canelling the dialog will close the dialog
williamr@2
   235
        * @panic Panics with system-wide, panic codes.
williamr@2
   236
        * @leave  Leaves with KErrNotSupported if framework functionality is not available.
williamr@2
   237
        * @return Returns non-zero if accepted & saved in edit mode.
williamr@2
   238
        		  Returns zero if fails due to less memory or any other error
williamr@2
   239
        		  in edit mode.It always returns zero in view mode.
williamr@2
   240
        */
williamr@2
   241
        IMPORT_C TInt ExecuteLD();
williamr@2
   242
        /**
williamr@2
   243
        * This function, when invoked, disables the Map and Navigation related Menu Options
williamr@2
   244
        * This needs to be invoked before ExecuteLD(). By default, the Map and Navigation
williamr@2
   245
        * menu options are enabled and are shown.
williamr@2
   246
        *
williamr@2
   247
        */
williamr@2
   248
        IMPORT_C void DisableMapAndNavigationMenuOptions();
williamr@2
   249
williamr@2
   250
    private:
williamr@2
   251
        /**
williamr@2
   252
        * C++ default constructor.
williamr@2
   253
        * @return newly instantiated object
williamr@2
   254
        */
williamr@2
   255
        CLmkEditorDlg();
williamr@2
   256
williamr@2
   257
        /**
williamr@2
   258
        * By default Symbian 2nd phase constructor is private.
williamr@2
   259
        * @param aDb
williamr@2
   260
        * @param aParams
williamr@2
   261
        * @param aLandmarkId
williamr@2
   262
        * @param aLandmark
williamr@2
   263
        */
williamr@2
   264
        void ConstructL( CPosLandmarkDatabase& aDb,
williamr@2
   265
                         TLmkEditorParams& aParams,
williamr@2
   266
                         TPosLmItemId aLandmarkId,
williamr@2
   267
                         CPosLandmark* aLandmark );
williamr@2
   268
williamr@2
   269
    private:    // Data
williamr@2
   270
        /// Own: Search implementor object
williamr@2
   271
        CLmkEditorImpl* iEditorImpl;
williamr@2
   272
williamr@2
   273
        /// Own: A pointer to TBool
williamr@2
   274
        TBool* iDestroyedPtr;
williamr@2
   275
williamr@2
   276
        /// Own: Landmark sender object
williamr@2
   277
        CLmkSender* iSender;
williamr@2
   278
    };
williamr@2
   279
williamr@2
   280
#endif      // CLMKEDITORDLG_H
williamr@2
   281
williamr@2
   282
// End of File