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