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 #ifndef _UNOEVENT_HXX 24 #define _UNOEVENT_HXX 25 26 #include <svtools/unoevent.hxx> 27 #include <svl/macitem.hxx> 28 29 30 class SvxMacroItem; 31 class SvxMacro; 32 class SwXFrame; 33 class SwXTextFrame; 34 class SwXTextGraphicObject; 35 class SwXTextEmbeddedObject; 36 class SwXFrameStyle; 37 class SwFmtINetFmt; 38 39 40 41 class SwHyperlinkEventDescriptor : public SvDetachedEventDescriptor 42 { 43 const ::rtl::OUString sImplName; 44 45 //XServiceInfo 46 virtual rtl::OUString SAL_CALL getImplementationName(void) 47 throw( ::com::sun::star::uno::RuntimeException ); 48 protected: 49 virtual ~SwHyperlinkEventDescriptor(); 50 public: 51 52 SwHyperlinkEventDescriptor(); 53 54 55 56 void copyMacrosFromINetFmt(const SwFmtINetFmt& aFmt); 57 void copyMacrosIntoINetFmt(SwFmtINetFmt& aFmt); 58 59 void copyMacrosFromNameReplace( 60 ::com::sun::star::uno::Reference< 61 ::com::sun::star::container::XNameReplace> & xReplace); 62 }; 63 64 65 66 // SwEventDescriptor for 67 // 1) SwXTextFrame 68 // 2) SwXGraphicObject 69 // 3) SwXEmbeddedObject 70 // All these objects are an SwXFrame, so they can use a common implementation 71 class SwFrameEventDescriptor : public SvEventDescriptor 72 { 73 ::rtl::OUString sSwFrameEventDescriptor; 74 75 SwXFrame& rFrame; 76 77 public: 78 SwFrameEventDescriptor( SwXTextFrame& rFrameRef ); 79 SwFrameEventDescriptor( SwXTextGraphicObject& rGraphicRef ); 80 SwFrameEventDescriptor( SwXTextEmbeddedObject& rObjectRef ); 81 82 ~SwFrameEventDescriptor(); 83 84 virtual rtl::OUString SAL_CALL getImplementationName(void) 85 throw( ::com::sun::star::uno::RuntimeException ); 86 87 protected: 88 virtual void setMacroItem(const SvxMacroItem& rItem); 89 virtual const SvxMacroItem& getMacroItem(); 90 virtual sal_uInt16 getMacroItemWhich() const; 91 }; 92 93 class SwFrameStyleEventDescriptor : public SvEventDescriptor 94 { 95 ::rtl::OUString sSwFrameStyleEventDescriptor; 96 97 SwXFrameStyle& rStyle; 98 99 public: 100 SwFrameStyleEventDescriptor( SwXFrameStyle& rStyleRef ); 101 102 ~SwFrameStyleEventDescriptor(); 103 104 virtual rtl::OUString SAL_CALL getImplementationName(void) 105 throw( ::com::sun::star::uno::RuntimeException ); 106 107 protected: 108 virtual void setMacroItem(const SvxMacroItem& rItem); 109 virtual const SvxMacroItem& getMacroItem(); 110 virtual sal_uInt16 getMacroItemWhich() const; 111 }; 112 113 114 #endif 115