bump product version to 6.3.0.0.beta1
[LibreOffice.git] / sd / source / ui / remotecontrol / BluetoothServer.hxx
blob987e5c6117863d25f3432d608d868c0860928ee0
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 <memory>
14 #include <vector>
16 #include <config_dbus.h>
18 #if (defined(LINUX) && !defined(__FreeBSD_kernel__)) && ENABLE_DBUS && DBUS_HAVE_GLIB
19 # define LINUX_BLUETOOTH
20 #endif
22 namespace sd
24 class Communicator;
26 class BluetoothServer:
27 public osl::Thread
29 public:
30 static void setup( std::vector<Communicator*>* pCommunicators );
32 /// ensure that Bluetooth discoverability is on
33 static void ensureDiscoverable();
34 /// restore the state of discoverability from before ensureDiscoverable
35 static void restoreDiscoverable();
37 // called by C / idle callbacks
38 static void doEnsureDiscoverable();
39 static void doRestoreDiscoverable();
41 #if defined(MACOSX)
42 void addCommunicator( Communicator* pCommunicator );
43 #endif
44 private:
45 explicit BluetoothServer( std::vector<Communicator*>* pCommunicators );
46 virtual ~BluetoothServer() override;
48 enum { UNKNOWN, DISCOVERABLE, NOT_DISCOVERABLE } meWasDiscoverable;
49 static BluetoothServer *spServer;
51 #ifdef LINUX_BLUETOOTH
52 struct Impl;
53 std::unique_ptr<Impl> mpImpl;
54 #endif
55 virtual void SAL_CALL run() override;
57 void cleanupCommunicators();
58 std::vector<Communicator*>* mpCommunicators;
62 #endif // INCLUDED_SD_SOURCE_UI_REMOTECONTROL_BLUETOOTHSERVER_HXX
63 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */