1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef GIO_SEEKABLE_HXX 25 #define GIO_SEEKABLE_HXX 26 27 #include <sal/types.h> 28 #include <rtl/ustring.hxx> 29 #include <cppuhelper/weak.hxx> 30 31 #include <com/sun/star/io/XTruncate.hpp> 32 #include <com/sun/star/io/XSeekable.hpp> 33 34 #include <gio/gio.h> 35 36 namespace gio 37 { 38 39 class Seekable : public ::com::sun::star::io::XTruncate, 40 public ::com::sun::star::io::XSeekable, 41 public ::cppu::OWeakObject 42 { 43 private: 44 GSeekable *mpStream; 45 public: 46 Seekable( GSeekable *pStream ); 47 virtual ~Seekable(); 48 49 // XInterface 50 virtual com::sun::star::uno::Any SAL_CALL queryInterface(const ::com::sun::star::uno::Type & type ) 51 throw( ::com::sun::star::uno::RuntimeException ); acquire(void)52 virtual void SAL_CALL acquire( void ) throw () { OWeakObject::acquire(); } release(void)53 virtual void SAL_CALL release( void ) throw() { OWeakObject::release(); } 54 55 // XSeekable 56 virtual void SAL_CALL seek( sal_Int64 location ) 57 throw( ::com::sun::star::lang::IllegalArgumentException, 58 ::com::sun::star::io::IOException, 59 ::com::sun::star::uno::RuntimeException ); 60 61 virtual sal_Int64 SAL_CALL getPosition() 62 throw( ::com::sun::star::io::IOException, 63 ::com::sun::star::uno::RuntimeException ); 64 65 virtual sal_Int64 SAL_CALL getLength() 66 throw( ::com::sun::star::io::IOException, 67 ::com::sun::star::uno::RuntimeException ); 68 69 // XTruncate 70 virtual void SAL_CALL truncate( void ) 71 throw( com::sun::star::io::IOException, 72 com::sun::star::uno::RuntimeException ); 73 }; 74 75 } // namespace gio 76 #endif 77