upnpsharing/upnpcontentserver/inc/upnpcontentserversession.h
changeset 0 7f85d04be362
equal deleted inserted replaced
-1:000000000000 0:7f85d04be362
       
     1 /*
       
     2 * Copyright (c) 2006-2007 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:      Header of CUpnpContentServerSession class
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 #ifndef __UPNPCONTENTSERVERSESSION_H__
       
    24 #define __UPNPCONTENTSERVERSESSION_H__
       
    25 
       
    26 #include <e32base.h>
       
    27 #include <badesca.h>
       
    28 
       
    29 #include "upnpcontentserver.h"
       
    30 #include "upnpcontentsharingobserver.h"
       
    31 
       
    32 
       
    33 // CLASS FORWARDS
       
    34 class CUpnpContentServer;
       
    35 
       
    36 /**
       
    37  *  A session class which creates an instance of Upnp content server
       
    38  *  when starting,
       
    39  *  and releases used memory when closing.
       
    40  *
       
    41  *  @since S60 3.1
       
    42  */
       
    43 class CUpnpContentServerSession : public CSession2,
       
    44                                   public MUpnpContentSharingObserver
       
    45     {
       
    46 public:
       
    47     /**
       
    48      * 2-phased constructor.
       
    49      * @since S60 3.1
       
    50      * @param aServer Pointer to server class
       
    51      */
       
    52     static CUpnpContentServerSession* NewL( CUpnpContentServer* aServer );
       
    53 
       
    54     /**
       
    55      * From CSession2, passes the request forward to DispatchMessageL.
       
    56      * @since S60 3.1
       
    57      * @param aMessage Reference to processed message
       
    58      */
       
    59     void ServiceL( const RMessage2& aMessage );
       
    60 
       
    61     /**
       
    62      * Handles the request from client.
       
    63      * @since S60 3.1
       
    64      * @param aMessage Reference to processed message
       
    65      */
       
    66     void DispatchMessageL( const RMessage2& aMessage );
       
    67 
       
    68     /**
       
    69      * Processes the album / playlist query
       
    70      * @since S60 3.1
       
    71      * @param aMessage Reference to processed message
       
    72      */
       
    73     void GetSelectionContentL(
       
    74         const RMessage2& aMessage );
       
    75 
       
    76     /**
       
    77      * Processes the old selections query
       
    78      * @since S60 3.1
       
    79      * @param aMessage Reference to processed message
       
    80      */
       
    81     void GetSelectionIndexesL(
       
    82         const RMessage2& aMessage );
       
    83 
       
    84     /**
       
    85      * Processes the sharing request
       
    86      * @since S60 3.1
       
    87      * @param aMessage Reference to processed message
       
    88      */
       
    89     void ChangeShareContentL(
       
    90         const RMessage2& aMessage );
       
    91 
       
    92     /**
       
    93      * Completes the album / playlist query
       
    94      * @param aMessage Reference to message from client
       
    95      * @since S60 3.1
       
    96      */
       
    97     void CompleteSelectionContentL(
       
    98         const CDesCArray& aMarkedItems );
       
    99 
       
   100     /**
       
   101      * Processes the progress query
       
   102      * @since S60 3.1
       
   103      * @param aMessage Reference to processed message
       
   104      */
       
   105     void RequestProgressInfoL(
       
   106         const RMessage2& aMessage );
       
   107 
       
   108     /**
       
   109      * Processes the refresh request
       
   110      * @since S60 3.1
       
   111      * @param aMessage Reference to processed message
       
   112      */
       
   113     void RefreshShareContentL(
       
   114         const RMessage2& aMessage );
       
   115 
       
   116     /**
       
   117      * Start connection monitor
       
   118      * @since S60 3.1
       
   119      * @param aMessage Reference to processed message
       
   120      */
       
   121     void StartConnectionMonitorL(
       
   122         const RMessage2& aMessage );
       
   123 
       
   124 
       
   125     /**
       
   126      * Stop connection monitoring
       
   127      * @since S60 3.1
       
   128      */
       
   129     void StopConnectionMonitorL( );
       
   130 
       
   131 private:
       
   132     /**
       
   133      * 2nd phase constructor.
       
   134      * @since S60 3.1
       
   135      * @param aServer Pointer to server class
       
   136      */
       
   137     void ConstructL( CUpnpContentServer* aServer );
       
   138 
       
   139     /**
       
   140      * C++ constructor.
       
   141      * @since S60 3.1
       
   142      */
       
   143     CUpnpContentServerSession();
       
   144 
       
   145     /**
       
   146      * C++ destructor.
       
   147      * @since S60 3.1
       
   148      */
       
   149     virtual ~CUpnpContentServerSession();
       
   150 
       
   151 private:
       
   152     /**
       
   153      * Handle to server
       
   154      * not owned
       
   155      */
       
   156     CUpnpContentServer* iServer;
       
   157 
       
   158     /** 
       
   159      * Handle to handler
       
   160      * not owned
       
   161      */
       
   162     CUpnpContentServerHandler* iHandler;
       
   163 
       
   164     /**
       
   165      * Result buffer for client messages
       
   166      * not owned
       
   167      */
       
   168     CBufFlat* iResultBuffer;
       
   169 
       
   170     /**
       
   171      * Possible pending message about for content selection
       
   172      */
       
   173     RMessage2 iSelectionContentMsg;
       
   174 
       
   175     /**
       
   176      * Possible pending message about sharing
       
   177      */
       
   178     RMessage2 iChangeShareContentMsg;
       
   179 
       
   180     };
       
   181 
       
   182 #endif // __UPNPCONTENTSERVERSESSION_H__
       
   183