inc/cimpsconnuiconnectionmodenotifierng.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2003 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:  Connection mode notifier.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __CIMPSCONNUICONNECTIONMODENOTIFIERNG_H
       
    19 #define __CIMPSCONNUICONNECTIONMODENOTIFIERNG_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include <e32base.h>
       
    23 #include <impspresenceconnectionuiconstsng.h>
       
    24 
       
    25 
       
    26 //FORWARD DECLARATIONS
       
    27 class MIMPSConnUiConnectionModeObserver;
       
    28 class CIMPSConnUiConnectionModeNotifierImp;
       
    29 
       
    30 
       
    31 /**
       
    32  * Connection mode notifier.
       
    33  *
       
    34  * Notifies registered observers from client
       
    35  * specific connection mode changes.
       
    36  *
       
    37  * For more information about connection mode
       
    38  * changes, see TIMPSConnectionModeEvent mode
       
    39  * event enumeration.
       
    40  *
       
    41  * @lib IMPSConnectionUi.lib
       
    42  * @since 2.1
       
    43  */
       
    44 class CIMPSConnUiConnectionModeNotifier : public CBase
       
    45     {
       
    46     public:  // Constructors and destructor
       
    47 
       
    48         /**
       
    49          * Two-phased constructor.
       
    50          *
       
    51          * @since 2.1
       
    52          * @param aClient The client for which to deliver
       
    53          * the connection mode events.
       
    54          */
       
    55         IMPORT_C static CIMPSConnUiConnectionModeNotifier* NewL( TIMPSConnectionClient aClient );
       
    56 
       
    57         /**
       
    58          * Two-phased constructor.
       
    59          * Leaves CIMPSConnUiConnectionModeNotifier object on the
       
    60          * CleanupStack.
       
    61          *
       
    62          * @since 2.1
       
    63          * @param aClient The client for which to deliver
       
    64          * the connection mode events.
       
    65          */
       
    66         IMPORT_C static CIMPSConnUiConnectionModeNotifier* NewLC( TIMPSConnectionClient aClient );
       
    67 
       
    68         /**
       
    69          * Destructor.
       
    70          */
       
    71         IMPORT_C virtual ~CIMPSConnUiConnectionModeNotifier();
       
    72 
       
    73 
       
    74     public: // New functions
       
    75 
       
    76         /**
       
    77          * Start listening connection mode events.
       
    78          *
       
    79          * Starts to deliver notifications from connection
       
    80          * mode changes (e.g. user selections that inpact to
       
    81          * connection state/modes).
       
    82          *
       
    83          * Starting fails with leave if:
       
    84          * - already started (KErrInUse)
       
    85          * - no observers registered (KErrNotReady)
       
    86          * - if running out of resourcies (KErrNoMemory)
       
    87          * - or with other standard Symbian OS error codes
       
    88          *   coming from underlying implementation.
       
    89          * @since 2.1
       
    90          *
       
    91          * @see MIMPSConnUiConnectionModeObserver
       
    92          * @see TIMPSConnectionModeEvent
       
    93          */
       
    94         IMPORT_C virtual void StartL();
       
    95 
       
    96 
       
    97         /**
       
    98          * Stop listening connection mode events.
       
    99          *
       
   100          * Stops listening connection mode events.
       
   101          * KErrCancel error is notified
       
   102          * synchronously to reqistered observers.
       
   103          *
       
   104          * @since 2.1
       
   105          */
       
   106         IMPORT_C virtual void Stop();
       
   107 
       
   108 
       
   109         /**
       
   110          * Add observer.
       
   111          *
       
   112          * Adds observer to receive notifications about
       
   113          * connection mode events.
       
   114          *
       
   115          * @since 2.1
       
   116          */
       
   117         IMPORT_C virtual void AddObserverL( MIMPSConnUiConnectionModeObserver* aObserver );
       
   118 
       
   119 
       
   120         /**
       
   121          * Remove observer.
       
   122          *
       
   123          * Removes observer from getting
       
   124          * connection mode events.
       
   125          *
       
   126          * @since 2.1
       
   127          * @return KErrNotFound if the observer wasn't previously added.
       
   128          * Otherwise KErrNone.
       
   129          */
       
   130         IMPORT_C virtual TInt RemoveObserver( MIMPSConnUiConnectionModeObserver* aObserver );
       
   131 
       
   132 
       
   133         /**
       
   134          * Gets current/last connection mode event
       
   135          * for in  the construction registered client type.
       
   136          *
       
   137          * Defaults to category to user level login/logout events.
       
   138          * (EIMPSCMEUserLevelSelectionEventGroup)
       
   139          *
       
   140          * @since 2.1
       
   141          * @return Current/last connection mode event for the
       
   142          * user level login/logout event category.
       
   143          * If there isn't any last/current event, return EIMPSCMEUnknown is returned.
       
   144          */
       
   145         IMPORT_C virtual TIMPSConnectionModeEvent ConnectionModeL();
       
   146 
       
   147 
       
   148         /**
       
   149          * Gets current/last connection mode event for in the
       
   150          * construction registered client type.
       
   151          *
       
   152          * Events are devided to different event groups
       
   153          * and last event for each group is maintained by the
       
   154          * notification system. It is possible to query
       
   155          * each group last event by giving the event
       
   156          * group id as method parameter.
       
   157          *
       
   158          * @since 2.1
       
   159          * @param aModeEventCateqory Event identifying the category
       
   160          * for which to get the last event.
       
   161          * @return Current/last connection mode event for the requested
       
   162          * event category. If there isn't any last/current event recognized
       
   163          * for the asked event group, EIMPSCMEUnknown is returned.
       
   164          */
       
   165         IMPORT_C virtual TIMPSConnectionModeEvent ConnectionModeByCategoryL(
       
   166             TIMPSConnectionModeEvent aModeEventCateqory );
       
   167 
       
   168 
       
   169 
       
   170 
       
   171     private: //Constructors.
       
   172 
       
   173         /**
       
   174          * C++ default constructor.
       
   175          */
       
   176         CIMPSConnUiConnectionModeNotifier();
       
   177 
       
   178 
       
   179         /**
       
   180          * Symbian OS constructor.
       
   181          */
       
   182         void ConstructL( TIMPSConnectionClient aClient );
       
   183 
       
   184 
       
   185 
       
   186     private: //Data
       
   187         ///<Implementation, owned
       
   188         CIMPSConnUiConnectionModeNotifierImp*   iImp;
       
   189 
       
   190         ///<Reserved, owned
       
   191         TAny*                                   iReserved1;
       
   192     };
       
   193 
       
   194 #endif      // __CIMPSCONNUICONNECTIONMODENOTIFIERNG_H
       
   195 
       
   196 // End of File