LibreOffice Module sd (master) 1
BluetoothServer.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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
10
11#include <osl/thread.hxx>
12#include <memory>
13#include <vector>
14
15#include <config_dbus.h>
16
17#if (defined(LINUX) && !defined(__FreeBSD_kernel__)) && ENABLE_DBUS && DBUS_HAVE_GLIB
18# define LINUX_BLUETOOTH
19#endif
20
21namespace sd
22{
23 class Communicator;
24
26 public osl::Thread
27 {
28 public:
29 static void setup( std::vector<Communicator*>* pCommunicators );
30
32 static void ensureDiscoverable();
34 static void restoreDiscoverable();
35
36 // called by C / idle callbacks
37 static void doEnsureDiscoverable();
38 static void doRestoreDiscoverable();
39
40#if defined(MACOSX)
41 void addCommunicator( Communicator* pCommunicator );
42#endif
43 private:
44 explicit BluetoothServer( std::vector<Communicator*>* pCommunicators );
45 virtual ~BluetoothServer() override;
46
49
50#ifdef LINUX_BLUETOOTH
51 struct Impl;
52 std::unique_ptr<Impl> mpImpl;
53#endif
54 virtual void SAL_CALL run() override;
55
57 std::vector<Communicator*>* mpCommunicators;
58 };
59}
60
61/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
enum sd::BluetoothServer::@0 meWasDiscoverable
static void restoreDiscoverable()
restore the state of discoverability from before ensureDiscoverable
static void setup(std::vector< Communicator * > *pCommunicators)
static void ensureDiscoverable()
ensure that Bluetooth discoverability is on
std::vector< Communicator * > * mpCommunicators
static void doEnsureDiscoverable()
virtual void SAL_CALL run() override
static BluetoothServer * spServer
BluetoothServer(std::vector< Communicator * > *pCommunicators)
virtual ~BluetoothServer() override
static void doRestoreDiscoverable()
Class used for communication with one single client, dealing with all tasks specific to this client.