services/terminalmodeservice/inc/upnptmserverdescriptionprovider.h
branchRCL_3
changeset 9 5c72fd91570d
equal deleted inserted replaced
5:8116cc943311 9: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: CUpnpTmServerDescriptionProvider class declaration
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __UPNPTMSERVERDESCRIPTIONPROVIDER_H__
       
    19 #define __UPNPTMSERVERDESCRIPTIONPROVIDER_H__
       
    20 
       
    21 // Include Files
       
    22 #include <e32base.h>
       
    23 #include <upnpdevicedescriptionrequest.h>
       
    24 #include <upnpdevicedescriptionprovider.h>
       
    25 #include <upnpfileutils.h>
       
    26 #include <upnpcons.h>
       
    27 
       
    28 const TUint KForwardSlash = '/';
       
    29 
       
    30 /**
       
    31  * CUpnpTmServerDescriptionProvider 
       
    32  * Provides description of device and its services, and icons. 
       
    33  */
       
    34 class CUpnpTmServerDescriptionProvider : public CBase,
       
    35                                          public MUpnpDeviceDescriptionProvider
       
    36     {
       
    37 public:
       
    38     // Destructor.
       
    39     ~CUpnpTmServerDescriptionProvider();
       
    40 
       
    41     // Two-phased constructor.
       
    42     static CUpnpTmServerDescriptionProvider* NewL();
       
    43     
       
    44 private:    // from MUpnpDeviceDescriptionProvider
       
    45     
       
    46     virtual TInt OnDeviceDescription( CUpnpDeviceDescriptionRequest& aRequest );
       
    47     
       
    48     virtual TInt OnServiceDescription( CUpnpDeviceDescriptionRequest& aRequest );    
       
    49     
       
    50     virtual TInt OnIcon( CUpnpDeviceDescriptionRequest& aRequest );            
       
    51     
       
    52     virtual TInt GetFile( const TDesC8& aUri, RFile& aFile ); 
       
    53 
       
    54 private:
       
    55      // Constructor for performing 1st stage construction
       
    56     CUpnpTmServerDescriptionProvider();
       
    57 
       
    58     //Default constructor for performing 2nd stage construction
       
    59     void ConstructL();
       
    60 
       
    61     /**
       
    62      * Main function to service requests.
       
    63      * @param aRequest request to service
       
    64      * @return error code
       
    65      */
       
    66     TInt OnRequest( CUpnpDeviceDescriptionRequest& aRequest );
       
    67 
       
    68     void OnRequestL( const TDesC8& aUrlPath, const TDesC8& aFileName );
       
    69 
       
    70 private:
       
    71     // File server session used to open file
       
    72     RFs                                  iFs;
       
    73     TBuf<UpnpString::KMaxFilenameLength> iFilePath;  
       
    74     };
       
    75 
       
    76 #endif // __UPNPTMSERVERDESCRIPTIONPROVIDER_H__