wvuing/IMPSConnectionUI/ServiceInc/MCnUiClientStatusHandler.h
branchRCL_3
changeset 13 a941bc465d9f
parent 0 094583676ce7
equal deleted inserted replaced
12:6ca72c0fe49a 13:a941bc465d9f
       
     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:  Client status handler.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __MCNUICLIENTSTATUSHANDLER_H
       
    19 #define __MCNUICLIENTSTATUSHANDLER_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include <E32Base.h>
       
    23 #include <impspresenceconnectionuiconstsng.h>
       
    24 
       
    25 
       
    26 //FORWARD DECLARATION
       
    27 class MCnUiClientStatusObserver;
       
    28 class MCnUiClientStatusHandler;
       
    29 
       
    30 /**
       
    31  * Factory method for client status
       
    32  * handler construction.
       
    33  *
       
    34  * Global factory method to create concrete
       
    35  * client status handler.
       
    36  *
       
    37  * @since 2.1
       
    38  * @return New MCnUiClientStatusHandler instance.
       
    39  * Leaves created object on CleanupStack.
       
    40  */
       
    41 GLREF_D MCnUiClientStatusHandler* CreateClientStatusHandlerLC();
       
    42 
       
    43 
       
    44 
       
    45 // CLASS DECLARATION
       
    46 /**
       
    47  * Abstract interface to handle client login
       
    48  * status.
       
    49  *
       
    50  * @since 2.1
       
    51  */
       
    52 NONSHARABLE_CLASS( MCnUiClientStatusHandler )
       
    53     {
       
    54 public: // Client status related functions
       
    55 
       
    56 
       
    57     /**
       
    58      * Checks is there any client marked as
       
    59      * logged in.
       
    60      *
       
    61      * @since 2.1
       
    62      * @return ETrue if there is atleast
       
    63      * one known client logged in.
       
    64      * Else EFalse.
       
    65      */
       
    66     virtual TBool AnyClientLoggedIn() = 0;
       
    67 
       
    68 
       
    69     /**
       
    70      * Checks is the given client marked as
       
    71      * logged in.
       
    72      *
       
    73      * @since 2.1
       
    74      * @param aClient The client to check.
       
    75      * @return ETrue if the client is logged in.
       
    76      * Else EFalse.
       
    77      */
       
    78     virtual TBool ClientLoggedIn( TIMPSConnectionClient aClient ) = 0;
       
    79 
       
    80 
       
    81     /**
       
    82      * Sets the client as logged in.
       
    83      *
       
    84      * @since 2.1
       
    85      * @param aClient The client to mark in.
       
    86      */
       
    87     virtual void SetClientLoggedInL( TIMPSConnectionClient aClient ) = 0;
       
    88 
       
    89 
       
    90     /**
       
    91      * Clear all logged in flags.
       
    92      *
       
    93      * @since 2.1
       
    94      */
       
    95     virtual void SetNoClientsLoggedInL() = 0;
       
    96 
       
    97 
       
    98     /**
       
    99      * Removes the client from loged in.
       
   100      *
       
   101      * @since 2.1
       
   102      * @param aClient The client to take out of logged in ones.
       
   103      */
       
   104     virtual void SetClientLoggedOutL( TIMPSConnectionClient aClient ) = 0;
       
   105 
       
   106 
       
   107     /**
       
   108      * Requests notifications from certain client login
       
   109      * staus changes. There can be just one this kind
       
   110      * of reqest active at time per one MCnUiClientStatusHandler.
       
   111      *
       
   112      * @since 2.1
       
   113      * @param aObserver The observer to notify. Must be a valid object.
       
   114      * @param aClientToNotify The client for which login status to notify.
       
   115      */
       
   116     virtual void NotifyClientLoginStatusChangesL( MCnUiClientStatusObserver* aObserver,
       
   117                                                   TIMPSConnectionClient aClientToNotify ) = 0;
       
   118 
       
   119     /**
       
   120      * Cancels any previously issued
       
   121      * client status notify.
       
   122      *
       
   123      * @since 2.1
       
   124      */
       
   125     virtual void CancelClientStatusNotify() = 0;
       
   126 
       
   127 
       
   128 public:  //Destructor
       
   129 
       
   130     /**
       
   131      * Virtual inline destructor.
       
   132      *
       
   133      * Allows destruction using this
       
   134      * interface
       
   135      *
       
   136      * Cancels any previously issued
       
   137      * client status notify.
       
   138      */
       
   139     virtual ~MCnUiClientStatusHandler() {};
       
   140     };
       
   141 
       
   142 
       
   143 
       
   144 /**
       
   145  * Observer interface to report client
       
   146  * status changes.
       
   147  *
       
   148  * @since 2.1
       
   149  */
       
   150 NONSHARABLE_CLASS( MCnUiClientStatusObserver )
       
   151     {
       
   152 public:  // New observation methods
       
   153 
       
   154     /**
       
   155      * Method called to handle client
       
   156      * status changes.
       
   157      *
       
   158      * @since 2.1
       
   159      * @param aRequestedClient The client for which the
       
   160      * notifiaction was requested.
       
   161      * @param aClientNowLoggedIn ETrue if the client is
       
   162      * now logged in. EFalse if the client is now logged out.
       
   163      */
       
   164     virtual void HandleClientLoginStatusChange( TIMPSConnectionClient aRequestedClient,
       
   165                                                 TBool aClientNowLoggedIn ) = 0;
       
   166 
       
   167 protected:  //Destructor
       
   168 
       
   169     /**
       
   170      * Virtual inline destructor.
       
   171      *
       
   172      * Concrete observer can't be destroyed
       
   173      * using this interface.
       
   174      */
       
   175     virtual ~MCnUiClientStatusObserver() {};
       
   176     };
       
   177 
       
   178 
       
   179 #endif      //  __MCNUICLIENTSTATUSHANDLER_H
       
   180 
       
   181 //  End of File
       
   182