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 ); acquire(void)51 virtual void SAL_CALL acquire( void ) throw () { OWeakObject::acquire(); } release(void)52 virtual void SAL_CALL release( void ) throw() { OWeakObject::release(); } 53 54 // XSeekable 55 virtual void SAL_CALL seek( sal_Int64 location ); 56 57 virtual sal_Int64 SAL_CALL getPosition(); 58 59 virtual sal_Int64 SAL_CALL getLength(); 60 61 // XTruncate 62 virtual void SAL_CALL truncate( void ); 63 }; 64 65 } // namespace gio 66 #endif 67