Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*
3 : : * This file is part of the LibreOffice project.
4 : : *
5 : : * This Source Code Form is subject to the terms of the Mozilla Public
6 : : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : : *
9 : : * This file incorporates work covered by the following license notice:
10 : : *
11 : : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : : * contributor license agreements. See the NOTICE file distributed
13 : : * with this work for additional information regarding copyright
14 : : * ownership. The ASF licenses this file to you under the Apache
15 : : * License, Version 2.0 (the "License"); you may not use this file
16 : : * except in compliance with the License. You may obtain a copy of
17 : : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : : */
19 : : #ifndef _UNOMOD_HXX
20 : : #define _UNOMOD_HXX
21 : :
22 : : #include <com/sun/star/text/XModule.hpp>
23 : : #include <com/sun/star/beans/XPropertySet.hpp>
24 : : #include <com/sun/star/view/XPrintSettingsSupplier.hpp>
25 : : #include <com/sun/star/view/XViewSettingsSupplier.hpp>
26 : : #include <com/sun/star/lang/XServiceInfo.hpp>
27 : : #include <com/sun/star/lang/XMultiServiceFactory.hpp>
28 : : #include <cppuhelper/implbase2.hxx> // helper for implementations
29 : : #include <cppuhelper/implbase3.hxx> // helper for implementations
30 : : #include <cppuhelper/implbase4.hxx> // helper for implementations
31 : : #include <comphelper/ChainablePropertySet.hxx>
32 : : #include <comphelper/SettingsHelper.hxx>
33 : : #include <usrpref.hxx>
34 : :
35 : : class SwView;
36 : : class SwViewOption;
37 : : class SwPrintData;
38 : : class SwDoc;
39 : :
40 : : ::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 > & );
41 : :
42 : : class SwXModule : public cppu::WeakImplHelper4
43 : : <
44 : : ::com::sun::star::text::XModule,
45 : : ::com::sun::star::view::XViewSettingsSupplier,
46 : : ::com::sun::star::view::XPrintSettingsSupplier,
47 : : ::com::sun::star::lang::XServiceInfo
48 : : >
49 : : {
50 : :
51 : : ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > * pxViewSettings;
52 : : ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > * pxPrintSettings;
53 : :
54 : : protected:
55 : : virtual ~SwXModule();
56 : : public:
57 : : SwXModule();
58 : :
59 : :
60 : : //XViewSettings
61 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getViewSettings(void)
62 : : throw( ::com::sun::star::uno::RuntimeException );
63 : :
64 : : //XPrintSettings
65 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getPrintSettings(void)
66 : : throw( ::com::sun::star::uno::RuntimeException );
67 : :
68 : : //XServiceInfo
69 : : virtual rtl::OUString SAL_CALL getImplementationName(void)
70 : : throw( ::com::sun::star::uno::RuntimeException );
71 : : virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName)
72 : : throw( ::com::sun::star::uno::RuntimeException );
73 : : virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void)
74 : : throw( ::com::sun::star::uno::RuntimeException );
75 : : };
76 : :
77 : : enum SwXPrintSettingsType
78 : : {
79 : : PRINT_SETTINGS_MODULE,
80 : : PRINT_SETTINGS_WEB,
81 : : PRINT_SETTINGS_DOCUMENT
82 : : };
83 : :
84 : : class SwXPrintSettings : public comphelper::ChainableHelperNoState
85 : : {
86 : : friend class SwXDocumentSettings;
87 : : protected:
88 : : SwXPrintSettingsType meType;
89 : : SwPrintData * mpPrtOpt;
90 : : SwDoc *mpDoc;
91 : :
92 : : virtual void _preSetValues ()
93 : : throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
94 : : virtual void _setSingleValue( const comphelper::PropertyInfo & rInfo, const ::com::sun::star::uno::Any &rValue )
95 : : throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
96 : : virtual void _postSetValues ()
97 : : throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
98 : :
99 : : virtual void _preGetValues ()
100 : : throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
101 : : virtual void _getSingleValue( const comphelper::PropertyInfo & rInfo, ::com::sun::star::uno::Any & rValue )
102 : : throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException );
103 : : virtual void _postGetValues ()
104 : : throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
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 : : throw( ::com::sun::star::uno::RuntimeException );
115 : : virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName)
116 : : throw( ::com::sun::star::uno::RuntimeException );
117 : : virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void)
118 : : throw( ::com::sun::star::uno::RuntimeException );
119 : : };
120 : :
121 : : class SwXViewSettings : public comphelper::ChainableHelperNoState
122 : : {
123 : :
124 : : friend class SwXDocumentSettings;
125 : : protected:
126 : : SwView* pView;
127 : : SwViewOption* mpViewOption;
128 : : const SwViewOption* mpConstViewOption;
129 : : sal_Bool bObjectValid:1, bWeb:1, mbApplyZoom;
130 : :
131 : : sal_Int32 eHRulerUnit;
132 : : sal_Bool mbApplyHRulerMetric;
133 : : sal_Int32 eVRulerUnit;
134 : : sal_Bool mbApplyVRulerMetric;
135 : :
136 : : virtual void _preSetValues ()
137 : : throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
138 : : virtual void _setSingleValue( const comphelper::PropertyInfo & rInfo, const ::com::sun::star::uno::Any &rValue )
139 : : throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
140 : : virtual void _postSetValues ()
141 : : throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
142 : :
143 : : virtual void _preGetValues ()
144 : : throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
145 : : virtual void _getSingleValue( const comphelper::PropertyInfo & rInfo, ::com::sun::star::uno::Any & rValue )
146 : : throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException );
147 : : virtual void _postGetValues ()
148 : : throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
149 : :
150 : : virtual ~SwXViewSettings()
151 : : throw();
152 : : public:
153 : : SwXViewSettings(sal_Bool bWeb, SwView* pView);
154 : :
155 : :
156 : : //XServiceInfo
157 : : virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException );
158 : : virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
159 : : virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
160 : :
161 : 698 : sal_Bool IsValid() const {return bObjectValid;}
162 : 20 : void Invalidate() {bObjectValid = sal_False;}
163 : : };
164 : :
165 : : #endif
166 : :
167 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|