homescreensrv_plat/sapi_menucontent/mcsservice/inc/mcsupdateitem.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 __MCSUPDATEITEM_H
       
    20 #define __MCSUPDATEITEM_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include "mcsmenuopobserver.h"
       
    24 
       
    25 class MMCSCallback;
       
    26 class CMenuOperation;
       
    27 class CMCSMenuOpWatcher;
       
    28 class RMcsOperationManager;
       
    29 
       
    30 /**
       
    31  * This class implements MCS SAPI core logic for Add / Change async requests.
       
    32  * 
       
    33  */
       
    34 class CMCSUpdateItem : 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 CMCSUpdateItem reference.
       
    43 		*/
       
    44 		static CMCSUpdateItem* NewL( CMenuItem& aMenu, MMCSCallback* aCallback,
       
    45 		                        RMcsOperationManager& aOperationManager );
       
    46 		
       
    47 		/**
       
    48         * Add/Change item and its attributes
       
    49         */
       
    50 		void UpdateItemL();
       
    51 		
       
    52 		/**
       
    53 	     * Destructor.
       
    54     	*/
       
    55 		virtual ~CMCSUpdateItem();
       
    56 		
       
    57 	public: // from MMCSMenuOpObserver
       
    58 	    
       
    59         /**
       
    60          * MenuOpCompletedL menu operation complete call back.
       
    61          * @param aStatus status of the operation 
       
    62          */
       
    63         void MenuOpCompletedL(TInt aStatus );
       
    64 	    
       
    65 	private:
       
    66 
       
    67 		/** 
       
    68 	    * Default constructor.
       
    69 	    * @param aMCS MenuContentService object.
       
    70 	    * @param aCallback It is a callback notification.
       
    71 	    */
       
    72 		CMCSUpdateItem( CMenuItem& aMenu, MMCSCallback* aCallback,
       
    73 		                            RMcsOperationManager& aOperationManager );
       
    74 
       
    75 		/** 
       
    76         * ConstructL
       
    77         */
       
    78 		void ConstructL();
       
    79 		
       
    80 		/**
       
    81 		* Inherited from CActive class 
       
    82 		*/ 
       
    83     	virtual void DoCancel();
       
    84 
       
    85 		/**
       
    86 		* Inherited from CActive class 
       
    87 		*/ 
       
    88         virtual void RunL();
       
    89 
       
    90 		/**
       
    91 		* Notify callback in case RunL leaved;
       
    92 		*/ 
       
    93         TInt RunError(TInt aError);
       
    94         
       
    95 		/**
       
    96 		* Activates the request and call SetActive() function
       
    97 		*/ 
       
    98 		void ActivateRequest(TInt aReason);
       
    99 
       
   100 		/**
       
   101 		* Gives the result for notification request.
       
   102 		*/ 
       
   103 		void NotifyRequestResult(TInt aReason);
       
   104 	
       
   105 	private:
       
   106 
       
   107 		/** Callback Object. Not owned. */ 
       
   108 		MMCSCallback* iCallback;
       
   109 		/** iMCS reference. Owned. */
       
   110 		CMenuItem *iMenu;
       
   111 		/*not own*/
       
   112         RMcsOperationManager& iOperationManager;
       
   113 	};
       
   114 
       
   115 
       
   116 
       
   117 #endif //__MCSUPDATEITEM_H
       
   118 
       
   119 // End of file