wvuing/IMPSConnectionUI/ServiceSrc/CCnUiConnModeHandler.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2004 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 handler implementation.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __CCNUICONNMODEHANDLER_H
       
    19 #define __CCNUICONNMODEHANDLER_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include <E32Base.h>
       
    23 #include <impspresenceconnectionuiconstsng.h>
       
    24 #include "CCnUiGroupChannel.h"
       
    25 #include "MCnUiConnModeHandler.h"
       
    26 
       
    27 
       
    28 //FORWARD DECLARATION
       
    29 class MCnUiConnModeObserver;
       
    30 
       
    31 
       
    32 
       
    33 // CLASS DECLARATION
       
    34 /**
       
    35  * Connection mode handler implementation.
       
    36  *
       
    37  * @since 2.1
       
    38  */
       
    39 NONSHARABLE_CLASS( CCnUiConnModeHandler ) : public CBase,
       
    40         public MCnUiGroupChannelListener,
       
    41         public MCnUiConnModeHandler
       
    42 
       
    43     {
       
    44 public:  // Two-phased constructors and destructor
       
    45 
       
    46     /**
       
    47      * Two-phased constructor.
       
    48      */
       
    49     static CCnUiConnModeHandler* NewL();
       
    50 
       
    51 
       
    52     /**
       
    53      * Destructor.
       
    54      */
       
    55     virtual ~CCnUiConnModeHandler();
       
    56 
       
    57 private:
       
    58 
       
    59     /**
       
    60      * C++ constructor.
       
    61      */
       
    62     CCnUiConnModeHandler();
       
    63 
       
    64 
       
    65     /**
       
    66      * Symbian OS constructor.
       
    67      */
       
    68     void ConstructL();
       
    69 
       
    70 
       
    71 
       
    72 public: // New functions from MCnUiConnModeHandler
       
    73 
       
    74     /**
       
    75      * From MCnUiConnModeHandler.
       
    76      * See it for details.
       
    77      *
       
    78      * @since 2.1
       
    79      */
       
    80     void SendUserSelectionL( TIMPSUserConnectionSelection aUserSelection,
       
    81                              TIMPSConnectionClient aClient );
       
    82 
       
    83     /**
       
    84      * From MCnUiConnModeHandler.
       
    85      * See it for details.
       
    86      *
       
    87      * @since 2.1
       
    88      */
       
    89     TInt RegisterAsSignificantSchedulingClientL( TIMPSConnectionClient aClient );
       
    90 
       
    91 
       
    92     /**
       
    93      * From MCnUiConnModeHandler.
       
    94      * See it for details.
       
    95      *
       
    96      * @since 2.1
       
    97      */
       
    98     void CancelRegisteringAsSSClient();
       
    99 
       
   100 
       
   101     /**
       
   102      * From MCnUiConnModeHandler.
       
   103      * See it for details.
       
   104      *
       
   105      * @since 2.1
       
   106      */
       
   107     TIMPSConnectionModeEvent ConnectionModeL( TIMPSConnectionClient aClient,
       
   108                                               TIMPSConnectionModeEvent aModeEventCateqory );
       
   109 
       
   110     /**
       
   111      * From MCnUiConnModeHandler.
       
   112      * See it for details.
       
   113      *
       
   114      * @since 2.1
       
   115      */
       
   116     void NotifyConnectionModeChangesL( MCnUiConnModeObserver* aObserver,
       
   117                                        TIMPSConnectionClient aClientToNotify );
       
   118 
       
   119     /**
       
   120      * From MCnUiConnModeHandler.
       
   121      * See it for details.
       
   122      *
       
   123      * @since 2.1
       
   124      */
       
   125     void CancelConnectionModeNotify();
       
   126 
       
   127 
       
   128 
       
   129 public: // from MCnUiGroupChannelListener
       
   130 
       
   131     /**
       
   132      * Channel listener.
       
   133      * @since 2.1
       
   134      */
       
   135     void HandleChannelMsg( TInt aGroupId,
       
   136                            TGCChannelID aChannelId,
       
   137                            TInt aChannelMsg );
       
   138 
       
   139 
       
   140 private: // Private helpers
       
   141 
       
   142 
       
   143     /**
       
   144      * Helper to start the notifying.
       
   145      *
       
   146      * @param aClientToNotify The client for which to start the notify.
       
   147      */
       
   148     void DoStartNotifyL( TIMPSConnectionClient aClientToNotify );
       
   149 
       
   150 
       
   151     /**
       
   152      * Event category checkers.
       
   153      *
       
   154      * @param aEvent The event to check.
       
   155      * @return ETrue if given event value belongs to
       
   156      * category. Else EFalse.
       
   157      */
       
   158     TBool LoginLogoutModeCategoryEvent( TInt aEvent );
       
   159     TBool SSClientStartStopCategoryEvent( TInt aEvent );
       
   160 
       
   161 
       
   162 
       
   163 private: // data
       
   164 
       
   165     ///<Listeners to listen channel activity, owned, lazy initialized
       
   166     CCnUiGroupChannel*            iLoginLogoutEventChannelListener;
       
   167     CCnUiGroupChannel*            iSSReqistrationChannelListener;
       
   168 
       
   169     ///<SS registration channel, owned
       
   170     CCnUiGroupChannel*            iSSReqistration;
       
   171 
       
   172     //Cached SS registration client count, owned.
       
   173     TInt                           iSSClientCountPrev;
       
   174 
       
   175     ///<Connection mode observer, not owned
       
   176     MCnUiConnModeObserver*        iConnModeObserver;
       
   177 
       
   178     ///<Observed client type, owned
       
   179     TIMPSConnectionClient         iObserverClient;
       
   180 
       
   181     };
       
   182 
       
   183 #endif      //  __CCNUICONNMODEHANDLER_H
       
   184 
       
   185 //  End of File
       
   186