update credits
[LibreOffice.git] / framework / inc / xml / imagesconfiguration.hxx
blob0961438fde8ed65a8eeb0471f02eb0ede6e05fd6
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef FRAMEWORK_XML_IMAGESCONFIGURATION_HXX_
21 #define FRAMEWORK_XML_IMAGESCONFIGURATION_HXX_
23 #include <framework/fwedllapi.h>
24 #include <tools/string.hxx>
25 #include <tools/stream.hxx>
26 #include <tools/color.hxx>
28 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
29 #include <com/sun/star/io/XInputStream.hpp>
30 #include <com/sun/star/io/XOutputStream.hpp>
31 #include <com/sun/star/uno/XComponentContext.hpp>
33 #include <vector>
34 #include <boost/ptr_container/ptr_vector.hpp>
36 namespace framework
39 enum ImageMaskMode
41 ImageMaskMode_Color,
42 ImageMaskMode_Bitmap
45 struct ImageItemDescriptor
47 ImageItemDescriptor() : nIndex( -1 ) {}
49 String aCommandURL; // URL command to dispatch
50 long nIndex; // index of the bitmap inside the bitmaplist
53 struct ExternalImageItemDescriptor
55 String aCommandURL; // URL command to dispatch
56 String aURL; // a URL to an external bitmap
59 typedef boost::ptr_vector<ImageItemDescriptor> ImageItemListDescriptor;
61 typedef boost::ptr_vector<ExternalImageItemDescriptor> ExternalImageItemListDescriptor;
63 struct ImageListItemDescriptor
65 ImageListItemDescriptor() : nMaskMode( ImageMaskMode_Color ),
66 pImageItemList( 0 ) {}
68 ~ImageListItemDescriptor() { delete pImageItemList; }
70 String aURL; // an URL to a bitmap with several images inside
71 Color aMaskColor; // a color used as transparent
72 String aMaskURL; // an URL to an optional bitmap used as a mask
73 ImageMaskMode nMaskMode; // an enum to describe the current mask mode
74 ImageItemListDescriptor* pImageItemList; // an array of ImageItemDescriptors that describes every image
75 String aHighContrastURL; // an URL to an optional high contrast bitmap with serveral images inside
76 String aHighContrastMaskURL; // an URL to an optional high contrast bitmap as a mask
79 typedef boost::ptr_vector<ImageListItemDescriptor> ImageListDescriptor;
81 struct ImageListsDescriptor
83 ImageListsDescriptor() : pImageList( 0 ),
84 pExternalImageList( 0 ) {}
85 ~ImageListsDescriptor() { delete pImageList; delete pExternalImageList; }
87 ImageListDescriptor* pImageList;
88 ExternalImageItemListDescriptor* pExternalImageList;
91 class ImagesConfiguration
93 public:
94 static sal_Bool LoadImages(
95 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
96 const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rInputStream,
97 ImageListsDescriptor& rItems );
99 static sal_Bool StoreImages(
100 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
101 const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& rOutputStream,
102 const ImageListsDescriptor& rItems );
105 } // namespace framework
107 #endif // __FRAMEWORK_CLASSES_IMAGES
109 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */