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 INCLUDED_SD_SOURCE_UI_INC_REMOTESERVER_HXX
10 #define INCLUDED_SD_SOURCE_UI_INC_REMOTESERVER_HXX
16 #include <osl/socket_decl.hxx>
17 #include <salhelper/thread.hxx>
21 namespace osl
{ class Mutex
; }
22 namespace com
{ namespace sun
{ namespace star
{ namespace presentation
{ class XSlideShowController
; } } } }
23 namespace com
{ namespace sun
{ namespace star
{ namespace uno
{ template <class interface_type
> class Reference
; } } } }
26 * The port for use for the main communication between LibO and remote control app.
30 #define CHARSET RTL_TEXTENCODING_UTF8
40 bool const mbIsAlreadyAuthorised
;
42 ClientInfo( const OUString
& rName
,
43 const bool bIsAlreadyAuthorised
) :
45 mbIsAlreadyAuthorised( bIsAlreadyAuthorised
) {}
47 virtual ~ClientInfo() {};
50 struct ClientInfoInternal
;
52 class RemoteServer
: public salhelper::Thread
58 // For slideshowimpl to inform us.
59 static void presentationStarted( const css::uno::Reference
<
60 css::presentation::XSlideShowController
> &rController
);
61 static void presentationStopped();
63 // For the control dialog
64 SD_DLLPUBLIC
static std::vector
< std::shared_ptr
< ClientInfo
> > getClients();
65 SD_DLLPUBLIC
static bool connectClient( const std::shared_ptr
< ClientInfo
>& pClient
,
66 const OUString
& aPin
);
67 SD_DLLPUBLIC
static void deauthoriseClient( const std::shared_ptr
< ClientInfo
>& pClient
);
69 /// ensure that discoverability (eg. for Bluetooth) is enabled
70 SD_DLLPUBLIC
static void ensureDiscoverable();
71 /// restore the state of discoverability from before ensureDiscoverable
72 SD_DLLPUBLIC
static void restoreDiscoverable();
74 // For the communicator
75 static void removeCommunicator( Communicator
const * pCommunicator
);
78 virtual ~RemoteServer() override
;
79 static RemoteServer
*spServer
;
80 static ::osl::Mutex sDataMutex
;
81 static ::std::vector
<Communicator
*> sCommunicators
;
82 osl::AcceptorSocket mSocket
;
84 ::std::vector
< std::shared_ptr
< ClientInfoInternal
> > mAvailableClients
;
86 void execute() override
;
90 #endif // INCLUDED_SD_SOURCE_UI_INC_REMOTESERVER_HXX
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */