bump product version to 5.0.4.1
[LibreOffice.git] / sd / source / ui / remotecontrol / BluetoothServer.hxx
blob2427ed7c1f08967414f1789d903934b6e8e5b425
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9 #ifndef INCLUDED_SD_SOURCE_UI_REMOTECONTROL_BLUETOOTHSERVER_HXX
10 #define INCLUDED_SD_SOURCE_UI_REMOTECONTROL_BLUETOOTHSERVER_HXX
12 #include <osl/thread.hxx>
13 #include <vector>
15 #include <boost/scoped_ptr.hpp>
17 #if (defined(LINUX) && !defined(__FreeBSD_kernel__)) && defined(ENABLE_DBUS)
18 # define LINUX_BLUETOOTH
19 #endif
21 namespace sd
23 class Communicator;
25 class BluetoothServer:
26 public osl::Thread
28 public:
29 static void setup( std::vector<Communicator*>* pCommunicators );
31 /// ensure that Bluetooth discoverability is on
32 static void ensureDiscoverable();
33 /// restore the state of discoverability from before ensureDiscoverable
34 static void restoreDiscoverable();
36 // called by C / idle callbacks
37 static void doEnsureDiscoverable();
38 static void doRestoreDiscoverable();
40 void addCommunicator( Communicator* pCommunicator );
41 private:
42 BluetoothServer( std::vector<Communicator*>* pCommunicators );
43 virtual ~BluetoothServer();
45 enum { UNKNOWN, DISCOVERABLE, NOT_DISCOVERABLE } meWasDiscoverable;
46 static BluetoothServer *spServer;
48 #ifdef LINUX_BLUETOOTH
49 struct Impl;
50 boost::scoped_ptr<Impl> mpImpl;
51 #endif
52 virtual void SAL_CALL run() SAL_OVERRIDE;
54 void cleanupCommunicators();
55 std::vector<Communicator*>* mpCommunicators;
59 #endif // INCLUDED_SD_SOURCE_UI_REMOTECONTROL_BLUETOOTHSERVER_HXX
60 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */