Update ooo320-m1
[ooovba.git] / sw / inc / unomod.hxx
blobb68859e06c00b00c12e93a20f1a50363422afcf3
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: unomod.hxx,v $
10 * $Revision: 1.11 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _UNOMOD_HXX
31 #define _UNOMOD_HXX
33 #include <com/sun/star/text/XModule.hpp>
34 #include <com/sun/star/beans/XPropertySet.hpp>
35 #include <com/sun/star/view/XPrintSettingsSupplier.hpp>
36 #include <com/sun/star/view/XViewSettingsSupplier.hpp>
37 #include <com/sun/star/lang/XServiceInfo.hpp>
38 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
39 #include <cppuhelper/implbase2.hxx> // helper for implementations
40 #include <cppuhelper/implbase3.hxx> // helper for implementations
41 #include <cppuhelper/implbase4.hxx> // helper for implementations
42 #include <comphelper/ChainablePropertySet.hxx>
43 #include <comphelper/SettingsHelper.hxx>
44 #include <usrpref.hxx>
46 class SwView;
47 class SwViewOption;
48 struct SwPrintData;
49 class SwDoc;
51 /******************************************************************************
53 ******************************************************************************/
54 /*-----------------15.03.98 13:21-------------------
56 --------------------------------------------------*/
58 ::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 > & );
60 class SwXModule : public cppu::WeakImplHelper4
62 ::com::sun::star::text::XModule,
63 ::com::sun::star::view::XViewSettingsSupplier,
64 ::com::sun::star::view::XPrintSettingsSupplier,
65 ::com::sun::star::lang::XServiceInfo
69 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > * pxViewSettings;
70 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > * pxPrintSettings;
72 protected:
73 virtual ~SwXModule();
74 public:
75 SwXModule();
78 //XViewSettings
79 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getViewSettings(void)
80 throw( ::com::sun::star::uno::RuntimeException );
82 //XPrintSettings
83 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getPrintSettings(void)
84 throw( ::com::sun::star::uno::RuntimeException );
86 //XServiceInfo
87 virtual rtl::OUString SAL_CALL getImplementationName(void)
88 throw( ::com::sun::star::uno::RuntimeException );
89 virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName)
90 throw( ::com::sun::star::uno::RuntimeException );
91 virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void)
92 throw( ::com::sun::star::uno::RuntimeException );
95 enum SwXPrintSettingsType
97 PRINT_SETTINGS_MODULE,
98 PRINT_SETTINGS_WEB,
99 PRINT_SETTINGS_DOCUMENT
102 class SwXPrintSettings : public comphelper::ChainableHelperNoState
104 friend class SwXDocumentSettings;
105 protected:
106 SwXPrintSettingsType meType;
107 SwPrintData * mpPrtOpt;
108 SwDoc *mpDoc;
110 virtual void _preSetValues ()
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 _setSingleValue( const comphelper::PropertyInfo & rInfo, const ::com::sun::star::uno::Any &rValue )
113 throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
114 virtual void _postSetValues ()
115 throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
117 virtual void _preGetValues ()
118 throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
119 virtual void _getSingleValue( const comphelper::PropertyInfo & rInfo, ::com::sun::star::uno::Any & rValue )
120 throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException );
121 virtual void _postGetValues ()
122 throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
124 virtual ~SwXPrintSettings()
125 throw();
126 public:
127 SwXPrintSettings( SwXPrintSettingsType eType, SwDoc * pDoc = NULL );
130 //XServiceInfo
131 virtual rtl::OUString SAL_CALL getImplementationName(void)
132 throw( ::com::sun::star::uno::RuntimeException );
133 virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName)
134 throw( ::com::sun::star::uno::RuntimeException );
135 virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void)
136 throw( ::com::sun::star::uno::RuntimeException );
138 /*-----------------15.03.98 13:21-------------------
140 --------------------------------------------------*/
141 class SwXViewSettings : public comphelper::ChainableHelperNoState
144 friend class SwXDocumentSettings;
145 protected:
146 SwView* pView;
147 SwViewOption* mpViewOption;
148 const SwViewOption* mpConstViewOption;
149 sal_Bool bObjectValid:1, bWeb:1, mbApplyZoom;
151 sal_Int32 eHRulerUnit;
152 sal_Bool mbApplyHRulerMetric;
153 sal_Int32 eVRulerUnit;
154 sal_Bool mbApplyVRulerMetric;
156 virtual void _preSetValues ()
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 _setSingleValue( const comphelper::PropertyInfo & rInfo, const ::com::sun::star::uno::Any &rValue )
159 throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
160 virtual void _postSetValues ()
161 throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
163 virtual void _preGetValues ()
164 throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
165 virtual void _getSingleValue( const comphelper::PropertyInfo & rInfo, ::com::sun::star::uno::Any & rValue )
166 throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException );
167 virtual void _postGetValues ()
168 throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
170 virtual ~SwXViewSettings()
171 throw();
172 public:
173 SwXViewSettings(sal_Bool bWeb, SwView* pView);
176 //XServiceInfo
177 virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException );
178 virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
179 virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
181 sal_Bool IsValid() const {return bObjectValid;}
182 void Invalidate() {bObjectValid = sal_False;}
184 /* -----------------24.09.98 10:47-------------------
186 * --------------------------------------------------*/
187 /*class SwXTerminateListener : public ::com::sun::star::frame::XTerminateListener,
188 public UsrObject
190 public:
191 SwXTerminateListener();
192 virtual ~SwXTerminateListener();
194 SMART_UNO_DECLARATION( SwXTerminateListener, UsrObject );
196 virtual UString getClassName();
197 // automatisch auskommentiert - [getIdlClass or queryInterface] - Bitte XTypeProvider benutzen!
198 // virtual ::com::sun::star::uno::XInterface * queryInterface( ::com::sun::star::uno::Uik aUik);
200 // automatisch auskommentiert - [getIdlClass or queryInterface] - Bitte XTypeProvider benutzen!
201 // virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XIdlClass > > getIdlClasses(void);
204 //XTerminateListener
205 virtual void queryTermination(const ::com::sun::star::lang::EventObject& aEvent);
206 virtual void notifyTermination(const ::com::sun::star::lang::EventObject& aEvent);
208 //XEventListener
209 virtual void disposing(const ::com::sun::star::lang::EventObject& Source);
213 #endif