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