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 23 24 #ifndef OOX_OLE_OLEOBJECTHELPER_HXX 25 #define OOX_OLE_OLEOBJECTHELPER_HXX 26 27 #include "oox/helper/binarystreambase.hxx" 28 29 namespace com { namespace sun { namespace star { 30 namespace awt { struct Size; } 31 namespace document { class XEmbeddedObjectResolver; } 32 namespace lang { class XMultiServiceFactory; } 33 } } } 34 35 namespace oox { class PropertyMap; } 36 37 namespace oox { 38 namespace ole { 39 40 // ============================================================================ 41 42 /** Contains generic information about an OLE object. */ 43 struct OleObjectInfo 44 { 45 StreamDataSequence maEmbeddedData; /// Data of an embedded OLE object. 46 ::rtl::OUString maTargetLink; /// Path to external data for linked OLE object. 47 ::rtl::OUString maProgId; 48 bool mbLinked; /// True = linked OLE object, false = embedded OLE object. 49 bool mbShowAsIcon; /// True = show as icon, false = show contents. 50 bool mbAutoUpdate; 51 52 explicit OleObjectInfo(); 53 }; 54 55 // ============================================================================ 56 57 /** Helper for OLE object handling. */ 58 class OleObjectHelper 59 { 60 public: 61 explicit OleObjectHelper( 62 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxModelFactory ); 63 ~OleObjectHelper(); 64 65 bool importOleObject( 66 PropertyMap& rPropMap, 67 const OleObjectInfo& rOleObject, 68 const ::com::sun::star::awt::Size& rObjSize ); 69 70 private: 71 ::com::sun::star::uno::Reference< ::com::sun::star::document::XEmbeddedObjectResolver > mxResolver; 72 const ::rtl::OUString maEmbeddedObjScheme; 73 sal_Int32 mnObjectId; 74 }; 75 76 // ============================================================================ 77 78 } // namespace ole 79 } // namespace oox 80 81 #endif 82