00001 /* 00002 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. 00003 * 00004 * Redistribution and use in source and binary forms, with or without 00005 * modification, are permitted provided that the following conditions are met: 00006 * 00007 * * Redistributions of source code must retain the above copyright notice, this 00008 * list of conditions and the following disclaimer. 00009 * * Redistributions in binary form must reproduce the above copyright notice, 00010 * this list of conditions and the following disclaimer in the documentation 00011 * and/or other materials provided with the distribution. 00012 * * Neither the name of Nokia Corporation nor the names of its contributors 00013 * may be used to endorse or promote products derived from this software 00014 * without specific prior written permission. 00015 * 00016 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00017 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00018 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00019 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 00020 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00021 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 00022 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00023 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00024 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00025 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00026 * 00027 * Description: Wrapper implementation. 00028 */ 00029 00030 #include <QAction> 00031 #include "bluetoothdiscovery.h" 00032 #include "bluetoothdiscovery_symbian.h" 00033 00034 00035 00036 // Constructor. 00037 BluetoothDiscovery::BluetoothDiscovery(BluetoothAppWindow *aWindow):mWindow(aWindow) 00038 { 00039 // Create engine 00040 QT_TRAP_THROWING(d_ptr = BluetoothDiscoveryPrivate::NewL(this)); 00041 d_ptr->TurnBtOnL(); 00042 00043 } 00044 00045 // Destructor. 00046 BluetoothDiscovery::~BluetoothDiscovery() 00047 { 00048 delete d_ptr; 00049 } 00050 00051 // Discover the available devices 00052 void BluetoothDiscovery::discoverDevices() 00053 { 00054 d_ptr->DiscoverDevicesL(); 00055 } 00056 00057 // Discover the services of available devices. 00058 void BluetoothDiscovery::discoverServices() 00059 { 00060 d_ptr->DiscoverServicesL(); 00061 } 00062 00063 // Stop the device discovery. 00064 void BluetoothDiscovery::stopDiscovery() 00065 { 00066 d_ptr->StopDiscovery(); 00067 } 00068 00069 // Send a message through the available connection. 00070 void BluetoothDiscovery::sendMessage() 00071 { 00072 d_ptr->SendMessageL(); 00073 } 00074 00075 // Start slave. 00076 void BluetoothDiscovery::startSlave() 00077 { 00078 d_ptr->StartSlaveL(); 00079 } 00080 00081 // Connect to available devices. 00082 void BluetoothDiscovery::connectDevices() 00083 { 00084 d_ptr->ConnectDevicesL(); 00085 } 00086 00087 // Stop Slave 00088 void BluetoothDiscovery::stopSlave() 00089 { 00090 d_ptr->StopSlaveL(); 00091 } 00092 00093 // Disconnect the devices. 00094 void BluetoothDiscovery::disconnectDevices() 00095 { 00096 d_ptr->DisconnectDevices(); 00097 } 00098 00099 // Show the connected devices. 00100 void BluetoothDiscovery::showConnectedDevices() 00101 { 00102 d_ptr->ShowConnectedDevicesL(); 00103 } 00104 //end of file