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 "SlideSorterService.hxx"
31 : : #include "controller/SlideSorterController.hxx"
32 : : #include "controller/SlsProperties.hxx"
33 : : #include "controller/SlsCurrentSlideManager.hxx"
34 : : #include "model/SlideSorterModel.hxx"
35 : : #include "model/SlsPageDescriptor.hxx"
36 : : #include "view/SlideSorterView.hxx"
37 : : #include "view/SlsLayouter.hxx"
38 : : #include "DrawController.hxx"
39 : : #include <toolkit/helper/vclunohelper.hxx>
40 : : #include <com/sun/star/beans/PropertyAttribute.hpp>
41 : : #include <com/sun/star/lang/XUnoTunnel.hpp>
42 : : #include <osl/mutex.hxx>
43 : : #include <vcl/svapp.hxx>
44 : : #include <cppuhelper/proptypehlp.hxx>
45 : :
46 : : using namespace ::com::sun::star;
47 : : using namespace ::com::sun::star::uno;
48 : : using namespace ::com::sun::star::drawing::framework;
49 : : using ::rtl::OUString;
50 : : using ::sd::slidesorter::view::Layouter;
51 : :
52 : : namespace sd { namespace slidesorter {
53 : :
54 : : namespace {
55 : : enum Properties
56 : : {
57 : : PropertyDocumentSlides,
58 : : PropertyHighlightCurrentSlide,
59 : : PropertyShowSelection,
60 : : PropertyCenterSelection,
61 : : PropertySuspendPreviewUpdatesDuringFullScreenPresentation,
62 : : PropertyOrientationVertical
63 : : };
64 : : }
65 : :
66 : :
67 : :
68 : :
69 : : //===== Service ===============================================================
70 : :
71 : 0 : Reference<XInterface> SAL_CALL SlideSorterService_createInstance (
72 : : const Reference<XComponentContext>& rxContext)
73 : : {
74 [ # # ][ # # ]: 0 : return Reference<XInterface>(static_cast<drawing::XDrawView*>(new SlideSorterService(rxContext)));
75 : : }
76 : :
77 : :
78 : :
79 : :
80 : 22 : ::rtl::OUString SlideSorterService_getImplementationName (void) throw(RuntimeException)
81 : : {
82 : 22 : return OUString("com.sun.star.comp.Draw.SlideSorter");
83 : : }
84 : :
85 : :
86 : :
87 : :
88 : 0 : Sequence<rtl::OUString> SAL_CALL SlideSorterService_getSupportedServiceNames (void)
89 : : throw (RuntimeException)
90 : : {
91 [ # # ][ # # ]: 0 : static const ::rtl::OUString sServiceName("com.sun.star.drawing.SlideSorter");
92 : 0 : return Sequence<rtl::OUString>(&sServiceName, 1);
93 : : }
94 : :
95 : :
96 : :
97 : :
98 : : //===== SlideSorterService ==========================================================
99 : :
100 : 0 : SlideSorterService::SlideSorterService (const Reference<XComponentContext>& rxContext)
101 : : : SlideSorterServiceInterfaceBase(m_aMutex),
102 : : mpSlideSorter(),
103 [ # # ][ # # ]: 0 : mxParentWindow()
104 : : {
105 : : (void)rxContext;
106 : 0 : }
107 : :
108 : :
109 : :
110 : :
111 [ # # ][ # # ]: 0 : SlideSorterService::~SlideSorterService (void)
[ # # ][ # # ]
112 : : {
113 [ # # ]: 0 : }
114 : :
115 : :
116 : :
117 : :
118 : 0 : void SAL_CALL SlideSorterService::disposing (void)
119 : : {
120 : 0 : mpSlideSorter.reset();
121 : :
122 [ # # ]: 0 : if (mxParentWindow.is())
123 : : {
124 [ # # ]: 0 : mxParentWindow->removeWindowListener(this);
125 : : }
126 : 0 : }
127 : :
128 : :
129 : :
130 : :
131 : : //----- XInitialization -------------------------------------------------------
132 : :
133 : 0 : void SAL_CALL SlideSorterService::initialize (const Sequence<Any>& rArguments)
134 : : throw (Exception, RuntimeException)
135 : : {
136 : 0 : ThrowIfDisposed();
137 : :
138 [ # # ]: 0 : if (rArguments.getLength() == 3)
139 : : {
140 : : try
141 : : {
142 [ # # ][ # # ]: 0 : mxViewId = Reference<XResourceId>(rArguments[0], UNO_QUERY_THROW);
143 : :
144 : : // Get the XController.
145 [ # # ]: 0 : Reference<frame::XController> xController (rArguments[1], UNO_QUERY_THROW);
146 : :
147 : : // Tunnel through the controller to obtain a ViewShellBase.
148 : 0 : ViewShellBase* pBase = NULL;
149 [ # # ]: 0 : Reference<lang::XUnoTunnel> xTunnel (xController, UNO_QUERY_THROW);
150 : : ::sd::DrawController* pController = reinterpret_cast<sd::DrawController*>(
151 [ # # ][ # # ]: 0 : xTunnel->getSomething(sd::DrawController::getUnoTunnelId()));
[ # # ]
152 [ # # ]: 0 : if (pController != NULL)
153 [ # # ]: 0 : pBase = pController->GetViewShellBase();
154 : :
155 : : // Get the parent window.
156 [ # # ][ # # ]: 0 : mxParentWindow = Reference<awt::XWindow>(rArguments[2], UNO_QUERY_THROW);
157 [ # # ]: 0 : ::Window* pParentWindow = VCLUnoHelper::GetWindow(mxParentWindow);
158 : :
159 [ # # ][ # # ]: 0 : mxParentWindow->addWindowListener(this);
[ # # ]
160 : :
161 [ # # ][ # # ]: 0 : if (pBase != NULL && pParentWindow!=NULL)
162 : : mpSlideSorter = SlideSorter::CreateSlideSorter(
163 : : *pBase,
164 : : NULL,
165 [ # # ][ # # ]: 0 : *pParentWindow);
[ # # ]
166 : :
167 [ # # ]: 0 : Resize();
168 : : }
169 [ # # ]: 0 : catch (RuntimeException&)
170 : : {
171 : 0 : throw;
172 : : }
173 : : }
174 : : else
175 : : {
176 : : throw RuntimeException("SlideSorterService: invalid number of arguments",
177 [ # # ][ # # ]: 0 : static_cast<drawing::XDrawView*>(this));
178 : : }
179 : 0 : }
180 : :
181 : :
182 : :
183 : :
184 : : //----- XView -----------------------------------------------------------------
185 : :
186 : 0 : Reference<XResourceId> SAL_CALL SlideSorterService::getResourceId (void)
187 : : throw (RuntimeException)
188 : : {
189 : 0 : return mxViewId;
190 : : }
191 : :
192 : :
193 : :
194 : :
195 : 0 : sal_Bool SAL_CALL SlideSorterService::isAnchorOnly (void)
196 : : throw (RuntimeException)
197 : : {
198 : 0 : return sal_False;
199 : : }
200 : :
201 : :
202 : :
203 : :
204 : : //----- XWindowListener -------------------------------------------------------
205 : :
206 : 0 : void SAL_CALL SlideSorterService::windowResized (const awt::WindowEvent& rEvent)
207 : : throw (RuntimeException)
208 : : {
209 : : (void)rEvent;
210 : 0 : ThrowIfDisposed();
211 : :
212 : 0 : Resize();
213 : 0 : }
214 : :
215 : :
216 : :
217 : :
218 : :
219 : 0 : void SAL_CALL SlideSorterService::windowMoved (const awt::WindowEvent& rEvent)
220 : : throw (RuntimeException)
221 : : {
222 : : (void)rEvent;
223 : 0 : }
224 : :
225 : :
226 : :
227 : :
228 : 0 : void SAL_CALL SlideSorterService::windowShown (const lang::EventObject& rEvent)
229 : : throw (RuntimeException)
230 : : {
231 : : (void)rEvent;
232 : 0 : ThrowIfDisposed();
233 : 0 : Resize();
234 : 0 : }
235 : :
236 : :
237 : :
238 : :
239 : 0 : void SAL_CALL SlideSorterService::windowHidden (const lang::EventObject& rEvent)
240 : : throw (RuntimeException)
241 : : {
242 : : (void)rEvent;
243 : 0 : ThrowIfDisposed();
244 : 0 : }
245 : :
246 : :
247 : :
248 : :
249 : : //----- lang::XEventListener --------------------------------------------------
250 : :
251 : 0 : void SAL_CALL SlideSorterService::disposing (const lang::EventObject& rEvent)
252 : : throw (RuntimeException)
253 : : {
254 [ # # ]: 0 : if (rEvent.Source == mxParentWindow)
255 : 0 : mxParentWindow = NULL;
256 : 0 : }
257 : :
258 : :
259 : :
260 : :
261 : : //----- XDrawView -------------------------------------------------------------
262 : :
263 : 0 : void SAL_CALL SlideSorterService::setCurrentPage(const Reference<drawing::XDrawPage>& rxSlide)
264 : : throw (RuntimeException)
265 : : {
266 : 0 : ThrowIfDisposed();
267 [ # # ]: 0 : if (mpSlideSorter.get() != NULL)
268 : 0 : mpSlideSorter->GetController().GetCurrentSlideManager()->NotifyCurrentSlideChange(
269 [ # # ]: 0 : mpSlideSorter->GetModel().GetIndex(rxSlide));
270 : 0 : }
271 : :
272 : :
273 : :
274 : :
275 : 0 : Reference<drawing::XDrawPage> SAL_CALL SlideSorterService::getCurrentPage (void)
276 : : throw (RuntimeException)
277 : : {
278 : 0 : ThrowIfDisposed();
279 [ # # ]: 0 : if (mpSlideSorter.get() != NULL)
280 [ # # ][ # # ]: 0 : return mpSlideSorter->GetController().GetCurrentSlideManager()->GetCurrentSlide()->GetXDrawPage();
[ # # ]
281 : : else
282 : 0 : return NULL;
283 : : }
284 : :
285 : :
286 : :
287 : :
288 : : //----- attributes ------------------------------------------------------------
289 : :
290 : :
291 : 0 : Reference<container::XIndexAccess> SAL_CALL SlideSorterService::getDocumentSlides (void)
292 : : throw (RuntimeException)
293 : : {
294 : 0 : return mpSlideSorter->GetModel().GetDocumentSlides();
295 : : }
296 : :
297 : :
298 : :
299 : :
300 : 0 : void SAL_CALL SlideSorterService::setDocumentSlides (
301 : : const Reference<container::XIndexAccess >& rxSlides)
302 : : throw (RuntimeException)
303 : : {
304 : 0 : ThrowIfDisposed();
305 [ # # ][ # # ]: 0 : if (mpSlideSorter.get() != NULL && mpSlideSorter->IsValid())
[ # # ]
306 : 0 : mpSlideSorter->GetController().SetDocumentSlides(rxSlides);
307 : 0 : }
308 : :
309 : :
310 : :
311 : :
312 : 0 : sal_Bool SAL_CALL SlideSorterService::getIsHighlightCurrentSlide (void)
313 : : throw (RuntimeException)
314 : : {
315 : 0 : ThrowIfDisposed();
316 [ # # ][ # # ]: 0 : if (mpSlideSorter.get() == NULL || ! mpSlideSorter->IsValid())
[ # # ]
317 : 0 : return false;
318 : : else
319 [ # # ]: 0 : return mpSlideSorter->GetProperties()->IsHighlightCurrentSlide();
320 : : }
321 : :
322 : :
323 : :
324 : :
325 : 0 : void SAL_CALL SlideSorterService::setIsHighlightCurrentSlide (sal_Bool bValue)
326 : : throw (RuntimeException)
327 : : {
328 : 0 : ThrowIfDisposed();
329 [ # # ][ # # ]: 0 : if (mpSlideSorter.get() != NULL && mpSlideSorter->IsValid())
[ # # ]
330 : : {
331 [ # # ][ # # ]: 0 : mpSlideSorter->GetProperties()->SetHighlightCurrentSlide(bValue);
[ # # ]
332 [ # # ][ # # ]: 0 : controller::SlideSorterController::ModelChangeLock aLock (mpSlideSorter->GetController());
333 [ # # ][ # # ]: 0 : mpSlideSorter->GetController().HandleModelChange();
[ # # ]
334 : : }
335 : 0 : }
336 : :
337 : :
338 : :
339 : :
340 : 0 : sal_Bool SAL_CALL SlideSorterService::getIsShowSelection (void)
341 : : throw (RuntimeException)
342 : : {
343 : 0 : ThrowIfDisposed();
344 [ # # ][ # # ]: 0 : if (mpSlideSorter.get() == NULL || ! mpSlideSorter->IsValid())
[ # # ]
345 : 0 : return false;
346 : : else
347 [ # # ]: 0 : return mpSlideSorter->GetProperties()->IsShowSelection();
348 : : }
349 : :
350 : :
351 : :
352 : :
353 : 0 : void SAL_CALL SlideSorterService::setIsShowSelection (sal_Bool bValue)
354 : : throw (RuntimeException)
355 : : {
356 : 0 : ThrowIfDisposed();
357 [ # # ][ # # ]: 0 : if (mpSlideSorter.get() != NULL && mpSlideSorter->IsValid())
[ # # ]
358 [ # # ]: 0 : mpSlideSorter->GetProperties()->SetShowSelection(bValue);
359 : 0 : }
360 : :
361 : :
362 : :
363 : :
364 : 0 : sal_Bool SAL_CALL SlideSorterService::getIsShowFocus (void)
365 : : throw (RuntimeException)
366 : : {
367 : 0 : ThrowIfDisposed();
368 [ # # ][ # # ]: 0 : if (mpSlideSorter.get() == NULL || ! mpSlideSorter->IsValid())
[ # # ]
369 : 0 : return false;
370 : : else
371 [ # # ]: 0 : return mpSlideSorter->GetProperties()->IsShowFocus();
372 : : }
373 : :
374 : :
375 : :
376 : :
377 : 0 : void SAL_CALL SlideSorterService::setIsShowFocus (sal_Bool bValue)
378 : : throw (RuntimeException)
379 : : {
380 : 0 : ThrowIfDisposed();
381 [ # # ][ # # ]: 0 : if (mpSlideSorter.get() != NULL && mpSlideSorter->IsValid())
[ # # ]
382 [ # # ]: 0 : mpSlideSorter->GetProperties()->SetShowFocus(bValue);
383 : 0 : }
384 : :
385 : :
386 : :
387 : :
388 : 0 : sal_Bool SAL_CALL SlideSorterService::getIsCenterSelection (void)
389 : : throw (RuntimeException)
390 : : {
391 : 0 : ThrowIfDisposed();
392 [ # # ][ # # ]: 0 : if (mpSlideSorter.get() == NULL || ! mpSlideSorter->IsValid())
[ # # ]
393 : 0 : return false;
394 : : else
395 [ # # ]: 0 : return mpSlideSorter->GetProperties()->IsCenterSelection();
396 : : }
397 : :
398 : :
399 : :
400 : :
401 : 0 : void SAL_CALL SlideSorterService::setIsCenterSelection (sal_Bool bValue)
402 : : throw (RuntimeException)
403 : : {
404 : 0 : ThrowIfDisposed();
405 [ # # ][ # # ]: 0 : if (mpSlideSorter.get() != NULL && mpSlideSorter->IsValid())
[ # # ]
406 [ # # ]: 0 : mpSlideSorter->GetProperties()->SetCenterSelection(bValue);
407 : 0 : }
408 : :
409 : :
410 : :
411 : :
412 : 0 : sal_Bool SAL_CALL SlideSorterService::getIsSuspendPreviewUpdatesDuringFullScreenPresentation (void)
413 : : throw (RuntimeException)
414 : : {
415 : 0 : ThrowIfDisposed();
416 [ # # ][ # # ]: 0 : if (mpSlideSorter.get() == NULL || ! mpSlideSorter->IsValid())
[ # # ]
417 : 0 : return true;
418 : : else
419 : : return mpSlideSorter->GetProperties()
420 [ # # ]: 0 : ->IsSuspendPreviewUpdatesDuringFullScreenPresentation();
421 : : }
422 : :
423 : :
424 : :
425 : :
426 : 0 : void SAL_CALL SlideSorterService::setIsSuspendPreviewUpdatesDuringFullScreenPresentation (
427 : : sal_Bool bValue)
428 : : throw (RuntimeException)
429 : : {
430 : 0 : ThrowIfDisposed();
431 [ # # ][ # # ]: 0 : if (mpSlideSorter.get() != NULL && mpSlideSorter->IsValid())
[ # # ]
432 : : mpSlideSorter->GetProperties()
433 [ # # ]: 0 : ->SetSuspendPreviewUpdatesDuringFullScreenPresentation(bValue);
434 : 0 : }
435 : :
436 : :
437 : :
438 : :
439 : 0 : sal_Bool SAL_CALL SlideSorterService::getIsOrientationVertical (void)
440 : : throw (RuntimeException)
441 : : {
442 : 0 : ThrowIfDisposed();
443 [ # # ][ # # ]: 0 : if (mpSlideSorter.get() == NULL || ! mpSlideSorter->IsValid())
[ # # ]
444 : 0 : return true;
445 : : else
446 : 0 : return mpSlideSorter->GetView().GetOrientation() != Layouter::HORIZONTAL;
447 : : }
448 : :
449 : :
450 : :
451 : :
452 : 0 : void SAL_CALL SlideSorterService::setIsOrientationVertical (sal_Bool bValue)
453 : : throw (RuntimeException)
454 : : {
455 : 0 : ThrowIfDisposed();
456 [ # # ][ # # ]: 0 : if (mpSlideSorter.get() != NULL && mpSlideSorter->IsValid())
[ # # ]
457 : 0 : mpSlideSorter->GetView().SetOrientation(bValue
458 : : ? Layouter::GRID
459 [ # # ]: 0 : : Layouter::HORIZONTAL);
460 : 0 : }
461 : :
462 : :
463 : :
464 : :
465 : 0 : sal_Bool SAL_CALL SlideSorterService::getIsSmoothScrolling (void)
466 : : throw (RuntimeException)
467 : : {
468 : 0 : ThrowIfDisposed();
469 [ # # ][ # # ]: 0 : if (mpSlideSorter.get() == NULL || ! mpSlideSorter->IsValid())
[ # # ]
470 : 0 : return false;
471 : : else
472 [ # # ]: 0 : return mpSlideSorter->GetProperties()->IsSmoothSelectionScrolling();
473 : : }
474 : :
475 : :
476 : :
477 : :
478 : 0 : void SAL_CALL SlideSorterService::setIsSmoothScrolling (sal_Bool bValue)
479 : : throw (RuntimeException)
480 : : {
481 : 0 : ThrowIfDisposed();
482 [ # # ][ # # ]: 0 : if (mpSlideSorter.get() != NULL && mpSlideSorter->IsValid())
[ # # ]
483 [ # # ]: 0 : mpSlideSorter->GetProperties()->SetSmoothSelectionScrolling(bValue);
484 : 0 : }
485 : :
486 : :
487 : :
488 : :
489 : 0 : util::Color SAL_CALL SlideSorterService::getBackgroundColor (void)
490 : : throw (RuntimeException)
491 : : {
492 : 0 : ThrowIfDisposed();
493 [ # # ][ # # ]: 0 : if (mpSlideSorter.get() == NULL || ! mpSlideSorter->IsValid())
[ # # ]
494 : 0 : return util::Color();
495 : : else
496 : : return util::Color(
497 [ # # ]: 0 : mpSlideSorter->GetProperties()->GetBackgroundColor().GetColor());
498 : : }
499 : :
500 : :
501 : :
502 : :
503 : 0 : void SAL_CALL SlideSorterService::setBackgroundColor (util::Color aBackgroundColor)
504 : : throw (RuntimeException)
505 : : {
506 : 0 : ThrowIfDisposed();
507 [ # # ][ # # ]: 0 : if (mpSlideSorter.get() != NULL && mpSlideSorter->IsValid())
[ # # ]
508 [ # # ][ # # ]: 0 : mpSlideSorter->GetProperties()->SetBackgroundColor(Color(aBackgroundColor));
[ # # ]
509 : 0 : }
510 : :
511 : :
512 : :
513 : :
514 : 0 : util::Color SAL_CALL SlideSorterService::getTextColor (void)
515 : : throw (css::uno::RuntimeException)
516 : : {
517 : 0 : ThrowIfDisposed();
518 [ # # ][ # # ]: 0 : if (mpSlideSorter.get() == NULL || ! mpSlideSorter->IsValid())
[ # # ]
519 : 0 : return util::Color();
520 : : else
521 : : return util::Color(
522 [ # # ]: 0 : mpSlideSorter->GetProperties()->GetTextColor().GetColor());
523 : : }
524 : :
525 : :
526 : :
527 : :
528 : 0 : void SAL_CALL SlideSorterService::setTextColor (util::Color aTextColor)
529 : : throw (RuntimeException)
530 : : {
531 : 0 : ThrowIfDisposed();
532 [ # # ][ # # ]: 0 : if (mpSlideSorter.get() != NULL && mpSlideSorter->IsValid())
[ # # ]
533 [ # # ][ # # ]: 0 : mpSlideSorter->GetProperties()->SetTextColor(Color(aTextColor));
[ # # ]
534 : 0 : }
535 : :
536 : :
537 : :
538 : :
539 : 0 : util::Color SAL_CALL SlideSorterService::getSelectionColor (void)
540 : : throw (RuntimeException)
541 : : {
542 : 0 : ThrowIfDisposed();
543 [ # # ][ # # ]: 0 : if (mpSlideSorter.get() == NULL || ! mpSlideSorter->IsValid())
[ # # ]
544 : 0 : return util::Color();
545 : : else
546 : : return util::Color(
547 [ # # ]: 0 : mpSlideSorter->GetProperties()->GetSelectionColor().GetColor());
548 : : }
549 : :
550 : :
551 : :
552 : :
553 : 0 : void SAL_CALL SlideSorterService::setSelectionColor (util::Color aSelectionColor)
554 : : throw (RuntimeException)
555 : : {
556 : 0 : ThrowIfDisposed();
557 [ # # ][ # # ]: 0 : if (mpSlideSorter.get() != NULL && mpSlideSorter->IsValid())
[ # # ]
558 [ # # ][ # # ]: 0 : mpSlideSorter->GetProperties()->SetSelectionColor(Color(aSelectionColor));
[ # # ]
559 : 0 : }
560 : :
561 : :
562 : :
563 : :
564 : 0 : util::Color SAL_CALL SlideSorterService::getHighlightColor (void)
565 : : throw (RuntimeException)
566 : : {
567 : 0 : ThrowIfDisposed();
568 [ # # ][ # # ]: 0 : if (mpSlideSorter.get() == NULL || ! mpSlideSorter->IsValid())
[ # # ]
569 : 0 : return util::Color();
570 : : else
571 : : return util::Color(
572 [ # # ]: 0 : mpSlideSorter->GetProperties()->GetHighlightColor().GetColor());
573 : : }
574 : :
575 : :
576 : :
577 : :
578 : 0 : void SAL_CALL SlideSorterService::setHighlightColor (util::Color aHighlightColor)
579 : : throw (RuntimeException)
580 : : {
581 : 0 : ThrowIfDisposed();
582 [ # # ][ # # ]: 0 : if (mpSlideSorter.get() != NULL && mpSlideSorter->IsValid())
[ # # ]
583 [ # # ][ # # ]: 0 : mpSlideSorter->GetProperties()->SetHighlightColor(Color(aHighlightColor));
[ # # ]
584 : 0 : }
585 : :
586 : :
587 : :
588 : 0 : sal_Bool SAL_CALL SlideSorterService::getIsUIReadOnly (void)
589 : : throw (RuntimeException)
590 : : {
591 : 0 : ThrowIfDisposed();
592 [ # # ][ # # ]: 0 : if (mpSlideSorter.get() == NULL || ! mpSlideSorter->IsValid())
[ # # ]
593 : 0 : return true;
594 : : else
595 [ # # ]: 0 : return mpSlideSorter->GetProperties()->IsUIReadOnly();
596 : : }
597 : :
598 : :
599 : :
600 : :
601 : 0 : void SAL_CALL SlideSorterService::setIsUIReadOnly (sal_Bool bIsUIReadOnly)
602 : : throw (RuntimeException)
603 : : {
604 : 0 : ThrowIfDisposed();
605 [ # # ][ # # ]: 0 : if (mpSlideSorter.get() != NULL && mpSlideSorter->IsValid())
[ # # ]
606 [ # # ]: 0 : mpSlideSorter->GetProperties()->SetUIReadOnly(bIsUIReadOnly);
607 : 0 : }
608 : :
609 : :
610 : :
611 : :
612 : : //-----------------------------------------------------------------------------
613 : :
614 : 0 : void SlideSorterService::Resize (void)
615 : : {
616 [ # # ]: 0 : if (mxParentWindow.is())
617 : : {
618 [ # # ][ # # ]: 0 : awt::Rectangle aWindowBox = mxParentWindow->getPosSize();
619 : : mpSlideSorter->ArrangeGUIElements(
620 : : Point(0,0),
621 [ # # ]: 0 : Size(aWindowBox.Width, aWindowBox.Height));
622 : : }
623 : 0 : }
624 : :
625 : :
626 : :
627 : :
628 : 0 : void SlideSorterService::ThrowIfDisposed (void)
629 : : throw (::com::sun::star::lang::DisposedException)
630 : : {
631 [ # # ][ # # ]: 0 : if (SlideSorterServiceInterfaceBase::rBHelper.bDisposed || SlideSorterServiceInterfaceBase::rBHelper.bInDispose)
632 : : {
633 : : throw lang::DisposedException ("SlideSorterService object has already been disposed",
634 [ # # ][ # # ]: 0 : static_cast<drawing::XDrawView*>(this));
635 : : }
636 : 0 : }
637 : :
638 : :
639 : : } } // end of namespace ::sd::presenter
640 : :
641 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|