bump product version to 4.1.6.2
[LibreOffice.git] / sd / source / ui / inc / RemoteServer.hxx
blob60c9b18f4d48a70f4cbd0e39ad5ef0cb942d8b66
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 #ifndef _SD_IMPRESSREMOTE_SERVER_HXX
10 #define _SD_IMPRESSREMOTE_SERVER_HXX
12 // SERVER
13 #include <stdio.h>
14 #include <stdlib.h>
15 #ifndef _WIN32
16 #include <unistd.h>
17 #endif
18 #include <sys/types.h>
19 #include <vector>
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>
28 #include "sddllapi.h"
30 /**
31 * The port for use for the main communication between LibO and remote control app.
33 #define PORT 1599
35 #define CHARSET RTL_TEXTENCODING_UTF8
37 namespace sd
39 class Communicator;
40 class BufferedStreamSocket;
42 struct ClientInfo
44 OUString mName;
45 OUString mAddress;
47 enum PROTOCOL { NETWORK = 1, BLUETOOTH };
48 ClientInfo( const OUString rName, const OUString rAddress ) :
49 mName( rName ),
50 mAddress( rAddress ) {}
53 struct ClientInfoInternal;
55 class RemoteServer : public salhelper::Thread
57 public:
58 // Internal setup
59 static void setup();
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,
69 OUString aPin );
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 );
78 private:
79 RemoteServer();
80 ~RemoteServer();
81 static RemoteServer *spServer;
82 static ::osl::Mutex sDataMutex;
83 static ::std::vector<Communicator*> sCommunicators;
84 osl::AcceptorSocket mSocket;
86 ::std::vector<ClientInfoInternal*> mAvailableClients;
88 void execute();
92 #endif // _SD_IMPRESSREMOTE_SERVER_HXX
93 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */