12#include <com/sun/star/frame/Desktop.hpp>
13#include <com/sun/star/presentation/XPresentation2.hpp>
14#include <com/sun/star/presentation/XPresentationSupplier.hpp>
17#include <config_version.h>
18#include <rtl/string.hxx>
32Communicator::Communicator( std::unique_ptr<IBluetoothSocket> pSocket ):
33 Thread(
"CommunicatorThread" ),
34 mpSocket(
std::move(pSocket) )
59 pTransmitter->addMessage(
"LO_SERVER_INFO\n" LIBO_VERSION_DOTTED
"\n\n",
64 uno::Reference< frame::XDesktop2 > xFramesSupplier = frame::Desktop::create( ::comphelper::getProcessComponentContext() );
65 uno::Reference< frame::XFrame >
xFrame = xFramesSupplier->getActiveFrame();
67 uno::Reference<presentation::XPresentationSupplier> xPS;
69 xPS.set(
xFrame->getController()->getModel(), uno::UNO_QUERY );
70 uno::Reference<presentation::XPresentation2> xPresentation;
72 xPresentation.set( xPS->getPresentation(), uno::UNO_QUERY );
73 if ( xPresentation.is() && xPresentation->isRunning() )
78 OUStringToOString( ::comphelper::DocumentInfo::getDocumentTitle(
xFrame->getController()->getModel() ), RTL_TEXTENCODING_UTF8 ) +
89 catch (uno::RuntimeException &)
103 if ( aLine.getLength() )
114 SAL_INFO (
"sdremote",
"Exiting transmission loop");
139 css::presentation::XSlideShowController > &rController )
virtual ~Communicator() override
std::unique_ptr< Transmitter > pTransmitter
void forceClose()
Close the underlying socket from another thread to force an early exit / termination.
void presentationStarted(const css::uno::Reference< css::presentation::XSlideShowController > &rController)
std::unique_ptr< IBluetoothSocket > mpSocket
void informListenerDestroyed()
rtl::Reference< Listener > mListener
void pushCommand(const std::vector< OString > &rCommand)
static void removeCommunicator(Communicator const *pCommunicator)
#define SAL_INFO(area, stream)
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
Reference< XFrame > xFrame
std::unique_ptr< char[]> aBuffer