diff -r f05641c183ff -r 43824b19ee35 bluetoothengine/btnotif/btnotifsrv/inc/btnotifdeviceselector.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bluetoothengine/btnotif/btnotifsrv/inc/btnotifdeviceselector.h Fri May 14 16:01:46 2010 +0300 @@ -0,0 +1,171 @@ +/* +* ============================================================================ +* Name : btnotifdeviceselector.h +* Part of : BTProximity / BTProximity +* Description : Class for tracking Bluetooth settings, and also for +* handling notes unrelated to specific connection. +* +* Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* Nokia Corporation +* ============================================================================ +* Template version: 4.2 +*/ + +#ifndef BTNOTIFDEVICESELECTOR_H +#define BTNOTIFDEVICESELECTOR_H + + +#include +#include +#include +#include "bluetoothnotification.h" + +class CBTNotifServer; +class CAdvanceDevDiscoverer; +class CBtDevExtension; + +/** + * ?one_line_short_description + * ?more_complete_description + * + * @code + * ?good_class_usage_example(s) + * @endcode + * + * @lib ?library + * @since S60 ?S60_version *** for example, S60 v3.0 + */ +NONSHARABLE_CLASS( CBTNotifDeviceSelector ) : + public CBase, + public MBTNotificationResult, + public MDevDiscoveryObserver + { + +public: + + /** + * Two-phased constructor. + * @param aServer Pointer to our parent + */ + static CBTNotifDeviceSelector* NewL( CBTNotifServer& aServer ); + + /** + * Destructor. + */ + virtual ~CBTNotifDeviceSelector(); + + /** + * Processes a message from a notifier client related to settings. + * + * @since Symbian^4 + * @param aMessage The message containing the details of the client request. + */ + void DispatchNotifierMessageL( const RMessage2& aMessage ); + + /** + * Cancels an oustanding message from a notifier client related to settings. + * + * @since Symbian^4 + * @param aMessage The message containing the details of the original client request. + */ + void CancelNotifierMessageL( const RMessage2& aMessage ); + +private: +// from base class MBTNotificationResult + + /** + * From MBTNotificationResult. + * Handle an intermediate result from a user query. + * This ffunction is called if the user query passes information + * back before it has finished i.e. is dismissed. The final acceptance/ + * denial of a query is passed back in MBRNotificationClosed. + * + * @since Symbian^4 + * @param aData the returned data. The actual format + * is dependent on the actual notifier. + */ + virtual void MBRDataReceived( CHbSymbianVariantMap& aData ); + + /** + * From MBTNotificationResult. + * The notification is finished. The resulting data (e.g. user input or + * acceptance/denial of the query) is passed back here. + * + * @since Symbian^4 + * @param aErr KErrNone or one of the system-wide error codes. + * @param aData the returned data. The actual format + * is dependent on the actual notifier. + */ + virtual void MBRNotificationClosed( TInt aError, const TDesC8& aData ); + + // From MDevDiscoveryObserver + + /** + * Callback to notify that a device has been found. + * + * @param aAddr the inquiry address that contains the inquiry information + * of the found device. + * @param aName the Bluetooth device name of the found device + */ + virtual void HandleNextDiscoveryResultL( + const TInquirySockAddr& aAddr, const TDesC& aName ); + + /** + * Callback to notify that the device search has completed. + * + * @param aErr the error code of device search result. + */ + virtual void HandleDiscoveryCompleted( TInt aErr ); + +private: + + CBTNotifDeviceSelector( CBTNotifServer& aServer ); + + void ConstructL(); + + void PrepareNotificationL( + TBluetoothDialogParams::TBTDialogType aType, + TBTDialogResourceId aResourceId ); + +private: // data + + /** + * Reference to our parent the server class. + * Not own. + */ + CBTNotifServer& iServer; + + /** + * Pointer to an outstanding user interaction. + * Not own. + */ + CBluetoothNotification* iNotification; + + /** + * device inquiry handler: + */ + CAdvanceDevDiscoverer* iDiscoverer; + + /** + * do not own the elements in the array. + */ + RPointerArray iDevices; + + /** + * The message for a pending device selection request from a RNotifier client. + */ + RMessage2 iMessage; + + }; + +#endif // BTNOTIFDEVICESELECTOR_H