xref: /AOO41X/main/xmloff/inc/xmloff/xmlmultiimagehelper.hxx (revision 598d8f9faf4a3fe69ec31082f4bbef618d63898a)
1ddde725dSArmin Le Grand /**************************************************************
2ddde725dSArmin Le Grand  *
3ddde725dSArmin Le Grand  * Licensed to the Apache Software Foundation (ASF) under one
4ddde725dSArmin Le Grand  * or more contributor license agreements.  See the NOTICE file
5ddde725dSArmin Le Grand  * distributed with this work for additional information
6ddde725dSArmin Le Grand  * regarding copyright ownership.  The ASF licenses this file
7ddde725dSArmin Le Grand  * to you under the Apache License, Version 2.0 (the
8ddde725dSArmin Le Grand  * "License"); you may not use this file except in compliance
9ddde725dSArmin Le Grand  * with the License.  You may obtain a copy of the License at
10ddde725dSArmin Le Grand  *
11ddde725dSArmin Le Grand  *   http://www.apache.org/licenses/LICENSE-2.0
12ddde725dSArmin Le Grand  *
13ddde725dSArmin Le Grand  * Unless required by applicable law or agreed to in writing,
14ddde725dSArmin Le Grand  * software distributed under the License is distributed on an
15ddde725dSArmin Le Grand  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16ddde725dSArmin Le Grand  * KIND, either express or implied.  See the License for the
17ddde725dSArmin Le Grand  * specific language governing permissions and limitations
18ddde725dSArmin Le Grand  * under the License.
19ddde725dSArmin Le Grand  *
20ddde725dSArmin Le Grand  *************************************************************/
21ddde725dSArmin Le Grand 
22ddde725dSArmin Le Grand #ifndef _XMLOFF_XMLMULTIIMAGEHELPER_HXX
23ddde725dSArmin Le Grand #define _XMLOFF_XMLMULTIIMAGEHELPER_HXX
24ddde725dSArmin Le Grand 
25ddde725dSArmin Le Grand #include <sal/types.h>
26ddde725dSArmin Le Grand #include <xmloff/xmlimp.hxx>
27ddde725dSArmin Le Grand 
28ddde725dSArmin Le Grand //////////////////////////////////////////////////////////////////////////////
29ddde725dSArmin Le Grand 
30ddde725dSArmin Le Grand class multiImageImportHelper
31ddde725dSArmin Le Grand {
32ddde725dSArmin Le Grand private:
33ddde725dSArmin Le Grand     std::vector< SvXMLImportContextRef* >       maImplContextVector;
34ddde725dSArmin Le Grand     bool                                        mbSupportsMultipleContents;
35ddde725dSArmin Le Grand 
36ddde725dSArmin Le Grand protected:
37ddde725dSArmin Le Grand     /// helper to get the created xShape instance, needs to be overloaded
38ddde725dSArmin Le Grand     virtual rtl::OUString getGraphicURLFromImportContext(const SvXMLImportContext& rContext) const = 0;
39ddde725dSArmin Le Grand     virtual void removeGraphicFromImportContext(const SvXMLImportContext& rContext) const = 0;
40ddde725dSArmin Le Grand 
41ddde725dSArmin Le Grand public:
42ddde725dSArmin Le Grand     multiImageImportHelper();
43ddde725dSArmin Le Grand     ~multiImageImportHelper();
44ddde725dSArmin Le Grand 
45ddde725dSArmin Le Grand     /// solve multiple imported images. The most valuable one is choosen,
46*598d8f9fSArmin Le Grand     /// see imlementation for evtl. changing weights and/or adding filetypes.
47*598d8f9fSArmin Le Grand     /// returns the winner of the contest (which can be 0 when no candidates)
48*598d8f9fSArmin Le Grand     const SvXMLImportContext* solveMultipleImages();
49ddde725dSArmin Le Grand 
50ddde725dSArmin Le Grand     /// add a content to the remembered image import contexts
51ddde725dSArmin Le Grand     void addContent(const SvXMLImportContext& rSvXMLImportContext);
52ddde725dSArmin Le Grand 
53ddde725dSArmin Le Grand     /// read/write access to boolean switch
54ddde725dSArmin Le Grand     bool getSupportsMultipleContents() const { return mbSupportsMultipleContents; }
55ddde725dSArmin Le Grand     void setSupportsMultipleContents(bool bNew) { mbSupportsMultipleContents = bNew; }
56ddde725dSArmin Le Grand };
57ddde725dSArmin Le Grand 
58ddde725dSArmin Le Grand //////////////////////////////////////////////////////////////////////////////
59ddde725dSArmin Le Grand 
60ddde725dSArmin Le Grand #endif	//  _XMLOFF_XMLMULTIIMAGEHELPER_HXX
61ddde725dSArmin Le Grand 
62ddde725dSArmin Le Grand //////////////////////////////////////////////////////////////////////////////
63ddde725dSArmin Le Grand // eof
64