--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btserviceutil/export/btdevrepository.h Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,156 @@
+/*
+* Copyright (c) 2010 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:
+*
+* Description: The repository of remote devices from BT registry
+*
+*/
+
+#ifndef BTDEVICEREPOSITORY_H
+#define BTDEVICEREPOSITORY_H
+
+#include <btdevice.h>
+#include <btmanclient.h>
+#include <btservices/btdevextension.h>
+
+class CBtDevRepositoryImpl;
+
+/**
+ * APIs from this class offer functionalities that are common in mw and app
+ * components of Bluetooth packages. They do not serve as domain APIs.
+ *
+ * Using these from external components is risky, due to possible source
+ * and binary breaks in future.
+ *
+ */
+
+/**
+ * Class MBtDevRepositoryObserver
+ *
+ * Callback class to notify changes in BT registry.
+ */
+class MBtDevRepositoryObserver
+ {
+public:
+
+ /**
+ * Callback to notify that the repository has finished initialization.
+ * Initialization completion means the repository has retieved all
+ * Bluetooth devices from BT registry, and it is subscribing to
+ * registry update events.
+ *
+ */
+ virtual void RepositoryInitialiazed() = 0;
+
+ /**
+ * Callback to notify that a device has been deleted from BT registry.
+ *
+ *
+ * @param aAddr the bd_addr of the deleted device
+ */
+ virtual void BtDeviceDeleted( const TBTDevAddr& aAddr ) = 0;
+
+ /**
+ * Callback to notify that the device has been added to BT registry.
+ *
+ * @param aDevice the device that has been added to registry
+ */
+ virtual void BtDeviceAdded( const CBtDevExtension& aDevice ) = 0;
+
+ /**
+ * Callback to notify that the property of a device in BT registry has been
+ * changed.
+ *
+ * @param aDevice the device that possesses the latest properties.
+ * @param aSimilarity the similarity of the properties comparing to the ones
+ * prior to this change.
+ * Refer CBTDevice::TBTDeviceNameSelector and
+ * TBTNamelessDevice::TBTDeviceSet for the meanings of the bits
+ * in this parameter.
+ */
+ virtual void BtDeviceChangedInRegistry(
+ const CBtDevExtension& aDevice, TUint aSimilarity ) = 0;
+ };
+
+/**
+ * Class CBtDevRepository
+ *
+ * This class provides the full access to remote devices in BT registry,
+ * and informs client when the properties of remote devices are changed.
+ *
+ */
+NONSHARABLE_CLASS( CBtDevRepository ) : public CBase
+ {
+public:
+
+ /**
+ * Two-phase constructor
+ */
+ IMPORT_C static CBtDevRepository* NewL();
+
+ /**
+ * Destructor
+ */
+ IMPORT_C virtual ~CBtDevRepository();
+
+ /**
+ * Add an observer to this reposity for receivng repository update
+ * events.
+ * @param aObserver the observer to be added.
+ */
+ IMPORT_C void AddObserverL( MBtDevRepositoryObserver* aObserver );
+
+ /**
+ * Remove an observer from this repository.
+ * @param aObserver the observer to be removed.
+ */
+ IMPORT_C void RemoveObserver( MBtDevRepositoryObserver* aObserver );
+
+ /**
+ * Tells if this repository has finished the initialization.
+ * Initialization completion means the repository has retieved all
+ * Bluetooth devices from BT registry, and it is subscribing to
+ * registry update events.
+ */
+ IMPORT_C TBool IsInitialized() const;
+
+ /**
+ * Get all devices in this repository.
+ * @return the device list
+ */
+ IMPORT_C const RDevExtensionArray& AllDevices() const;
+
+ /**
+ * Get a specific device by the given address.
+ * @param aAddr the address of the device to be retrieved
+ * @return the device pointer, NULL if the device is unavailable.
+ */
+ IMPORT_C const CBtDevExtension* Device( const TBTDevAddr& aAddr ) const;
+
+private:
+
+ /**
+ * C++ default constructor
+ */
+ CBtDevRepository();
+
+ /**
+ * Symbian 2nd-phase constructor
+ */
+ void ConstructL();
+
+private:
+
+ CBtDevRepositoryImpl* iImpl;
+ };
+
+#endif /*BTDEVICEREPOSITORY_H*/