meetingrequest/mrviewer/inc/cesmrviewerctrl.h
branchRCL_3
changeset 64 3533d4323edc
equal deleted inserted replaced
63:d189ee25cf9d 64:3533d4323edc
       
     1 /*
       
     2 * Copyright (c) 2002-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:  Mrviewer controller definition
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CESMRVIEWERCTRL_H
       
    20 #define CESMRVIEWERCTRL_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <MAgnEntryUi.h>
       
    24 #include <CMRUtils.h>
       
    25 #include <e32base.h>
       
    26 #include "mmrinfoprovider.h"
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class CCalEntry;
       
    30 class TCoeHelpContext;
       
    31 class CMRDialogBase;
       
    32 class CESMRUtils;
       
    33 class CMRMailboxUtils;
       
    34 class CActiveSchedulerWait;
       
    35 class CESMRUiFactory;
       
    36 class CMREntryProcessor;
       
    37 class MESMRTaskExtension;
       
    38 class CESMRPolicyManager;
       
    39 class MESMRCalDbMgr;
       
    40 
       
    41 // CLASS DECLARATION
       
    42 
       
    43 /**
       
    44  * ESMRVIEWER controller is responsible for control logic and UI view
       
    45  * creation and execution.
       
    46  */
       
    47 NONSHARABLE_CLASS(CESMRViewerController)  :
       
    48         public CBase,
       
    49         public MAgnEntryUiCallback,
       
    50         public MMRUtilsObserver,
       
    51         public MMRInfoProvider
       
    52     {
       
    53 public:  // Constructors and destructor
       
    54     /**
       
    55     * Two-phased constructor.
       
    56     */
       
    57     IMPORT_C static CESMRViewerController * NewL(
       
    58             const TDesC8& aMtmuid,
       
    59             RPointerArray<CCalEntry>& aEntries,
       
    60             const MAgnEntryUi::TAgnEntryUiInParams& aParams,
       
    61             MAgnEntryUi::TAgnEntryUiOutParams& aOutParams,
       
    62             MAgnEntryUiCallback& aCallback );
       
    63 
       
    64     /**
       
    65     * Destructor.
       
    66     */
       
    67     IMPORT_C ~CESMRViewerController ();
       
    68 
       
    69 public: // Implementation
       
    70     IMPORT_C void ExecuteL();
       
    71 
       
    72 protected: // From MAgnEntryUICallback
       
    73     TBool IsCommandAvailable( TInt aCommandId );
       
    74     TInt ProcessCommandWithResultL( TInt aCommandId );
       
    75     void ProcessCommandL( TInt aCommandId);
       
    76 
       
    77 protected: // From MMRUtilsObserver
       
    78     void HandleCalEngStatus( TMRUtilsCalEngStatus aStatus );
       
    79     void HandleOperation(
       
    80             TInt aType,
       
    81             TInt aPercentageCompleted,
       
    82             TInt aStatus );
       
    83 
       
    84 protected: // From MMRInfoProvider
       
    85     MMRPolicyProvider& PolicyProvider() const;
       
    86     MESMRCalEntry* EntryL();
       
    87     
       
    88 private: // Constructors and implementation
       
    89     CESMRViewerController(
       
    90             RPointerArray<CCalEntry>& aEntries,
       
    91             const MAgnEntryUi::TAgnEntryUiInParams& aParams,
       
    92             MAgnEntryUi::TAgnEntryUiOutParams& aOutParams,
       
    93             MAgnEntryUiCallback& aCallback );
       
    94     void ConstructL(const TDesC8& aMtmuid);
       
    95     TInt ProcessCommandWithResultInternalL(
       
    96             TInt aCommandId );
       
    97     void LaunchUIL();
       
    98     void LaunchCorrectOperationModeL();
       
    99     TInt ProcessDefaultCommandL( TInt aCommandId );
       
   100     TInt ProcessMeetingRequestCommandL( TInt aCommandId );
       
   101     void ChangeEntryTypeL( TInt aCommandId );
       
   102     void UpdateComparativeEntryInTypeChangeL( const CCalEntry& aOriginalEntry );
       
   103     void CancelAndDeleteMRInEntryTypeChangeL( 
       
   104             CCalEntry& entry, MESMRCalDbMgr& aDbMgr );
       
   105 
       
   106 private: // Data
       
   107     /// Own: Operation error value
       
   108     TInt iExecutionError;
       
   109     /// Own: Pointer to ESMRUTILS handler
       
   110     CESMRUtils* iESMRUtils;
       
   111     // Ref: Oarameters from the launching application
       
   112     const MAgnEntryUi::TAgnEntryUiInParams iInParams;
       
   113     // Ref: Parameters for the launching application
       
   114     MAgnEntryUi::TAgnEntryUiOutParams& iOutParams;
       
   115     // Ref: callback for command handling
       
   116     MAgnEntryUiCallback& iCallback;
       
   117     // Ref: Calendar entries to be handled
       
   118     RPointerArray<CCalEntry>& iEntries;
       
   119     /// Own: MR UTILS syncher
       
   120     CActiveSchedulerWait* iCtrlSyncher;
       
   121     /// Own: UI factory
       
   122     CESMRUiFactory* iGuiFactory;
       
   123     /// Ref: Reference to entry processor
       
   124     CMREntryProcessor* iEntryProcessor;
       
   125     /// Ref: Reference to task extension
       
   126     MESMRTaskExtension* iTaskExt;
       
   127     /// Ref: Reference to policy manager
       
   128     CESMRPolicyManager* iPolicyMgr;
       
   129     /// Own: Current calendar entry to be handled
       
   130     CCalEntry* iCalEntry;
       
   131     };
       
   132 
       
   133 #endif      // CMRHANDLER_H
       
   134 
       
   135 // End of File