meetingrequest/mrcasplugin/inc/cesmrcaspluginimpl.h
branchRCL_3
changeset 25 3533d4323edc
parent 0 8466d47a6819
child 12 4ce476e64c59
equal deleted inserted replaced
24:d189ee25cf9d 25:3533d4323edc
       
     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:  Definition of the class CESMRCasPluginImpl.
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CESMRCASPLUGINIMPL_H
       
    20 #define CESMRCASPLUGINIMPL_H
       
    21 
       
    22 #include <e32base.h>
       
    23 //<cmail>
       
    24 #include "cfsccontactactionplugin.h"
       
    25 #include "mfscreasoncallback.h"
       
    26 #include "cesmrcascontactaction.h"
       
    27 #include <CAgnEntryUi.h>
       
    28 #include <calsession.h>
       
    29 #include "mfsccontactsetobserver.h"
       
    30 //</cmail>
       
    31 #include "mesmrcasplugincontactretrieverobserver.h"
       
    32 #include "mesmrcaspluginuilauncherobserver.h"
       
    33 
       
    34 // FORWARD DECLARATIONS
       
    35 class CGulIcon;
       
    36 class CCalSession;
       
    37 class CMRMailboxUtils;
       
    38 class CCalenInterimUtils2;
       
    39 class CESMRCasPluginUiLauncher;
       
    40 class CESMRCasPluginContactRetriever;
       
    41 
       
    42 /**
       
    43  *  Create Meeting Request contact action plugin implementation.
       
    44  *  
       
    45  *  Contains implementation to create meeting request action plugin.
       
    46  *  Adds the "Send Meeting Request" option to those contact
       
    47  *  action menu service users that request it. and lauches meeting
       
    48  *  request editors in the current process
       
    49  *
       
    50  *  Ecom plugin
       
    51  */
       
    52 NONSHARABLE_CLASS (CESMRCasPluginImpl) :
       
    53         public CFscContactActionPlugin,
       
    54         public MFscReasonCallback,
       
    55         public MESMRCasPluginContactRetrieverObserver,
       
    56         public MESMRCasPluginUiLauncherObserver
       
    57     {
       
    58 public: // Constructors and destructor
       
    59 
       
    60     /**
       
    61      * Two-phased constructor. Creates and initializes
       
    62      * CESMRCasPluginImpl object. Ownership transferred to caller.
       
    63      *
       
    64      * @param aParams generic set of parameters from the creator of CESMRCasPluginImpl
       
    65      * @return Pointer to esmr CESMRCasPluginImpl ecom based object.
       
    66      */
       
    67     static CESMRCasPluginImpl* NewL( TAny* aParams );
       
    68 
       
    69     /**
       
    70      * C++ Destructor.
       
    71      */
       
    72     virtual ~CESMRCasPluginImpl( );
       
    73 
       
    74 public: // From CFscContactActionPlugin
       
    75     TUid Uid( ) const;
       
    76     const CArrayFix<TUid>* ActionList( ) const;
       
    77     const MFscContactAction& GetActionL(
       
    78             TUid aActionUid ) const  ;
       
    79     void PriorityForContactSetL(
       
    80             TUid aActionUid,
       
    81             MFscContactSet& aContactSet,
       
    82             TFscContactActionVisibility& aActionMenuVisibility,
       
    83             TFscContactActionVisibility& aOptionsMenuVisibility,
       
    84             MFscContactActionPluginObserver* aObserver ) ;
       
    85     void CancelPriorityForContactSet();
       
    86     void ExecuteL(
       
    87         TUid aActionUid,
       
    88         MFscContactSet& aContactSet,
       
    89         MFscContactActionPluginObserver* aObserver );
       
    90     void CancelExecute();
       
    91 
       
    92 public: // From MFscReasonCallback
       
    93     void GetReasonL( TUid aActionUid,
       
    94             TInt aReasonId,
       
    95             HBufC*& aReason ) const;
       
    96 
       
    97 private: // from MESMRCasPluginContactRetrieverObserver
       
    98     void MRCanExecuteComplete(
       
    99             TBool aCanExecute );
       
   100     void MRCanExecuteError(
       
   101             TInt aError );
       
   102     void MRGetAttendeesComplete(
       
   103             TInt aContactCount,
       
   104             const RPointerArray<CCalUser>& aContacts );
       
   105     void MRGetAttendeesError(
       
   106             TInt aError );
       
   107     
       
   108 private: // from MESMRCasPluginUiLauncherObserver
       
   109     void MREditorInitializationComplete();
       
   110 
       
   111 private: // Implementation
       
   112     CESMRCasPluginImpl(const TFscContactActionPluginParams& aParams );
       
   113     void ConstructL( );
       
   114     CGulIcon* IconL( TInt aBitmapId, TInt aMaskId ) const;
       
   115     TBool MRViewersEnabledL();
       
   116     void MRGetAttendeesCompleteL(
       
   117             TInt aContactCount,
       
   118             const RPointerArray<CCalUser>& aContacts );
       
   119 
       
   120 private: // data
       
   121     /// Ref: Reference to contact action params
       
   122     const TFscContactActionPluginParams& iParams;
       
   123     /// Own: Phonebook Resource handle
       
   124     TInt iResourceHandle;
       
   125     /// Own: meeting request action
       
   126     CESMRCasContactAction* iMeetingRequestContactAction;
       
   127      /// Own: Contact action array
       
   128     CArrayFixFlat<TUid>* iActionList;
       
   129     /// Ref: Plugin observer
       
   130     MFscContactActionPluginObserver* iPluginObserver;
       
   131     /// Ref: Action UID
       
   132     TUid* iActionUid;
       
   133     /// Own: Action menu visibility
       
   134     TFscContactActionVisibility* iActionMenuVisibility;
       
   135     /// Own: Option menu visibility
       
   136     TFscContactActionVisibility* iOptionsMenuVisibility;
       
   137     /// Own: Action priority
       
   138     TInt iActionPriority;
       
   139     /// Own: Calendar session
       
   140     CCalSession* iCalSession;
       
   141     /// Own: MRMailbox utils
       
   142     CMRMailboxUtils* iMailboxUtils;
       
   143     /// Own Calendar utils
       
   144     CCalenInterimUtils2* iCalUtils;
       
   145     /// Own: UI Launcher
       
   146     CESMRCasPluginUiLauncher* iUiLauncher;
       
   147     /// Own: Contact retriever
       
   148     CESMRCasPluginContactRetriever* iContactRetriever;
       
   149     };
       
   150 
       
   151 #endif // CESMRCASPLUGINIMPL_H
       
   152 
       
   153 /// EOF