inc/cimpsconnuipreseventnotifierng.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2005 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:  Presence event notifier.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __CIMPSCONNUIPRESEVENTNOTIFIERNG_H
       
    19 #define __CIMPSCONNUIPRESEVENTNOTIFIERNG_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include <e32base.h>
       
    23 #include <impspresenceconnectionuiconstsng.h>
       
    24 
       
    25 
       
    26 //FORWARD DECLARATIONS
       
    27 class MIMPSConnUiPresenceEventObserver;
       
    28 class CIMPSConnUiPresEventNotifierImpBase;
       
    29 class CPEngNWSessionSlotID2;
       
    30 
       
    31 /**
       
    32  * Presence event notifier.
       
    33  *
       
    34  * @lib IMPSConnectionUi.lib
       
    35  * @since 2.1
       
    36  */
       
    37 class CIMPSConnUiPresEventNotifier : public CBase
       
    38     {
       
    39     public:  // Constructors and destructor
       
    40 
       
    41         /**
       
    42          * Two-phased constructor.
       
    43          */
       
    44         IMPORT_C static CIMPSConnUiPresEventNotifier* NewL();
       
    45 
       
    46         /**
       
    47          * Two-phased constructor.
       
    48          * Leaves CIMPSConnUiPresEventNotifier object on the
       
    49          * CleanupStack.
       
    50          */
       
    51         IMPORT_C static CIMPSConnUiPresEventNotifier* NewLC();
       
    52 
       
    53         /**
       
    54          * Destructor.
       
    55          */
       
    56         IMPORT_C virtual ~CIMPSConnUiPresEventNotifier();
       
    57 
       
    58 
       
    59     public: // New functions
       
    60 
       
    61         /**
       
    62          * Start listening presence events.
       
    63          *
       
    64          * Starts to deliver notifications to reqistered
       
    65          * observers. Notifiaction is requsted from all
       
    66          * presence events, and those are reported
       
    67          * asynchronously to observers when they happen.
       
    68          *
       
    69          * Starting fails with leave if:
       
    70          * - already started (KErrInUse)
       
    71          * - no observers registered (KErrNotReady)
       
    72          * - if running out of resourcies (KErrNoMemory)
       
    73          * - or with other standard Symbian OS errorcodes
       
    74          *   coming from underlying PEC engine.
       
    75          * @since 2.1
       
    76          */
       
    77         IMPORT_C virtual void StartL();
       
    78 
       
    79 
       
    80         /**
       
    81          * Stop listening presence events.
       
    82          *
       
    83          * Stop listening presence events.
       
    84          * KErrCancel error is notified
       
    85          * synchronously to reqistered observers.
       
    86          *
       
    87          * @since 2.1
       
    88          */
       
    89         IMPORT_C virtual void Stop();
       
    90 
       
    91 
       
    92         /**
       
    93          * Add observer.
       
    94          *
       
    95          * Add observer to receive notifications about
       
    96          * presence events.
       
    97          *
       
    98          * @since 2.1
       
    99          */
       
   100         IMPORT_C virtual void AddObserverL( MIMPSConnUiPresenceEventObserver* aObserver );
       
   101 
       
   102 
       
   103         /**
       
   104          * Remove observer.
       
   105          *
       
   106          * Removes observer from getting the presence events.
       
   107          *
       
   108          * @since 2.1
       
   109          * @return KErrNotFound if the observer wasn't previously added.
       
   110          * Otherwise KErrNone.
       
   111          */
       
   112         IMPORT_C virtual TInt RemoveObserver( MIMPSConnUiPresenceEventObserver* aObserver );
       
   113 
       
   114 
       
   115         /**
       
   116          * Gets current service status as application
       
   117          * level enumeration.
       
   118          *
       
   119          * @since 3.0
       
   120          * @return  Result:
       
   121          *  - KErrNone if state succesfully get.
       
   122          *  - Else one of system wide error codes.
       
   123          */
       
   124         IMPORT_C virtual const CPEngNWSessionSlotID2* AppServiceStatusL(
       
   125             TIMPSConnectionClient aClient );
       
   126 
       
   127 
       
   128 
       
   129     protected: //Constructors.
       
   130 
       
   131         /**
       
   132          * C++ default constructor.
       
   133          */
       
   134         CIMPSConnUiPresEventNotifier();
       
   135 
       
   136         /**
       
   137          * Symbian OS constructor.
       
   138          *
       
   139          * Symbian OS constructor for
       
   140          * derived implementations.
       
   141          */
       
   142         void ConstructL( CIMPSConnUiPresEventNotifierImpBase* aImp );
       
   143 
       
   144 
       
   145     private: //Symbian constructor
       
   146 
       
   147         /**
       
   148          * Symbian OS constructor.
       
   149          * For class internal vonstruction.
       
   150          */
       
   151         void ConstructL();
       
   152 
       
   153 
       
   154 
       
   155     private: //Data
       
   156         ///<Implementation, owned
       
   157         CIMPSConnUiPresEventNotifierImpBase*   iImp;
       
   158 
       
   159         ///<Reserved, owned
       
   160         TAny*                                  iReserved1;
       
   161     };
       
   162 
       
   163 #endif      // __CIMPSCONNUIPRESEVENTNOTIFIERNG_H
       
   164 
       
   165 // End of File