sensorservices/sensorserver/inc/client/sensrvchannelfinderimpl.h
changeset 0 4e1aa6a622a0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 /*
       
     2 * Copyright (c) 2006-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:  Sensor Control API
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef SENSRVCHANNELFINDERIMPL_H
       
    22 #define SENSRVCHANNELFINDERIMPL_H
       
    23 
       
    24 //  INCLUDES
       
    25 #include <e32base.h>
       
    26 #include "sensrvchannelfinder.h"
       
    27 #include "sensrvtypes.h"
       
    28 #include "sensrvclient.h"
       
    29 #include "sensrvchannellistener.h"
       
    30 #include "sensrvchannelchangehandlerobserver.h"
       
    31 
       
    32 class CSensrvChannelChangeHandler;
       
    33 
       
    34 
       
    35 /**
       
    36  *  Sensor control for controlling and searching sensors
       
    37  *
       
    38  *  @lib SensrvClient.lib
       
    39  *  @since S60 5.0
       
    40  */
       
    41 
       
    42 NONSHARABLE_CLASS(CSensrvChannelFinderImpl) : public CSensrvChannelFinder, 
       
    43                                               public MSensrvChannelChangeHandlerObserver
       
    44     {
       
    45 
       
    46     friend class CSensrvChannelFinder;
       
    47     
       
    48     public:
       
    49     
       
    50         /**
       
    51         * Destructor.
       
    52         */
       
    53         virtual ~CSensrvChannelFinderImpl();
       
    54         
       
    55     public:
       
    56       
       
    57         /**
       
    58         * Find channels which have properties given in the parameters
       
    59         *
       
    60         * @since S60 5.0
       
    61         * @param aChannelList List of channel info objects
       
    62         * @param aSearchConditions Search conditions for channels to be fetched
       
    63         * @return void Description
       
    64         */    
       
    65          void FindChannelsL( RSensrvChannelInfoList& aChannelList, 
       
    66                                       const TSensrvChannelInfo& aSearchConditions );
       
    67                                       
       
    68          /**
       
    69         * Set channel listener. The channel listener may listen new channels installed to
       
    70         * the system. If a new SSY is installed notification for each channel it provides is
       
    71         * reveived.
       
    72         *
       
    73         * @since S60 5.0
       
    74         * @param[in] aChannelListener Pointer to channel listener instance.
       
    75         * @param[in] aSearchParameters Search parameters.
       
    76         */
       
    77         void SetChannelListenerL( MSensrvChannelListener* aChannelListener,
       
    78                                   const TSensrvChannelInfo& aSearchParameters );
       
    79 
       
    80     public:  // From MSensrvChannelChangeHandlerObserver
       
    81     
       
    82         /**
       
    83         * Indicates channel availability change caused by installation or removal
       
    84         * of new software. 
       
    85         *
       
    86         * @since S60 5.0
       
    87         * @param[in] aDetectedChannel Channel information of the channel.
       
    88         * @param[in] aChangeType If ESensrvChannelAdded, channel is a newly available
       
    89         *                        channel. 
       
    90         *                        If ESensrvChannelRemoved, channel was removed and is  
       
    91         *                        no longer available.
       
    92         */
       
    93         virtual void ChannelChangeDetected( const TSensrvChannelInfo& aDetectedChannel,
       
    94                                             TSensrvChannelChangeType aChangeType  );
       
    95 
       
    96         /**
       
    97         * Channel change listening failed.
       
    98         * If error was fatal, sensor server session has also been terminated, and
       
    99         * related finder is no longer usable.
       
   100         * If error was minor, some notifications have potentially been lost.
       
   101         *
       
   102         * @since S60 5.0
       
   103         * @param[in] aError Error code.
       
   104         */
       
   105         virtual void ChannelDetectionError( TSensrvErrorSeverity aError );    
       
   106                  
       
   107     private:
       
   108      
       
   109         /**
       
   110         * C++ constructor
       
   111         *
       
   112         * @since S60 5.0
       
   113         */
       
   114          CSensrvChannelFinderImpl();
       
   115      
       
   116         /**
       
   117         * 2nd phase of construction
       
   118         *
       
   119         * @since S60 5.0
       
   120         */
       
   121         void ConstructL();
       
   122          
       
   123     private:
       
   124     
       
   125         /**
       
   126         * Sensor server client
       
   127         */
       
   128         RSensrvClient iSensrvClient;
       
   129 
       
   130         /**
       
   131         * Property handler
       
   132         * Own         
       
   133         */
       
   134         CSensrvChannelChangeHandler* iChannelChangeHandler;
       
   135 
       
   136         /**
       
   137         * Property listener
       
   138         * Not own         
       
   139         */
       
   140         MSensrvChannelListener* iChannelChangeListener;
       
   141         
       
   142     };
       
   143 
       
   144 
       
   145 #endif //SENSRVCHANNELFINDERIMPL_H