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: imagesconfiguration.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 __FRAMEWORK_XML_IMAGESCONFIGURATION_HXX_
32 #define __FRAMEWORK_XML_IMAGESCONFIGURATION_HXX_
34 #include <svtools/svarray.hxx>
35 #include <tools/string.hxx>
36 #include <tools/stream.hxx>
37 #include <tools/color.hxx>
40 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
41 #include <com/sun/star/io/XInputStream.hpp>
42 #include <com/sun/star/io/XOutputStream.hpp>
55 struct ImageItemDescriptor
57 ImageItemDescriptor() : nIndex( -1 ) {}
59 String aCommandURL
; // URL command to dispatch
60 long nIndex
; // index of the bitmap inside the bitmaplist
63 struct ExternalImageItemDescriptor
65 String aCommandURL
; // URL command to dispatch
66 String aURL
; // a URL to an external bitmap
69 typedef ImageItemDescriptor
* ImageItemDescriptorPtr
;
70 SV_DECL_PTRARR_DEL( ImageItemListDescriptor
, ImageItemDescriptorPtr
, 10, 2)
72 typedef ExternalImageItemDescriptor
* ExternalImageItemDescriptorPtr
;
73 SV_DECL_PTRARR_DEL( ExternalImageItemListDescriptor
, ExternalImageItemDescriptorPtr
, 10, 2)
75 struct ImageListItemDescriptor
77 ImageListItemDescriptor() : nMaskMode( ImageMaskMode_Color
),
78 pImageItemList( 0 ) {}
80 ~ImageListItemDescriptor() { delete pImageItemList
; }
82 String aURL
; // an URL to a bitmap with several images inside
83 Color aMaskColor
; // a color used as transparent
84 String aMaskURL
; // an URL to an optional bitmap used as a mask
85 ImageMaskMode nMaskMode
; // an enum to describe the current mask mode
86 ImageItemListDescriptor
* pImageItemList
; // an array of ImageItemDescriptors that describes every image
87 String aHighContrastURL
; // an URL to an optional high contrast bitmap with serveral images inside
88 String aHighContrastMaskURL
; // an URL to an optional high contrast bitmap as a mask
91 typedef ImageListItemDescriptor
* ImageListItemDescriptorPtr
;
92 SV_DECL_PTRARR_DEL( ImageListDescriptor
, ImageListItemDescriptorPtr
, 10, 2)
94 struct ImageListsDescriptor
96 ImageListsDescriptor() : pImageList( 0 ),
97 pExternalImageList( 0 ) {}
98 ~ImageListsDescriptor() { delete pImageList
; delete pExternalImageList
; }
100 ImageListDescriptor
* pImageList
;
101 ExternalImageItemListDescriptor
* pExternalImageList
;
104 class ImagesConfiguration
108 static sal_Bool
LoadImages(
109 const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& xServiceFactory
,
110 SvStream
& rInStream
, ImageListsDescriptor
& aItems
);
113 static sal_Bool
StoreImages(
114 const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& xServiceFactory
,
115 SvStream
& rOutStream
, const ImageListsDescriptor
& aItems
);
117 static sal_Bool
LoadImages(
118 const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& xServiceFactory
,
119 const ::com::sun::star::uno::Reference
< ::com::sun::star::io::XInputStream
>& rInputStream
,
120 ImageListsDescriptor
& rItems
);
122 static sal_Bool
StoreImages(
123 const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& xServiceFactory
,
124 const ::com::sun::star::uno::Reference
< ::com::sun::star::io::XOutputStream
>& rOutputStream
,
125 const ImageListsDescriptor
& rItems
);
128 } // namespace framework
130 #endif // __FRAMEWORK_CLASSES_IMAGES