meetingrequest/mrgui/inc/cesmreditordialog.h
changeset 0 8466d47a6819
child 14 48df8036c0f5
child 16 4ce476e64c59
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     1 /*
       
     2 * Copyright (c) 2007-2009 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:  ESMR editor dialog
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CESMREDITORDIALOG_H
       
    19 #define CESMREDITORDIALOG_H
       
    20 
       
    21 #include <AknDialog.h>
       
    22 #include "mesmruibase.h"
       
    23 #include "mesmrresponseobserver.h"
       
    24 #include "mesmrfieldeventobserver.h"
       
    25 
       
    26 class CESMRPolicy;
       
    27 class MESMRCalEntry;
       
    28 class CESMRView;
       
    29 class MAgnEntryUiCallback;
       
    30 class CESMRSendUI;
       
    31 class CAiwServiceHandler;
       
    32 class CESMRField;
       
    33 class CESMRTitlePaneHandler;
       
    34 class CCalenInterimUtils2;
       
    35 class CESMRLocationPluginHandler;
       
    36 class CESMRAddressInfoHandler;
       
    37 class CESMRFeatureSettings;
       
    38 
       
    39 /**
       
    40  *  CESMREditorDialog implements the editor dialog for meeting requests.
       
    41  *
       
    42  *  @see mesmruibase.h, mesmruifactory.h
       
    43  *  @lib esmrgui.lib
       
    44  */
       
    45 NONSHARABLE_CLASS( CESMREditorDialog ) :
       
    46 		public CAknDialog,
       
    47 		public MESMRUiBase,
       
    48 		public MESMRResponseObserver,
       
    49 		public MESMRFieldEventObserver
       
    50     {
       
    51 public:
       
    52     /**
       
    53      * Two-phased constructor.
       
    54      *
       
    55      * @param aPolicy contains all the fields for list component.
       
    56      * @param aEntry ESMR calendar entry (wraps the CCalEntry object)
       
    57      * @param aCallback Callback interface for AgnEntryUI
       
    58      * @return Pointer to created and initialized esmr editor dialog.
       
    59      */
       
    60     IMPORT_C static CESMREditorDialog* NewL(
       
    61             CESMRPolicy* aPolicy,
       
    62             MESMRCalEntry& aEntry,
       
    63             MAgnEntryUiCallback& aCallback );
       
    64 
       
    65     /*
       
    66      * Destructor.
       
    67      */
       
    68     ~CESMREditorDialog();
       
    69 
       
    70 public: // From CAknDialog
       
    71     SEikControlInfo CreateCustomControlL( TInt aType );
       
    72     TKeyResponse OfferKeyEventL(
       
    73             const TKeyEvent& aEvent,
       
    74             TEventCode aType);
       
    75     TBool OkToExitL ( TInt aButtonId );
       
    76     void ActivateL();
       
    77     void ProcessCommandL( TInt aCommand );
       
    78     void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
       
    79 
       
    80 public: // From MESMRUIBase
       
    81     TInt ExecuteViewLD();
       
    82 
       
    83 public: // From MESMRResponseObserver
       
    84     TBool Response( TInt aCommand );
       
    85     void ExitDialog();
       
    86     void ChangeReadyResponseL();
       
    87     
       
    88 protected: // From MESMRFieldEventObserver
       
    89     void HandleFieldEventL( const MESMRFieldEvent& aEvent );
       
    90 
       
    91 private: // Implementation
       
    92 
       
    93     void DoProcessCommandL( TInt aCommand );
       
    94 
       
    95     /**
       
    96      * Constructor.
       
    97      *
       
    98      * @param aEntry ESMR calendar entry (wraps the CCalEntry object)
       
    99      * @param aCallback Callback interface for AgnEntryUI
       
   100      */
       
   101     CESMREditorDialog(
       
   102             MESMRCalEntry& aEntry,
       
   103             MAgnEntryUiCallback& aCallback );
       
   104 
       
   105     /**
       
   106      * Second phase constructor.
       
   107      *
       
   108      * @param aPolicy contains all the fields for list component.
       
   109      */
       
   110     void ConstructL( CESMRPolicy* aPolicy );
       
   111 
       
   112     /**
       
   113      * Handles dialog exit, saves entry etc.
       
   114      * @return TInt
       
   115      */
       
   116     TInt HandleExitL();
       
   117 
       
   118     /**
       
   119      * Handles dialog exit, saves, no queries.
       
   120      * @param aShowConfirmationQuery ETrue shows 'save changes' query before saving entry.
       
   121      * @return TInt
       
   122      */
       
   123     TInt HandleForcedExitL( TBool aShowConfirmationQuery = EFalse );
       
   124 
       
   125     /**
       
   126      * Sends calendar entry.
       
   127      * @param aCommandId
       
   128      */
       
   129     void SendCalendarEntryL(TInt aCommandId);
       
   130 
       
   131     /**
       
   132      * Tries to add send menu item to options menu if needed.
       
   133      * @param aMenuPane
       
   134      */
       
   135     void TryInsertSendMenuL(CEikMenuPane* aMenuPane);
       
   136 
       
   137     /**
       
   138      * Handles print command.
       
   139      * @param aCommand
       
   140      */
       
   141     void HandlePrintCommandL(TInt aCommand);
       
   142 
       
   143     /**
       
   144      * Executes user related queries whether the entry should be
       
   145      * save or not.
       
   146      * @return TBool
       
   147      */
       
   148     TBool IsAllowedToSaveL();
       
   149 
       
   150     /**
       
   151      * Checks if cfsmailbox actually supports attendee status
       
   152      * @return TBool
       
   153      */
       
   154     TBool CESMREditorDialog::SupportsAttendeeStatusL( );
       
   155     
       
   156     /**
       
   157      * Handle options menu command "open"
       
   158      */
       
   159     void HandleOpenCmdL();
       
   160 
       
   161     /**
       
   162      * Handles Location Options submenu content
       
   163      * 
       
   164      * @param aResourceId Menu resource id
       
   165      * @param aMenuPane menu pane 
       
   166      */
       
   167     void HandleLocationOptionsL( TInt aResourceId, CEikMenuPane* aMenuPane );
       
   168     
       
   169     /**
       
   170      * Loads options menu text for given command.
       
   171      * 
       
   172      * @param aCommandId option menu item command id
       
   173      * @return text
       
   174      */
       
   175     HBufC* LoadOptionsMenuTextLC( TInt aCommandId );
       
   176     
       
   177     CESMRLocationPluginHandler& LocationPluginHandlerL();
       
   178     
       
   179     CESMRAddressInfoHandler& AddressInfoHandlerL();
       
   180     
       
   181     void HandleFieldCommandEventL( const MESMRFieldEvent& aEvent );
       
   182     
       
   183     void HandleFieldChangeEventL( const MESMRFieldEvent& aEvent );
       
   184     
       
   185 private:
       
   186 
       
   187     /**
       
   188      * Own: Feature manager initialization flag
       
   189      */
       
   190     TBool iFeatureManagerInitialized;
       
   191 
       
   192     /**
       
   193      * Ref: Policy for building fields and menus
       
   194      */
       
   195     CESMRPolicy* iPolicy;
       
   196 
       
   197     /**
       
   198      * Ref: The only control in this dialog. Fwk deletes.
       
   199      */
       
   200     CESMRView* iView;
       
   201 
       
   202     /**
       
   203      * Ref: Reference to MESRCalEntry (CCalEntry wrapper)
       
   204      */
       
   205     MESMRCalEntry& iEntry;
       
   206 
       
   207     /**
       
   208      * Ref: Agn Entry UI callback interface
       
   209      */
       
   210     MAgnEntryUiCallback& iCallback;
       
   211 
       
   212     /**
       
   213      * Own: Calendar Global data
       
   214      */
       
   215     CESMRSendUI* iESMRSendUI;
       
   216 
       
   217     /**
       
   218      * Own: AIW Service handler
       
   219      */
       
   220     CAiwServiceHandler* iServiceHandler;
       
   221 
       
   222     /**
       
   223      * Own: Boolean indicating if required attendees field contains items.
       
   224      */
       
   225     TBool iRequiredAttendeesEnabled;
       
   226 
       
   227     /**
       
   228      * Own: Boolean indicating if optional attendees field contains items.
       
   229      */
       
   230     TBool iOptionalAttendeesEnabled;
       
   231 
       
   232     /// Own: Titlepane handler
       
   233     CESMRTitlePaneHandler* iTitlePane;
       
   234 
       
   235     /**
       
   236      * Pointer to instance of CCalenInterimUtils2.
       
   237      * Own: Release on destruct.
       
   238      */
       
   239     CCalenInterimUtils2* iInterimUtils;
       
   240     
       
   241 	/**
       
   242 	 * Location plugin handler.
       
   243 	 * Own.
       
   244 	 */
       
   245     CESMRLocationPluginHandler* iLocationPluginHandler;
       
   246 	
       
   247     /**
       
   248      * Address info handler.
       
   249      * Own.
       
   250      */
       
   251     CESMRAddressInfoHandler* iAddressInfoHandler;
       
   252     
       
   253     /**
       
   254      * Feature settings.
       
   255      * Own.
       
   256      */
       
   257     CESMRFeatureSettings* iFeatures;
       
   258     
       
   259     /**
       
   260      * Indicates if meeting request occurs in past. 
       
   261      */
       
   262     TBool iOccursInPast;
       
   263     
       
   264     /**
       
   265      * Indicates if location has been modified.
       
   266      */
       
   267     TBool iLocationModified;
       
   268     };
       
   269 
       
   270 #endif  // CESMREDITORDIALOG_H