menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdnotifyrequest.h
changeset 0 f72a12da539e
equal deleted inserted replaced
-1:000000000000 0:f72a12da539e
       
     1 /*
       
     2 * Copyright (c) 2007-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 HNMDREQUESTNOTIFY_
       
    20 #define HNMDREQUESTNOTIFY_
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <xmlengelement.h> 
       
    24 #include <liwcommon.h>
       
    25 
       
    26 #include "hnmdbasekey.h"
       
    27 #include "hnmdservice.h"
       
    28 #include "hnitemid.h"
       
    29 
       
    30 
       
    31 class CHnServiceHandler;
       
    32 class CHnMdServiceCommand;
       
    33 struct THnMdCommonPointers;
       
    34 
       
    35 /**
       
    36  * Notify Request.
       
    37  * 
       
    38  * This class is responsible for managing notifications coming from
       
    39  * services and refreshing content of the view.
       
    40  * 
       
    41  * @lib hnmetadatamodel
       
    42  * @since S60 5.0
       
    43  * @ingroup group_hnmetadatamodel
       
    44  */
       
    45 NONSHARABLE_CLASS( CHnMdNotifyRequest ):
       
    46     public CBase,
       
    47     public MLiwNotifyCallback
       
    48     {
       
    49 public:
       
    50 
       
    51     /**
       
    52      * Two-phased constructor.
       
    53      * Constructs an object from xml element.
       
    54      * 
       
    55      * @since S60 5.0
       
    56      * @param aElement A XML element holding information.
       
    57      * @param aItemId Item id.
       
    58      * @param aCmnPtrs Common pointers structure.
       
    59      * @return Fully constructed notify request.
       
    60      */
       
    61      static CHnMdNotifyRequest* NewL( TXmlEngElement aElement, 
       
    62              const CHnItemId & aItemId,
       
    63              THnMdCommonPointers* aCmnPtrs );
       
    64 
       
    65      /**
       
    66       * Two-phased constructor.
       
    67       * Constructs an object from xml element.
       
    68       * 
       
    69       * @since S60 5.0
       
    70       * @param aElement A XML element holding information.
       
    71       * @param aItemId Item id.
       
    72       * @param aCmnPtrs Common pointers structure.
       
    73       * @return Fully constructed notify request.
       
    74       */
       
    75      static CHnMdNotifyRequest* NewLC( TXmlEngElement aElement,
       
    76              const CHnItemId & aItemId,
       
    77              THnMdCommonPointers* aCmnPtrs );
       
    78      
       
    79      /**
       
    80       * Virtual C++ destructor.
       
    81       */
       
    82      virtual ~CHnMdNotifyRequest();
       
    83      
       
    84      /**
       
    85       * Requests notification from the service, which was set up
       
    86       * in the configuration.
       
    87       * 
       
    88       * @param aParams Parameters list.
       
    89       * @param aCmdOptions Command options.
       
    90       */
       
    91      void RequestNotifyL( CLiwGenericParamList& aParams,
       
    92              TInt aCmdOptions = 0 );
       
    93      
       
    94      /**
       
    95       * Method is invoked when the notifucation occurs.
       
    96       * It is called as a callback by the service which want to
       
    97       * notify change.
       
    98       * 
       
    99       * @see MLiwNotifyCallback::HandleNotifyL
       
   100       * @param aCmdId Command id.
       
   101       * @param aEventId Event id.
       
   102       * @param aEventParamList Event parameters list.
       
   103       * @param aInParamList Input parameters list.
       
   104       *
       
   105       * @return error code
       
   106       */
       
   107      TInt HandleNotifyL( TInt aCmdId, TInt aEventId,
       
   108              CLiwGenericParamList& aEventParamList,
       
   109              const CLiwGenericParamList& aInParamList );
       
   110 
       
   111   
       
   112 private:
       
   113 
       
   114     /**
       
   115      * Gets command object.
       
   116      *
       
   117      * @since S60 5.0
       
   118      * @return Service command.
       
   119      */
       
   120     const CHnMdServiceCommand& GetService() const;
       
   121     
       
   122     /**
       
   123      * Second phase constructor.
       
   124      * @param aElement A XML element holding information. 
       
   125      * @param aItemId Item's id.
       
   126      */
       
   127     void ConstructL( TXmlEngElement aElement, 
       
   128             const CHnItemId & aItemId );
       
   129     
       
   130     /**
       
   131      * Standard C++ constructor.
       
   132      * @param aCmnPtrs Common pointers structure.
       
   133      */
       
   134     CHnMdNotifyRequest(THnMdCommonPointers* aCmnPtrs);
       
   135            
       
   136 private:
       
   137     
       
   138     /**
       
   139      * Own - Associated item id.
       
   140      */
       
   141     CHnItemId* iItemId;
       
   142     
       
   143     /**
       
   144      * Not own - Common pointers.
       
   145      */
       
   146     THnMdCommonPointers* iCmnPtrs;
       
   147    
       
   148     /**
       
   149      * Own - Service Handler
       
   150      */
       
   151     CHnMdService* iService; 
       
   152     
       
   153     /**
       
   154      * Own - Service Handler
       
   155      */
       
   156     CHnServiceHandler* iSh; 
       
   157     
       
   158     };
       
   159 
       
   160 #endif // HNMDREQUESTNOTIFY_