xref: /trunk/main/sw/inc/unomod.hxx (revision 91144cd0085a7583d2099b982122deb2184ab956)
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 
74     //XPrintSettings
75     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >  SAL_CALL getPrintSettings(void);
76 
77     //XServiceInfo
78     virtual rtl::OUString SAL_CALL getImplementationName(void);
79     virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName);
80     virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void);
81 };
82 
83 enum SwXPrintSettingsType
84 {
85     PRINT_SETTINGS_MODULE,
86     PRINT_SETTINGS_WEB,
87     PRINT_SETTINGS_DOCUMENT
88 };
89 
90 class SwXPrintSettings : public comphelper::ChainableHelperNoState
91 {
92     friend class SwXDocumentSettings;
93 protected:
94     SwXPrintSettingsType meType;
95     SwPrintData * mpPrtOpt;
96     SwDoc *mpDoc;
97 
98     virtual void _preSetValues ();
99     virtual void _setSingleValue( const comphelper::PropertyInfo & rInfo, const ::com::sun::star::uno::Any &rValue );
100     virtual void _postSetValues ();
101 
102     virtual void _preGetValues ();
103     virtual void _getSingleValue( const comphelper::PropertyInfo & rInfo, ::com::sun::star::uno::Any & rValue );
104     virtual void _postGetValues ();
105 
106     virtual ~SwXPrintSettings()
107         throw();
108 public:
109     SwXPrintSettings( SwXPrintSettingsType eType, SwDoc * pDoc = NULL );
110 
111 
112     //XServiceInfo
113     virtual rtl::OUString SAL_CALL getImplementationName(void);
114     virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName);
115     virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void);
116 };
117 /*-----------------15.03.98 13:21-------------------
118 
119 --------------------------------------------------*/
120 class SwXViewSettings : public comphelper::ChainableHelperNoState
121 {
122 
123     friend class SwXDocumentSettings;
124 protected:
125     SwView*                     pView;
126     SwViewOption*       mpViewOption;
127     const SwViewOption*         mpConstViewOption;
128     sal_Bool                    bObjectValid:1, bWeb:1, mbApplyZoom;
129 
130     sal_Int32   eHRulerUnit;
131     sal_Bool    mbApplyHRulerMetric;
132     sal_Int32   eVRulerUnit;
133     sal_Bool    mbApplyVRulerMetric;
134 
135     virtual void _preSetValues ();
136     virtual void _setSingleValue( const comphelper::PropertyInfo & rInfo, const ::com::sun::star::uno::Any &rValue );
137     virtual void _postSetValues ();
138 
139     virtual void _preGetValues ();
140     virtual void _getSingleValue( const comphelper::PropertyInfo & rInfo, ::com::sun::star::uno::Any & rValue );
141     virtual void _postGetValues ();
142 
143     virtual ~SwXViewSettings()
144         throw();
145 public:
146     SwXViewSettings(sal_Bool bWeb, SwView*  pView);
147 
148 
149     //XServiceInfo
150     virtual rtl::OUString SAL_CALL getImplementationName(void);
151     virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName);
152     virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void);
153 
IsValid() const154     sal_Bool    IsValid() const {return bObjectValid;}
Invalidate()155     void    Invalidate() {bObjectValid = sal_False;}
156 };
157 /* -----------------24.09.98 10:47-------------------
158  *
159  * --------------------------------------------------*/
160 /*class SwXTerminateListener : public ::com::sun::star::frame::XTerminateListener,
161                                 public UsrObject
162 {
163 public:
164     SwXTerminateListener();
165     virtual ~SwXTerminateListener();
166 
167     SMART_UNO_DECLARATION( SwXTerminateListener, UsrObject );
168 
169     virtual UString                 getClassName();
170 // automatisch auskommentiert - [getIdlClass or queryInterface] - Bitte XTypeProvider benutzen!
171 //  virtual ::com::sun::star::uno::XInterface *         queryInterface( ::com::sun::star::uno::Uik aUik);
172 
173 // automatisch auskommentiert - [getIdlClass or queryInterface] - Bitte XTypeProvider benutzen!
174 //  virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XIdlClass > >  getIdlClasses(void);
175 
176 
177     //XTerminateListener
178     virtual void queryTermination(const ::com::sun::star::lang::EventObject& aEvent);
179     virtual void notifyTermination(const ::com::sun::star::lang::EventObject& aEvent);
180 
181     //XEventListener
182     virtual void disposing(const ::com::sun::star::lang::EventObject& Source);
183 };
184 
185 */
186 #endif
187