1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 #ifndef _RETRIEVEINPUTSTREAMCONSUMER_HXX 28 #define _RETRIEVEINPUTSTREAMCONSUMER_HXX 29 30 #include <com/sun/star/uno/Reference.hxx> 31 #ifndef _COM_SUN_STAR_IO_XINPUTSTREAM_HXX_ 32 #include <com/sun/star/io/XInputStream.hpp> 33 #endif 34 #include <osl/interlck.h> 35 #include <retrievedinputstreamdata.hxx> 36 37 class SwGrfNode; 38 class String; 39 class SwAsyncRetrieveInputStreamThread; 40 41 /** class to provide creation of a thread to retrieve an input stream given by 42 an URL and to consume the retrieved input stream. 43 44 OD 2007-01-29 #i73788# 45 46 @author OD 47 */ 48 class SwAsyncRetrieveInputStreamThreadConsumer 49 { 50 public: 51 52 SwAsyncRetrieveInputStreamThreadConsumer( SwGrfNode& rGrfNode ); 53 ~SwAsyncRetrieveInputStreamThreadConsumer(); 54 55 /** method to create thread 56 57 @author OD 58 */ 59 void CreateThread( const String& rURL ); 60 61 /** method called to provide the retrieved input stream to the thread Consumer 62 63 @author OD 64 */ 65 void ApplyInputStream( 66 com::sun::star::uno::Reference<com::sun::star::io::XInputStream> xInputStream, 67 const sal_Bool bIsStreamReadOnly ); 68 69 private: 70 71 SwGrfNode& mrGrfNode; 72 oslInterlockedCount mnThreadID; 73 }; 74 #endif 75