presencefwsimpleadpt/inc/simplepluginentitywatcher.h
branchRCL_3
changeset 18 fbd2e7cec7ef
parent 0 c8caa15ef882
equal deleted inserted replaced
17:2669f8761a99 18:fbd2e7cec7ef
       
     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 Protocol implementation for Presence Framework
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef CSIMPLEPLUGINENTITYWATCHER_H
       
    22 #define CSIMPLEPLUGINENTITYWATCHER_H
       
    23 
       
    24 #include <e32std.h>
       
    25 
       
    26 #include <protocolpresencewatching.h>
       
    27 
       
    28 #include <msimplewatcherobserver.h>
       
    29 
       
    30 #include "simpleplugincommon.h"
       
    31 #include "msimplepluginconnectionobs.h"
       
    32 
       
    33 
       
    34 class TXIMPRequestId;
       
    35 class MXIMPIdentity;
       
    36 class MXIMPProtocolConnectionHost;
       
    37 class MPersonPresenceInfo;
       
    38 
       
    39 class MSimpleDocument;
       
    40 class MSimpleWatcher;
       
    41 
       
    42 class CSimplePluginWatcher;
       
    43 
       
    44 /**
       
    45  * CSimplePluginEntityWatcher
       
    46  *
       
    47  * Simple Engine Connection
       
    48  *
       
    49  * @lib ?library
       
    50  * @since s60 v5.0
       
    51  */
       
    52 NONSHARABLE_CLASS( CSimplePluginEntityWatcher ): public CBase,
       
    53     public MSimpleWatcherObserver
       
    54     {
       
    55 
       
    56 private:
       
    57     /**
       
    58      * Current operation
       
    59      */
       
    60     enum TPluginEntityWatcherOperation
       
    61         {
       
    62         EPluginIdle,
       
    63         EPluginStop,
       
    64         EPluginStart
       
    65         };
       
    66 
       
    67 public:
       
    68 
       
    69     /**
       
    70      * Constructor.
       
    71      * @param aObs callback for complete requests
       
    72      * @param aConn Simple Engine connection
       
    73      * @param aHost PrFw connection host
       
    74      */
       
    75     static CSimplePluginEntityWatcher* NewL(
       
    76         MSimplePluginConnectionObs& aObs,
       
    77         MSimpleConnection& aConn,
       
    78         CSimplePluginWatcher& aWatcher );
       
    79 
       
    80     virtual ~CSimplePluginEntityWatcher();
       
    81 
       
    82 
       
    83     /**
       
    84      * Access Request id
       
    85      * @return PrFw request id
       
    86      */
       
    87     TXIMPRequestId PrFwRequestId();
       
    88 
       
    89     /**
       
    90      * Access Presentity id
       
    91      * @return Presentity id
       
    92      */
       
    93     TPtrC8 PresentityId();
       
    94 
       
    95     /**
       
    96      * Start subscribe
       
    97      * @param aPresentityId presentity id
       
    98      */
       
    99     void StartSubscribeL(
       
   100         const TDesC8& aPresentityId );
       
   101 
       
   102     /**
       
   103      * Start subscribe
       
   104      * @param aPresentityId presentity id
       
   105      */
       
   106     void StartSubscribeListL(
       
   107         const TDesC8& aPresentityId );
       
   108 
       
   109     /**
       
   110      * Set simple name
       
   111      * @param aPresentityId presentity id
       
   112      */
       
   113     void SetSimpleNameL(
       
   114         const TDesC8& aPresentityId );
       
   115 
       
   116     void StopSubscribeL( );
       
   117 
       
   118 private:
       
   119 
       
   120     CSimplePluginEntityWatcher(
       
   121         MSimplePluginConnectionObs& aObs,
       
   122         MSimpleConnection& aConn,
       
   123         CSimplePluginWatcher& aWatcher );
       
   124 
       
   125     void ConstructL( );
       
   126 
       
   127 public:
       
   128 
       
   129 // from base class MSimpleWatcherObserver
       
   130 
       
   131     /**
       
   132      * Defined in a base class
       
   133      */
       
   134     void WatcherReqCompleteL( TInt aOpId, TInt aStatus );
       
   135 
       
   136     /**
       
   137      * Defined in a base class
       
   138      */
       
   139     void WatcherNotificationL( MSimpleDocument& aDocument );
       
   140 
       
   141     /**
       
   142      * Defined in a base class
       
   143      */
       
   144     void WatcherListNotificationL( MSimplePresenceList& aList );
       
   145 
       
   146     /**
       
   147      * Defined in a base class
       
   148      */
       
   149     void WatcherTerminatedL(
       
   150         TInt aOpId, TInt aReason );
       
   151 
       
   152 private:
       
   153 
       
   154     /**
       
   155      * Calls caller active object
       
   156      * @param aStatus error status
       
   157      */
       
   158     void CompleteClientReq( TInt aStatus );
       
   159 
       
   160 
       
   161 
       
   162 private: // Data
       
   163 
       
   164     /**
       
   165      * host class
       
   166      */
       
   167     CSimplePluginWatcher& iPluginWatcher;
       
   168 
       
   169     /**
       
   170      * PrFw Plugin connection observer
       
   171      */
       
   172     MSimplePluginConnectionObs& iConnObs;
       
   173 
       
   174     /**
       
   175      * SIMPLE engine connection
       
   176      */
       
   177     MSimpleConnection& iConnection;
       
   178 
       
   179     /**
       
   180      * SIMPLE engine watcher
       
   181      * Own.
       
   182      */
       
   183     MSimpleWatcher* iWatcher;
       
   184 
       
   185     /**
       
   186      * PrFW request id
       
   187      */
       
   188     TXIMPRequestId iPrFwId;
       
   189 
       
   190     /**
       
   191      * Simple Engine request id
       
   192      */
       
   193     TInt iSimpleId;
       
   194 
       
   195     /**
       
   196      * client statutus.
       
   197      * Not own.
       
   198      */
       
   199     TRequestStatus* iClientStatus;
       
   200 
       
   201     /**
       
   202      * Subscribed entity id
       
   203      * Own.
       
   204      */
       
   205     HBufC8* iEntityId;
       
   206 
       
   207     /**
       
   208      * Subscribed entity id, pure group name
       
   209      * Own.
       
   210      */
       
   211     HBufC8* iSimpleEntityId;
       
   212 
       
   213     /**
       
   214      * current pending operation
       
   215      */
       
   216     TPluginEntityWatcherOperation iOperation;
       
   217 
       
   218     /**
       
   219      * Whether subscription of list is pending
       
   220      */
       
   221     TBool iListSubsActive;
       
   222 
       
   223     };
       
   224 
       
   225 #endif // CSimplePluginEntityWatcher_H