1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: imageresourceaccess.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SVTOOLS_INC_IMAGERESOURCEACCESS_HXX
32 #define SVTOOLS_INC_IMAGERESOURCEACCESS_HXX
34 #ifndef INCLUDED_SVTDLLAPI_H
35 #include "bf_svtools/svtdllapi.h"
38 /** === begin UNO includes === **/
39 #ifndef _COM_SUN_STAR_IO_XINPUTSTREAM_HPP_
40 #include <com/sun/star/io/XInputStream.hpp>
42 #ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
43 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
45 /** === end UNO includes === **/
48 //........................................................................
51 //........................................................................
53 //====================================================================
54 //= ImageResourceAccess
55 //====================================================================
56 /** helper class for obtaining streams (which also can be used with the ImageProducer)
59 class ImageResourceAccess
62 ImageResourceAccess(); // never implemented
65 /** determines whether the given URL denotes an image within a resource
67 static bool isImageResourceURL( const ::rtl::OUString
& _rURL
);
69 /** for a given URL of an image within a resource, this method retrieves
70 an SvStream for this image.
72 This method works for arbitrary URLs denoting an image, since the
73 <type scope="com::sun::star::graphics">GraphicsProvider</type> service is used
74 to resolve the URL. However, obtaining the stream is expensive (since
75 the image must be copied), so you are strongly encouraged to only use it
76 when you know that the image is small enough.
78 static SvStream
* getImageStream(
79 const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& _rxORB
,
80 const ::rtl::OUString
& _rImageResourceURL
84 //........................................................................
86 //........................................................................
88 #endif // DBA14_SVTOOLS_INC_IMAGERESOURCEACCESS_HXX