xref: /trunk/main/sw/inc/unomod.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 _UNOMOD_HXX
28 #define _UNOMOD_HXX
29 
30 #include <com/sun/star/text/XModule.hpp>
31 #include <com/sun/star/beans/XPropertySet.hpp>
32 #include <com/sun/star/view/XPrintSettingsSupplier.hpp>
33 #include <com/sun/star/view/XViewSettingsSupplier.hpp>
34 #include <com/sun/star/lang/XServiceInfo.hpp>
35 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
36 #include <cppuhelper/implbase2.hxx>	// helper for implementations
37 #include <cppuhelper/implbase3.hxx>	// helper for implementations
38 #include <cppuhelper/implbase4.hxx>	// helper for implementations
39 #include <comphelper/ChainablePropertySet.hxx>
40 #include <comphelper/SettingsHelper.hxx>
41 #include <usrpref.hxx>
42 
43 class SwView;
44 class SwViewOption;
45 class SwPrintData;
46 class SwDoc;
47 
48 /******************************************************************************
49  *
50  ******************************************************************************/
51 /*-----------------15.03.98 13:21-------------------
52 
53 --------------------------------------------------*/
54 
55 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >  SAL_CALL SwXModule_CreateInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & );
56 
57 class SwXModule : public cppu::WeakImplHelper4
58 <
59 	::com::sun::star::text::XModule,
60 	::com::sun::star::view::XViewSettingsSupplier,
61 	::com::sun::star::view::XPrintSettingsSupplier,
62 	::com::sun::star::lang::XServiceInfo
63 >
64 {
65 
66 	::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > * 	pxViewSettings;
67 	::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > * 	pxPrintSettings;
68 
69 protected:
70 	virtual ~SwXModule();
71 public:
72 	SwXModule();
73 
74 
75 	//XViewSettings
76 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >  SAL_CALL getViewSettings(void)
77 		throw( ::com::sun::star::uno::RuntimeException );
78 
79 	//XPrintSettings
80 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >  SAL_CALL getPrintSettings(void)
81 		throw( ::com::sun::star::uno::RuntimeException );
82 
83 	//XServiceInfo
84 	virtual rtl::OUString SAL_CALL getImplementationName(void)
85 		throw( ::com::sun::star::uno::RuntimeException );
86 	virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName)
87 		throw( ::com::sun::star::uno::RuntimeException );
88 	virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void)
89 		throw( ::com::sun::star::uno::RuntimeException );
90 };
91 
92 enum SwXPrintSettingsType
93 {
94 	PRINT_SETTINGS_MODULE,
95 	PRINT_SETTINGS_WEB,
96 	PRINT_SETTINGS_DOCUMENT
97 };
98 
99 class SwXPrintSettings : public comphelper::ChainableHelperNoState
100 {
101 	friend class SwXDocumentSettings;
102 protected:
103 	SwXPrintSettingsType meType;
104 	SwPrintData * mpPrtOpt;
105 	SwDoc *mpDoc;
106 
107 	virtual void _preSetValues ()
108 		throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
109 	virtual void _setSingleValue( const comphelper::PropertyInfo & rInfo, const ::com::sun::star::uno::Any &rValue )
110 		throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
111 	virtual void _postSetValues ()
112 		throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
113 
114 	virtual void _preGetValues ()
115 		throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
116 	virtual void _getSingleValue( const comphelper::PropertyInfo & rInfo, ::com::sun::star::uno::Any & rValue )
117 		throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException );
118 	virtual void _postGetValues ()
119 		throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
120 
121 	virtual ~SwXPrintSettings()
122 		throw();
123 public:
124 	SwXPrintSettings( SwXPrintSettingsType eType, SwDoc * pDoc = NULL );
125 
126 
127 	//XServiceInfo
128 	virtual rtl::OUString SAL_CALL getImplementationName(void)
129 		throw( ::com::sun::star::uno::RuntimeException );
130 	virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName)
131 		throw( ::com::sun::star::uno::RuntimeException );
132 	virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void)
133 		throw( ::com::sun::star::uno::RuntimeException );
134 };
135 /*-----------------15.03.98 13:21-------------------
136 
137 --------------------------------------------------*/
138 class SwXViewSettings : public comphelper::ChainableHelperNoState
139 {
140 
141 	friend class SwXDocumentSettings;
142 protected:
143 	SwView*						pView;
144 	SwViewOption* 		mpViewOption;
145 	const SwViewOption* 		mpConstViewOption;
146 	sal_Bool					bObjectValid:1, bWeb:1, mbApplyZoom;
147 
148     sal_Int32   eHRulerUnit;
149     sal_Bool    mbApplyHRulerMetric;
150     sal_Int32   eVRulerUnit;
151     sal_Bool    mbApplyVRulerMetric;
152 
153 	virtual void _preSetValues ()
154 		throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
155 	virtual void _setSingleValue( const comphelper::PropertyInfo & rInfo, const ::com::sun::star::uno::Any &rValue )
156 		throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
157 	virtual void _postSetValues ()
158 		throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
159 
160 	virtual void _preGetValues ()
161 		throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
162 	virtual void _getSingleValue( const comphelper::PropertyInfo & rInfo, ::com::sun::star::uno::Any & rValue )
163 		throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException );
164 	virtual void _postGetValues ()
165 		throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
166 
167 	virtual ~SwXViewSettings()
168 		throw();
169 public:
170 	SwXViewSettings(sal_Bool bWeb, SwView*	pView);
171 
172 
173 	//XServiceInfo
174 	virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException );
175 	virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
176 	virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
177 
178 	sal_Bool 	IsValid() const {return bObjectValid;}
179 	void	Invalidate() {bObjectValid = sal_False;}
180 };
181 /* -----------------24.09.98 10:47-------------------
182  *
183  * --------------------------------------------------*/
184 /*class SwXTerminateListener : public ::com::sun::star::frame::XTerminateListener,
185 								public UsrObject
186 {
187 public:
188 	SwXTerminateListener();
189 	virtual ~SwXTerminateListener();
190 
191 	SMART_UNO_DECLARATION( SwXTerminateListener, UsrObject );
192 
193 	virtual	UString 				getClassName();
194 // automatisch auskommentiert - [getIdlClass or queryInterface] - Bitte XTypeProvider benutzen!
195 //	virtual ::com::sun::star::uno::XInterface *			queryInterface( ::com::sun::star::uno::Uik aUik);
196 
197 // automatisch auskommentiert - [getIdlClass or queryInterface] - Bitte XTypeProvider benutzen!
198 //	virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XIdlClass > >	getIdlClasses(void);
199 
200 
201 	//XTerminateListener
202 	virtual void queryTermination(const ::com::sun::star::lang::EventObject& aEvent);
203 	virtual void notifyTermination(const ::com::sun::star::lang::EventObject& aEvent);
204 
205 	//XEventListener
206 	virtual void disposing(const ::com::sun::star::lang::EventObject& Source);
207 };
208 
209 */
210 #endif
211