summaryrefslogtreecommitdiff
path: root/sd/source/ui/remotecontrol/Communicator.hxx
blob: 89f2c2e6d131370e273c4fb23c3bc50202001aa4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */
#ifndef INCLUDED_SD_SOURCE_UI_REMOTECONTROL_COMMUNICATOR_HXX
#define INCLUDED_SD_SOURCE_UI_REMOTECONTROL_COMMUNICATOR_HXX

#include <stdlib.h>
#ifndef _WIN32
#include <unistd.h>
#endif
#include <sys/types.h>
#include <vector>

#include <rtl/ref.hxx>
#include <salhelper/thread.hxx>

#include <com/sun/star/presentation/XSlideShowController.hpp>

#include "IBluetoothSocket.hxx"

#define CHARSET RTL_TEXTENCODING_UTF8
namespace sd
{

    class Transmitter;
    class Listener;

    /** Class used for communication with one single client, dealing with all
     * tasks specific to this client.
     *
     * Needs to be created, then started using launch(), disposes itself.
     */
    class Communicator : public salhelper::Thread
    {
        public:
            Communicator( IBluetoothSocket *pSocket );
            ~Communicator();

            void presentationStarted( const css::uno::Reference<
                css::presentation::XSlideShowController > &rController );
            void informListenerDestroyed();
            void disposeListener();
            void forceClose();

        private:
            void execute();
            IBluetoothSocket *mpSocket;

            Transmitter *pTransmitter;
            rtl::Reference<Listener> mListener;
    };
}

#endif // INCLUDED_SD_SOURCE_UI_REMOTECONTROL_COMMUNICATOR_HXX

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */