homescreensrv_plat/sapi_menucontent/mcsservice/inc/mcsexecuteaction.h
changeset 0 79c6a41cd166
equal deleted inserted replaced
-1:000000000000 0:79c6a41cd166
       
     1 /*
       
     2 * Copyright (c) 2008 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:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __MCSEXECUTEATCION_H
       
    20 #define __MCSEXECUTEATCION_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include "mcsmenuopobserver.h"
       
    24 
       
    25 class MMCSCallback;
       
    26 class RMenu;
       
    27 class TMenuItem;
       
    28 class RMcsOperationManager;
       
    29 
       
    30 /**
       
    31  * This class implements MCS SAPI core logic for ExecuteAction async requests.
       
    32  * 
       
    33  */
       
    34 class CMCSExecuteAction : public CActive, public MMCSMenuOpObserver
       
    35 	{
       
    36 	public:
       
    37 	
       
    38 		/**
       
    39 		* Two-phased constructor.
       
    40 	    * @param aMCS MenuContentService object.
       
    41 	    * @param aCallback Callback Object for Change notification.
       
    42 	    * @return CMCSExecuteAction reference.
       
    43 		*/
       
    44 		static CMCSExecuteAction* NewL( RMenu& aMCS, MMCSCallback* aCallback,
       
    45 		                            RMcsOperationManager& aOperationManager );
       
    46 		
       
    47 		/**
       
    48         * ExecuteActionL for asynchronous  calls.
       
    49         * @param aItemId item id.
       
    50         * @param aAction action open/remove.
       
    51         */
       
    52 		void ExecuteActionL( TInt aItemId, TDesC8& aAction);
       
    53 		
       
    54 		/**
       
    55         * ExecuteL for synchronous calls.
       
    56         * @param aItemId item id.
       
    57         * @param aAction action open/remove.
       
    58         */
       
    59 		void ExecuteL(TInt aItemId, TDesC8& aAction);
       
    60 	
       
    61 		/**
       
    62 	     * Destructor.
       
    63     	*/
       
    64 		virtual ~CMCSExecuteAction();
       
    65 
       
    66 	public: // from MMCSMenuOpObserver
       
    67 	
       
    68 		/**
       
    69 	     * MenuOpCompletedL menu operation complete call back.
       
    70 	     * @param aStatus status of the operation 
       
    71 	     */
       
    72 		void MenuOpCompletedL(TInt aStatus );
       
    73 	
       
    74 	private:
       
    75 
       
    76 		/** 
       
    77 	    * Default constructor.
       
    78 	    * @param aMCS MenuContentService object.
       
    79 	    * @param aCallback It is a callback notification.
       
    80 	    */
       
    81 		CMCSExecuteAction( RMenu& aMCS, MMCSCallback* aCallback, 
       
    82 		                        RMcsOperationManager& aOperationManager );
       
    83 
       
    84 		/** 
       
    85         * ConstructL
       
    86         */
       
    87 		void ConstructL();
       
    88 		
       
    89 		/**
       
    90 		* Inherited from CActive class 
       
    91 		*/ 
       
    92     	virtual void DoCancel();
       
    93 
       
    94 		/**
       
    95 		* Inherited from CActive class 
       
    96 		*/ 
       
    97         virtual void RunL();
       
    98         
       
    99 		/**
       
   100 		* Notify callback in case RunL leaved;
       
   101 		*/ 
       
   102         TInt RunError(TInt aError);
       
   103 
       
   104 		/**
       
   105 		* Activates the request and call SetActive() function
       
   106 		*/ 
       
   107 		void ActivateRequest(TInt aReason);
       
   108 
       
   109 		/**
       
   110 		* Gives the result for notification request.
       
   111 		*/ 
       
   112 		void NotifyRequestResult(TInt aReason);
       
   113 	
       
   114 	private:
       
   115 	
       
   116 		/** Callback Object. Not owned. */ 
       
   117 		MMCSCallback* iCallback;
       
   118 		/** iMCS reference. Not owned. */
       
   119 		RMenu iMCS;
       
   120 
       
   121 		/** item id **/
       
   122 		TInt iItemId;
       
   123 		/** Action to Execute **/
       
   124 		TPtrC8 iAction;
       
   125 		/*not own*/
       
   126 		RMcsOperationManager& iOperationManager;
       
   127 	};
       
   128 
       
   129 #endif //__MCSEXECUTEATCION_H