meetingrequest/mrgui/inc/cesmrviewerdialog.h
changeset 0 8466d47a6819
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 viewer dialog
       
    15 *
       
    16 */
       
    17 #ifndef CESMRVIEWERDIALOG_H
       
    18 #define CESMRVIEWERDIALOG_H
       
    19 
       
    20 #include <AknDialog.h>
       
    21 #include <akntoolbarobserver.h>
       
    22 #include <AknNaviDecoratorObserver.h>
       
    23 #include <msvapi.h>
       
    24 
       
    25 #include "mesmruibase.h"
       
    26 #include "mesmrresponseobserver.h"
       
    27 #include "resmrstatic.h"
       
    28 #include "mesmrfieldeventobserver.h"
       
    29 
       
    30 class MESMRFieldStorage;
       
    31 class MESMRCalEntry;
       
    32 class CESMRView;
       
    33 class MAgnEntryUiCallback;
       
    34 class CESMRPolicy;
       
    35 class CESMRSendUI;
       
    36 class CAiwServiceHandler;
       
    37 class CCEUIPolicyResolver;
       
    38 class CESMRPolicyManager;
       
    39 class CESMRLocationPluginHandler;
       
    40 class CESMRFeatureSettings;
       
    41 class CAknNavigationDecorator;
       
    42 class MESMRMeetingRequestEntry;
       
    43 class TFSMailMsgId;
       
    44 
       
    45 /**
       
    46  *  CESMRViewerDialog implements the viewer dialog for meeting requests.
       
    47  *
       
    48  *  @see mesmruibase.h, mesmruifactory.h
       
    49  *  @lib esmrgui.lib
       
    50  */
       
    51 NONSHARABLE_CLASS( CESMRViewerDialog ):
       
    52          public CAknDialog,
       
    53          public MESMRUiBase,
       
    54          public MESMRResponseObserver,
       
    55          public MESMRFieldEventObserver,
       
    56          public MAknToolbarObserver,
       
    57          public MAknNaviDecoratorObserver,
       
    58          public MMsvSessionObserver
       
    59     {
       
    60 public:
       
    61 
       
    62     /**
       
    63      * Two-phased constructor.
       
    64      *
       
    65      * @param aStorage Field storage contains all the fields for list component.
       
    66      * @param aEntry ESMR calendar entry (wraps the CCalEntry object)
       
    67      * @param aCallback Callback interface for AgnEntryUI
       
    68      * @return Pointer to created and initialized esmr editor dialog.
       
    69      */
       
    70      IMPORT_C static CESMRViewerDialog* NewL(
       
    71         CESMRPolicy* aPolicy,
       
    72         MESMRCalEntry& aEntry,
       
    73         MAgnEntryUiCallback& aCallback );
       
    74     /*
       
    75      * Destructor.
       
    76      */
       
    77     ~CESMRViewerDialog();
       
    78 
       
    79 public: // From CAknDialog
       
    80     SEikControlInfo CreateCustomControlL( TInt aType );
       
    81     TKeyResponse OfferKeyEventL(const TKeyEvent& aEvent, TEventCode aType);
       
    82     TBool OkToExitL (TInt aButtonId);
       
    83     void ProcessCommandL( TInt aCommand );
       
    84     void DynInitMenuPaneL(
       
    85             TInt aResourceId,
       
    86             CEikMenuPane* aMenuPane );
       
    87     void ActivateL();
       
    88     void PreLayoutDynInitL();
       
    89 
       
    90 public: // From MESUIBase
       
    91     TInt ExecuteViewLD();
       
    92 
       
    93 public: // From MESMRResponseObserver
       
    94     TBool Response( TInt aCommand );
       
    95     void ExitDialog();
       
    96     void ChangeReadyResponseL();
       
    97 
       
    98 public: // From MAknToolbarObserver
       
    99     virtual void OfferToolbarEventL( TInt aCommand );
       
   100 
       
   101 public: // from MAknNaviDecoratorObserver
       
   102     void HandleNaviDecoratorEventL( TInt aEventID );
       
   103 
       
   104 public: // from MMsvSessionObserver
       
   105     void HandleSessionEventL( 
       
   106         TMsvSessionEvent aEvent, TAny* aArg1,
       
   107         TAny* aArg2, TAny* aArg3 );
       
   108     
       
   109 public:
       
   110     /**
       
   111      *  Static method that is given as callback to CIdle object
       
   112      *  handling the navigation decorator right arrow event.
       
   113      *  
       
   114      *  @param aObjPtr TAny-casted pointer to an instance of this class.
       
   115      *  @return Always KErrNone.
       
   116      */
       
   117     static TInt RunCmdMailNextMessageIdle( TAny* aObjPtr );
       
   118     
       
   119     /**
       
   120      *  Static method that is given as callback to CIdle object
       
   121      *  handling the navigation decorator left arrow event.
       
   122      *  
       
   123      *  @param aObjPtr TAny-casted pointer to an instance of this class.
       
   124      *  @return Always KErrNone.
       
   125      */
       
   126     static TInt RunCmdMailPreviousMessageIdle( TAny* aObjPtr );
       
   127     
       
   128 protected: // MESMRFieldEventObserver
       
   129     void HandleFieldEventL( const MESMRFieldEvent& aEvent );
       
   130 
       
   131 private: // Implementation
       
   132     void DoProcessCommandL( TInt aCommand );
       
   133     CESMRViewerDialog( MESMRCalEntry& aEntry, MAgnEntryUiCallback& aCallback );
       
   134     void ConstructL( CESMRPolicy* aPolicy );
       
   135     void OpenInDayModeL();
       
   136     void CommandTailL(HBufC16*& aTailBuffer);
       
   137     TBool HandleCommandForRecurrentEventL( TInt aCommand );
       
   138     void SendCalendarEntryL(TInt aCommandId);
       
   139     void TryInsertSendMenuL(CEikMenuPane* aMenuPane);
       
   140     void HandlePrintCommandL(TInt aCommand);
       
   141     void HandleEmailSubmenuL(
       
   142             TInt aResourceId,
       
   143             CEikMenuPane* aMenuPane );
       
   144     void HandlePolicyMenuL(
       
   145             TInt aResourceId,
       
   146             CEikMenuPane* aMenuPane );
       
   147     void HandleDynamicMenuItemsL(
       
   148             TInt aResourceId,
       
   149             CEikMenuPane* aMenuPane );
       
   150     TBool SupportsAttendeeStatusL();
       
   151     TBool HandleMRExitL(
       
   152             TInt aCommand  );
       
   153     TBool SupportsForwardingAsMeetingL( 
       
   154             MESMRMeetingRequestEntry* aEntry,
       
   155             TBool aForceResetDefaultMRMailbox );
       
   156     CESMRLocationPluginHandler& LocationPluginHandlerL();
       
   157     void SetDefaultMiddleSoftKeyL();
       
   158     TPtrC DigMailboxAndRemovePrefixL();
       
   159     void MakeMrGuiToolbarButtonsL();
       
   160     void ClearToolbarL();
       
   161     TInt AccountIdL( const TFSMailMsgId& aMailboxId );
       
   162     
       
   163 private: // Data
       
   164 
       
   165     /// Own: Feature manager initialization flag
       
   166     TBool iFeatureManagerInitialized;
       
   167     /// Ref: The only control in this dialog. Fwk deletes.
       
   168     CESMRView* iView;
       
   169     /// Ref: Reference to MESRCalEntry (CCalEntry wrapper)
       
   170     MESMRCalEntry& iEntry;
       
   171     /// Ref: Agn Entry UI callback interface
       
   172     MAgnEntryUiCallback& iCallback;
       
   173     /// Ref: Pointer to policy
       
   174     CESMRPolicy* iPolicy;
       
   175     /// Own: Calendar Global data
       
   176     CESMRSendUI* iESMRSendUI;
       
   177     /// Own: AIW Service handler
       
   178     CAiwServiceHandler* iServiceHandler;
       
   179     /// Own: Flag for marking exit
       
   180     TBool iExitTriggered;
       
   181     /// Own: Static TLS data handler
       
   182     RESMRStatic iESMRStatic;
       
   183     // Own: Location plugin handler.    
       
   184     CESMRLocationPluginHandler* iLocationPluginHandler;
       
   185     // Own: Feature settings.
       
   186     CESMRFeatureSettings* iFeatures;
       
   187     // Not own: Pointer to previous toolbar observer.
       
   188     MAknToolbarObserver* iOldObserver;
       
   189     // flag to indicate toolbar can be cleared
       
   190     TBool iClearToolbar;
       
   191     // Own: CIdle object through which navi button events are handled.
       
   192     //      CIdle with callback is used because the navi buttons events
       
   193     //      cause deletion of this dialog, but the actual button event 
       
   194     //      handling needs to be completed before closing the dialog.
       
   195     CIdle* iIdleNaviEventRunner;
       
   196     // Not own: Pointer to navigation decorator
       
   197     CAknNavigationDecorator* iESMRNaviDecorator;
       
   198     };
       
   199 
       
   200 #endif // CESMRVIEWERDIALOG_H