meetingrequest/mrgui/inc/cesmrviewerdialog.h
branchRCL_3
changeset 25 3533d4323edc
equal deleted inserted replaced
24:d189ee25cf9d 25:3533d4323edc
       
     1 /*
       
     2 * Copyright (c) 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 viewer dialog
       
    15 *
       
    16 */
       
    17 #ifndef CESMRVIEWERDIALOG_H
       
    18 #define CESMRVIEWERDIALOG_H
       
    19 
       
    20 #include <AknDialog.h>
       
    21 #include <akntoolbarobserver.h>
       
    22 #include <AknServerApp.h>
       
    23 #include "mesmruibase.h"
       
    24 #include "mesmrresponseobserver.h"
       
    25 #include "resmrstatic.h"
       
    26 #include "mesmrfieldeventobserver.h"
       
    27 #include "mesmrnaviarroweventobserver.h"
       
    28 #include "cesmrfieldbuilderinterface.h"
       
    29 
       
    30 class MESMRFieldStorage;
       
    31 class MESMRCalEntry;
       
    32 class CESMRView;
       
    33 class MAgnEntryUiCallback;
       
    34 class CESMRPolicy;
       
    35 class CESMRSendUI;
       
    36 class CCEUIPolicyResolver;
       
    37 class CESMRPolicyManager;
       
    38 class CESMRLocationPluginHandler;
       
    39 class CESMRFeatureSettings;
       
    40 class CMRToolbar;
       
    41 class TDataType;
       
    42 class MMRInfoProvider;
       
    43 class MMRFocusStrategy;
       
    44 class CESMRTitlePaneHandler;
       
    45 
       
    46 /**
       
    47  *  CESMRViewerDialog implements the viewer dialog for meeting requests.
       
    48  *
       
    49  *  @see mesmruibase.h, mesmruifactory.h
       
    50  *  @lib esmrgui.lib
       
    51  */
       
    52 NONSHARABLE_CLASS( CESMRViewerDialog ):
       
    53          public CAknDialog,
       
    54          public MESMRUiBase,
       
    55          public MESMRResponseObserver,
       
    56          public MESMRFieldEventObserver,
       
    57          public MAknToolbarObserver,
       
    58          public MESMRNaviArrowEventObserver
       
    59     {
       
    60 public:
       
    61 
       
    62     /**
       
    63      * Two-phased constructor.
       
    64      *
       
    65      * @param aInfoProvider Reference to MR / entry info provider.
       
    66      * @param aCallback Callback interface for AgnEntryUI
       
    67      * @return Pointer to created and initialized esmr editor dialog.
       
    68      */
       
    69      IMPORT_C static CESMRViewerDialog* NewL(
       
    70              MMRInfoProvider& aInfoProvider,
       
    71              MAgnEntryUiCallback& aCallback );
       
    72     /*
       
    73      * Destructor.
       
    74      */
       
    75     ~CESMRViewerDialog();
       
    76 
       
    77 public: // From CAknDialog
       
    78     SEikControlInfo CreateCustomControlL( TInt aType );
       
    79     TKeyResponse OfferKeyEventL(const TKeyEvent& aEvent, TEventCode aType);
       
    80     TBool OkToExitL (TInt aButtonId);
       
    81     void ProcessCommandL( TInt aCommand );
       
    82     void DynInitMenuPaneL(
       
    83             TInt aResourceId,
       
    84             CEikMenuPane* aMenuPane );
       
    85     void ActivateL();
       
    86     void PreLayoutDynInitL();
       
    87     
       
    88 public: // From MESUIBase
       
    89     TInt ExecuteViewLD();
       
    90 
       
    91 public: // From MESMRResponseObserver
       
    92     TBool Response( TInt aCommand );
       
    93     void ExitDialog();
       
    94     void ChangeReadyResponseL();
       
    95 
       
    96 public: // From MAknToolbarObserver
       
    97     void DynInitToolbarL ( TInt aResourceId, CAknToolbar* aToolbar );
       
    98     void OfferToolbarEventL ( TInt aCommand );
       
    99 
       
   100 protected: // MESMRFieldEventObserver
       
   101     void HandleFieldEventL( const MESMRFieldEvent& aEvent );
       
   102     
       
   103 public: // From MESMRNaviArrowEventObserver
       
   104     void HandleNaviArrowEventL( const TInt aCommand );
       
   105 
       
   106 private: // Implementation
       
   107     void DoProcessCommandL( TInt aCommand );
       
   108     CESMRViewerDialog(
       
   109             MMRInfoProvider& aInfoProvider,
       
   110             MAgnEntryUiCallback& aCallback );
       
   111     void ConstructL();
       
   112     void OpenInDayModeL();
       
   113     void CommandTailL(HBufC16*& aTailBuffer);
       
   114     TBool HandleCommandForEventL( TInt aCommand );
       
   115     void SendCalendarEntryL(TInt aCommandId);
       
   116     void TryInsertSendMenuL(CEikMenuPane* aMenuPane);
       
   117     void HandleEmailSubmenuL(
       
   118             TInt aResourceId,
       
   119             CEikMenuPane* aMenuPane );
       
   120     void HandlePolicyMenuL(
       
   121             TInt aResourceId,
       
   122             CEikMenuPane* aMenuPane );
       
   123     void HandleDynamicMenuItemsL(
       
   124             TInt aResourceId,
       
   125             CEikMenuPane* aMenuPane );
       
   126     TBool SupportsMailBoxCapabilityL( 
       
   127             MESMRBuilderExtension::TMRCFSMailBoxCapability aCapa );
       
   128     TBool HandleMRExitL(
       
   129             TInt aCommand  );
       
   130     void HandleForwardMenuL(
       
   131             TInt aResourceId,
       
   132             CEikMenuPane* aMenuPane );
       
   133     CESMRLocationPluginHandler& LocationPluginHandlerL();
       
   134     void SetDefaultMiddleSoftKeyL();
       
   135     TInt TryToSaveAttachmentL();
       
   136     void SetContextMenu();
       
   137     void ShowContextMenuL();
       
   138     TBool UserWantToHandleAttachmentsL();
       
   139     void InitLocationMenuL(
       
   140             CEikMenuPane* aMenuPane );
       
   141     void ConstructToolbarL();
       
   142     void ProcessCommandEventL( const MESMRFieldEvent& aEvent );
       
   143     void ProcessFieldEventL( const MESMRFieldEvent& aEvent );
       
   144     
       
   145 private: // Data
       
   146 
       
   147      /// Ref: The only control in this dialog. Fwk deletes.
       
   148     CESMRView* iView;
       
   149     /// Ref: Agn Entry UI callback interface
       
   150     MAgnEntryUiCallback& iCallback;
       
   151     /// Own: Calendar Global data
       
   152     CESMRSendUI* iESMRSendUI;
       
   153     /// Own: Flag for marking exit
       
   154     TBool iExitTriggered;
       
   155     /// Own: Static TLS data handler
       
   156     RESMRStatic iESMRStatic;
       
   157     // Own: Location plugin handler.
       
   158     CESMRLocationPluginHandler* iLocationPluginHandler;
       
   159     // Own: Feature settings.
       
   160     CESMRFeatureSettings* iFeatures;
       
   161     /// Own: Toolbar
       
   162     CMRToolbar* iToolbar;
       
   163     /// Ref: Reference to mrinfo provider
       
   164     MMRInfoProvider& iInfoProvider;
       
   165     /// Own: Context menu resource ID.
       
   166     TInt iContextMenuResourceId;
       
   167     /// Own: Focus strategy of the viewer
       
   168     MMRFocusStrategy* iFocusStrategy;
       
   169     /// Own: Titlepane handler
       
   170     CESMRTitlePaneHandler* iTitlePane;
       
   171     };
       
   172 
       
   173 #endif // CESMRVIEWERDIALOG_H