services/terminalmodeservice/inc/upnptmappserverservice.h
branchRCL_3
changeset 29 5c72fd91570d
equal deleted inserted replaced
7:8116cc943311 29:5c72fd91570d
       
     1 /**
       
     2 * Copyright (c) 2010 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: CUpnpTmAppServerService class declaration
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __UPNPTMAPPSERVERSERVICE_H__
       
    19 #define __UPNPTMAPPSERVERSERVICE_H__
       
    20 
       
    21 
       
    22 // Include Files
       
    23 #include <upnpserviceimplementation.h>
       
    24 #include <upnphttpserverobserver.h>
       
    25 #include <upnphttpservertransactioncreator.h>
       
    26 #include <upnpcommonupnplits.h>
       
    27 #include <upnpsettings.h>
       
    28 #include <upnphttpserversession.h>
       
    29 #include <upnphttpserverruntime.h>
       
    30 
       
    31 // FORWARD DECLARATIONS
       
    32 class CUPnPTmServerDevice;
       
    33 class CUpnpTmServerImpl;
       
    34 
       
    35 
       
    36 // CLASS DECLARATION
       
    37 
       
    38 /**
       
    39 * TerminalMode Application Server Service class. It encapsulates all the major actions 
       
    40 * needed for accessing and controlling the remotable apps from the Control Point.
       
    41 *
       
    42 */
       
    43 
       
    44 class CUpnpTmAppServerService: public CUpnpServiceImplementation, 
       
    45                                public MUpnpHttpServerTransactionCreator,
       
    46                                public MUpnpHttpServerObserver
       
    47     {               
       
    48 public: // Constructors and destructors
       
    49     
       
    50     /**
       
    51     * Two-phased constructor.
       
    52     * @param aService Parent service 
       
    53     */
       
    54     static CUpnpTmAppServerService* NewL( CUpnpDevice& aUpnpDevice, const TDesC& aDescriptionPath , 
       
    55                                                                 CUpnpTmServerImpl& aTmServerImpl );
       
    56                                       
       
    57     /**
       
    58     * Destructor function called automatically from the destructor of a 
       
    59     * derived class
       
    60     **/
       
    61     ~CUpnpTmAppServerService();
       
    62                
       
    63 public: //from CUpnpServiceImplementation
       
    64     /**
       
    65     * This functions is a entry point for actions. See coments in base class
       
    66     */
       
    67     void ActionReceivedLD( CUpnpAction* aAction );
       
    68     void AppStatusUpdateEventL( const TDesC8& aStatusUpdateBuffer );    
       
    69     void AppListUpdateEventL( const TDesC8& aListUpdateBuffer );  
       
    70 
       
    71 public: //from MUpnpHttpServerTransactionCreator
       
    72     void NewTransactionL( const TDesC8& aMethod, const TDesC8& aUri,    
       
    73                        const TInetAddr& aSender, CUpnpHttpServerTransaction*& aResultTrans );
       
    74         
       
    75 private: //From MUpnpHttpServerObserver
       
    76     void HttpEventLD( CUpnpHttpMessage* aMessage );
       
    77    
       
    78 private:      
       
    79     TUpnpErrorCode GetAppListActionL( CUpnpAction* aAction );
       
    80     TUpnpErrorCode LaunchAppActionL( CUpnpAction* aAction );
       
    81     TUpnpErrorCode TerminateAppActionL( CUpnpAction* aAction );
       
    82     TUpnpErrorCode GetAppStatusActionL( CUpnpAction* aAction );
       
    83 
       
    84 private: // Constructors
       
    85     
       
    86     /**
       
    87     * C++ default constructor.
       
    88     */
       
    89     CUpnpTmAppServerService( CUpnpDevice& aUpnpDevice, CUpnpTmServerImpl& aTmServerImpl );
       
    90 
       
    91     /**
       
    92     * Second phase of the constructor.
       
    93     * Initialises a DOM tree.
       
    94     * By default Symbian 2nd phase constructor is private.
       
    95     * @param service Parent service
       
    96     */
       
    97     void ConstructL(const TDesC& aDescriptionPath );
       
    98                     
       
    99     void ConstructHttpL( );
       
   100     TInt ConvertDescriptorToInt( const TDesC8& aDes, TUint& aErr );
       
   101     
       
   102 private:
       
   103     CUpnpHttpServerSession*     iHttpServerSession;
       
   104     CUpnpDevice&                iUpnpDevice;
       
   105     CUpnpTmServerImpl&          iTmServerImpl;
       
   106     };
       
   107 
       
   108 #endif  // __UPNPTMAPPSERVERSERVICE_H__
       
   109 
       
   110 // End Of File