xref: /trunk/main/sd/source/ui/inc/SdUnoDrawView.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 
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 
64     virtual css::uno::Any SAL_CALL getSelection (void);
65 
66     virtual void SAL_CALL addSelectionChangeListener (
67         const css::uno::Reference<css::view::XSelectionChangeListener>& rxListener);
68 
69     virtual void SAL_CALL removeSelectionChangeListener (
70         const css::uno::Reference<css::view::XSelectionChangeListener>& rxListener);
71 
72 
73     // XDrawView
74 
75     virtual void SAL_CALL setCurrentPage (
76         const css::uno::Reference<css::drawing::XDrawPage >& xPage);
77 
78     virtual css::uno::Reference<css::drawing::XDrawPage> SAL_CALL getCurrentPage (void);
79 
80 
81     // XFastPropertySet
82 
83     virtual void SAL_CALL setFastPropertyValue (
84         sal_Int32 nHandle,
85         const css::uno::Any& rValue);
86 
87     virtual css::uno::Any SAL_CALL getFastPropertyValue (
88         sal_Int32 nHandle);
89 
90     // XServiceInfo
91     virtual ::rtl::OUString SAL_CALL getImplementationName(  );
92     virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName );
93     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(  );
94 
95 protected:
96     sal_Bool getMasterPageMode(void) const throw();
97     void setMasterPageMode(sal_Bool MasterPageMode_) throw();
98     sal_Bool getLayerMode(void) const throw();
99     void setLayerMode(sal_Bool LayerMode_) throw();
100 public:
101     /** Return a reference to the active layer object.
102         @return
103             The returned value may be empty when the internal state of this
104             view is not valid (like during destruction.)
105     */
106     ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XLayer> getActiveLayer (void) throw ();
107 protected:
108     /** Make the specified object the active layer.
109         @param rxLayer
110             The new layer object.
111     */
112     void setActiveLayer (const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XLayer>& rxLayer) throw ();
113 
114     void SetZoom( sal_Int16 nZoom );
115     sal_Int16 GetZoom(void) const;
116 
117     void SetViewOffset(const com::sun::star::awt::Point& rWinPos );
118     com::sun::star::awt::Point GetViewOffset() const;
119 
120     void SetZoomType( sal_Int16 nType );
121 
122     ::com::sun::star::uno::Any getDrawViewMode() const;
123 
124 private:
125     DrawController& mrController;
126     DrawViewShell& mrDrawViewShell;
127     sd::View& mrView;
128 
129     SdXImpressDocument* GetModel (void) const throw();
130 };
131 
132 } // end of namespace sd
133 
134 #endif
135