resourcemgmt/hwrmfmtxwatcherplugin/inc/hwrmfmtxconnobserver.h
changeset 0 4e1aa6a622a0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 /*
       
     2 * Copyright (c) 2008 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 observer mixin and callback definition for fmtx watcher plugin.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef HWRMFMTXCONNOBSERVER_H
       
    20 #define HWRMFMTXCONNOBSERVER_H
       
    21 
       
    22 /**
       
    23 * Connection types. Not a bitmask, but types can be assigned
       
    24 * values as 0, 1, 2, 3, ...
       
    25 */  
       
    26 enum TFmtxWatcherObserverTypes
       
    27     {
       
    28     EFmtxWatcherObserverAccessory,
       
    29     EFmtxWatcherObserverUsb,
       
    30     EFmtxWatcherObserverTest, // Test observer should be always the last
       
    31     EFmtxWatcherObserverCount
       
    32     };
       
    33 
       
    34 
       
    35 /**
       
    36 * A callback interface for handling notifification of changes 
       
    37 * in wired connections, which ought to disable FM Tx. The client 
       
    38 * derives a class from this interface and implements the 
       
    39 * HandleConnectionChange-method.
       
    40 *
       
    41 * @since S60 3.2
       
    42 * @lib hwrmfmtxwatcherplugin.lib
       
    43 */
       
    44 class MHWRMFmtxConnObserverCallback
       
    45     {
       
    46 public:
       
    47 
       
    48     /**
       
    49     * This callback method is used to notify the client about
       
    50     * the change in connection status.
       
    51     *
       
    52     * @param aType Connection type.
       
    53     * @param aConnected Truth value indicating connection status.
       
    54     */
       
    55     virtual void HandleConnectionChange( TFmtxWatcherObserverTypes aType,
       
    56                                          TBool aConnected ) = 0;
       
    57     };
       
    58 
       
    59 /**
       
    60 *  Interface class to be implemented by connection observers.
       
    61 *
       
    62 * @since S60 3.2
       
    63 * @lib hwrmfmtxwatcherplugin.lib
       
    64 */
       
    65 class MHWRMFmtxConnObserver
       
    66     {
       
    67 public:
       
    68 
       
    69     /**
       
    70     * Destructor.
       
    71     *
       
    72     * Needed for destroying objects so that there's no need to know
       
    73     * the actual implementation class(es).
       
    74     */
       
    75     virtual ~MHWRMFmtxConnObserver() {};
       
    76 
       
    77     /**
       
    78     * This method gets connection status.
       
    79     *
       
    80     * @return TBool ETrue if connected, otherwise EFalse.
       
    81     *
       
    82 	* @leave One of the Symbian OS error codes.
       
    83     */
       
    84     virtual TBool GetStatusL() = 0;
       
    85 
       
    86     /**
       
    87     * This method is used to start observing connections.
       
    88     *
       
    89 	* @leave One of the Symbian OS error codes.
       
    90     */
       
    91     virtual void StartObservingL() = 0;
       
    92 
       
    93     /** 
       
    94     * This method is used to stop observing connections.
       
    95     *
       
    96     */
       
    97     virtual void StopObserving() = 0;
       
    98     };
       
    99 
       
   100 #endif // HWRMFMTXCONNOBSERVER_H