upnpmediaserver/mediaserverengine/inc/upnpmediaservereventhandler.h
changeset 0 7f85d04be362
equal deleted inserted replaced
-1:000000000000 0:7f85d04be362
       
     1 /** @file
       
     2 * Copyright (c) 2005-2006 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:  Defines CUpnpMediaServerEventHandler class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_CUPNPMEDIASERVEREVENTHANDLER_H
       
    20 #define C_CUPNPMEDIASERVEREVENTHANDLER_H
       
    21 
       
    22 // INCLUDES
       
    23 #include "upnpmediaserverobserver.h"
       
    24 #include "upnpcontentdirectoryeventobserver.h"
       
    25 #include <e32base.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CUpnpObject;
       
    29 class CUpnpItemList;
       
    30 class CUpnpBrowseCriteria;
       
    31 class CUpnpMediaServerEventHandler;
       
    32 class CUpnpMediaServer;
       
    33 class CUpnpFileTransferEventList;
       
    34 class MUpnpContentDirectoryEventObserver;
       
    35 
       
    36 // CLASS DECLARATION
       
    37 class CUpnpMediaServerEventHandler: public CBase, MUpnpContentDirectoryEventObserver
       
    38 {
       
    39 
       
    40 public:    
       
    41     /*
       
    42     * Create a CUpnpMediaServerSession object using two phase construction,
       
    43     * and return a pointer to the created object
       
    44     * @result pointer to new session
       
    45     */
       
    46     static CUpnpMediaServerEventHandler* NewL(CUpnpMediaServer* aServer);
       
    47 
       
    48     /**
       
    49     * Create a CUpnpMediaServerSession object using two phase construction,
       
    50     * and return a pointer to the created object
       
    51     * @result pointer to new session
       
    52     */
       
    53     static CUpnpMediaServerEventHandler* NewLC(CUpnpMediaServer* aServer);
       
    54 
       
    55     /**
       
    56     * Perform the second phase construction of a CUpnpMediaServerSession object
       
    57     */
       
    58     void ConstructL() ;
       
    59     
       
    60     /**
       
    61     * Destroy the object and release all memory objects
       
    62     */
       
    63     virtual ~CUpnpMediaServerEventHandler();
       
    64        
       
    65     /**
       
    66     * Destroy the object and release all memory objects
       
    67     */
       
    68     void EventMediaServerSubscribeEvents( const RMessage2& aMessage );
       
    69     /**
       
    70     * Destroy the object and release all memory objects
       
    71     */
       
    72     
       
    73     void EventMediaServerUnsubscribeEvents( const RMessage2& aMessage );
       
    74     /**
       
    75     * Destroy the object and release all memory objects
       
    76     */
       
    77     void EventMediaServerServerListenTransferEventL( const RMessage2& aMessage );
       
    78 
       
    79     /**
       
    80     * Destroy the object and release all memory objects
       
    81     */
       
    82     void EventMediaServerGetTransferEventBodyL( const RMessage2& aMessage );
       
    83     
       
    84     /**
       
    85     * Destroy the object and release all memory objects
       
    86     */
       
    87     virtual void FileTransferEvent(CUpnpFileTransferEvent *aEvent);
       
    88 
       
    89 private:
       
    90     /**
       
    91     * Destroy the object and release all memory objects
       
    92     */
       
    93     void ServeEventL(CUpnpFileTransferEvent *aEvent); 
       
    94 
       
    95     /**
       
    96     * Serialize events queue and sends buffer length to client
       
    97     */
       
    98     void ListenTransferEventCompleteL();
       
    99 
       
   100     /**
       
   101     * Destroy the object and release all memory objects
       
   102     */
       
   103     CUpnpMediaServerEventHandler(CUpnpMediaServer* aServer);
       
   104 
       
   105 private:
       
   106     //Media server
       
   107     CUpnpMediaServer*   iMediaServer;
       
   108     //reponse length 
       
   109     TInt                iRespLength;
       
   110     //package for reponse length 
       
   111     TPckg<TInt>         iRespLengthPkg; 
       
   112     //buffer for response 
       
   113     HBufC8*             iResponseBuffer;
       
   114     //last asynchronous message handle
       
   115     RMessage2 iCurrentMessage;
       
   116     //event queue 
       
   117     CUpnpFileTransferEventList* iFileTransferEventList;
       
   118     //indicates that there is listen request was issued  
       
   119     TBool iListenRequestPending;        
       
   120 };
       
   121 
       
   122 #endif // C_CUPNPMEDIASERVEREVENTHANDLER_H