upnp/upnpstack/controlpointbase/inc/upnpserviceinfo.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:  implementation of Control Point
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_CUPNPSERVICEINFO_H
       
    20 #define C_CUPNPSERVICEINFO_H
       
    21 
       
    22 // INCLUDES
       
    23 
       
    24 #include <e32base.h>
       
    25 #include <badesca.h>
       
    26 #include "upnpdispatchercustomer.h"
       
    27 #include "upnpdispatcher.h"
       
    28 #include "upnpnotifytimer.h"
       
    29 
       
    30 // FORWARD DECLARATIONS
       
    31 class CUpnpControlPoint;
       
    32 
       
    33 // CLASS DECLARATION
       
    34 /**
       
    35 *  @brief Implementation of the CUpnpServiceInfo
       
    36 *
       
    37 *  @since Series60 2.0
       
    38 */
       
    39 NONSHARABLE_CLASS( CUpnpServiceInfo ) : public CBase, public MUpnpNotifyTimerObserver
       
    40     {
       
    41     public: // Constructors
       
    42 
       
    43         /**
       
    44         * Factory method
       
    45         * @since Series60 3.1
       
    46         * @param aControlPoint pointer to Control Point.
       
    47         * @param aService Upnp Service
       
    48         */
       
    49         static CUpnpServiceInfo* CUpnpServiceInfo::NewLC(
       
    50                             CUpnpControlPoint* aControlPoint,
       
    51                             CUpnpService* aService );
       
    52 
       
    53         /**
       
    54         * Destructor
       
    55         */
       
    56         virtual ~CUpnpServiceInfo();
       
    57 
       
    58         /**
       
    59         * Starts timer
       
    60         * @param aTimeout subscribtion timeout
       
    61         */
       
    62         void StartTimerL( const TDesC8& aTimeout );
       
    63 
       
    64         /**
       
    65         * Getter.
       
    66         */
       
    67         TInt SessionId();
       
    68 
       
    69         /**
       
    70         * Getter.
       
    71         */
       
    72         CUpnpService* Service();
       
    73 
       
    74         /**
       
    75         * Getter.
       
    76         */
       
    77         const TDesC8& Sid() const;
       
    78 
       
    79         /**
       
    80         * Setter.
       
    81         */
       
    82         void SetSidL( const TDesC8& aSid );
       
    83 
       
    84         /**
       
    85         * Get SEQ of the current service. SEQ is the sequence id of last
       
    86         * eventing message from this service. SEQ can be inspected
       
    87         * to observe eventing operations.
       
    88         * @since Series60 2.0
       
    89         * @return SEQ of last received event.
       
    90         */
       
    91         TUint32 Seq() const;
       
    92 
       
    93         /**
       
    94         * Set SEQ
       
    95         * @since Series60 2.0
       
    96         * @param aSeq SEQ of a event.
       
    97         */
       
    98         void SetSeq( TUint32 aSeq );
       
    99 
       
   100     public: // From MNotifyTimerObserve
       
   101 
       
   102        /**
       
   103         * Callback function used to inform about the timer events
       
   104         * @since Series60 2.0
       
   105         */
       
   106         void TimerEventL( CUpnpNotifyTimer* /*aTimer*/ );
       
   107         /*
       
   108         * ConstructSubscribtionPathLC
       
   109         */
       
   110         HBufC8* ConstructSubscribtionPathLC( const TDesC8& aControlPointPath,
       
   111                                                TInetAddr& aAddr );
       
   112     
       
   113         /**
       
   114         * These functions create Gena subscription message,
       
   115         * which will be used for data retrieval.
       
   116         */
       
   117         CUpnpGenaMessage* CreateSubscriptionMessageL(
       
   118                                           const TDesC8& aPath,
       
   119                                           THTTPMsgType aType );
       
   120 
       
   121         /*
       
   122         * CreateSubscriptionMessageL
       
   123         */
       
   124         CUpnpGenaMessage* CreateSubscriptionMessageL(
       
   125                                               THTTPMsgType aType);
       
   126 
       
   127     private:
       
   128 
       
   129         /**
       
   130         * Constructor
       
   131         */
       
   132         CUpnpServiceInfo( CUpnpControlPoint * aControlPoint,
       
   133                           CUpnpService* aService );
       
   134         /**
       
   135         * ConstructL
       
   136         */
       
   137         void ConstructL();
       
   138 
       
   139         /*
       
   140         * ResubscribeL
       
   141         */
       
   142         void ResubscribeL();
       
   143 
       
   144       
       
   145 
       
   146     private:
       
   147 
       
   148         // Sid buffer, owned
       
   149         HBufC8* iSid;
       
   150 
       
   151         // For Control Point, owned
       
   152         TUint32 iSeq;
       
   153 
       
   154         // Session ID, owned
       
   155         TInt iSessionId;
       
   156 
       
   157         // Service, not owned
       
   158         CUpnpService* iService;
       
   159 
       
   160         // Resubscribe timer, owned
       
   161         CUpnpNotifyTimer* iResubscribeTimer;
       
   162 
       
   163         // Parent control point, not owned
       
   164         CUpnpControlPoint* iControlPoint;
       
   165 
       
   166         // Timeout, owned
       
   167         TInt iTimeOut;
       
   168     };
       
   169 
       
   170 #endif // C_CUPNPSERVICEINFO_H
       
   171 
       
   172 // End Of File