tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / sd / source / ui / remotecontrol / Transmitter.hxx
blobc24f5a5a46fe4bbbc9819239f523bfbb99af21a1
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 */
10 #pragma once
12 #include <osl/conditn.hxx>
13 #include <osl/mutex.hxx>
14 #include <osl/thread.hxx>
15 #include <rtl/string.hxx>
17 #include <queue>
19 namespace sd { struct IBluetoothSocket; }
21 namespace sd
24 class Transmitter
25 : public osl::Thread
27 public:
28 enum Priority { PRIORITY_LOW = 1, PRIORITY_HIGH };
29 explicit Transmitter( ::sd::IBluetoothSocket* aSocket );
30 virtual ~Transmitter() override;
31 void addMessage( const OString& aMessage, const Priority aPriority );
32 void notifyFinished();
34 private:
35 virtual void SAL_CALL run() override;
37 ::sd::IBluetoothSocket* pStreamSocket;
39 ::osl::Condition mProcessingRequired;
41 ::osl::Mutex mMutex;
42 /**
43 * Used to indicate that we're done and the transmitter loop should exit.
44 * All access must be guarded my `mMutex`.
46 bool mFinishRequested;
47 /// Queue for low priority messages. All access must be guarded my `mMutex`.
48 std::queue<OString> mLowPriority;
49 /// Queue for high priority messages. All access must be guarded my `mMutex`.
50 std::queue<OString> mHighPriority;
55 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */