upnp/upnpstack/serviceframework/inc/upnpdispatcherrequest.h
changeset 0 f5a58ecadc66
equal deleted inserted replaced
-1:000000000000 0:f5a58ecadc66
       
     1 /** @file
       
     2 * Copyright (c) 2005-2006 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:  Declares CUpnpdispacherrequset class
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef C_CUPNPDISPATCHERREQUEST_H
       
    19 #define C_CUPNPDISPATCHERREQUEST_H
       
    20 
       
    21 // INCLUDES
       
    22 #include <e32base.h>
       
    23 #include "upnpmhcommon.h"
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class CDesC8ArrayFlat;
       
    27 
       
    28 // CONSTANTS
       
    29 
       
    30 // CLASS DECLARATION
       
    31 
       
    32 /** 
       
    33 @brief A class that represents single request to the Message Handler
       
    34 
       
    35 This class represents a logical unit between UPnP devices / control points and
       
    36 Message Handler. CUpnpDispatcherRequest wraps different requests, 
       
    37 so they can be queued as in array.
       
    38 */
       
    39 
       
    40 class CUpnpDispatcherRequest: public CBase
       
    41 {
       
    42 public:
       
    43 
       
    44     /**
       
    45     * Create a CUpnpDispatcherRequest object using two phase construction, 
       
    46     * and return a pointer to the created object
       
    47     *
       
    48     * A session with Message Handler is initiated during the construction.
       
    49     *
       
    50     * @param aRequest from client using dispatcher request
       
    51     * @result a pointer to the created instance of CUpnpDispatcherRequest
       
    52     */
       
    53     static CUpnpDispatcherRequest* NewLC( TMessageHandlerRqst aRequest ) ;
       
    54 
       
    55     /**
       
    56     * Destroy the object and release all memory objects
       
    57     */
       
    58     virtual ~CUpnpDispatcherRequest();
       
    59 
       
    60 private:
       
    61     /**
       
    62     * @function CUpnpDispatcherRequest
       
    63     *
       
    64     * @discussion Perform the first phase of two phase construction
       
    65     * @param aRequest from client using dispatcher request
       
    66     */
       
    67     CUpnpDispatcherRequest( TMessageHandlerRqst aRequest );
       
    68 
       
    69     /**
       
    70      * Second phase of construction
       
    71      */
       
    72     void ConstructL();
       
    73     
       
    74 public:
       
    75 
       
    76 
       
    77     /**
       
    78     * Returns a reference to given request's argument list. 
       
    79     * @since Series60 2.6
       
    80     * @return Reference to given request's argument list.
       
    81     */    
       
    82     CDesC8ArrayFlat& Arguments();
       
    83     
       
    84     /**
       
    85     * Adds a argument to argument list.
       
    86     * @since Series60 2.6
       
    87     * @param aArgument Argument to add.
       
    88     */
       
    89     void AddArgumentL(const TDesC8& aArgument);
       
    90 
       
    91     /**
       
    92     * When trying to make request on adding device, this function 
       
    93     * is used for storing service list to request.
       
    94     * @since Series60 2.6
       
    95     * @param aArgument Array of arguments to add.
       
    96     */
       
    97     void AddServices(CDesC8ArrayFlat* aArgument);
       
    98 
       
    99     /**
       
   100     * Returns the list of services on this request.
       
   101     * @since Series60 2.6
       
   102     * @return Reference to given request's argument list.
       
   103     */  
       
   104     CDesC8ArrayFlat& Services();
       
   105 
       
   106     /**
       
   107     * Returns request type.
       
   108     * @since Series60 2.6
       
   109     * @return Returns request type.
       
   110     */  
       
   111     TMessageHandlerRqst Request();
       
   112 
       
   113 private:    
       
   114 
       
   115     /*! @var iRequest Type of request. */
       
   116     TMessageHandlerRqst     iRequest;
       
   117 
       
   118     /*! @var iArguments Array that contains arguments of this request. */
       
   119     CDesC8ArrayFlat*       iArguments;
       
   120 
       
   121     /*! @var iServices Array that contains services if adding local device. */
       
   122     CDesC8ArrayFlat*        iServices;
       
   123 
       
   124 };
       
   125 
       
   126 #endif // C_CUPNPDISPATCHERREQUEST_H
       
   127 
       
   128 // End of File