xref: /aoo41x/main/sw/inc/unomod.hxx (revision 1d2dbeb0)
1*1d2dbeb0SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*1d2dbeb0SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*1d2dbeb0SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*1d2dbeb0SAndrew Rist  * distributed with this work for additional information
6*1d2dbeb0SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*1d2dbeb0SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*1d2dbeb0SAndrew Rist  * "License"); you may not use this file except in compliance
9*1d2dbeb0SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*1d2dbeb0SAndrew Rist  *
11*1d2dbeb0SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*1d2dbeb0SAndrew Rist  *
13*1d2dbeb0SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*1d2dbeb0SAndrew Rist  * software distributed under the License is distributed on an
15*1d2dbeb0SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*1d2dbeb0SAndrew Rist  * KIND, either express or implied.  See the License for the
17*1d2dbeb0SAndrew Rist  * specific language governing permissions and limitations
18*1d2dbeb0SAndrew Rist  * under the License.
19*1d2dbeb0SAndrew Rist  *
20*1d2dbeb0SAndrew Rist  *************************************************************/
21*1d2dbeb0SAndrew Rist 
22*1d2dbeb0SAndrew Rist 
23cdf0e10cSrcweir #ifndef _UNOMOD_HXX
24cdf0e10cSrcweir #define _UNOMOD_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <com/sun/star/text/XModule.hpp>
27cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp>
28cdf0e10cSrcweir #include <com/sun/star/view/XPrintSettingsSupplier.hpp>
29cdf0e10cSrcweir #include <com/sun/star/view/XViewSettingsSupplier.hpp>
30cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp>
31cdf0e10cSrcweir #include <com/sun/star/lang/XMultiServiceFactory.hpp>
32cdf0e10cSrcweir #include <cppuhelper/implbase2.hxx>	// helper for implementations
33cdf0e10cSrcweir #include <cppuhelper/implbase3.hxx>	// helper for implementations
34cdf0e10cSrcweir #include <cppuhelper/implbase4.hxx>	// helper for implementations
35cdf0e10cSrcweir #include <comphelper/ChainablePropertySet.hxx>
36cdf0e10cSrcweir #include <comphelper/SettingsHelper.hxx>
37cdf0e10cSrcweir #include <usrpref.hxx>
38cdf0e10cSrcweir 
39cdf0e10cSrcweir class SwView;
40cdf0e10cSrcweir class SwViewOption;
41cdf0e10cSrcweir class SwPrintData;
42cdf0e10cSrcweir class SwDoc;
43cdf0e10cSrcweir 
44cdf0e10cSrcweir /******************************************************************************
45cdf0e10cSrcweir  *
46cdf0e10cSrcweir  ******************************************************************************/
47cdf0e10cSrcweir /*-----------------15.03.98 13:21-------------------
48cdf0e10cSrcweir 
49cdf0e10cSrcweir --------------------------------------------------*/
50cdf0e10cSrcweir 
51cdf0e10cSrcweir ::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 > & );
52cdf0e10cSrcweir 
53cdf0e10cSrcweir class SwXModule : public cppu::WeakImplHelper4
54cdf0e10cSrcweir <
55cdf0e10cSrcweir 	::com::sun::star::text::XModule,
56cdf0e10cSrcweir 	::com::sun::star::view::XViewSettingsSupplier,
57cdf0e10cSrcweir 	::com::sun::star::view::XPrintSettingsSupplier,
58cdf0e10cSrcweir 	::com::sun::star::lang::XServiceInfo
59cdf0e10cSrcweir >
60cdf0e10cSrcweir {
61cdf0e10cSrcweir 
62cdf0e10cSrcweir 	::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > * 	pxViewSettings;
63cdf0e10cSrcweir 	::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > * 	pxPrintSettings;
64cdf0e10cSrcweir 
65cdf0e10cSrcweir protected:
66cdf0e10cSrcweir 	virtual ~SwXModule();
67cdf0e10cSrcweir public:
68cdf0e10cSrcweir 	SwXModule();
69cdf0e10cSrcweir 
70cdf0e10cSrcweir 
71cdf0e10cSrcweir 	//XViewSettings
72cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >  SAL_CALL getViewSettings(void)
73cdf0e10cSrcweir 		throw( ::com::sun::star::uno::RuntimeException );
74cdf0e10cSrcweir 
75cdf0e10cSrcweir 	//XPrintSettings
76cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >  SAL_CALL getPrintSettings(void)
77cdf0e10cSrcweir 		throw( ::com::sun::star::uno::RuntimeException );
78cdf0e10cSrcweir 
79cdf0e10cSrcweir 	//XServiceInfo
80cdf0e10cSrcweir 	virtual rtl::OUString SAL_CALL getImplementationName(void)
81cdf0e10cSrcweir 		throw( ::com::sun::star::uno::RuntimeException );
82cdf0e10cSrcweir 	virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName)
83cdf0e10cSrcweir 		throw( ::com::sun::star::uno::RuntimeException );
84cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void)
85cdf0e10cSrcweir 		throw( ::com::sun::star::uno::RuntimeException );
86cdf0e10cSrcweir };
87cdf0e10cSrcweir 
88cdf0e10cSrcweir enum SwXPrintSettingsType
89cdf0e10cSrcweir {
90cdf0e10cSrcweir 	PRINT_SETTINGS_MODULE,
91cdf0e10cSrcweir 	PRINT_SETTINGS_WEB,
92cdf0e10cSrcweir 	PRINT_SETTINGS_DOCUMENT
93cdf0e10cSrcweir };
94cdf0e10cSrcweir 
95cdf0e10cSrcweir class SwXPrintSettings : public comphelper::ChainableHelperNoState
96cdf0e10cSrcweir {
97cdf0e10cSrcweir 	friend class SwXDocumentSettings;
98cdf0e10cSrcweir protected:
99cdf0e10cSrcweir 	SwXPrintSettingsType meType;
100cdf0e10cSrcweir 	SwPrintData * mpPrtOpt;
101cdf0e10cSrcweir 	SwDoc *mpDoc;
102cdf0e10cSrcweir 
103cdf0e10cSrcweir 	virtual void _preSetValues ()
104cdf0e10cSrcweir 		throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
105cdf0e10cSrcweir 	virtual void _setSingleValue( const comphelper::PropertyInfo & rInfo, const ::com::sun::star::uno::Any &rValue )
106cdf0e10cSrcweir 		throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
107cdf0e10cSrcweir 	virtual void _postSetValues ()
108cdf0e10cSrcweir 		throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
109cdf0e10cSrcweir 
110cdf0e10cSrcweir 	virtual void _preGetValues ()
111cdf0e10cSrcweir 		throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
112cdf0e10cSrcweir 	virtual void _getSingleValue( const comphelper::PropertyInfo & rInfo, ::com::sun::star::uno::Any & rValue )
113cdf0e10cSrcweir 		throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException );
114cdf0e10cSrcweir 	virtual void _postGetValues ()
115cdf0e10cSrcweir 		throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
116cdf0e10cSrcweir 
117cdf0e10cSrcweir 	virtual ~SwXPrintSettings()
118cdf0e10cSrcweir 		throw();
119cdf0e10cSrcweir public:
120cdf0e10cSrcweir 	SwXPrintSettings( SwXPrintSettingsType eType, SwDoc * pDoc = NULL );
121cdf0e10cSrcweir 
122cdf0e10cSrcweir 
123cdf0e10cSrcweir 	//XServiceInfo
124cdf0e10cSrcweir 	virtual rtl::OUString SAL_CALL getImplementationName(void)
125cdf0e10cSrcweir 		throw( ::com::sun::star::uno::RuntimeException );
126cdf0e10cSrcweir 	virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName)
127cdf0e10cSrcweir 		throw( ::com::sun::star::uno::RuntimeException );
128cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void)
129cdf0e10cSrcweir 		throw( ::com::sun::star::uno::RuntimeException );
130cdf0e10cSrcweir };
131cdf0e10cSrcweir /*-----------------15.03.98 13:21-------------------
132cdf0e10cSrcweir 
133cdf0e10cSrcweir --------------------------------------------------*/
134cdf0e10cSrcweir class SwXViewSettings : public comphelper::ChainableHelperNoState
135cdf0e10cSrcweir {
136cdf0e10cSrcweir 
137cdf0e10cSrcweir 	friend class SwXDocumentSettings;
138cdf0e10cSrcweir protected:
139cdf0e10cSrcweir 	SwView*						pView;
140cdf0e10cSrcweir 	SwViewOption* 		mpViewOption;
141cdf0e10cSrcweir 	const SwViewOption* 		mpConstViewOption;
142cdf0e10cSrcweir 	sal_Bool					bObjectValid:1, bWeb:1, mbApplyZoom;
143cdf0e10cSrcweir 
144cdf0e10cSrcweir     sal_Int32   eHRulerUnit;
145cdf0e10cSrcweir     sal_Bool    mbApplyHRulerMetric;
146cdf0e10cSrcweir     sal_Int32   eVRulerUnit;
147cdf0e10cSrcweir     sal_Bool    mbApplyVRulerMetric;
148cdf0e10cSrcweir 
149cdf0e10cSrcweir 	virtual void _preSetValues ()
150cdf0e10cSrcweir 		throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
151cdf0e10cSrcweir 	virtual void _setSingleValue( const comphelper::PropertyInfo & rInfo, const ::com::sun::star::uno::Any &rValue )
152cdf0e10cSrcweir 		throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
153cdf0e10cSrcweir 	virtual void _postSetValues ()
154cdf0e10cSrcweir 		throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
155cdf0e10cSrcweir 
156cdf0e10cSrcweir 	virtual void _preGetValues ()
157cdf0e10cSrcweir 		throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
158cdf0e10cSrcweir 	virtual void _getSingleValue( const comphelper::PropertyInfo & rInfo, ::com::sun::star::uno::Any & rValue )
159cdf0e10cSrcweir 		throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException );
160cdf0e10cSrcweir 	virtual void _postGetValues ()
161cdf0e10cSrcweir 		throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
162cdf0e10cSrcweir 
163cdf0e10cSrcweir 	virtual ~SwXViewSettings()
164cdf0e10cSrcweir 		throw();
165cdf0e10cSrcweir public:
166cdf0e10cSrcweir 	SwXViewSettings(sal_Bool bWeb, SwView*	pView);
167cdf0e10cSrcweir 
168cdf0e10cSrcweir 
169cdf0e10cSrcweir 	//XServiceInfo
170cdf0e10cSrcweir 	virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException );
171cdf0e10cSrcweir 	virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
172cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
173cdf0e10cSrcweir 
IsValid() const174cdf0e10cSrcweir 	sal_Bool 	IsValid() const {return bObjectValid;}
Invalidate()175cdf0e10cSrcweir 	void	Invalidate() {bObjectValid = sal_False;}
176cdf0e10cSrcweir };
177cdf0e10cSrcweir /* -----------------24.09.98 10:47-------------------
178cdf0e10cSrcweir  *
179cdf0e10cSrcweir  * --------------------------------------------------*/
180cdf0e10cSrcweir /*class SwXTerminateListener : public ::com::sun::star::frame::XTerminateListener,
181cdf0e10cSrcweir 								public UsrObject
182cdf0e10cSrcweir {
183cdf0e10cSrcweir public:
184cdf0e10cSrcweir 	SwXTerminateListener();
185cdf0e10cSrcweir 	virtual ~SwXTerminateListener();
186cdf0e10cSrcweir 
187cdf0e10cSrcweir 	SMART_UNO_DECLARATION( SwXTerminateListener, UsrObject );
188cdf0e10cSrcweir 
189cdf0e10cSrcweir 	virtual	UString 				getClassName();
190cdf0e10cSrcweir // automatisch auskommentiert - [getIdlClass or queryInterface] - Bitte XTypeProvider benutzen!
191cdf0e10cSrcweir //	virtual ::com::sun::star::uno::XInterface *			queryInterface( ::com::sun::star::uno::Uik aUik);
192cdf0e10cSrcweir 
193cdf0e10cSrcweir // automatisch auskommentiert - [getIdlClass or queryInterface] - Bitte XTypeProvider benutzen!
194cdf0e10cSrcweir //	virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XIdlClass > >	getIdlClasses(void);
195cdf0e10cSrcweir 
196cdf0e10cSrcweir 
197cdf0e10cSrcweir 	//XTerminateListener
198cdf0e10cSrcweir 	virtual void queryTermination(const ::com::sun::star::lang::EventObject& aEvent);
199cdf0e10cSrcweir 	virtual void notifyTermination(const ::com::sun::star::lang::EventObject& aEvent);
200cdf0e10cSrcweir 
201cdf0e10cSrcweir 	//XEventListener
202cdf0e10cSrcweir 	virtual void disposing(const ::com::sun::star::lang::EventObject& Source);
203cdf0e10cSrcweir };
204cdf0e10cSrcweir 
205cdf0e10cSrcweir */
206cdf0e10cSrcweir #endif
207