1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
9 #ifndef _SD_IMPRESSREMOTE_SERVER_HXX
10 #define _SD_IMPRESSREMOTE_SERVER_HXX
18 #include <sys/types.h>
21 #include <osl/mutex.hxx>
22 #include <osl/socket.hxx>
23 #include <rtl/ref.hxx>
24 #include <salhelper/thread.hxx>
26 #include <com/sun/star/presentation/XSlideShowController.hpp>
31 * The port for use for the main communication between LibO and remote control app.
35 #define CHARSET RTL_TEXTENCODING_UTF8
40 class BufferedStreamSocket
;
47 enum PROTOCOL
{ NETWORK
= 1, BLUETOOTH
};
48 ClientInfo( const OUString rName
, const OUString rAddress
) :
50 mAddress( rAddress
) {}
53 struct ClientInfoInternal
;
55 class RemoteServer
: public salhelper::Thread
61 // For slideshowimpl to inform us.
62 static void presentationStarted( const css::uno::Reference
<
63 css::presentation::XSlideShowController
> &rController
);
64 static void presentationStopped();
66 // For the control dialog
67 SD_DLLPUBLIC
static std::vector
<ClientInfo
*> getClients();
68 SD_DLLPUBLIC
static sal_Bool
connectClient( ClientInfo
*pClient
,
71 /// ensure that discoverability (eg. for Bluetooth) is enabled
72 SD_DLLPUBLIC
static void ensureDiscoverable();
73 /// restore the state of discoverability from before ensureDiscoverable
74 SD_DLLPUBLIC
static void restoreDiscoverable();
76 // For the communicator
77 static void removeCommunicator( Communicator
* pCommunicator
);
81 static RemoteServer
*spServer
;
82 static ::osl::Mutex sDataMutex
;
83 static ::std::vector
<Communicator
*> sCommunicators
;
84 osl::AcceptorSocket mSocket
;
86 ::std::vector
<ClientInfoInternal
*> mAvailableClients
;
92 #endif // _SD_IMPRESSREMOTE_SERVER_HXX
93 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */