upnp/upnpstack/serviceframework/inc/upnpgenamessage.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 the CUpnpGenaMessage class. 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_CUPNPGENAMESSAGE_H
       
    20 #define C_CUPNPGENAMESSAGE_H
       
    21 
       
    22 // INCLUDES
       
    23 
       
    24 #include <e32base.h>
       
    25 #include <in_sock.h>
       
    26 #include "upnphttpmessage.h"
       
    27 #include "upnphttpheader.h"
       
    28 #include "upnpcons.h"
       
    29 
       
    30 // CONSTANTS
       
    31 /*
       
    32 _LIT8( KNoHeader, "NoHeader" );
       
    33 _LIT8( KDefaultHostPort, "80" );
       
    34 _LIT8( KSidPrefix,"uuid:" );
       
    35 _LIT8( KTimeoutPrefix,"Second-" );
       
    36 */
       
    37 static const TInt KMaxGenaMessageLength = 20480;
       
    38 
       
    39 // CLASS DECLARATION
       
    40 
       
    41 /**
       
    42 *  GENA-Message class. Used in sending and handling GENA-messages.
       
    43 *
       
    44 *  @since Series60 2.6
       
    45 */
       
    46 class CUpnpGenaMessage : public CUpnpHttpMessage
       
    47 {
       
    48 public: // Constructors and destructor
       
    49     
       
    50     // Enumeration for GENA-message types:
       
    51     enum TGenaMessageType 
       
    52         {   
       
    53         EGenaSubscription = 1,
       
    54         EGenaResubscription,
       
    55         EGenaUnsubscription,
       
    56         EGenaEventing,
       
    57         EGenaSubscriptionResponse,
       
    58         EGenaResubscriptionResponse,
       
    59         EGenaUnsubscriptionResponse,
       
    60         EGenaEventingResponse
       
    61         };
       
    62     
       
    63     /**
       
    64     * Two-phased constructor.
       
    65     * @param aAddr the address
       
    66     */
       
    67     IMPORT_C static CUpnpGenaMessage* NewL( const TInetAddr& aAddr );
       
    68     
       
    69     /**
       
    70     * Two-phased constructor.
       
    71     * @param aAddr the address
       
    72     */
       
    73     IMPORT_C static CUpnpGenaMessage* NewLC( const TInetAddr& aAddr );
       
    74     
       
    75     /**
       
    76     * Virtual Destructor.
       
    77     */
       
    78     IMPORT_C virtual ~CUpnpGenaMessage();        
       
    79     
       
    80 public: // New functions
       
    81 
       
    82     /**
       
    83     * Returns CALLBACK-header of GENA-message.
       
    84     * @since Series60 2.6
       
    85     * @return CALLBACK header of GENA message or NULL
       
    86     */
       
    87     IMPORT_C TDesC8& Callback();
       
    88     
       
    89     /**
       
    90     * Returns NT-header of GENA-message.
       
    91     * @since Series60 2.6
       
    92     * @return NT header of GENA message or NULL
       
    93     */
       
    94     IMPORT_C TDesC8& Nt();
       
    95     
       
    96     /**
       
    97     * Returns TIMEOUT-header of GENA-message.
       
    98     * @since Series60 2.6
       
    99     * @return TIMEOUT header of GENA message or NULL
       
   100     */
       
   101     IMPORT_C TDesC8& Timeout();
       
   102     
       
   103     /**
       
   104     * Returns SID-header of GENA-message.
       
   105     * @since Series60 2.6
       
   106     * @return SID header of GENA message or NULL
       
   107     */
       
   108     IMPORT_C TDesC8& Sid();
       
   109     
       
   110     /**
       
   111     * Returns NTS-header of GENA-message.
       
   112     * @since Series60 2.6
       
   113     * @return NTS header of GENA message or NULL
       
   114     */
       
   115     IMPORT_C TDesC8& Nts();
       
   116     
       
   117     /**
       
   118     * Returns SEQ-header of GENA-message.
       
   119     * @since Series60 2.6
       
   120     * @return SEQ header of GENA message or NULL
       
   121     */
       
   122     IMPORT_C const TDesC8& Seq();
       
   123 
       
   124 private:
       
   125     
       
   126     /**
       
   127     * C++ default constructor.
       
   128     */
       
   129     IMPORT_C CUpnpGenaMessage(); 
       
   130     
       
   131     /**
       
   132     * Second phase construct.
       
   133     **/     
       
   134     void ConstructL(TInetAddr aSender);    
       
   135    
       
   136 };
       
   137 
       
   138 #endif // C_CUPNPGENAMESSAGE_H
       
   139 
       
   140 // End of File