libbluedevil v1.8
Signals | Public Member Functions | Static Public Member Functions | Properties

BlueDevil::Manager Class Reference

#include <bluedevil/bluedevilmanager.h>

Inheritance diagram for BlueDevil::Manager:
QObject

List of all members.

Signals

void adapterAdded (Adapter *adapter)
void adapterRemoved (Adapter *adapter)
void defaultAdapterChanged (Adapter *adapter)
void usableAdapterChanged (Adapter *adapter)
void allAdaptersRemoved ()

Public Member Functions

virtual ~Manager ()
AdapterdefaultAdapter ()
AdapterusableAdapter () const
QList< Adapter * > adapters () const
bool isBluetoothOperational () const

Static Public Member Functions

static Managerself ()
static void release ()

Properties

Manager self
Adapter defaultAdapter
QList< Adapter * > adapters
bool isBluetoothOperational

Detailed Description

Manager class. The entry point to BlueDevil exposed services.

The typical way to proceed is to work with the default adapter, but you can also list all bluetooth adapters and work with the one you want.

The interface is a singleton with release-when-you-want capability.

All adapters and devices are created by BlueDevil, and the ownership is always of BlueDevil.

Author:
Rafael Fernández López <ereslibre@kde.org>

Constructor & Destructor Documentation

BlueDevil::Manager::~Manager ( ) [virtual]

Member Function Documentation

void BlueDevil::Manager::adapterAdded ( Adapter adapter) [signal]

This signal will be emitted when an adapter has been connected.

void BlueDevil::Manager::adapterRemoved ( Adapter adapter) [signal]

This signal will be emitted when an adapter has been disconnected.

QList<Adapter*> BlueDevil::Manager::adapters ( ) const
Returns:
A list with all the connected adapters.
void BlueDevil::Manager::allAdaptersRemoved ( ) [signal]

This signal will be emitted when all adapters have been disconnected.

Adapter* BlueDevil::Manager::defaultAdapter ( )
Returns:
The default adapter. NULL if there is no default adapter or the system is not ready (the bus is not accessible or there is no Bluetooth system running).
void BlueDevil::Manager::defaultAdapterChanged ( Adapter adapter) [signal]

This signal will be emitted when the default adapter has changed. It also will be emitted when all adapters have been removed, placing 0 at adapter.

bool BlueDevil::Manager::isBluetoothOperational ( ) const
Returns:
Whether the bluetooth system is ready to be used, and there is a default adapter connected and turned on at the system.
Note:
After this check, if succeeded, you can freely access to all libbluedevil functionality by retrieving the default adapter through a call to defaultAdapter().
If this method returns false, you can connect to the defaultAdapterChanged signal, so you can be notified when bluetooth is operational.
void BlueDevil::Manager::release ( ) [static]

When you consider you have finished working with BlueDevil you can immediatly release the memory by calling this method. It will automatically delete all Adapters and Devices that were still on memory.

static Manager* BlueDevil::Manager::self ( ) [static]
Returns:
The Manager instance.
Adapter * BlueDevil::Manager::usableAdapter ( ) const
Returns:
The default adapter if present and ready to be used. Otherwise it will return the first adapter that is ready to be used (is powered). If there are no usable adapters, NULL will be returned.
void BlueDevil::Manager::usableAdapterChanged ( Adapter adapter) [signal]

This signal will be emitted when the current usable adapter has changed. This basically means two cases:

  • There were no usable adapters (powered off, or not present), and a new one has been connected and is powered on.
  • The adapter that was considered usable has been removed or powered off.

If any of those cases happen, and it was possible to find a usable adapter, this signal will report the new adapter. If no usable adapter could be found, 0 will be placed at adapter.

Note:
Default adapter will be always given priority. This is, the first adapter that is checked to be usable is the default one (if present).

Property Documentation

QList< Adapter * > BlueDevil::Manager::adapters [read]
Adapter * BlueDevil::Manager::defaultAdapter [read]
bool BlueDevil::Manager::isBluetoothOperational [read]
Manager * BlueDevil::Manager::self [read]
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Friends