Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : :
30 : : #include <comphelper/serviceinfohelper.hxx>
31 : :
32 : : #include "SdUnoOutlineView.hxx"
33 : :
34 : : #include "DrawController.hxx"
35 : : #include "OutlineViewShell.hxx"
36 : : #include "sdpage.hxx"
37 : : #include "unopage.hxx"
38 : :
39 : : #include <cppuhelper/proptypehlp.hxx>
40 : : #include <svx/unopage.hxx>
41 : : #include <osl/mutex.hxx>
42 : : #include <vcl/svapp.hxx>
43 : :
44 : : using ::rtl::OUString;
45 : : using namespace ::cppu;
46 : : using namespace ::com::sun::star;
47 : : using namespace ::com::sun::star::uno;
48 : :
49 : :
50 : :
51 : : namespace sd {
52 : :
53 : 0 : SdUnoOutlineView::SdUnoOutlineView(
54 : : DrawController& rController,
55 : : OutlineViewShell& rViewShell,
56 : : View& rView) throw()
57 : : : DrawSubControllerInterfaceBase(m_aMutex),
58 : : mrController(rController),
59 : : mrOutlineViewShell(rViewShell),
60 [ # # ]: 0 : mrView(rView)
61 : : {
62 : 0 : }
63 : :
64 : :
65 : :
66 : :
67 [ # # ]: 0 : SdUnoOutlineView::~SdUnoOutlineView (void) throw()
68 : : {
69 [ # # ]: 0 : }
70 : :
71 : :
72 : :
73 : :
74 : 0 : void SAL_CALL SdUnoOutlineView::disposing (void)
75 : : {
76 : 0 : }
77 : :
78 : :
79 : :
80 : :
81 : : //----- XSelectionSupplier ----------------------------------------------------
82 : :
83 : 0 : sal_Bool SAL_CALL SdUnoOutlineView::select( const Any& )
84 : : throw(lang::IllegalArgumentException, RuntimeException)
85 : : {
86 : : // todo: add selections for text ranges
87 : 0 : return sal_False;
88 : : }
89 : :
90 : :
91 : :
92 : 0 : Any SAL_CALL SdUnoOutlineView::getSelection()
93 : : throw(RuntimeException)
94 : : {
95 : 0 : Any aAny;
96 : 0 : return aAny;
97 : : }
98 : :
99 : :
100 : :
101 : 0 : void SAL_CALL SdUnoOutlineView::addSelectionChangeListener (
102 : : const css::uno::Reference<css::view::XSelectionChangeListener>& rxListener)
103 : : throw(css::uno::RuntimeException)
104 : : {
105 : : (void)rxListener;
106 : 0 : }
107 : :
108 : :
109 : :
110 : :
111 : 0 : void SAL_CALL SdUnoOutlineView::removeSelectionChangeListener (
112 : : const css::uno::Reference<css::view::XSelectionChangeListener>& rxListener)
113 : : throw(css::uno::RuntimeException)
114 : : {
115 : : (void)rxListener;
116 : 0 : }
117 : :
118 : :
119 : :
120 : :
121 : : //----- XDrawView -------------------------------------------------------------
122 : :
123 : :
124 : 0 : void SAL_CALL SdUnoOutlineView::setCurrentPage (
125 : : const Reference< drawing::XDrawPage >& xPage)
126 : : throw(RuntimeException)
127 : : {
128 : 0 : SvxDrawPage* pDrawPage = SvxDrawPage::getImplementation( xPage );
129 [ # # ]: 0 : SdrPage *pSdrPage = pDrawPage ? pDrawPage->GetSdrPage() : NULL;
130 : :
131 [ # # ]: 0 : if (pSdrPage != NULL)
132 [ # # ]: 0 : mrOutlineViewShell.SetCurrentPage(dynamic_cast<SdPage*>(pSdrPage));
133 : 0 : }
134 : :
135 : :
136 : :
137 : :
138 : 0 : Reference< drawing::XDrawPage > SAL_CALL SdUnoOutlineView::getCurrentPage (void)
139 : : throw(RuntimeException)
140 : : {
141 : 0 : Reference<drawing::XDrawPage> xPage;
142 : :
143 [ # # ]: 0 : SdPage* pPage = mrOutlineViewShell.getCurrentPage();
144 [ # # ]: 0 : if (pPage != NULL)
145 [ # # ][ # # ]: 0 : xPage = Reference<drawing::XDrawPage>::query(pPage->getUnoPage());
[ # # ]
146 : :
147 : 0 : return xPage;
148 : : }
149 : :
150 : 0 : void SdUnoOutlineView::setFastPropertyValue (
151 : : sal_Int32 nHandle,
152 : : const Any& rValue)
153 : : throw(css::beans::UnknownPropertyException,
154 : : css::beans::PropertyVetoException,
155 : : css::lang::IllegalArgumentException,
156 : : css::lang::WrappedTargetException,
157 : : css::uno::RuntimeException)
158 : : {
159 [ # # ]: 0 : switch( nHandle )
160 : : {
161 : : case DrawController::PROPERTY_CURRENTPAGE:
162 : : {
163 : 0 : Reference< drawing::XDrawPage > xPage;
164 [ # # ]: 0 : rValue >>= xPage;
165 [ # # ]: 0 : setCurrentPage( xPage );
166 : : }
167 : 0 : break;
168 : :
169 : : default:
170 [ # # ]: 0 : throw beans::UnknownPropertyException();
171 : : }
172 : 0 : }
173 : :
174 : :
175 : :
176 : :
177 : 0 : void SAL_CALL SdUnoOutlineView::disposing (const ::com::sun::star::lang::EventObject& )
178 : : throw (::com::sun::star::uno::RuntimeException)
179 : : {
180 : 0 : }
181 : :
182 : :
183 : :
184 : :
185 : 0 : Any SAL_CALL SdUnoOutlineView::getFastPropertyValue (
186 : : sal_Int32 nHandle)
187 : : throw(css::beans::UnknownPropertyException,
188 : : css::lang::WrappedTargetException,
189 : : css::uno::RuntimeException)
190 : : {
191 : 0 : Any aValue;
192 : :
193 [ # # # ]: 0 : switch( nHandle )
194 : : {
195 : : case DrawController::PROPERTY_CURRENTPAGE:
196 : : {
197 [ # # ]: 0 : SdPage* pPage = const_cast<OutlineViewShell&>(mrOutlineViewShell).GetActualPage();
198 [ # # ]: 0 : if (pPage != NULL)
199 [ # # ][ # # ]: 0 : aValue <<= pPage->getUnoPage();
200 : : }
201 : 0 : break;
202 : : case DrawController::PROPERTY_VIEWOFFSET:
203 : 0 : break;
204 : :
205 : : default:
206 [ # # ]: 0 : throw beans::UnknownPropertyException();
207 : : }
208 : :
209 : 0 : return aValue;
210 : : }
211 : :
212 : :
213 : : // XServiceInfo
214 : 0 : OUString SAL_CALL SdUnoOutlineView::getImplementationName( ) throw (RuntimeException)
215 : : {
216 : 0 : return OUString("com.sun.star.comp.sd.SdUnoOutlineView");
217 : : }
218 : :
219 : 0 : sal_Bool SAL_CALL SdUnoOutlineView::supportsService( const OUString& ServiceName ) throw (RuntimeException)
220 : : {
221 : 0 : return comphelper::ServiceInfoHelper::supportsService( ServiceName, getSupportedServiceNames() );
222 : : }
223 : :
224 : 0 : Sequence< OUString > SAL_CALL SdUnoOutlineView::getSupportedServiceNames( ) throw (RuntimeException)
225 : : {
226 : 0 : OUString aSN( "com.sun.star.presentation.OutlineView" );
227 [ # # ]: 0 : uno::Sequence< OUString > aSeq( &aSN, 1 );
228 : 0 : return aSeq;
229 : : }
230 : :
231 : : } // end of namespace sd
232 : :
233 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|