upnp/upnpstack/controlpointbase/inc/upnpcpbcurrenthttpclient.h
changeset 0 f5a58ecadc66
equal deleted inserted replaced
-1:000000000000 0:f5a58ecadc66
       
     1 /** @file
       
     2 * Copyright (c) 2007-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: 
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef UPNPCPBCURRENTHTTPCLIENT_H_
       
    20 #define UPNPCPBCURRENTHTTPCLIENT_H_
       
    21 
       
    22 #include <upnpdispatcher.h>
       
    23 
       
    24 #include "upnpcpbhttpmessagecontroller.h"
       
    25 #include "upnphttpclientengine.h"
       
    26 
       
    27 class CUpnpGenaMessage;
       
    28 class CUpnpServiceInfo;
       
    29 class CUpnpControlPoint;
       
    30 class CUpnpHTTPTransaction;
       
    31 
       
    32 class MUpnpCpHttpRequestor;
       
    33 class CUpnpCpHttpRequestorImplBase;
       
    34 class MUpnpCpStackRequestor;
       
    35 class CUpnpCpStackRequestorImplBase;
       
    36 
       
    37 class CUpnpFileSender;
       
    38 
       
    39 NONSHARABLE_CLASS( CUpnpCpbCurrentHttpClient ) : public CBase, public MUpnpHttpClientObserver,
       
    40     public MUpnpCpbHttpMessageController
       
    41     {
       
    42 public:
       
    43     static const TInt KDefaultSubscriptionTimeout = 300; // 5 minutes
       
    44 
       
    45 public:
       
    46 
       
    47     virtual ~CUpnpCpbCurrentHttpClient();
       
    48 
       
    49     static CUpnpCpbCurrentHttpClient* NewL(CUpnpControlPoint& aControlPoint,
       
    50             MUpnpCpHttpRequestor* aHttpRequestor, MUpnpCpStackRequestor* aStackRequestor );
       
    51 
       
    52     void StartIPFilteringL();
       
    53 
       
    54     void StopIPFiltering();
       
    55 
       
    56     void SendFileByPostL( CUpnpHttpMessage* aMessage );
       
    57     /**
       
    58      * It is called from bottom layer when wlan lost event occurs [callback method]     
       
    59      * @result None
       
    60      */
       
    61     void WlanLostOccurs();
       
    62     
       
    63     /**
       
    64      * It is called from bottom layer when address change event occurs [callback method]        
       
    65      */
       
    66     void AddressChangedL();
       
    67     
       
    68 public:  //from MUpnpCpbHttpMessageController
       
    69 
       
    70     virtual void SendL( CUpnpHttpMessage* aMessage );
       
    71 
       
    72     virtual void SendActionL(CUpnpAction* aAction);
       
    73 
       
    74     virtual void SendSubscribeL(CUpnpServiceInfo* aServiceInfo);
       
    75 
       
    76     virtual void SendUnsubscribeL(CUpnpServiceInfo* aServiceInfo);
       
    77 
       
    78     virtual void SendResubscribeL(CUpnpServiceInfo* aServiceInfo);
       
    79 
       
    80     virtual TInt GetServiceDescriptionL(CUpnpDevice* aDevice, const TDesC8& aServiceUrl);
       
    81 
       
    82     virtual TInt GetDeviceDescriptionL(CUpnpDevice* aDevice);
       
    83 
       
    84     virtual void SearchL(const TDesC8& aSearchString);
       
    85 
       
    86     /**
       
    87      * Stops ignoring all embedded devices of specified device
       
    88      * @since Series60 3.2
       
    89      * @param aRoot Root device
       
    90      */
       
    91     virtual void StopIgnoringEmbeddedL( CUpnpDevice* aRoot );
       
    92 
       
    93     virtual void StopIgnoringUuidL(const TDesC8& aUuids);
       
    94 
       
    95     /**
       
    96      * Stops ignoring all device tree
       
    97      * @since Series60 3.2
       
    98      * @param aRoot Root device
       
    99      */
       
   100     virtual void StopIgnoringL( CUpnpDevice* aDevice );
       
   101 
       
   102 private://from MUpnpDispatcherCustomer that is derived by MUpnpCpbHttpMessageController
       
   103 
       
   104     virtual void MessageReceivedLD(CUpnpHttpMessage* aMessage);
       
   105 
       
   106     virtual const TDesC8& Path();
       
   107 
       
   108 private: //from MUpnpHTTPClientObserver
       
   109 
       
   110     /**
       
   111      * Callback indicating that response was received within transaction.
       
   112      *
       
   113      * @param aCompletedTrasaction completed transaction that has response message
       
   114      */
       
   115     virtual void ClientResponseRecivedLD( CUpnpHttpTransaction& aCompletedTrasaction );
       
   116 
       
   117 private:
       
   118     CUpnpCpbCurrentHttpClient( CUpnpControlPoint& aControlPoint,
       
   119         MUpnpCpHttpRequestor* aHttpRequestor, MUpnpCpStackRequestor* aStackRequestor );
       
   120 
       
   121     void ConstructL();
       
   122 
       
   123     /**
       
   124      * Set requestors which leaves with KErrNotReady or do nothing.
       
   125      * This is used when WLan Lost occurs.
       
   126      * @result None
       
   127      */
       
   128     void SetNullRequestorsL();
       
   129 
       
   130 private:
       
   131 
       
   132     // control point, not owned
       
   133     CUpnpControlPoint& iControlPoint;
       
   134 
       
   135     // pointer to http requestor interface
       
   136     MUpnpCpHttpRequestor* iHttpRequestor;
       
   137 
       
   138     // default implementation of http requestor
       
   139     CUpnpCpHttpRequestorImplBase* iHttpRequestorDefaultImpl;
       
   140 
       
   141     // iStackRequestor uses DLNA webserver API for http, and dispacher to communicate with stack
       
   142     MUpnpCpStackRequestor* iStackRequestor;
       
   143 
       
   144     // default implementation of stack requestor
       
   145     CUpnpCpStackRequestorImplBase* iStackRequestorDefaultImpl;
       
   146 
       
   147     // value of USER-AGENT header in sent SOAP requests
       
   148     HBufC8* iUserAgent;
       
   149 
       
   150     // Current state of discovery engine
       
   151     TInt iResult;
       
   152 
       
   153     // The pending message list
       
   154     RPointerArray<CUpnpHttpMessage> iPendingHttpMessages;
       
   155 
       
   156     // pending transactions array
       
   157     RPointerArray<CUpnpHttpTransaction> iPendingTransactions;
       
   158     
       
   159     CUpnpFileSender* iFileSender;
       
   160     
       
   161     };
       
   162 
       
   163 #endif /*UPNPCPBCURRENTHTTPCLIENT_H_*/
       
   164 
       
   165 //  End of File
       
   166