xref: /aoo41x/main/sd/source/ui/inc/SdUnoDrawView.hxx (revision c45d927a)
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 
24 #ifndef SD_UNO_DRAW_VIEW_HXX
25 #define SD_UNO_DRAW_VIEW_HXX
26 
27 #include "DrawSubController.hxx"
28 #include "DrawController.hxx"
29 #include "DrawViewShell.hxx"
30 #include <cppuhelper/basemutex.hxx>
31 
32 class SdXImpressDocument;
33 class SdPage;
34 
35 namespace css = ::com::sun::star;
36 
37 namespace com { namespace sun { namespace star { namespace drawing {
38 class XLayer;
39 } } } }
40 
41 namespace sd {
42 
43 class DrawController;
44 class DrawViewShell;
45 
46 /** This class implements the DrawViewShell specific part of the controller.
47 */
48 class SdUnoDrawView
49     : private cppu::BaseMutex,
50       public DrawSubControllerInterfaceBase
51 {
52 public:
53 	SdUnoDrawView (
54         DrawController& rController,
55         DrawViewShell& rViewShell,
56         View& rView) throw();
57 	virtual ~SdUnoDrawView (void) throw();
58 
59 	// XSelectionSupplier
60 
61     virtual sal_Bool SAL_CALL select (
62         const css::uno::Any& aSelection)
63         throw(css::lang::IllegalArgumentException,
64             css::uno::RuntimeException);
65 
66     virtual css::uno::Any SAL_CALL getSelection (void)
67         throw(css::uno::RuntimeException);
68 
69     virtual void SAL_CALL addSelectionChangeListener (
70         const css::uno::Reference<css::view::XSelectionChangeListener>& rxListener)
71         throw(css::uno::RuntimeException);
72 
73     virtual void SAL_CALL removeSelectionChangeListener (
74         const css::uno::Reference<css::view::XSelectionChangeListener>& rxListener)
75         throw(css::uno::RuntimeException);
76 
77 
78 	// XDrawView
79 
80     virtual void SAL_CALL setCurrentPage (
81         const css::uno::Reference<css::drawing::XDrawPage >& xPage)
82         throw(css::uno::RuntimeException);
83 
84     virtual css::uno::Reference<css::drawing::XDrawPage> SAL_CALL getCurrentPage (void)
85         throw(css::uno::RuntimeException);
86 
87 
88     // XFastPropertySet
89 
90     virtual void SAL_CALL setFastPropertyValue (
91         sal_Int32 nHandle,
92         const css::uno::Any& rValue)
93         throw(css::beans::UnknownPropertyException,
94             css::beans::PropertyVetoException,
95             css::lang::IllegalArgumentException,
96             css::lang::WrappedTargetException,
97             css::uno::RuntimeException);
98 
99     virtual css::uno::Any SAL_CALL getFastPropertyValue (
100         sal_Int32 nHandle)
101         throw(css::beans::UnknownPropertyException,
102             css::lang::WrappedTargetException,
103             css::uno::RuntimeException);
104 
105 	// XServiceInfo
106 	virtual ::rtl::OUString SAL_CALL getImplementationName(  ) throw (::com::sun::star::uno::RuntimeException);
107 	virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
108 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(  ) throw (::com::sun::star::uno::RuntimeException);
109 
110 protected:
111 	sal_Bool getMasterPageMode(void) const throw();
112 	void setMasterPageMode(sal_Bool MasterPageMode_) throw();
113 	sal_Bool getLayerMode(void) const throw();
114 	void setLayerMode(sal_Bool LayerMode_) throw();
115 
116     /** Return a reference to the active layer object.
117         @return
118             The returned value may be empty when the internal state of this
119             view is not valid (like during destruction.)
120     */
121     ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XLayer> getActiveLayer (void) throw ();
122 
123     /** Make the specified object the active layer.
124         @param rxLayer
125             The new layer object.
126     */
127     void setActiveLayer (const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XLayer>& rxLayer) throw ();
128 
129 	void SetZoom( sal_Int16 nZoom );
130 	sal_Int16 GetZoom(void) const;
131 
132 	void SetViewOffset(const com::sun::star::awt::Point& rWinPos );
133 	com::sun::star::awt::Point GetViewOffset() const;
134 
135 	void SetZoomType( sal_Int16 nType );
136 
137 	::com::sun::star::uno::Any getDrawViewMode() const;
138 
139 private:
140     DrawController& mrController;
141     DrawViewShell& mrDrawViewShell;
142     sd::View& mrView;
143 
144     SdXImpressDocument* GetModel (void) const throw();
145 };
146 
147 } // end of namespace sd
148 
149 #endif
150