2012-07-13 17:34:49 +01:00
|
|
|
/* -*- 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/.
|
|
|
|
*/
|
2013-02-14 17:07:01 +02:00
|
|
|
|
2012-07-13 17:34:49 +01:00
|
|
|
#ifndef _SD_IMPRESSREMOTE_TRANSMITTER_HXX
|
|
|
|
#define _SD_IMPRESSREMOTE_TRANSMITTER_HXX
|
|
|
|
|
|
|
|
#include <osl/conditn.hxx>
|
|
|
|
#include <osl/mutex.hxx>
|
2013-02-14 17:07:01 +02:00
|
|
|
#include "IBluetoothSocket.hxx"
|
2012-11-23 17:59:41 +01:00
|
|
|
#include <osl/thread.hxx>
|
2012-07-13 17:34:49 +01:00
|
|
|
#include <rtl/string.hxx>
|
|
|
|
|
|
|
|
#include <queue>
|
|
|
|
|
|
|
|
namespace sd
|
|
|
|
{
|
|
|
|
|
|
|
|
class Transmitter
|
2012-11-23 17:59:41 +01:00
|
|
|
: public osl::Thread
|
2012-07-13 17:34:49 +01:00
|
|
|
{
|
|
|
|
public:
|
2012-08-06 15:02:52 +02:00
|
|
|
enum Priority { PRIORITY_LOW = 1, PRIORITY_HIGH };
|
2013-02-14 17:07:01 +02:00
|
|
|
Transmitter( ::sd::IBluetoothSocket* aSocket );
|
2012-07-13 17:34:49 +01:00
|
|
|
~Transmitter();
|
2013-04-07 12:06:47 +02:00
|
|
|
void addMessage( const OString& aMessage, const Priority aPriority );
|
2012-08-07 09:03:41 +02:00
|
|
|
void notifyFinished();
|
2012-07-13 17:34:49 +01:00
|
|
|
|
|
|
|
private:
|
2012-11-23 17:59:41 +01:00
|
|
|
virtual void SAL_CALL run();
|
2012-07-13 17:34:49 +01:00
|
|
|
|
2013-02-14 17:07:01 +02:00
|
|
|
::sd::IBluetoothSocket* pStreamSocket;
|
2012-07-13 17:34:49 +01:00
|
|
|
|
2012-07-18 16:14:52 +02:00
|
|
|
::osl::Condition mQueuesNotEmpty;
|
2012-08-07 09:03:41 +02:00
|
|
|
::osl::Condition mFinishRequested;
|
2012-07-13 17:34:49 +01:00
|
|
|
|
2012-07-18 16:14:52 +02:00
|
|
|
::osl::Mutex mQueueMutex;
|
2012-07-13 17:34:49 +01:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
std::queue<OString> mLowPriority;
|
|
|
|
std::queue<OString> mHighPriority;
|
2012-07-13 17:34:49 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
#endif // _SD_IMPRESSREMOTE_TRANSMITTER_HXX
|
2013-02-14 17:07:01 +02:00
|
|
|
|
2012-11-23 17:59:41 +01:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|