tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / sd / source / ui / remotecontrol / BluetoothServer.hxx
blob9e20bfa5195f7e109bf5eaf70f91e9cba3a23a42
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 #pragma once
11 #include <osl/thread.hxx>
12 #include <memory>
13 #include <vector>
15 #include <config_dbus.h>
17 #if (defined(LINUX) && !defined(__FreeBSD_kernel__)) && ENABLE_DBUS && DBUS_HAVE_GLIB
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 #if defined(MACOSX)
41 void addCommunicator( Communicator* pCommunicator );
42 #endif
43 private:
44 explicit BluetoothServer( std::vector<Communicator*>* pCommunicators );
45 virtual ~BluetoothServer() override;
47 enum { UNKNOWN, DISCOVERABLE, NOT_DISCOVERABLE } meWasDiscoverable;
48 static BluetoothServer *spServer;
50 #ifdef LINUX_BLUETOOTH
51 struct Impl;
52 std::unique_ptr<Impl> mpImpl;
53 #endif
54 virtual void SAL_CALL run() override;
56 void cleanupCommunicators();
57 std::vector<Communicator*>* mpCommunicators;
61 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */