pressrv_plat/watcher_api/inc/msimplewatcher.h
changeset 0 c8caa15ef882
equal deleted inserted replaced
-1:000000000000 0:c8caa15ef882
       
     1 /*
       
     2 * Copyright (c) 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:    SIMPLE Engine presence watcher
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef M_simplewatcher_H
       
    22 #define M_simplewatcher_H
       
    23 
       
    24 #include <e32std.h>
       
    25 
       
    26 // FORWARD DECLARATION
       
    27 class MSimpleConnection;
       
    28 class MSimpleFilterDocument;
       
    29 
       
    30 /**
       
    31  *  MSimpleWatcher
       
    32  *
       
    33  *  SIMPLE Engine presence watcher
       
    34  *
       
    35  *  @lib simpleengine
       
    36  *  @since S60 3.2
       
    37  */
       
    38 
       
    39 class MSimpleWatcher
       
    40     {
       
    41 
       
    42 public:
       
    43 
       
    44     /** SIP subscription-state */    
       
    45     enum TSimpleSipSubscriptionState
       
    46         {
       
    47         // subscription not complete
       
    48         ESimpleStateNone=0,
       
    49         // subscription is in pending state
       
    50         ESimpleStatePending,
       
    51         // subscription is in active state        
       
    52         ESimpleStateActive,
       
    53         // subscription is terminated, either by server or by client.        
       
    54         ESimpleStateTerminated
       
    55         };
       
    56 
       
    57     /**
       
    58      * Destroy this entity
       
    59      *
       
    60      * @since S60 3.2
       
    61      */
       
    62     virtual void Close() = 0;
       
    63 
       
    64     /**
       
    65      * Getter for the SIMPLE Engine connection.
       
    66      *
       
    67      * @since S60 3.2
       
    68      * @return connection
       
    69      */
       
    70     virtual const MSimpleConnection& Connection() = 0;
       
    71 
       
    72     /**
       
    73      * Subscribe presence entity.
       
    74      * Expiry time is set based on SIMPLE settings.
       
    75      * Leaves with KErrInUse if there is already active subscription
       
    76      * in this MSimpleWatcher entity.
       
    77      *
       
    78      * @since S60 3.2
       
    79      * @param aURI URI of entity to be subscribed
       
    80      * @param aFilter filter data, may be NULL.
       
    81      * @param aRefresh whether refresh is made automatically
       
    82      * @param aAnonymous whether anonymous subscription is wanted
       
    83      * @return operation id
       
    84      */
       
    85     virtual TInt SubscribeL(
       
    86         const TDesC8& aURI,
       
    87         MSimpleFilterDocument* aFilter,
       
    88         TBool aRefresh,
       
    89         TBool aAnonymous ) = 0;
       
    90 
       
    91     /**
       
    92      * Subscribe presence list.
       
    93      * Expiry time is set based on SIMPLE settings.
       
    94      * Leaves with KErrInUse if there is already active subscription
       
    95      * in this MSimpleWatcher entity.
       
    96      *
       
    97      * @since S60 3.2
       
    98      * @param aURI URI of entity to be subscribed
       
    99      * @param aFilter filter data, may be NULL.
       
   100      * @param aRefresh whether refresh is made automatically
       
   101      * @param aAnonymous whether anonymous subscription is wanted
       
   102      * @return operation id
       
   103      */
       
   104     virtual TInt SubscribeListL(
       
   105         const TDesC8& aURI,
       
   106         MSimpleFilterDocument* aFilter,
       
   107         TBool aRefresh,
       
   108         TBool aAnonymous  ) = 0;
       
   109 
       
   110     /**
       
   111      * Get presence data
       
   112      * Leaves with KErrInUse if there is already active subscription
       
   113      * in this MSimpleWatcher entity.
       
   114      *
       
   115      * @since S60 3.2
       
   116      * @param aURI URI of entity to be subscribed
       
   117      * @param aFilter filter data, may be NULL.
       
   118      * @param aAnonymous whether anonymous subscription is wanted
       
   119      * @return operation id
       
   120      */
       
   121     virtual TInt GetPresenceL(
       
   122         const TDesC8& aURI,
       
   123         MSimpleFilterDocument* aFilter,
       
   124         TBool aAnonymous ) = 0;
       
   125 
       
   126     /**
       
   127      * Unsubscribe.
       
   128      * Leaves with KErrNotFound if there is no active subscription.
       
   129      *
       
   130      * @since S60 3.2
       
   131      * @return operation id
       
   132      */
       
   133     virtual TInt UnsubscribeL( ) = 0;
       
   134 
       
   135     /**
       
   136      * SIP Status code accessor.
       
   137      * Get the status of the last completed request.
       
   138      * Refer to RFC3261, RFC3265, RFC3903.
       
   139      *
       
   140      * @since S60 3.2
       
   141      * @return SIP status, 0 if not available
       
   142      */
       
   143     virtual TUint SIPStatus() = 0;
       
   144 
       
   145     /**
       
   146      * SIP Retry-after header value accessor.
       
   147      * Get the SIP retry-fater header value of the last completed request.
       
   148      * Refer to RFC3261, RFC3265, RFC3903.     
       
   149      *
       
   150      * @since S60 3.2
       
   151      * @return retry-after value in seconds, 0 if not available
       
   152      */
       
   153     virtual TUint SIPRetryAfter() = 0;
       
   154     
       
   155     /**
       
   156      * SIP Subscription-state header value accessor.
       
   157      * Get the SIP Subscription-state header value of the last NOTIFY message or
       
   158      * ESimpleStateTerminated when the subscription is terminated by a client.
       
   159      * Refer to RFC3265     
       
   160      *
       
   161      * @since S60 3.2
       
   162      * @return subscription state
       
   163      */
       
   164     virtual TSimpleSipSubscriptionState SipSubscriptionState() = 0;    
       
   165 
       
   166     };
       
   167 
       
   168 #endif
       
   169 
       
   170 // End of File