upnp/upnpstack/controlpointbase/src/upnpcpstackrequestorimpl.cpp
changeset 0 f5a58ecadc66
equal deleted inserted replaced
-1:000000000000 0:f5a58ecadc66
       
     1 /** @file
       
     2 * Copyright (c) 2008 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:  Provides default implementation of MUpnpCpHttpClientRequestor interface.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include "upnpcpstackrequestorimpl.h"
       
    21 #include "upnpdispatcher.h"
       
    22 #include "upnpcontrolpoint.h"
       
    23 #include "upnpdeviceimplementationbase.h"
       
    24 
       
    25 // -----------------------------------------------------------------------------
       
    26 // CUpnpCpStackRequestorImpl::CUpnpCpStackRequestorImpl
       
    27 // -----------------------------------------------------------------------------
       
    28 //
       
    29 CUpnpCpStackRequestorImpl::CUpnpCpStackRequestorImpl()
       
    30     {
       
    31     }
       
    32 
       
    33 // -----------------------------------------------------------------------------
       
    34 // CUpnpCpStackRequestorImpl::~CUpnpCpStackRequestorImpl
       
    35 // -----------------------------------------------------------------------------
       
    36 //
       
    37 CUpnpCpStackRequestorImpl::~CUpnpCpStackRequestorImpl()
       
    38     {
       
    39     delete iDispatcher;
       
    40     }
       
    41 
       
    42 // -----------------------------------------------------------------------------
       
    43 // CUpnpCpStackRequestorImpl::NewL
       
    44 // -----------------------------------------------------------------------------
       
    45 //
       
    46 CUpnpCpStackRequestorImpl* CUpnpCpStackRequestorImpl::NewL(
       
    47     MUpnpDiscoveryObserver& aDiscoveryObserver )
       
    48     {
       
    49     CUpnpCpStackRequestorImpl* self = new (ELeave) CUpnpCpStackRequestorImpl();
       
    50     CleanupStack::PushL( self );
       
    51     self->ConstructL( aDiscoveryObserver );
       
    52     CleanupStack::Pop( self );
       
    53     return self;
       
    54     }
       
    55 
       
    56 // -----------------------------------------------------------------------------
       
    57 // CUpnpCpStackRequestorImpl::SearchL
       
    58 // -----------------------------------------------------------------------------
       
    59 //
       
    60 void  CUpnpCpStackRequestorImpl::SearchL( const TDesC8& aSearchString )
       
    61     {
       
    62     iDispatcher->SearchL( aSearchString );
       
    63     }
       
    64 
       
    65 // -----------------------------------------------------------------------------
       
    66 // CUpnpCpStackRequestorImpl::SearchL
       
    67 // -----------------------------------------------------------------------------
       
    68 //
       
    69 void  CUpnpCpStackRequestorImpl::SearchL( const TDesC16& aSearchString )
       
    70     {
       
    71     iDispatcher->SearchL( aSearchString );
       
    72     }
       
    73 
       
    74 // -----------------------------------------------------------------------------
       
    75 // CUpnpCpStackRequestorImpl::AddCustomerL
       
    76 // -----------------------------------------------------------------------------
       
    77 //
       
    78 void  CUpnpCpStackRequestorImpl::AddCustomerL( const MUpnpDispatcherCustomer& aCustomer )
       
    79     {
       
    80     iDispatcher->AddCustomerL( aCustomer, ETrue );
       
    81     }
       
    82 
       
    83 // -----------------------------------------------------------------------------
       
    84 // CUpnpCpStackRequestorImpl::RemoveCustomer
       
    85 // -----------------------------------------------------------------------------
       
    86 //
       
    87 void  CUpnpCpStackRequestorImpl::RemoveCustomer( const MUpnpDispatcherCustomer& aCustomer )
       
    88     {
       
    89     iDispatcher->RemoveCustomer( aCustomer, ETrue );
       
    90     }
       
    91 
       
    92 // -----------------------------------------------------------------------------
       
    93 // CUpnpCpStackRequestorImpl::HttpServerAddress
       
    94 // -----------------------------------------------------------------------------
       
    95 //
       
    96 TInetAddr CUpnpCpStackRequestorImpl::HttpServerAddress()
       
    97     {
       
    98     return iDispatcher->HttpServerAddress();
       
    99     }
       
   100     
       
   101 // -----------------------------------------------------------------------------
       
   102 // CUpnpCpStackRequestorImpl::ConstructL
       
   103 // -----------------------------------------------------------------------------
       
   104 //
       
   105 void  CUpnpCpStackRequestorImpl::ConstructL( MUpnpDiscoveryObserver& aDiscoveryObserver )
       
   106     {
       
   107     iDispatcher = CUpnpDispatcher::NewL( &aDiscoveryObserver );
       
   108     }
       
   109 
       
   110 // -----------------------------------------------------------------------------
       
   111 // CUpnpCpStackRequestorImpl::SendLocalRequestL
       
   112 // -----------------------------------------------------------------------------
       
   113 //
       
   114 void CUpnpCpStackRequestorImpl::SendLocalRequestL( CUpnpHttpMessage* aMessage,
       
   115                              MUpnpDispatcherCustomer &aCustomer )
       
   116     {
       
   117     iDispatcher->SendMessageL( aMessage, aCustomer, ETrue );
       
   118     }
       
   119 
       
   120 // -----------------------------------------------------------------------------
       
   121 // CUpnpCpStackRequestorImpl::SendMessageL
       
   122 // -----------------------------------------------------------------------------
       
   123 //
       
   124 void CUpnpCpStackRequestorImpl::SendMessageL( CUpnpHttpMessage* aMessage,
       
   125                                 MUpnpDispatcherCustomer &aCustomer,
       
   126                                 TBool aIsLocal)
       
   127     {
       
   128     iDispatcher->SendMessageL( aMessage, aCustomer, aIsLocal );
       
   129     }
       
   130 
       
   131 // -----------------------------------------------------------------------------
       
   132 // CUpnpCpStackRequestorImpl::StopFilteringL
       
   133 // -----------------------------------------------------------------------------
       
   134 //
       
   135 void  CUpnpCpStackRequestorImpl::StopIgnoringL( const TDesC8& aUuids )
       
   136     {
       
   137     iDispatcher->StopFilteringL( aUuids );
       
   138     }
       
   139 
       
   140 // -----------------------------------------------------------------------------
       
   141 // CUpnpCpStackRequestorImpl::StartIPFilteringL
       
   142 // -----------------------------------------------------------------------------
       
   143 //
       
   144 void CUpnpCpStackRequestorImpl::StartIPFilteringL()
       
   145     {
       
   146     iDispatcher->StartIPFilteringL();
       
   147     }
       
   148 
       
   149 // -----------------------------------------------------------------------------
       
   150 // CUpnpCpHttpClientRequestorImpl::StopIPFiltering
       
   151 // -----------------------------------------------------------------------------
       
   152 //
       
   153 void CUpnpCpStackRequestorImpl::StopIPFiltering()
       
   154     {
       
   155     iDispatcher->StopIPFiltering();
       
   156     }
       
   157 
       
   158 // -----------------------------------------------------------------------------
       
   159 // CUpnpCpHttpClientRequestorImpl::StopHttpServer
       
   160 // -----------------------------------------------------------------------------
       
   161 //    
       
   162 void CUpnpCpStackRequestorImpl::StopHttpServer()
       
   163     {
       
   164     iDispatcher->StopHttpServer();
       
   165     }
       
   166     
       
   167 // -----------------------------------------------------------------------------
       
   168 // CUpnpCpHttpClientRequestorImpl::StartHttpServerL
       
   169 // -----------------------------------------------------------------------------
       
   170 //    
       
   171 void CUpnpCpStackRequestorImpl::StartHttpServerL()
       
   172     {
       
   173     iDispatcher->StartHttpServerL( ETrue, KRandomPort );
       
   174     }    
       
   175 
       
   176 //  End of File