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