fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / xmlhelp / source / cxxhelp / provider / bufferedinputstream.hxx
blob9a57abe55dc8d5fa05e5fc945c41f3a0a9089b85
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/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <cppuhelper/weak.hxx>
21 #include <osl/mutex.hxx>
22 #include <com/sun/star/io/XInputStream.hpp>
23 #include <com/sun/star/io/XSeekable.hpp>
26 namespace chelp {
28 class BufferedInputStream
29 : public cppu::OWeakObject,
30 public com::sun::star::io::XInputStream,
31 public com::sun::star::io::XSeekable
33 private:
35 sal_Int32 m_nBufferLocation;
36 sal_Int32 m_nBufferSize;
37 sal_Int8 *m_pBuffer;
38 osl::Mutex m_aMutex;
40 public:
42 BufferedInputStream(
43 const com::sun::star::uno::Reference<com::sun::star::io::XInputStream>& xInputStream);
45 ~BufferedInputStream();
47 virtual com::sun::star::uno::Any SAL_CALL
48 queryInterface( const com::sun::star::uno::Type& rType )
49 throw( com::sun::star::uno::RuntimeException );
51 virtual void SAL_CALL acquire( void ) throw();
53 virtual void SAL_CALL release( void ) throw();
56 virtual sal_Int32 SAL_CALL readBytes( com::sun::star::uno::Sequence< sal_Int8 >& aData,
57 sal_Int32 nBytesToRead )
58 throw( com::sun::star::io::NotConnectedException,
59 com::sun::star::io::BufferSizeExceededException,
60 com::sun::star::io::IOException,
61 com::sun::star::uno::RuntimeException );
63 virtual sal_Int32 SAL_CALL readSomeBytes( com::sun::star::uno::Sequence< sal_Int8 >& aData,
64 sal_Int32 nMaxBytesToRead )
65 throw( com::sun::star::io::NotConnectedException,
66 com::sun::star::io::BufferSizeExceededException,
67 com::sun::star::io::IOException,
68 com::sun::star::uno::RuntimeException );
70 virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip )
71 throw( com::sun::star::io::NotConnectedException,
72 com::sun::star::io::BufferSizeExceededException,
73 com::sun::star::io::IOException,
74 com::sun::star::uno::RuntimeException );
76 virtual sal_Int32 SAL_CALL available( void )
77 throw( com::sun::star::io::NotConnectedException,
78 com::sun::star::io::IOException,
79 com::sun::star::uno::RuntimeException );
81 virtual void SAL_CALL closeInput( void )
82 throw( com::sun::star::io::NotConnectedException,
83 com::sun::star::io::IOException,
84 com::sun::star::uno::RuntimeException );
86 virtual void SAL_CALL seek( sal_Int64 location )
87 throw( com::sun::star::lang::IllegalArgumentException,
88 com::sun::star::io::IOException,
89 com::sun::star::uno::RuntimeException );
91 virtual sal_Int64 SAL_CALL getPosition( void )
92 throw( com::sun::star::io::IOException,
93 com::sun::star::uno::RuntimeException );
95 virtual sal_Int64 SAL_CALL getLength( void )
96 throw( com::sun::star::io::IOException,
97 com::sun::star::uno::RuntimeException );
101 extern com::sun::star::uno::Reference<com::sun::star::io::XInputStream>
102 turnToSeekable(
103 const com::sun::star::uno::Reference<com::sun::star::io::XInputStream>& xInputStream);
107 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */