xref: /trunk/main/sw/inc/unoevent.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _UNOEVENT_HXX
28 #define _UNOEVENT_HXX
29 
30 #include <svtools/unoevent.hxx>
31 #include <svl/macitem.hxx>
32 
33 
34 class SvxMacroItem;
35 class SvxMacro;
36 class SwXFrame;
37 class SwXTextFrame;
38 class SwXTextGraphicObject;
39 class SwXTextEmbeddedObject;
40 class SwXFrameStyle;
41 class SwFmtINetFmt;
42 
43 
44 
45 class SwHyperlinkEventDescriptor : public SvDetachedEventDescriptor
46 {
47 	const ::rtl::OUString sImplName;
48 
49 	//XServiceInfo
50 	virtual rtl::OUString SAL_CALL getImplementationName(void)
51 		throw( ::com::sun::star::uno::RuntimeException );
52 protected:
53 	virtual ~SwHyperlinkEventDescriptor();
54 public:
55 
56  	SwHyperlinkEventDescriptor();
57 
58 
59 
60 	void copyMacrosFromINetFmt(const SwFmtINetFmt& aFmt);
61 	void copyMacrosIntoINetFmt(SwFmtINetFmt& aFmt);
62 
63 	void copyMacrosFromNameReplace(
64 		::com::sun::star::uno::Reference<
65 			::com::sun::star::container::XNameReplace> & xReplace);
66 };
67 
68 
69 
70 // SwEventDescriptor for
71 // 1) SwXTextFrame
72 // 2) SwXGraphicObject
73 // 3) SwXEmbeddedObject
74 // All these objects are an SwXFrame, so they can use a common implementation
75 class SwFrameEventDescriptor : public SvEventDescriptor
76 {
77 	::rtl::OUString sSwFrameEventDescriptor;
78 
79 	SwXFrame& rFrame;
80 
81 public:
82 	SwFrameEventDescriptor( SwXTextFrame& rFrameRef );
83 	SwFrameEventDescriptor( SwXTextGraphicObject& rGraphicRef );
84 	SwFrameEventDescriptor( SwXTextEmbeddedObject& rObjectRef );
85 
86 	~SwFrameEventDescriptor();
87 
88 	virtual rtl::OUString SAL_CALL getImplementationName(void)
89 		throw( ::com::sun::star::uno::RuntimeException );
90 
91 protected:
92 	virtual void setMacroItem(const SvxMacroItem& rItem);
93 	virtual const SvxMacroItem& getMacroItem();
94 	virtual sal_uInt16 getMacroItemWhich() const;
95 };
96 
97 class SwFrameStyleEventDescriptor : public SvEventDescriptor
98 {
99 	::rtl::OUString sSwFrameStyleEventDescriptor;
100 
101 	SwXFrameStyle& rStyle;
102 
103 public:
104 	SwFrameStyleEventDescriptor( SwXFrameStyle& rStyleRef );
105 
106 	~SwFrameStyleEventDescriptor();
107 
108 	virtual rtl::OUString SAL_CALL getImplementationName(void)
109 		throw( ::com::sun::star::uno::RuntimeException );
110 
111 protected:
112 	virtual void setMacroItem(const SvxMacroItem& rItem);
113 	virtual const SvxMacroItem& getMacroItem();
114 	virtual sal_uInt16 getMacroItemWhich() const;
115 };
116 
117 
118 #endif
119