From 40427a71e22ae43dd857b64a56e4a3516b13d805 Mon Sep 17 00:00:00 2001 From: Kurt Zenker Date: Thu, 3 Apr 2008 15:06:39 +0000 Subject: INTEGRATION: CWS presenterview (1.1.2); FILE ADDED 2008/02/26 15:33:48 af 1.1.2.6: #i18486# Factored out management of theme bitmaps to PresenterBitmapContainer. 2008/01/30 11:54:44 af 1.1.2.5: #i18486# Added guards againts missing canvas. 2008/01/21 15:28:28 af 1.1.2.4: #i18486# Using PresenterHelper for loading bitmaps. Code cleanup. 2007/12/12 15:32:45 af 1.1.2.3: #i18486# Using canvas for rendering. 2007/11/19 09:44:01 af 1.1.2.2: #i18486# Added isAnchorOnly() method. Added initial theming support. 2007/10/24 12:24:50 af 1.1.2.1: #i18486# Initial revision. --- sdext/source/presenter/PresenterToolBar.hxx | 221 ++++++++++++++++++++++++++++ 1 file changed, 221 insertions(+) create mode 100644 sdext/source/presenter/PresenterToolBar.hxx (limited to 'sdext/source/presenter/PresenterToolBar.hxx') diff --git a/sdext/source/presenter/PresenterToolBar.hxx b/sdext/source/presenter/PresenterToolBar.hxx new file mode 100644 index 000000000000..9c0cd3ba4b86 --- /dev/null +++ b/sdext/source/presenter/PresenterToolBar.hxx @@ -0,0 +1,221 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: PresenterToolBar.hxx,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: kz $ $Date: 2008-04-03 16:06:39 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef SDEXT_PRESENTER_TOOL_BAR_HXX +#define SDEXT_PRESENTER_TOOL_BAR_HXX + +#include "PresenterController.hxx" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace css = ::com::sun::star; + +namespace { + typedef cppu::WeakComponentImplHelper6< + css::awt::XWindowListener, + css::awt::XPaintListener, + css::awt::XMouseListener, + css::awt::XMouseMotionListener, + css::drawing::framework::XView, + css::drawing::XDrawView + > PresenterToolBarInterfaceBase; +} + +namespace sdext { namespace presenter { + +class PresenterBitmapContainer; + +/** A simple tool bar that can display bitmapped buttons and labels. At the + moment there are buttons for moving to the next and previous slide and + to the next effect. A label displayes the index of the current slide + and the total number of slides. + + In the future this set of controls may be extended. Declaration of the + control set could be made more flexible and more easy (e.g. via the + configuration to avoid the need to recompile this class.) +*/ +class PresenterToolBar + : private ::cppu::BaseMutex, + public PresenterToolBarInterfaceBase +{ +public: + explicit PresenterToolBar ( + const css::uno::Reference& rxContext, + const css::uno::Reference& rxViewId, + const css::uno::Reference& rxController, + const ::rtl::Reference& rpPresenterController); + virtual ~PresenterToolBar (void); + + virtual void SAL_CALL disposing (void); + + // lang::XEventListener + + virtual void SAL_CALL + disposing (const css::lang::EventObject& rEventObject) + throw (css::uno::RuntimeException); + + + // XWindowListener + + virtual void SAL_CALL windowResized (const css::awt::WindowEvent& rEvent) + throw (css::uno::RuntimeException); + + virtual void SAL_CALL windowMoved (const css::awt::WindowEvent& rEvent) + throw (css::uno::RuntimeException); + + virtual void SAL_CALL windowShown (const css::lang::EventObject& rEvent) + throw (css::uno::RuntimeException); + + virtual void SAL_CALL windowHidden (const css::lang::EventObject& rEvent) + throw (css::uno::RuntimeException); + + + // XPaintListener + + virtual void SAL_CALL windowPaint (const css::awt::PaintEvent& rEvent) + throw (css::uno::RuntimeException); + + + // XMouseListener + + virtual void SAL_CALL mousePressed (const css::awt::MouseEvent& rEvent) + throw (css::uno::RuntimeException); + + virtual void SAL_CALL mouseReleased (const css::awt::MouseEvent& rEvent) + throw (css::uno::RuntimeException); + + virtual void SAL_CALL mouseEntered (const css::awt::MouseEvent& rEvent) + throw (css::uno::RuntimeException); + + virtual void SAL_CALL mouseExited (const css::awt::MouseEvent& rEvent) + throw (css::uno::RuntimeException); + + + // XMouseMotionListener + + virtual void SAL_CALL mouseMoved (const css::awt::MouseEvent& rEvent) + throw (css::uno::RuntimeException); + + virtual void SAL_CALL mouseDragged (const css::awt::MouseEvent& rEvent) + throw (css::uno::RuntimeException); + + + // XResourceId + + virtual css::uno::Reference SAL_CALL getResourceId (void) + throw (css::uno::RuntimeException); + + virtual sal_Bool SAL_CALL isAnchorOnly (void) + throw (com::sun::star::uno::RuntimeException); + + + // XDrawView + + virtual void SAL_CALL setCurrentPage ( + const css::uno::Reference& rxSlide) + throw (css::uno::RuntimeException); + + virtual css::uno::Reference SAL_CALL getCurrentPage (void) + throw (css::uno::RuntimeException); + + class Element; + +private: + + css::uno::Reference mxComponentContext; + css::uno::Reference mxPane; + css::uno::Reference mxViewId; + css::uno::Reference mxCanvas; + + typedef ::std::vector > ElementContainer; + ElementContainer maElementContainer; + css::uno::Reference mxWindow; + css::uno::Reference mxControl; + css::uno::Reference mxCurrentSlide; + css::uno::Reference mxSlideShowController; + ::rtl::Reference mpPresenterController; + ::rtl::OUString msPreviousButtonBitmapURL; + ::rtl::OUString msNextButtonBitmapURL; + ::boost::scoped_ptr mpIconContainer; + + void CreateControls (void); + void Resize (void); + void Clear ( + const css::awt::Rectangle& rUpdateBox, + const css::rendering::ViewState& rViewState); + void Paint ( + const css::awt::Rectangle& rUpdateBox, + const css::rendering::ViewState& rViewState); + + void UpdateSlideNumber (void); + + void CheckMouseOver ( + const css::awt::MouseEvent& rEvent, + const bool bOverWindow, + const bool bMouseDown=false); + + void GotoPreviousSlide (void); + void GotoNextSlide (void); + void GotoNextEffect (void); + + /** This method throws a DisposedException when the object has already been + disposed. + */ + void ThrowIfDisposed (void) const + throw (css::lang::DisposedException); +}; + +} } // end of namespace ::sdext::presenter + +#endif -- cgit From 5a53c0aba91789b858ccd2cd1547f4a7e53d7f6b Mon Sep 17 00:00:00 2001 From: Rüdiger Timm Date: Fri, 11 Apr 2008 10:40:04 +0000 Subject: INTEGRATION: CWS changefileheaderm6 (1.2.2); FILE MERGED 2008/04/09 16:07:37 rt 1.2.2.1: #i87884# Change license header to LPGL v3. --- sdext/source/presenter/PresenterToolBar.hxx | 40 +++++++++++++---------------- 1 file changed, 18 insertions(+), 22 deletions(-) (limited to 'sdext/source/presenter/PresenterToolBar.hxx') diff --git a/sdext/source/presenter/PresenterToolBar.hxx b/sdext/source/presenter/PresenterToolBar.hxx index 9c0cd3ba4b86..61ec9a8c19c0 100644 --- a/sdext/source/presenter/PresenterToolBar.hxx +++ b/sdext/source/presenter/PresenterToolBar.hxx @@ -1,35 +1,31 @@ /************************************************************************* * - * OpenOffice.org - a multi-platform office productivity suite + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * $RCSfile: PresenterToolBar.hxx,v $ + * Copyright 2008 by Sun Microsystems, Inc. * - * $Revision: 1.2 $ + * OpenOffice.org - a multi-platform office productivity suite * - * last change: $Author: kz $ $Date: 2008-04-03 16:06:39 $ + * $RCSfile: PresenterToolBar.hxx,v $ * - * The Contents of this file are made available subject to - * the terms of GNU Lesser General Public License Version 2.1. + * $Revision: 1.3 $ * + * This file is part of OpenOffice.org. * - * GNU Lesser General Public License Version 2.1 - * ============================================= - * Copyright 2005 by Sun Microsystems, Inc. - * 901 San Antonio Road, Palo Alto, CA 94303, USA + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. * ************************************************************************/ -- cgit From 12e6fc7fcea65337597894e335ca7231aefc7d9a Mon Sep 17 00:00:00 2001 From: Vladimir Glazounov Date: Tue, 13 May 2008 13:40:09 +0000 Subject: INTEGRATION: CWS presenterscreen (1.2.4); FILE MERGED 2008/04/23 11:59:53 af 1.2.4.4: #i18486# Fixed mixup of uno/rtl References and boost::shared_ptrs. 2008/04/22 08:36:00 af 1.2.4.3: #i18486# Split initialization off the PresenterToolBar constructor. 2008/04/22 08:24:53 af 1.2.4.2: RESYNC: (1.2-1.3); FILE MERGED 2008/04/16 16:11:13 af 1.2.4.1: #i18486# Tool bar entries can be vertical stacks of other entries. --- sdext/source/presenter/PresenterToolBar.hxx | 184 +++++++++++++++++++++------- 1 file changed, 143 insertions(+), 41 deletions(-) (limited to 'sdext/source/presenter/PresenterToolBar.hxx') diff --git a/sdext/source/presenter/PresenterToolBar.hxx b/sdext/source/presenter/PresenterToolBar.hxx index 61ec9a8c19c0..8657843c69ce 100644 --- a/sdext/source/presenter/PresenterToolBar.hxx +++ b/sdext/source/presenter/PresenterToolBar.hxx @@ -8,7 +8,7 @@ * * $RCSfile: PresenterToolBar.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * * This file is part of OpenOffice.org. * @@ -33,9 +33,11 @@ #define SDEXT_PRESENTER_TOOL_BAR_HXX #include "PresenterController.hxx" +#include "PresenterViewFactory.hxx" #include -#include +#include +#include #include #include #include @@ -53,48 +55,72 @@ #include #include #include +#include #include +#include +#include namespace css = ::com::sun::star; namespace { - typedef cppu::WeakComponentImplHelper6< + typedef cppu::WeakComponentImplHelper5< css::awt::XWindowListener, css::awt::XPaintListener, css::awt::XMouseListener, css::awt::XMouseMotionListener, - css::drawing::framework::XView, css::drawing::XDrawView > PresenterToolBarInterfaceBase; + + typedef cppu::WeakComponentImplHelper3< + css::awt::XPaintListener, + css::drawing::framework::XView, + css::drawing::XDrawView + > PresenterToolBarViewInterfaceBase; } namespace sdext { namespace presenter { -class PresenterBitmapContainer; - /** A simple tool bar that can display bitmapped buttons and labels. At the moment there are buttons for moving to the next and previous slide and to the next effect. A label displayes the index of the current slide and the total number of slides. - - In the future this set of controls may be extended. Declaration of the - control set could be made more flexible and more easy (e.g. via the - configuration to avoid the need to recompile this class.) */ class PresenterToolBar : private ::cppu::BaseMutex, - public PresenterToolBarInterfaceBase + private ::boost::noncopyable, + public PresenterToolBarInterfaceBase, + public CachablePresenterView { public: - explicit PresenterToolBar ( + typedef ::boost::function Action; + + enum Anchor { Left, Center, Right }; + + PresenterToolBar ( const css::uno::Reference& rxContext, - const css::uno::Reference& rxViewId, - const css::uno::Reference& rxController, - const ::rtl::Reference& rpPresenterController); + const css::uno::Reference& rxWindow, + const css::uno::Reference& rxCanvas, + const ::rtl::Reference& rpPresenterController, + const Anchor eAnchor); virtual ~PresenterToolBar (void); + void Initialize ( + const ::rtl::OUString& rsConfigurationPath); + virtual void SAL_CALL disposing (void); + void InvalidateArea ( + const css::awt::Rectangle& rRepaintBox, + const bool bSynchronous); + sal_Int32 GetSlideCount (void); + sal_Int32 GetCurrentSlideIndex (void); + void RequestLayout (void); + css::geometry::RealSize2D GetSize (void); + css::geometry::RealSize2D GetMinimalSize (void); + ::rtl::Reference GetPresenterController (void) const; + css::uno::Reference GetWindow (void) const; + css::uno::Reference GetComponentContext (void) const; + // lang::XEventListener virtual void SAL_CALL @@ -147,15 +173,6 @@ public: throw (css::uno::RuntimeException); - // XResourceId - - virtual css::uno::Reference SAL_CALL getResourceId (void) - throw (css::uno::RuntimeException); - - virtual sal_Bool SAL_CALL isAnchorOnly (void) - throw (com::sun::star::uno::RuntimeException); - - // XDrawView virtual void SAL_CALL setCurrentPage ( @@ -165,28 +182,42 @@ public: virtual css::uno::Reference SAL_CALL getCurrentPage (void) throw (css::uno::RuntimeException); - class Element; + class Context; private: - css::uno::Reference mxComponentContext; - css::uno::Reference mxPane; - css::uno::Reference mxViewId; - css::uno::Reference mxCanvas; - typedef ::std::vector > ElementContainer; + class ElementContainerPart; + typedef ::boost::shared_ptr SharedElementContainerPart; + typedef ::std::vector ElementContainer; ElementContainer maElementContainer; + SharedElementContainerPart mpCurrentContainerPart; css::uno::Reference mxWindow; - css::uno::Reference mxControl; - css::uno::Reference mxCurrentSlide; + css::uno::Reference mxCanvas; css::uno::Reference mxSlideShowController; + css::uno::Reference mxCurrentSlide; ::rtl::Reference mpPresenterController; - ::rtl::OUString msPreviousButtonBitmapURL; - ::rtl::OUString msNextButtonBitmapURL; - ::boost::scoped_ptr mpIconContainer; - - void CreateControls (void); - void Resize (void); + bool mbIsLayoutPending; + const Anchor meAnchor; + css::geometry::RealRectangle2D maBoundingBox; + /** The minimal size that is necessary to display all elements without + overlap and with minimal gaps between them. + */ + css::geometry::RealSize2D maMinimalSize; + + void CreateControls ( + const ::rtl::OUString& rsConfigurationPath); + void Layout (const css::uno::Reference& rxCanvas); + css::geometry::RealSize2D CalculatePartSize ( + const css::uno::Reference& rxCanvas, + const SharedElementContainerPart& rpPart, + const bool bIsHorizontal); + void LayoutPart ( + const css::uno::Reference& rxCanvas, + const SharedElementContainerPart& rpPart, + const css::geometry::RealRectangle2D& rBoundingBox, + const css::geometry::RealSize2D& rPartSize, + const bool bIsHorizontal); void Clear ( const css::awt::Rectangle& rUpdateBox, const css::rendering::ViewState& rViewState); @@ -201,9 +232,80 @@ private: const bool bOverWindow, const bool bMouseDown=false); - void GotoPreviousSlide (void); - void GotoNextSlide (void); - void GotoNextEffect (void); + void ProcessEntry ( + const ::css::uno::Reference& rProperties, + Context& rContext); + + /** This method throws a DisposedException when the object has already been + disposed. + */ + void ThrowIfDisposed (void) const + throw (css::lang::DisposedException); +}; + + + + +/** View for the PresenterToolBar. +*/ +class PresenterToolBarView + : private ::cppu::BaseMutex, + private ::boost::noncopyable, + public PresenterToolBarViewInterfaceBase +{ +public: + explicit PresenterToolBarView ( + const css::uno::Reference& rxContext, + const css::uno::Reference& rxViewId, + const css::uno::Reference& rxController, + const ::rtl::Reference& rpPresenterController); + virtual ~PresenterToolBarView (void); + + virtual void SAL_CALL disposing (void); + + ::rtl::Reference GetPresenterToolBar (void) const; + + + // XPaintListener + + virtual void SAL_CALL windowPaint (const css::awt::PaintEvent& rEvent) + throw (css::uno::RuntimeException); + + + // lang::XEventListener + + virtual void SAL_CALL + disposing (const css::lang::EventObject& rEventObject) + throw (css::uno::RuntimeException); + + + // XResourceId + + virtual css::uno::Reference SAL_CALL getResourceId (void) + throw (css::uno::RuntimeException); + + virtual sal_Bool SAL_CALL isAnchorOnly (void) + throw (com::sun::star::uno::RuntimeException); + + + // XDrawView + + virtual void SAL_CALL setCurrentPage ( + const css::uno::Reference& rxSlide) + throw (css::uno::RuntimeException); + + virtual css::uno::Reference SAL_CALL getCurrentPage (void) + throw (css::uno::RuntimeException); + +private: + // css::uno::Reference mxComponentContext; + css::uno::Reference mxPane; + css::uno::Reference mxViewId; + css::uno::Reference mxWindow; + css::uno::Reference mxCanvas; + ::rtl::Reference mpPresenterController; + css::uno::Reference mxSlideShowController; + ::rtl::Reference mpToolBar; /** This method throws a DisposedException when the object has already been disposed. -- cgit From 4326ef06febe54729620f31d18505fd9f847a7f1 Mon Sep 17 00:00:00 2001 From: Jens-Heiner Rechtien Date: Fri, 12 Feb 2010 15:01:35 +0100 Subject: changefileheader2: #i109125#: change source file copyright notice from Sun Microsystems to Oracle; remove CVS style keywords (RCSfile, Revision) --- sdext/source/presenter/PresenterToolBar.hxx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'sdext/source/presenter/PresenterToolBar.hxx') diff --git a/sdext/source/presenter/PresenterToolBar.hxx b/sdext/source/presenter/PresenterToolBar.hxx index 8657843c69ce..bb8b83f7dec3 100644 --- a/sdext/source/presenter/PresenterToolBar.hxx +++ b/sdext/source/presenter/PresenterToolBar.hxx @@ -2,14 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: PresenterToolBar.hxx,v $ - * - * $Revision: 1.4 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify -- cgit From 0b468b7e7dcff4492a74582ef9482f6f0cc13c7c Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 27 Oct 2010 12:45:53 +0100 Subject: add modelines to .hxx files as well --- sdext/source/presenter/PresenterToolBar.hxx | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sdext/source/presenter/PresenterToolBar.hxx') diff --git a/sdext/source/presenter/PresenterToolBar.hxx b/sdext/source/presenter/PresenterToolBar.hxx index bb8b83f7dec3..d4dbf2ac1048 100644 --- a/sdext/source/presenter/PresenterToolBar.hxx +++ b/sdext/source/presenter/PresenterToolBar.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -313,3 +314,5 @@ private: } } // end of namespace ::sdext::presenter #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit