diff options
Diffstat (limited to 'svx/inc/svx/sdr/contact')
44 files changed, 4372 insertions, 0 deletions
diff --git a/svx/inc/svx/sdr/contact/displayinfo.hxx b/svx/inc/svx/sdr/contact/displayinfo.hxx new file mode 100644 index 000000000000..777e0abdd09b --- /dev/null +++ b/svx/inc/svx/sdr/contact/displayinfo.hxx @@ -0,0 +1,129 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_CONTACT_DISPLAYINFO_HXX +#define _SDR_CONTACT_DISPLAYINFO_HXX + +#include <sal/types.h> +#include <svx/svdsob.hxx> +#include <svtools/colorcfg.hxx> +#include <vcl/region.hxx> +#include <vector> +#include "svx/svxdllapi.h" + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +class SdrPage; + +namespace sdr { namespace contact { + class ViewObjectContact; +}} + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class SVX_DLLPUBLIC DisplayInfo + { + protected: + // The Layers which shall be processed (visible) + SetOfByte maProcessLayers; + + // The redraw area, in logical coordinates of OutputDevice. If Region + // is empty, everything needs to be redrawn + Region maRedrawArea; + + // bitfield + + // Internal flag to know when the control layer is painted. Default is + // false. If set to true, painting of the page, page borders and + // the rasters will be suppressed as if mbPageProcessingActive is set (see there). + // This flag is set internally from the processing mechanism to avoid double page + // painting when the control layer needs to be painted as last layer + unsigned mbControlLayerProcessingActive : 1; + + // Internal flag to decide if page stuff (background, border, MasterPage, grid, etc...) + // will be processed at all. This flag is user-defined and will not be changed from the + // processing mechanism. Default is true, thus set to false if PagePainting should be suppressed. + // For more granular switching page stuff painting on and off, use the according flags at the + // view (->Is*Visible()) + unsigned mbPageProcessingActive : 1; + + // Internal flag to remember if EnteredGroupDrawMode is active. Default is true + // since this mode starts activated and gets switched off when reacing + // the current group level. Should only be changed by instances which do + // primitive processing + unsigned mbGhostedDrawModeActive : 1; + + // Internal flag to know if a MasterPage is processed as SubContent of another + // page. Initialized to false, this should only be changed from the instance which + // is processing the MasterPage asSubContent and knows what it does + unsigned mbSubContentActive : 1; + + public: + // basic constructor. + DisplayInfo(); + + // destructor + virtual ~DisplayInfo(); + + // access to ProcessLayers + void SetProcessLayers(const SetOfByte& rSet); + const SetOfByte& GetProcessLayers() const { return maProcessLayers; } + + // access to RedrawArea + void SetRedrawArea(const Region& rRegion); + const Region& GetRedrawArea() const { return maRedrawArea; } + + // Access to ControlLayerProcessingActive flag + void SetControlLayerProcessingActive(bool bDoPaint); + bool GetControlLayerProcessingActive() const { return mbControlLayerProcessingActive; } + + // Access to PageProcessingActive flag + void SetPageProcessingActive(bool bDoPaint); + bool GetPageProcessingActive() const { return mbPageProcessingActive; } + + // Save the original DrawMode from outdev + void ClearGhostedDrawMode(); + void SetGhostedDrawMode(); + bool IsGhostedDrawModeActive() const { return mbGhostedDrawModeActive; } + + // access to master page painting flag + bool GetSubContentActive() const { return mbSubContentActive; } + void SetSubContentActive(bool bNew); + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_CONTACT_DISPLAYINFO_HXX + +// eof diff --git a/svx/inc/svx/sdr/contact/objectcontact.hxx b/svx/inc/svx/sdr/contact/objectcontact.hxx new file mode 100644 index 000000000000..d88ea3dc2a12 --- /dev/null +++ b/svx/inc/svx/sdr/contact/objectcontact.hxx @@ -0,0 +1,229 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_CONTACT_OBJECTCONTACT_HXX +#define _SDR_CONTACT_OBJECTCONTACT_HXX + +#include <svx/sdr/animation/objectanimator.hxx> +#include "svx/svxdllapi.h" +#include <drawinglayer/geometry/viewinformation2d.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +class SetOfByte; +class Rectangle; +class SdrPageView; +class OutputDevice; + +namespace sdr { namespace contact { + class DisplayInfo; + class ViewContact; + class ViewObjectContactRedirector; +}} + +namespace sdr { namespace event { + class TimerEventHandler; +}} + +namespace basegfx { + class B2DRange; + class B2DHomMatrix; +} + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class SVX_DLLPUBLIC ObjectContact + { + private: + // make ViewObjectContact a friend to exclusively allow it to use + // AddViewObjectContact/RemoveViewObjectContact + friend class ViewObjectContact; + + // All VOCs which are created using this OC, thus remembering this OC + // as a reference. All those VOCs need to be deleted when the OC goes down. + // Registering and de-registering is done in the VOC constructors/destructors. + std::vector< ViewObjectContact* > maViewObjectContactVector; + + // A new ViewObjectContact was created and shall be remembered. + void AddViewObjectContact(ViewObjectContact& rVOContact); + + // A ViewObjectContact was deleted and shall be forgotten. + virtual void RemoveViewObjectContact(ViewObjectContact& rVOContact); + + // the primitiveAnimator which is used if this View and/or the contained primitives + // support animatedSwitchPrimitives + sdr::animation::primitiveAnimator maPrimitiveAnimator; + + // the EventHandler for e.g. asynchronious loading of graphics + sdr::event::TimerEventHandler* mpEventHandler; + + // The redirector. If set it is used to pipe all supported calls + // to the redirector + ViewObjectContactRedirector* mpViewObjectContactRedirector; + + // the Primitive2DParameters containing view information + drawinglayer::geometry::ViewInformation2D maViewInformation2D; + + // bitfield + // flag for preview renderer + unsigned mbIsPreviewRenderer : 1; + + // method to create a EventHandler. Needs to give a result. + sdr::event::TimerEventHandler* CreateEventHandler(); + + protected: + // Interface to allow derivates to travel over the registered VOC's + sal_uInt32 getViewObjectContactCount() const { return maViewObjectContactVector.size(); } + ViewObjectContact* getViewObjectContact(sal_uInt32 a) const { return maViewObjectContactVector[a]; } + + // interface to allow derivates to set PreviewRenderer flag + void setPreviewRenderer(bool bNew) { mbIsPreviewRenderer = bNew; } + + // interface to allow derivates to set ViewInformation2D + void updateViewInformation2D(const drawinglayer::geometry::ViewInformation2D& rViewInformation2D) { maViewInformation2D = rViewInformation2D; } + + public: + // basic constructor + ObjectContact(); + virtual ~ObjectContact(); + + // LazyInvalidate request. This is used from the VOCs to mark that they + // got invalidated by an ActionCanged() call. An active view needs to remember + // this and take action on it. Default implementation directly calls back + // triggerLazyInvalidate() wich promptly handles the request + virtual void setLazyInvalidate(ViewObjectContact& rVOC); + + // call this to support evtl. preparations for repaint. Default does nothing + virtual void PrepareProcessDisplay(); + + // Process the whole displaying + virtual void ProcessDisplay(DisplayInfo& rDisplayInfo); + + // test if visualizing of entered groups is switched on at all. Default + // implementation returns sal_False. + virtual bool DoVisualizeEnteredGroup() const; + + // get active group's (the entered group) ViewContact + virtual const ViewContact* getActiveViewContact() const; + + // Invalidate given rectangle at the window/output which is represented by + // this ObjectContact. Default does nothing. + virtual void InvalidatePartOfView(const basegfx::B2DRange& rRange) const; + + // Get info if given Rectangle is visible in this view + virtual bool IsAreaVisible(const basegfx::B2DRange& rRange) const; + + // Get info about the need to visualize GluePoints. The default + // is that it is not necessary. + virtual bool AreGluePointsVisible() const; + + // method to get the primitiveAnimator + sdr::animation::primitiveAnimator& getPrimitiveAnimator(); + + // method to get the EventHandler. It will + // return a existing one or create a new one using CreateEventHandler(). + sdr::event::TimerEventHandler& GetEventHandler() const; + + // delete the EventHandler + void DeleteEventHandler(); + + // test if there is an EventHandler without creating one on demand + bool HasEventHandler() const; + + // check if text animation is allowed. Default is sal_true. + virtual bool IsTextAnimationAllowed() const; + + // check if graphic animation is allowed. Default is sal_true. + virtual bool IsGraphicAnimationAllowed() const; + + // check if asynchronious graphis loading is allowed. Default is sal_False. + virtual bool IsAsynchronGraphicsLoadingAllowed() const; + + // access to ViewObjectContactRedirector + ViewObjectContactRedirector* GetViewObjectContactRedirector() const; + void SetViewObjectContactRedirector(ViewObjectContactRedirector* pNew); + + // check if buffering of MasterPages is allowed. Default is sal_False. + virtual bool IsMasterPageBufferingAllowed() const; + + // print? Default is false + virtual bool isOutputToPrinter() const; + + // window? Default is true + virtual bool isOutputToWindow() const; + + // VirtualDevice? Default is false + virtual bool isOutputToVirtualDevice() const; + + // recording MetaFile? Default is false + virtual bool isOutputToRecordingMetaFile() const; + + // pdf export? Default is false + virtual bool isOutputToPDFFile() const; + + // gray display mode + virtual bool isDrawModeGray() const; + + // gray display mode + virtual bool isDrawModeBlackWhite() const; + + // high contrast display mode + virtual bool isDrawModeHighContrast() const; + + // check if this is a preview renderer. Default is sal_False. + bool IsPreviewRenderer() const { return mbIsPreviewRenderer; } + + // get Primitive2DParameters for this view + const drawinglayer::geometry::ViewInformation2D& getViewInformation2D() const { return maViewInformation2D; } + + // access to SdrPageView. May return 0L like the default implementations do. Needs to be overloaded as needed. + virtual SdrPageView* TryToGetSdrPageView() const; + + // access to OutputDevice. May return 0L like the default implementations do. Needs to be overloaded as needed. + virtual OutputDevice* TryToGetOutputDevice() const; + + // reset ViewPort at internal ViewInformation2D. This is needed when the OC is used + // not for ProcessDisplay() but to get a VOC associated with it. When trying to get + // a sequence of primitives from the VOC then, the last initialized ViewPort from + // the last ProcessDisplay() is used for geometric visibility testing. If this is not + // wanted (like in such cases) this method is used. It will reuse the current + // ViewInformation2D, but clear the ViewPort (no ViewPort means all is visible) + void resetViewPort(); + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_CONTACT_OBJECTCONTACT_HXX + +// eof diff --git a/svx/inc/svx/sdr/contact/objectcontactofobjlistpainter.hxx b/svx/inc/svx/sdr/contact/objectcontactofobjlistpainter.hxx new file mode 100644 index 000000000000..870192c9b151 --- /dev/null +++ b/svx/inc/svx/sdr/contact/objectcontactofobjlistpainter.hxx @@ -0,0 +1,153 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_CONTACT_OBJECTCONTACTOFOBJLISTPAINTER_HXX +#define _SDR_CONTACT_OBJECTCONTACTOFOBJLISTPAINTER_HXX + +#include <svx/sdr/contact/objectcontact.hxx> +#include "svx/svxdllapi.h" +#include <svx/svdpage.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +class SdrPage; +class SdrObject; + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class SVX_DLLPUBLIC ObjectContactPainter : public ObjectContact + { + protected: + // Hierarchy access methods + virtual sal_uInt32 GetPaintObjectCount() const = 0; + virtual ViewContact& GetPaintObjectViewContact(sal_uInt32 nIndex) const = 0; + + public: + // basic constructor/destructor + ObjectContactPainter(); + virtual ~ObjectContactPainter(); + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + // typedef for transferring SdrObject + typedef ::std::vector< SdrObject* > SdrObjectVector; + + class SVX_DLLPUBLIC ObjectContactOfObjListPainter : public ObjectContactPainter + { + protected: + // Target OutputDevice + OutputDevice& mrTargetOutputDevice; + + // Set StartPoint for next run, also given in constructor + SdrObjectVector maStartObjects; + + // the processed page which is the base e.g. for PageNumberFields + const SdrPage* mpProcessedPage; + + // Hierarchy access methods + virtual sal_uInt32 GetPaintObjectCount() const; + virtual ViewContact& GetPaintObjectViewContact(sal_uInt32 nIndex) const; + + public: + // basic constructor/destructor + ObjectContactOfObjListPainter( + OutputDevice& rTargetDevice, + const SdrObjectVector& rObjects, + const SdrPage* pProcessedPage); + virtual ~ObjectContactOfObjListPainter(); + + // Process the whole displaying + virtual void ProcessDisplay(DisplayInfo& rDisplayInfo); + + // VirtualDevice? Default is false + virtual bool isOutputToVirtualDevice() const; + + // recording MetaFile? Default is false + virtual bool isOutputToRecordingMetaFile() const; + + // pdf export? Default is false + virtual bool isOutputToPDFFile() const; + + // access to OutputDevice. May return 0L like the default implementations do. Needs to be overloaded as needed. + virtual OutputDevice* TryToGetOutputDevice() const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class ObjectContactOfPagePainter : public ObjectContactPainter + { + protected: + // the original ObjectContact this painter is working on + ObjectContact& mrOriginalObjectContact; + + // Set StartPoint for next run, also given in constructor + SdrPageWeakRef mxStartPage; + + // Hierarchy access methods + virtual sal_uInt32 GetPaintObjectCount() const; + virtual ViewContact& GetPaintObjectViewContact(sal_uInt32 nIndex) const; + + public: + // basic constructor + ObjectContactOfPagePainter( + const SdrPage* pPage, + ObjectContact& rOriginalObjectContact); + virtual ~ObjectContactOfPagePainter(); + + // set another page + void SetStartPage(const SdrPage* pPage); + const SdrPage* GetStartPage() const { return mxStartPage.get(); } + + // access to OutputDevice. May return 0L like the default implementations do. Needs to be overloaded as needed. + virtual OutputDevice* TryToGetOutputDevice() const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_CONTACT_OBJECTCONTACTOFOBJLISTPAINTER_HXX + +// eof diff --git a/svx/inc/svx/sdr/contact/objectcontactofpageview.hxx b/svx/inc/svx/sdr/contact/objectcontactofpageview.hxx new file mode 100644 index 000000000000..fc0a51c9eea8 --- /dev/null +++ b/svx/inc/svx/sdr/contact/objectcontactofpageview.hxx @@ -0,0 +1,153 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_CONTACT_OBJECTCONTACTOFPAGEVIEW_HXX +#define _SDR_CONTACT_OBJECTCONTACTOFPAGEVIEW_HXX + +#include <svx/sdr/contact/objectcontact.hxx> +#include <tools/gen.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +class SdrPageWindow; +class SdrPage; + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class ObjectContactOfPageView : public ObjectContact, public Timer + { + protected: + // the owner of this ObjectContactOfPageView. Set from constructor and not + // to be changed in any way. + SdrPageWindow& mrPageWindow; + + // Process the whole displaying, the real version + void DoProcessDisplay(DisplayInfo& rDisplayInfo); + + public: + // access to SdrPageWindow + SdrPageWindow& GetPageWindow() const { return mrPageWindow; } + + // access to SdrPage of PageView + SdrPage* GetSdrPage() const; + + // basic constructor, used from SdrPageView. + ObjectContactOfPageView(SdrPageWindow& rPageWindow); + virtual ~ObjectContactOfPageView(); + + // LazyInvalidate request. This is used from the VOCs to mark that they + // got invalidated by an ActionCanged() call. An active view needs to remember + // this and take action on it. Default implementation directly calls back + // triggerLazyInvalidate() wich promptly handles the request + virtual void setLazyInvalidate(ViewObjectContact& rVOC); + + // call this to support evtl. preparations for repaint + virtual void PrepareProcessDisplay(); + + // From baseclass Timer, the timeout call triggered by te LazyInvalidate mechanism + virtual void Timeout(); + + // Process the whole displaying + virtual void ProcessDisplay(DisplayInfo& rDisplayInfo); + + // test if visualizing of entered groups is switched on at all + virtual bool DoVisualizeEnteredGroup() const; + + // get active group's (the entered group) ViewContact + virtual const ViewContact* getActiveViewContact() const; + + // Invalidate given rectangle at the window/output which is represented by + // this ObjectContact. + virtual void InvalidatePartOfView(const basegfx::B2DRange& rRange) const; + + // Get info if given Rectangle is visible in this view + virtual bool IsAreaVisible(const basegfx::B2DRange& rRange) const; + + // Get info about the need to visualize GluePoints. The default + // is that it is not necessary. + virtual bool AreGluePointsVisible() const; + + // check if text animation is allowed. + virtual bool IsTextAnimationAllowed() const; + + // check if graphic animation is allowed. + virtual bool IsGraphicAnimationAllowed() const; + + // check if asynchronious graphis loading is allowed. Default is sal_False. + virtual bool IsAsynchronGraphicsLoadingAllowed() const; + + // check if buffering of MasterPages is allowed. Default is sal_False. + virtual bool IsMasterPageBufferingAllowed() const; + + // print? Default is false + virtual bool isOutputToPrinter() const; + + // window? Default is true + virtual bool isOutputToWindow() const; + + // VirtualDevice? Default is false + virtual bool isOutputToVirtualDevice() const; + + // recording MetaFile? Default is false + virtual bool isOutputToRecordingMetaFile() const; + + // pdf export? Default is false + virtual bool isOutputToPDFFile() const; + + // gray display mode + virtual bool isDrawModeGray() const; + + // gray display mode + virtual bool isDrawModeBlackWhite() const; + + // high contrast display mode + virtual bool isDrawModeHighContrast() const; + + // overloaded access to SdrPageView + virtual SdrPageView* TryToGetSdrPageView() const; + + // access to OutputDevice. May return 0L like the default implementations do. Needs to be overloaded as needed. + virtual OutputDevice* TryToGetOutputDevice() const; + + /** sets all UNO controls which are associated with this ObjectContact to + design or alive mode. + */ + void SetUNOControlsDesignMode( bool _bDesignMode ) const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_CONTACT_OBJECTCONTACTOFPAGEVIEW_HXX + +// eof diff --git a/svx/inc/svx/sdr/contact/objectcontacttools.hxx b/svx/inc/svx/sdr/contact/objectcontacttools.hxx new file mode 100644 index 000000000000..b7f22868ec57 --- /dev/null +++ b/svx/inc/svx/sdr/contact/objectcontacttools.hxx @@ -0,0 +1,62 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_CONTACT_OBJECTCONTACTTOOLS_HXX +#define _SDR_CONTACT_OBJECTCONTACTTOOLS_HXX + +#include <drawinglayer/geometry/viewinformation2d.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +class OutputDevice; + +namespace drawinglayer { namespace processor2d { + class BaseProcessor2D; +}} + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + // create a mating VCL-Provessor for given OutputDevice. This includes + // looking for MetaFile-recording. The returned renderer changes owner, + // deletion is duty of the caller + drawinglayer::processor2d::BaseProcessor2D* createBaseProcessor2DFromOutputDevice( + OutputDevice& rTargetOutDev, + const drawinglayer::geometry::ViewInformation2D& rViewInformation2D); + + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_CONTACT_OBJECTCONTACTTOOLS_HXX + +// eof diff --git a/svx/inc/svx/sdr/contact/viewcontact.hxx b/svx/inc/svx/sdr/contact/viewcontact.hxx new file mode 100644 index 000000000000..f4675f2728fc --- /dev/null +++ b/svx/inc/svx/sdr/contact/viewcontact.hxx @@ -0,0 +1,172 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_CONTACT_VIEWCONTACT_HXX +#define _SDR_CONTACT_VIEWCONTACT_HXX + +#include <sal/types.h> +#include <tools/gen.hxx> +#include "svx/svxdllapi.h" +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +class SetOfByte; +class SdrPage; +class SdrObject; + +namespace sdr +{ + namespace contact + { + class ObjectContact; + class ViewObjectContact; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class SVX_DLLPUBLIC ViewContact + { + private: + // make ViewObjectContact a friend to exclusively allow it to use + // AddViewObjectContact/RemoveViewObjectContact + friend class ViewObjectContact; + + // List of ViewObjectContacts. This contains all VOCs which were constructed + // with this VC. Since the VOCs remember a reference to this VC, this list needs + // to be kept and is used e.g. at destructor to destroy all VOCs. + // Registering and de-registering is done in the VOC constructors/destructors. + std::vector< ViewObjectContact* > maViewObjectContactVector; + + // Primitive2DSequence of the ViewContact. This contains all necessary information + // for the graphical visualisation and needs to be supported by all VCs which + // can be visualized. + drawinglayer::primitive2d::Primitive2DSequence mxViewIndependentPrimitive2DSequence; + + // A new ViewObjectContact was created and shall be remembered. + void AddViewObjectContact(ViewObjectContact& rVOContact); + + // A ViewObjectContact was deleted and shall be forgotten. + void RemoveViewObjectContact(ViewObjectContact& rVOContact); + + // internal tooling to delete VOCs + void deleteAllVOCs(); + + protected: + // Interface to allow derivates to travel over the registered VOC's + sal_uInt32 getViewObjectContactCount() const { return maViewObjectContactVector.size(); } + ViewObjectContact* getViewObjectContact(sal_uInt32 a) const { return maViewObjectContactVector[a]; } + + // Create a Object-Specific ViewObjectContact, set ViewContact and + // ObjectContact. Always needs to return something. Default is to create + // a standard ViewObjectContact containing the given ObjectContact and *this + virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact); + + // This method is responsible for creating the graphical visualisation data derived ONLY from + // the model data. It will be stored/buffered in mxViewIndependentPrimitive2DSequence. The default implementation + // creates a yellow replacement rectangle (1000, 1000, 5000, 3000) to visualize missing + // implementations. All implementations have to provide basic geometry here, this is the central + // visualisation method and will also be used for BoundRect computations in the long run. + // This means it's always an error when the default implementation is called and thus gets + // asserted there + virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const; + + // method for flushing View Independent Primitive2DSequence for VOC implementations + void flushViewIndependentPrimitive2DSequence() { mxViewIndependentPrimitive2DSequence.realloc(0); } + + // basic constructor. Since this is a base class only, it shall + // never be called directly + ViewContact(); + + // Methods to react on start getting viewed or stop getting + // viewed. This info is derived from the count of members of + // registered ViewObjectContacts. Default does nothing. + virtual void StartGettingViewed(); + virtual void StopGettingViewed(); + + public: + // basic destructor with needed cleanups + virtual ~ViewContact(); + + // get a Object-specific ViewObjectContact for a specific + // ObjectContact (->View). Always needs to return something. + ViewObjectContact& GetViewObjectContact(ObjectContact& rObjectContact); + + // Test if this ViewContact has ViewObjectContacts at all. This can + // be used to test if this ViewContact is visualized ATM or not + bool HasViewObjectContacts(bool bExcludePreviews = false) const; + + // Check if this primitive is animated in any OC (View) which means it has + // generated a PrimitiveAnimation in it's VOC + bool isAnimatedInAnyViewObjectContact() const; + + // Access to possible sub-hierarchy and parent. GetObjectCount() default is 0L + // and GetViewContact default pops up an assert since it's an error if + // GetObjectCount has a result != 0 and it's not overloaded. + virtual sal_uInt32 GetObjectCount() const; + virtual ViewContact& GetViewContact(sal_uInt32 nIndex) const; + virtual ViewContact* GetParentContact() const; + + // React on insertion of a child into DRawHierarchy starting + // from this object + void ActionChildInserted(ViewContact& rChild); + + // React on changes of the object of this ViewContact + virtual void ActionChanged(); + + // access to SdrObject and/or SdrPage. May return 0L like the default + // implementations do. Needs to be overloaded as needed. + virtual SdrObject* TryToGetSdrObject() const; + virtual SdrPage* TryToGetSdrPage() const; + + // access to the local primitive. This will ensure that the primitive is + // current in comparing the local one with a fresh created incarnation + drawinglayer::primitive2d::Primitive2DSequence getViewIndependentPrimitive2DSequence() const; + + // add Gluepoints (if available) + virtual drawinglayer::primitive2d::Primitive2DSequence createGluePointPrimitive2DSequence() const; + + // delete all existing VOCs including DrawHierarchy which will invalidate all + // visualisations, too. Used mostly at object removal from DrawHierarchy to + // delete all existing VOCs by purpose, but can also be used for other purposes. + // It is always possible to delete the VOCs, these are re-created on demand + void flushViewObjectContacts(bool bWithHierarchy = true); + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_CONTACT_VIEWCONTACT_HXX + +// eof diff --git a/svx/inc/svx/sdr/contact/viewcontactofe3d.hxx b/svx/inc/svx/sdr/contact/viewcontactofe3d.hxx new file mode 100644 index 000000000000..b8e30b320a79 --- /dev/null +++ b/svx/inc/svx/sdr/contact/viewcontactofe3d.hxx @@ -0,0 +1,120 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_CONTACT_VIEWCONTACTOFE3D_HXX +#define _SDR_CONTACT_VIEWCONTACTOFE3D_HXX + +#include <svx/sdr/contact/viewcontactofsdrobj.hxx> +#include <drawinglayer/primitive3d/baseprimitive3d.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +namespace sdr { namespace contact { + class ViewContactOfE3dScene; +}} + +namespace drawinglayer { namespace attribute { + class SdrLineAttribute; +}} + +namespace basegfx { + class BColor; + class B3DHomMatrix; +} + +class E3dObject; + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class ViewContactOfE3d : public ViewContactOfSdrObj + { + protected: + // Create a Object-Specific ViewObjectContact, set ViewContact and + // ObjectContact. Always needs to return something. + virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact); + + public: + // basic constructor, used from E3dObject. + ViewContactOfE3d(E3dObject& rObj); + virtual ~ViewContactOfE3d(); + + // access to E3dObject + E3dObject& GetE3dObject() const + { + return (E3dObject&)GetSdrObject(); + } + + // public helpers + drawinglayer::primitive2d::Primitive2DSequence impCreateWithGivenPrimitive3DSequence( + const drawinglayer::primitive3d::Primitive3DSequence& rxContent3D) const; + + ////////////////////////////////////////////////////////////////////////////// + // primitive stuff + + protected: + // Primitive3DSequence of the ViewContact. This contains all necessary information + // for the graphical visualisation and needs to be supported by all 3D VCs which + // can be visualized. It does NOT contain the object transformation to be able to + // buffer for all possible usages + drawinglayer::primitive3d::Primitive3DSequence mxViewIndependentPrimitive3DSequence; + + // This method is responsible for creating the graphical visualisation data which is + // stored in mxViewIndependentPrimitive3DSequence, but without object transformation + virtual drawinglayer::primitive3d::Primitive3DSequence createViewIndependentPrimitive3DSequence() const = 0; + + // This method is responsible for creating the graphical visualisation data derived ONLY from + // the model data. The default implementation will try to create a 3D to 2D embedding (will work + // when scene is known) which can then be used for 2D processing concerning ranges + virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const; + + // helper to enable test-visualisation of invisible 3D obects + drawinglayer::attribute::SdrLineAttribute* impCreateFallbackLineAttribute(const basegfx::BColor& rBColor) const; + + public: + // access to the local primitive without the object's local 3D transform. This is e.g. needed + // to get the not-yet transformed BoundVolume for e.g. interactions + drawinglayer::primitive3d::Primitive3DSequence getVIP3DSWithoutObjectTransform() const; + + // access to the local primitive. This will ensure that the list is + // current in comparing the local list content with a fresh created incarnation. It will + // use getVIP3DSWithoutObjectTransform and embed to 3d transform primitive when object's + // local 3d transform is used + drawinglayer::primitive3d::Primitive3DSequence getViewIndependentPrimitive3DSequence() const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_CONTACT_VIEWCONTACTOFE3D_HXX + +// eof diff --git a/svx/inc/svx/sdr/contact/viewcontactofe3dcube.hxx b/svx/inc/svx/sdr/contact/viewcontactofe3dcube.hxx new file mode 100644 index 000000000000..cccb51a4b8cc --- /dev/null +++ b/svx/inc/svx/sdr/contact/viewcontactofe3dcube.hxx @@ -0,0 +1,71 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_CONTACT_VIEWCONTACTOFE3DCUBE_HXX +#define _SDR_CONTACT_VIEWCONTACTOFE3DCUBE_HXX + +#ifndef _SDR_CONTACT_VIEWCONTACTOFE3D_HXX +#include <svx/sdr/contact/viewcontactofe3d.hxx> +#endif + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +class E3dCubeObj; + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class ViewContactOfE3dCube : public ViewContactOfE3d + { + public: + // basic constructor, used from SdrObject. + ViewContactOfE3dCube(E3dCubeObj& rCubeObj); + virtual ~ViewContactOfE3dCube(); + + // access to SdrObject + E3dCubeObj& GetE3dCubeObj() const + { + return (E3dCubeObj&)GetE3dObject(); + } + + protected: + // This method is responsible for creating the graphical visualisation data which is + // stored in the local primitive list. Default creates a yellow replacement rectangle. + virtual drawinglayer::primitive3d::Primitive3DSequence createViewIndependentPrimitive3DSequence() const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_CONTACT_VIEWCONTACTOFE3DCUBE_HXX + +// eof diff --git a/svx/inc/svx/sdr/contact/viewcontactofe3dextrude.hxx b/svx/inc/svx/sdr/contact/viewcontactofe3dextrude.hxx new file mode 100644 index 000000000000..4fa152af362d --- /dev/null +++ b/svx/inc/svx/sdr/contact/viewcontactofe3dextrude.hxx @@ -0,0 +1,71 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_CONTACT_VIEWCONTACTOFE3DEXTRUDE_HXX +#define _SDR_CONTACT_VIEWCONTACTOFE3DEXTRUDE_HXX + +#ifndef _SDR_CONTACT_VIEWCONTACTOFE3D_HXX +#include <svx/sdr/contact/viewcontactofe3d.hxx> +#endif + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +class E3dExtrudeObj; + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class ViewContactOfE3dExtrude : public ViewContactOfE3d + { + public: + // basic constructor, used from SdrObject. + ViewContactOfE3dExtrude(E3dExtrudeObj& rExtrude); + virtual ~ViewContactOfE3dExtrude(); + + // access to SdrObject + E3dExtrudeObj& GetE3dExtrudeObj() const + { + return (E3dExtrudeObj&)GetE3dObject(); + } + + protected: + // This method is responsible for creating the graphical visualisation data which is + // stored in the local primitive list. Default creates a yellow replacement rectangle. + virtual drawinglayer::primitive3d::Primitive3DSequence createViewIndependentPrimitive3DSequence() const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_CONTACT_VIEWCONTACTOFE3DEXTRUDE_HXX + +// eof diff --git a/svx/inc/svx/sdr/contact/viewcontactofe3dlathe.hxx b/svx/inc/svx/sdr/contact/viewcontactofe3dlathe.hxx new file mode 100644 index 000000000000..5c8502348b00 --- /dev/null +++ b/svx/inc/svx/sdr/contact/viewcontactofe3dlathe.hxx @@ -0,0 +1,71 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_CONTACT_VIEWCONTACTOFE3DLATHE_HXX +#define _SDR_CONTACT_VIEWCONTACTOFE3DLATHE_HXX + +#ifndef _SDR_CONTACT_VIEWCONTACTOFE3D_HXX +#include <svx/sdr/contact/viewcontactofe3d.hxx> +#endif + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +class E3dLatheObj; + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class ViewContactOfE3dLathe : public ViewContactOfE3d + { + public: + // basic constructor, used from SdrObject. + ViewContactOfE3dLathe(E3dLatheObj& rLathe); + virtual ~ViewContactOfE3dLathe(); + + // access to SdrObject + E3dLatheObj& GetE3dLatheObj() const + { + return (E3dLatheObj&)GetE3dObject(); + } + + protected: + // This method is responsible for creating the graphical visualisation data which is + // stored in the local primitive list. Default creates a yellow replacement rectangle. + virtual drawinglayer::primitive3d::Primitive3DSequence createViewIndependentPrimitive3DSequence() const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_CONTACT_VIEWCONTACTOFE3DLATHE_HXX + +// eof diff --git a/svx/inc/svx/sdr/contact/viewcontactofe3dpolygon.hxx b/svx/inc/svx/sdr/contact/viewcontactofe3dpolygon.hxx new file mode 100644 index 000000000000..f681655888aa --- /dev/null +++ b/svx/inc/svx/sdr/contact/viewcontactofe3dpolygon.hxx @@ -0,0 +1,71 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_CONTACT_VIEWCONTACTOFE3DPOLYGON_HXX +#define _SDR_CONTACT_VIEWCONTACTOFE3DPOLYGON_HXX + +#ifndef _SDR_CONTACT_VIEWCONTACTOFE3D_HXX +#include <svx/sdr/contact/viewcontactofe3d.hxx> +#endif + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +class E3dPolygonObj; + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class ViewContactOfE3dPolygon : public ViewContactOfE3d + { + public: + // basic constructor, used from SdrObject. + ViewContactOfE3dPolygon(E3dPolygonObj& rPolygon); + virtual ~ViewContactOfE3dPolygon(); + + // access to SdrObject + E3dPolygonObj& GetE3dPolygonObj() const + { + return (E3dPolygonObj&)GetE3dObject(); + } + + protected: + // This method is responsible for creating the graphical visualisation data which is + // stored in the local primitive list. Default creates a yellow replacement rectangle. + virtual drawinglayer::primitive3d::Primitive3DSequence createViewIndependentPrimitive3DSequence() const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_CONTACT_VIEWCONTACTOFE3DPOLYGON_HXX + +// eof diff --git a/svx/inc/svx/sdr/contact/viewcontactofe3dscene.hxx b/svx/inc/svx/sdr/contact/viewcontactofe3dscene.hxx new file mode 100644 index 000000000000..0b2efdc3d313 --- /dev/null +++ b/svx/inc/svx/sdr/contact/viewcontactofe3dscene.hxx @@ -0,0 +1,122 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_CONTACT_VIEWCONTACTOFE3DSCENE_HXX +#define _SDR_CONTACT_VIEWCONTACTOFE3DSCENE_HXX + +#include <svx/sdr/contact/viewcontactofsdrobj.hxx> +#include <drawinglayer/primitive3d/baseprimitive3d.hxx> +#include <drawinglayer/attribute/sdrsceneattribute3d.hxx> +#include <drawinglayer/attribute/sdrlightingattribute3d.hxx> +#include <drawinglayer/geometry/viewinformation3d.hxx> +#include <basegfx/matrix/b2dhommatrix.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +class E3dScene; + +namespace basegfx { + class B3DRange; +} + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class SVX_DLLPUBLIC ViewContactOfE3dScene : public ViewContactOfSdrObj + { + protected: + // Create a Object-Specific ViewObjectContact, set ViewContact and + // ObjectContact. Always needs to return something. Default is to create + // a standard ViewObjectContact containing the given ObjectContact and *this + virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact); + + public: + // basic constructor, used from SdrObject. + ViewContactOfE3dScene(E3dScene& rScene); + + // access to SdrObject + E3dScene& GetE3dScene() const + { + return (E3dScene&)GetSdrObject(); + } + + // React on changes of the object of this ViewContact + virtual void ActionChanged(); + + // access to ViewInformation3D and ObjectTransformation + const drawinglayer::geometry::ViewInformation3D& getViewInformation3D(const ::basegfx::B3DRange& rContentRange) const; + const drawinglayer::geometry::ViewInformation3D& getViewInformation3D() const; + const basegfx::B2DHomMatrix& getObjectTransformation() const; + + // attribute providers + const drawinglayer::attribute::SdrSceneAttribute& getSdrSceneAttribute() const; + const drawinglayer::attribute::SdrLightingAttribute& getSdrLightingAttribute() const; + + // scene primitive creators. If pLayerVisibility is given, a visibility test with the LayerID and the + // given SetOfByte is done. + drawinglayer::primitive2d::Primitive2DSequence createScenePrimitive2DSequence(const SetOfByte* pLayerVisibility) const; + + // helpers to get the sequence of all contained 3D primitives and it's range, + // regardless of layer or visibility constraints and using a neutral ViewInformation3D + drawinglayer::primitive3d::Primitive3DSequence getAllPrimitive3DSequence() const; + basegfx::B3DRange getAllContentRange3D() const; + + protected: + // the 3d transformation stack + drawinglayer::geometry::ViewInformation3D maViewInformation3D; + + // the object transformation + basegfx::B2DHomMatrix maObjectTransformation; + + // attributes + drawinglayer::attribute::SdrSceneAttribute maSdrSceneAttribute; + drawinglayer::attribute::SdrLightingAttribute maSdrLightingAttribute; + + // create methods for ViewInformation3D and ObjectTransformation + void createViewInformation3D(const ::basegfx::B3DRange& rContentRange); + void createObjectTransformation(); + + // attribute creators + void createSdrSceneAttribute(); + void createSdrLightingAttribute(); + + // This method is responsible for creating the graphical visualisation data + // ONLY based on model data + virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_CONTACT_VIEWCONTACTOFE3DSCENE_HXX + +// eof diff --git a/svx/inc/svx/sdr/contact/viewcontactofe3dsphere.hxx b/svx/inc/svx/sdr/contact/viewcontactofe3dsphere.hxx new file mode 100644 index 000000000000..68a64e888d91 --- /dev/null +++ b/svx/inc/svx/sdr/contact/viewcontactofe3dsphere.hxx @@ -0,0 +1,71 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_CONTACT_VIEWCONTACTOFE3DSPHERE_HXX +#define _SDR_CONTACT_VIEWCONTACTOFE3DSPHERE_HXX + +#ifndef _SDR_CONTACT_VIEWCONTACTOFE3D_HXX +#include <svx/sdr/contact/viewcontactofe3d.hxx> +#endif + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +class E3dSphereObj; + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class ViewContactOfE3dSphere : public ViewContactOfE3d + { + public: + // basic constructor, used from SdrObject. + ViewContactOfE3dSphere(E3dSphereObj& rSphere); + virtual ~ViewContactOfE3dSphere(); + + // access to SdrObject + E3dSphereObj& GetE3dSphereObj() const + { + return (E3dSphereObj&)GetE3dObject(); + } + + protected: + // This method is responsible for creating the graphical visualisation data which is + // stored in the local primitive list. Default creates a yellow replacement rectangle. + virtual drawinglayer::primitive3d::Primitive3DSequence createViewIndependentPrimitive3DSequence() const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_CONTACT_VIEWCONTACTOFE3DSPHERE_HXX + +// eof diff --git a/svx/inc/svx/sdr/contact/viewcontactofgraphic.hxx b/svx/inc/svx/sdr/contact/viewcontactofgraphic.hxx new file mode 100644 index 000000000000..b207c3e7fbde --- /dev/null +++ b/svx/inc/svx/sdr/contact/viewcontactofgraphic.hxx @@ -0,0 +1,94 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_CONTACT_VIEWCONTACTOFGRAPHIC_HXX +#define _SDR_CONTACT_VIEWCONTACTOFGRAPHIC_HXX + +#include <sal/types.h> +#include <svx/sdr/contact/viewcontactoftextobj.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +class SdrGrafObj; +namespace drawinglayer { namespace attribute { class SdrLineFillShadowTextAttribute; }} +class GraphicAttr; + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class ViewContactOfGraphic : public ViewContactOfTextObj + { + private: + // helpers for constructing various primitive visualisations in various states + drawinglayer::primitive2d::Primitive2DSequence createVIP2DSForPresObj( + const basegfx::B2DHomMatrix& rObjectMatrix, + const drawinglayer::attribute::SdrLineFillShadowTextAttribute& rAttribute, + const GraphicAttr& rLocalGrafInfo) const; + drawinglayer::primitive2d::Primitive2DSequence createVIP2DSForDraft( + const basegfx::B2DHomMatrix& rObjectMatrix, + const drawinglayer::attribute::SdrLineFillShadowTextAttribute& rAttribute) const; + + protected: + // Create a Object-Specific ViewObjectContact, set ViewContact and + // ObjectContact. Always needs to return something. + virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact); + + public: + // access to SdrObject + SdrGrafObj& GetGrafObject() const + { + return ((SdrGrafObj&)GetSdrObject()); + } + + // basic constructor, destructor + ViewContactOfGraphic(SdrGrafObj& rGrafObj); + virtual ~ViewContactOfGraphic(); + + // #i102380# + void flushGraphicObjects(); + + // helpers for viusualisation state + bool visualisationUsesPresObj() const; + bool visualisationUsesDraft() const; + + protected: + // This method is responsible for creating the graphical visualisation data + // ONLY based on model data + virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_CONTACT_VIEWCONTACTOFGRAPHIC_HXX + +// eof diff --git a/svx/inc/svx/sdr/contact/viewcontactofgroup.hxx b/svx/inc/svx/sdr/contact/viewcontactofgroup.hxx new file mode 100644 index 000000000000..189f69a7311b --- /dev/null +++ b/svx/inc/svx/sdr/contact/viewcontactofgroup.hxx @@ -0,0 +1,75 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_CONTACT_VIEWCONTACTOFGROUP_HXX +#define _SDR_CONTACT_VIEWCONTACTOFGROUP_HXX + +#include <svx/sdr/contact/viewcontactofsdrobj.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +class SdrObjGroup; + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class ViewContactOfGroup : public ViewContactOfSdrObj + { + protected: + // Create a Object-Specific ViewObjectContact, set ViewContact and + // ObjectContact. Always needs to return something. Default is to create + // a standard ViewObjectContact containing the given ObjectContact and *this + virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact); + + // internal access to SdrObject + SdrObjGroup& GetSdrObjGroup() const + { + return (SdrObjGroup&)GetSdrObject(); + } + + public: + // basic constructor, used from SdrObject. + ViewContactOfGroup(SdrObjGroup& rGroup); + virtual ~ViewContactOfGroup(); + + protected: + // This method is responsible for creating the graphical visualisation data + // ONLY based on model data + virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_CONTACT_VIEWCONTACTOFGROUP_HXX + +// eof diff --git a/svx/inc/svx/sdr/contact/viewcontactofmasterpagedescriptor.hxx b/svx/inc/svx/sdr/contact/viewcontactofmasterpagedescriptor.hxx new file mode 100644 index 000000000000..c408f1373e4c --- /dev/null +++ b/svx/inc/svx/sdr/contact/viewcontactofmasterpagedescriptor.hxx @@ -0,0 +1,85 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_CONTACT_VIEWCONTACTOFMASTERPAGEDESCRIPTOR_HXX +#define _SDR_CONTACT_VIEWCONTACTOFMASTERPAGEDESCRIPTOR_HXX + +#include <sal/types.h> +#include <svx/sdr/contact/viewcontact.hxx> +#include <svx/sdrmasterpagedescriptor.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations +class SfxItemSet; +class Bitmap; +class MapMode; + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class ViewContactOfMasterPageDescriptor : public ViewContact + { + protected: + // the owner of this ViewContact. Set from constructor and not + // to be changed in any way. + sdr::MasterPageDescriptor& mrMasterPageDescriptor; + + // Create a Object-Specific ViewObjectContact + virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact); + + // This method is responsible for creating the graphical visualisation data + virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const; + + public: + // basic constructor + ViewContactOfMasterPageDescriptor(sdr::MasterPageDescriptor& rDescriptor); + + // The destructor. + virtual ~ViewContactOfMasterPageDescriptor(); + + // access to MasterPageDescriptor + sdr::MasterPageDescriptor& GetMasterPageDescriptor() const + { + return mrMasterPageDescriptor; + } + + // Access to possible sub-hierarchy and parent + virtual sal_uInt32 GetObjectCount() const; + virtual ViewContact& GetViewContact(sal_uInt32 nIndex) const; + virtual ViewContact* GetParentContact() const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_CONTACT_VIEWCONTACTOFMASTERPAGEDESCRIPTOR_HXX + +// eof diff --git a/svx/inc/svx/sdr/contact/viewcontactofpageobj.hxx b/svx/inc/svx/sdr/contact/viewcontactofpageobj.hxx new file mode 100644 index 000000000000..54d188d198cc --- /dev/null +++ b/svx/inc/svx/sdr/contact/viewcontactofpageobj.hxx @@ -0,0 +1,80 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_CONTACT_VIEWCONTACTOFPAGEOBJ_HXX +#define _SDR_CONTACT_VIEWCONTACTOFPAGEOBJ_HXX + +#include <svx/sdr/contact/viewcontactofsdrobj.hxx> +#include "svx/svxdllapi.h" + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +class SdrPageObj; +class SdrPage; + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class SVX_DLLPUBLIC ViewContactOfPageObj : public ViewContactOfSdrObj + { + protected: + // Create a Object-Specific ViewObjectContact, set ViewContact and + // ObjectContact. Always needs to return something. + virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact); + + // create graphical visualisation data + virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const; + + // Access to referenced page + const SdrPage* GetReferencedPage() const; + + public: + // basic constructor, used from SdrObject. + ViewContactOfPageObj(SdrPageObj& rPageObj); + virtual ~ViewContactOfPageObj(); + + // #WIP# React on changes of the object of this ViewContact + virtual void ActionChanged(); + + // access to SdrObject + SdrPageObj& GetPageObj() const + { + return (SdrPageObj&)GetSdrObject(); + } + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_CONTACT_VIEWCONTACTOFPAGEOBJ_HXX + +// eof diff --git a/svx/inc/svx/sdr/contact/viewcontactofsdrcaptionobj.hxx b/svx/inc/svx/sdr/contact/viewcontactofsdrcaptionobj.hxx new file mode 100644 index 000000000000..5171ce75204f --- /dev/null +++ b/svx/inc/svx/sdr/contact/viewcontactofsdrcaptionobj.hxx @@ -0,0 +1,70 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_CONTACT_VIEWCONTACTOFSDRCAPTIONOBJ_HXX +#define _SDR_CONTACT_VIEWCONTACTOFSDRCAPTIONOBJ_HXX + +#include <svx/sdr/contact/viewcontactofsdrrectobj.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +class SdrCaptionObj; + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class ViewContactOfSdrCaptionObj : public ViewContactOfSdrRectObj + { + protected: + // internal access to SdrCaptionObj + SdrCaptionObj& GetCaptionObj() const + { + return (SdrCaptionObj&)GetSdrObject(); + } + + public: + // basic constructor, used from SdrObject. + ViewContactOfSdrCaptionObj(SdrCaptionObj& rCaptionObj); + virtual ~ViewContactOfSdrCaptionObj(); + + protected: + // This method is responsible for creating the graphical visualisation data + // ONLY based on model data + virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_CONTACT_VIEWCONTACTOFSDRCAPTIONOBJ_HXX + +// eof diff --git a/svx/inc/svx/sdr/contact/viewcontactofsdrcircobj.hxx b/svx/inc/svx/sdr/contact/viewcontactofsdrcircobj.hxx new file mode 100644 index 000000000000..3d0ed6b56a59 --- /dev/null +++ b/svx/inc/svx/sdr/contact/viewcontactofsdrcircobj.hxx @@ -0,0 +1,70 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_CONTACT_VIEWCONTACTOFSDRCIRCOBJ_HXX +#define _SDR_CONTACT_VIEWCONTACTOFSDRCIRCOBJ_HXX + +#include <svx/sdr/contact/viewcontactofsdrrectobj.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +class SdrCircObj; + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class ViewContactOfSdrCircObj : public ViewContactOfSdrRectObj + { + protected: + // internal access to SdrCircObj + SdrCircObj& GetCircObj() const + { + return (SdrCircObj&)GetSdrObject(); + } + + public: + // basic constructor, used from SdrObject. + ViewContactOfSdrCircObj(SdrCircObj& rCircObj); + virtual ~ViewContactOfSdrCircObj(); + + protected: + // This method is responsible for creating the graphical visualisation data + // ONLY based on model data + virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_CONTACT_VIEWCONTACTOFSDRCIRCOBJ_HXX + +// eof diff --git a/svx/inc/svx/sdr/contact/viewcontactofsdredgeobj.hxx b/svx/inc/svx/sdr/contact/viewcontactofsdredgeobj.hxx new file mode 100644 index 000000000000..97ccf16c8c0a --- /dev/null +++ b/svx/inc/svx/sdr/contact/viewcontactofsdredgeobj.hxx @@ -0,0 +1,70 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_CONTACT_VIEWCONTACTOFSDREDGEOBJ_HXX +#define _SDR_CONTACT_VIEWCONTACTOFSDREDGEOBJ_HXX + +#include <svx/sdr/contact/viewcontactoftextobj.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +class SdrEdgeObj; + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class ViewContactOfSdrEdgeObj : public ViewContactOfTextObj + { + protected: + // internal access to SdrEdgeObj + SdrEdgeObj& GetEdgeObj() const + { + return (SdrEdgeObj&)GetSdrObject(); + } + + public: + // basic constructor, used from SdrObject. + ViewContactOfSdrEdgeObj(SdrEdgeObj& rEdgeObj); + virtual ~ViewContactOfSdrEdgeObj(); + + protected: + // This method is responsible for creating the graphical visualisation data + // ONLY based on model data + virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_CONTACT_VIEWCONTACTOFSDREDGEOBJ_HXX + +// eof diff --git a/svx/inc/svx/sdr/contact/viewcontactofsdrmeasureobj.hxx b/svx/inc/svx/sdr/contact/viewcontactofsdrmeasureobj.hxx new file mode 100644 index 000000000000..97f258b2cda5 --- /dev/null +++ b/svx/inc/svx/sdr/contact/viewcontactofsdrmeasureobj.hxx @@ -0,0 +1,70 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_CONTACT_VIEWCONTACTOFSDRMEASUREOBJ_HXX +#define _SDR_CONTACT_VIEWCONTACTOFSDRMEASUREOBJ_HXX + +#include <svx/sdr/contact/viewcontactoftextobj.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +class SdrMeasureObj; + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class ViewContactOfSdrMeasureObj : public ViewContactOfTextObj + { + protected: + // internal access to SdrMeasureObj + SdrMeasureObj& GetMeasureObj() const + { + return (SdrMeasureObj&)GetSdrObject(); + } + + public: + // basic constructor, used from SdrObject. + ViewContactOfSdrMeasureObj(SdrMeasureObj& rMeasureObj); + virtual ~ViewContactOfSdrMeasureObj(); + + protected: + // This method is responsible for creating the graphical visualisation data + // ONLY based on model data + virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_CONTACT_VIEWCONTACTOFSDRMEASUREOBJ_HXX + +// eof diff --git a/svx/inc/svx/sdr/contact/viewcontactofsdrmediaobj.hxx b/svx/inc/svx/sdr/contact/viewcontactofsdrmediaobj.hxx new file mode 100644 index 000000000000..975ce214f3e8 --- /dev/null +++ b/svx/inc/svx/sdr/contact/viewcontactofsdrmediaobj.hxx @@ -0,0 +1,89 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_CONTACT_VIEWCONTACTOFSDRMEDIAOBJ_HXX +#define _SDR_CONTACT_VIEWCONTACTOFSDRMEDIAOBJ_HXX + +#include <svx/sdr/contact/viewcontactofsdrobj.hxx> +#include "svx/svxdllapi.h" + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +class SdrMediaObj; +namespace avmedia { class MediaItem; } + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class SVX_DLLPUBLIC ViewContactOfSdrMediaObj : public ViewContactOfSdrObj + { + friend class ViewObjectContactOfSdrMediaObj; + + public: + + // basic constructor, used from SdrObject. + ViewContactOfSdrMediaObj( SdrMediaObj& rMediaObj ); + virtual ~ViewContactOfSdrMediaObj(); + + public: + + // access to SdrMediaObj + SdrMediaObj& GetSdrMediaObj() const + { + return (SdrMediaObj&)GetSdrObject(); + } + + bool hasPreferredSize() const; + Size getPreferredSize() const; + + void updateMediaItem( ::avmedia::MediaItem& rItem ) const; + void executeMediaItem( const ::avmedia::MediaItem& rItem ); + + protected: + + // Create a Object-Specific ViewObjectContact, set ViewContact and + // ObjectContact. Always needs to return something. + virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact); + + // get notified if some properties have changed + virtual void mediaPropertiesChanged( const ::avmedia::MediaItem& rNewState ); + + protected: + // This method is responsible for creating the graphical visualisation data + // ONLY based on model data + virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_CONTACT_VIEWCONTACTOFSDRMEDIAOBJ_HXX diff --git a/svx/inc/svx/sdr/contact/viewcontactofsdrobj.hxx b/svx/inc/svx/sdr/contact/viewcontactofsdrobj.hxx new file mode 100644 index 000000000000..c9ac57389799 --- /dev/null +++ b/svx/inc/svx/sdr/contact/viewcontactofsdrobj.hxx @@ -0,0 +1,99 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_CONTACT_VIEWCONTACTOFSDROBJ_HXX +#define _SDR_CONTACT_VIEWCONTACTOFSDROBJ_HXX + +#include <sal/types.h> +#include <svx/sdr/contact/viewcontact.hxx> +#include <svx/sdtakitm.hxx> +#include "svx/svxdllapi.h" + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +class SdrObject; +class GeoStat; +class Bitmap; + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class SVX_DLLPUBLIC ViewContactOfSdrObj : public ViewContact + { + protected: + // the owner of this ViewContact. Set from constructor and not + // to be changed in any way. + SdrObject& mrObject; + + // Remember AnimationKind of object. Used to find out if that kind + // has changed in ActionChanged() + SdrTextAniKind meRememberedAnimationKind; + + // Create a Object-Specific ViewObjectContact, set ViewContact and + // ObjectContact. Always needs to return something. + virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact); + + public: + // access to SdrObject + SdrObject& GetSdrObject() const + { + return mrObject; + } + + // basic constructor, used from SdrObject. + ViewContactOfSdrObj(SdrObject& rObj); + virtual ~ViewContactOfSdrObj(); + + // Access to possible sub-hierarchy + virtual sal_uInt32 GetObjectCount() const; + virtual ViewContact& GetViewContact(sal_uInt32 nIndex) const; + virtual ViewContact* GetParentContact() const; + + // React on changes of the object of this ViewContact + virtual void ActionChanged(); + + // overload for acessing the SdrObject + virtual SdrObject* TryToGetSdrObject() const; + + ////////////////////////////////////////////////////////////////////////////// + // primitive stuff + + // add Gluepoints (if available) + virtual drawinglayer::primitive2d::Primitive2DSequence createGluePointPrimitive2DSequence() const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_CONTACT_VIEWCONTACTOFSDROBJ_HXX + +// eof diff --git a/svx/inc/svx/sdr/contact/viewcontactofsdrobjcustomshape.hxx b/svx/inc/svx/sdr/contact/viewcontactofsdrobjcustomshape.hxx new file mode 100644 index 000000000000..b58356283e57 --- /dev/null +++ b/svx/inc/svx/sdr/contact/viewcontactofsdrobjcustomshape.hxx @@ -0,0 +1,73 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_CONTACT_VIEWCONTACTOFSDROBJCUSTOMSHAPE_HXX +#define _SDR_CONTACT_VIEWCONTACTOFSDROBJCUSTOMSHAPE_HXX + +#include <svx/sdr/contact/viewcontactoftextobj.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +class SdrObjCustomShape; + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class ViewContactOfSdrObjCustomShape : public ViewContactOfTextObj + { + protected: + // internal access to SdrObjCustomShape + SdrObjCustomShape& GetCustomShapeObj() const + { + return (SdrObjCustomShape&)GetSdrObject(); + } + + // #i101684# internal tooling + basegfx::B2DRange getCorrectedTextBoundRect() const; + + public: + // basic constructor, used from SdrObject. + ViewContactOfSdrObjCustomShape(SdrObjCustomShape& rCustomShape); + virtual ~ViewContactOfSdrObjCustomShape(); + + protected: + // This method is responsible for creating the graphical visualisation data + // ONLY based on model data + virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_CONTACT_VIEWCONTACTOFSDROBJCUSTOMSHAPE_HXX + +// eof diff --git a/svx/inc/svx/sdr/contact/viewcontactofsdrole2obj.hxx b/svx/inc/svx/sdr/contact/viewcontactofsdrole2obj.hxx new file mode 100644 index 000000000000..76ff4f8e5632 --- /dev/null +++ b/svx/inc/svx/sdr/contact/viewcontactofsdrole2obj.hxx @@ -0,0 +1,81 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_CONTACT_VIEWCONTACTOFSDROLE2OBJ_HXX +#define _SDR_CONTACT_VIEWCONTACTOFSDROLE2OBJ_HXX + +#include <svx/sdr/contact/viewcontactofsdrrectobj.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +class SdrOle2Obj; +class Graphic; + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class ViewContactOfSdrOle2Obj : public ViewContactOfSdrRectObj + { + protected: + // Create a Object-Specific ViewObjectContact, set ViewContact and + // ObjectContact. Always needs to return something. + virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact); + + public: + // access to SdrOle2Obj + SdrOle2Obj& GetOle2Obj() const + { + return (SdrOle2Obj&)GetSdrObject(); + } + + // basic constructor, used from SdrObject. + ViewContactOfSdrOle2Obj(SdrOle2Obj& rOle2Obj); + virtual ~ViewContactOfSdrOle2Obj(); + + // helper for creating a OLE sequence for this object. It takes care od attributes, needed + // scaling (e.g. for EmptyPresObj's), the correct graphic and other stuff. It is used from + // createViewIndependentPrimitive2DSequence with false, and with evtl. HighContrast true + // from the VOC which knows that + drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequenceWithParameters(bool bHighContrast) const; + + protected: + // This method is responsible for creating the graphical visualisation data + // ONLY based on model data, just wraps to call createPrimitive2DSequenceWithParameters(false) + virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_CONTACT_VIEWCONTACTOFSDROLE2OBJ_HXX + +// eof diff --git a/svx/inc/svx/sdr/contact/viewcontactofsdrpage.hxx b/svx/inc/svx/sdr/contact/viewcontactofsdrpage.hxx new file mode 100644 index 000000000000..54ddb9c299b3 --- /dev/null +++ b/svx/inc/svx/sdr/contact/viewcontactofsdrpage.hxx @@ -0,0 +1,311 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_CONTACT_VIEWCONTACTOFSDRPAGE_HXX +#define _SDR_CONTACT_VIEWCONTACTOFSDRPAGE_HXX + +#include <sal/types.h> +#include <svx/sdr/contact/viewcontact.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations +class SdrPage; + +namespace sdr { namespace contact { + class ViewContactOfSdrPage; +}} + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class ViewContactOfPageSubObject : public ViewContact + { + protected: + ViewContactOfSdrPage& mrParentViewContactOfSdrPage; + + public: + ViewContactOfPageSubObject(ViewContactOfSdrPage& rParentViewContactOfSdrPage); + virtual ~ViewContactOfPageSubObject(); + + virtual ViewContact* GetParentContact() const; + const SdrPage& getPage() const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class ViewContactOfPageBackground : public ViewContactOfPageSubObject + { + protected: + virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact); + virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const; + + public: + ViewContactOfPageBackground(ViewContactOfSdrPage& rParentViewContactOfSdrPage); + virtual ~ViewContactOfPageBackground(); + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class ViewContactOfPageShadow : public ViewContactOfPageSubObject + { + protected: + virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact); + virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const; + + public: + ViewContactOfPageShadow(ViewContactOfSdrPage& rParentViewContactOfSdrPage); + virtual ~ViewContactOfPageShadow(); + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class ViewContactOfPageFill : public ViewContactOfPageSubObject + { + protected: + virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact); + virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const; + + public: + ViewContactOfPageFill(ViewContactOfSdrPage& rParentViewContactOfSdrPage); + virtual ~ViewContactOfPageFill(); + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class ViewContactOfMasterPage : public ViewContactOfPageSubObject + { + protected: + virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact); + virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const; + + public: + ViewContactOfMasterPage(ViewContactOfSdrPage& rParentViewContactOfSdrPage); + virtual ~ViewContactOfMasterPage(); + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class ViewContactOfOuterPageBorder : public ViewContactOfPageSubObject + { + protected: + virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact); + virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const; + + public: + ViewContactOfOuterPageBorder(ViewContactOfSdrPage& rParentViewContactOfSdrPage); + virtual ~ViewContactOfOuterPageBorder(); + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class ViewContactOfInnerPageBorder : public ViewContactOfPageSubObject + { + protected: + virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact); + virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const; + + public: + ViewContactOfInnerPageBorder(ViewContactOfSdrPage& rParentViewContactOfSdrPage); + virtual ~ViewContactOfInnerPageBorder(); + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class ViewContactOfPageHierarchy : public ViewContactOfPageSubObject + { + protected: + virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact); + virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const; + + public: + ViewContactOfPageHierarchy(ViewContactOfSdrPage& rParentViewContactOfSdrPage); + virtual ~ViewContactOfPageHierarchy(); + + virtual sal_uInt32 GetObjectCount() const; + virtual ViewContact& GetViewContact(sal_uInt32 nIndex) const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class ViewContactOfGrid : public ViewContactOfPageSubObject + { + protected: + // bitfield + unsigned mbFront : 1; + + virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact); + virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const; + + public: + ViewContactOfGrid(ViewContactOfSdrPage& rParentViewContactOfSdrPage, bool bFront); + virtual ~ViewContactOfGrid(); + + bool getFront() const { return mbFront; } + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class ViewContactOfHelplines : public ViewContactOfPageSubObject + { + protected: + // bitfield + unsigned mbFront : 1; + + virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact); + virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const; + + public: + ViewContactOfHelplines(ViewContactOfSdrPage& rParentViewContactOfSdrPage, bool bFront); + virtual ~ViewContactOfHelplines(); + + bool getFront() const { return mbFront; } + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class ViewContactOfSdrPage : public ViewContact + { + protected: + // the owner of this ViewContact. Set from constructor and not + // to be changed in any way. + SdrPage& mrPage; + + // helper viewContacts to build a clear paint hierarchy + ViewContactOfPageBackground maViewContactOfPageBackground; + ViewContactOfPageShadow maViewContactOfPageShadow; + ViewContactOfPageFill maViewContactOfPageFill; + ViewContactOfMasterPage maViewContactOfMasterPage; + ViewContactOfOuterPageBorder maViewContactOfOuterPageBorder; + ViewContactOfInnerPageBorder maViewContactOfInnerPageBorder; + ViewContactOfGrid maViewContactOfGridBack; + ViewContactOfHelplines maViewContactOfHelplinesBack; + ViewContactOfPageHierarchy maViewContactOfPageHierarchy; + ViewContactOfGrid maViewContactOfGridFront; + ViewContactOfHelplines maViewContactOfHelplinesFront; + + // Create a Object-Specific ViewObjectContact, set ViewContact and + // ObjectContact. Always needs to return something. Default is to create + // a standard ViewObjectContact containing the given ObjectContact and *this + virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact); + + public: + // access to SdrObject + SdrPage& GetSdrPage() const + { + return mrPage; + } + + // basic constructor, used from SdrPage. + ViewContactOfSdrPage(SdrPage& rObj); + virtual ~ViewContactOfSdrPage(); + + // Access to possible sub-hierarchy + virtual sal_uInt32 GetObjectCount() const; + virtual ViewContact& GetViewContact(sal_uInt32 nIndex) const; + + // React on changes of the object of this ViewContact + virtual void ActionChanged(); + + // overload for acessing the SdrPage + virtual SdrPage* TryToGetSdrPage() const; + + protected: + // This method is responsible for creating the graphical visualisation data + // ONLY based on model data + virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_CONTACT_VIEWCONTACTOFSDRPAGE_HXX + +// eof diff --git a/svx/inc/svx/sdr/contact/viewcontactofsdrpathobj.hxx b/svx/inc/svx/sdr/contact/viewcontactofsdrpathobj.hxx new file mode 100644 index 000000000000..1d2127a3ab80 --- /dev/null +++ b/svx/inc/svx/sdr/contact/viewcontactofsdrpathobj.hxx @@ -0,0 +1,70 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_CONTACT_VIEWCONTACTOFSDRPATHOBJ_HXX +#define _SDR_CONTACT_VIEWCONTACTOFSDRPATHOBJ_HXX + +#include <svx/sdr/contact/viewcontactoftextobj.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +class SdrPathObj; + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class ViewContactOfSdrPathObj : public ViewContactOfTextObj + { + protected: + // internal access to SdrPathObj + SdrPathObj& GetPathObj() const + { + return (SdrPathObj&)GetSdrObject(); + } + + public: + // basic constructor, used from SdrObject. + ViewContactOfSdrPathObj(SdrPathObj& rTextObj); + virtual ~ViewContactOfSdrPathObj(); + + protected: + // This method is responsible for creating the graphical visualisation data + // ONLY based on model data + virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_CONTACT_VIEWCONTACTOFSDRPATHOBJ_HXX + +// eof diff --git a/svx/inc/svx/sdr/contact/viewcontactofsdrrectobj.hxx b/svx/inc/svx/sdr/contact/viewcontactofsdrrectobj.hxx new file mode 100644 index 000000000000..dddedd4e9f5b --- /dev/null +++ b/svx/inc/svx/sdr/contact/viewcontactofsdrrectobj.hxx @@ -0,0 +1,70 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_CONTACT_VIEWCONTACTOFSDRRECTOBJ_HXX +#define _SDR_CONTACT_VIEWCONTACTOFSDRRECTOBJ_HXX + +#include <svx/sdr/contact/viewcontactoftextobj.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +class SdrRectObj; + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class ViewContactOfSdrRectObj : public ViewContactOfTextObj + { + protected: + // internal access to SdrRectObj + SdrRectObj& GetRectObj() const + { + return (SdrRectObj&)GetSdrObject(); + } + + public: + // basic constructor, used from SdrObject. + ViewContactOfSdrRectObj(SdrRectObj& rTextObj); + virtual ~ViewContactOfSdrRectObj(); + + protected: + // This method is responsible for creating the graphical visualisation data + // ONLY based on model data + virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_CONTACT_VIEWCONTACTOFSDRRECTOBJ_HXX + +// eof diff --git a/svx/inc/svx/sdr/contact/viewcontactoftextobj.hxx b/svx/inc/svx/sdr/contact/viewcontactoftextobj.hxx new file mode 100644 index 000000000000..933199761f5a --- /dev/null +++ b/svx/inc/svx/sdr/contact/viewcontactoftextobj.hxx @@ -0,0 +1,65 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_CONTACT_VIEWCONTACTOFTEXTOBJ_HXX +#define _SDR_CONTACT_VIEWCONTACTOFTEXTOBJ_HXX + +#include <svx/sdr/contact/viewcontactofsdrobj.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +class SdrTextObj; + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class ViewContactOfTextObj : public ViewContactOfSdrObj + { + protected: + // internal access to SdrTextObj + SdrTextObj& GetTextObj() const + { + return (SdrTextObj&)GetSdrObject(); + } + + public: + // basic constructor, used from SdrObject. + ViewContactOfTextObj(SdrTextObj& rTextObj); + virtual ~ViewContactOfTextObj(); + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_CONTACT_VIEWCONTACTOFTEXTOBJ_HXX + +// eof diff --git a/svx/inc/svx/sdr/contact/viewcontactofunocontrol.hxx b/svx/inc/svx/sdr/contact/viewcontactofunocontrol.hxx new file mode 100644 index 000000000000..d0263ce60506 --- /dev/null +++ b/svx/inc/svx/sdr/contact/viewcontactofunocontrol.hxx @@ -0,0 +1,101 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SVX_SDR_CONTACT_VIEWCONTACTOFUNOCONTROL_HXX +#define SVX_SDR_CONTACT_VIEWCONTACTOFUNOCONTROL_HXX + +/** === begin UNO includes === **/ +#include <com/sun/star/uno/Reference.hxx> +/** === end UNO includes === **/ +#include <svx/sdr/contact/viewcontactofsdrmediaobj.hxx> +#include <svx/svxdllapi.h> + +#include <memory> + +class OutputDevice; +class Window; +class SdrUnoObj; +namespace com { namespace sun { namespace star { + namespace awt { + class XControl; + class XControlContainer; + } +} } } + +//........................................................................ +namespace sdr { namespace contact { +//........................................................................ + + //==================================================================== + //= ViewContactOfUnoControl + //==================================================================== + class ViewContactOfUnoControl_Impl; + class SVX_DLLPRIVATE ViewContactOfUnoControl : public ViewContactOfSdrObj + { + private: + ::std::auto_ptr< ViewContactOfUnoControl_Impl > m_pImpl; + + public: + // access to SdrObject + SdrUnoObj& GetSdrUnoObj() const + { + return ((SdrUnoObj&)GetSdrObject()); + } + + ViewContactOfUnoControl( SdrUnoObj& _rUnoObject ); + virtual ~ViewContactOfUnoControl(); + + /** access control to selected members + */ + struct SdrUnoObjAccessControl { friend class ::SdrUnoObj; private: SdrUnoObjAccessControl() { } }; + + /** retrieves a temporary XControl instance, whose parent is the given window + @seealso SdrUnoObj::GetTemporaryControlForWindow + */ + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > + getTemporaryControlForWindow( const Window& _rWindow, ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >& _inout_ControlContainer ) const; + + protected: + virtual ViewObjectContact& CreateObjectSpecificViewObjectContact( ObjectContact& _rObjectContact ); + + private: + ViewContactOfUnoControl(); // never implemented + ViewContactOfUnoControl( const ViewContactOfUnoControl& ); // never implemented + ViewContactOfUnoControl& operator=( const ViewContactOfUnoControl& ); // never implemented + + protected: + // This method is responsible for creating the graphical visualisation data + // ONLY based on model data + virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const; + }; + +//........................................................................ +} } // namespace sdr::contact +//........................................................................ + +#endif // SVX_SDR_CONTACT_VIEWCONTACTOFUNOCONTROL_HXX +// eof diff --git a/svx/inc/svx/sdr/contact/viewcontactofvirtobj.hxx b/svx/inc/svx/sdr/contact/viewcontactofvirtobj.hxx new file mode 100644 index 000000000000..7aef09535149 --- /dev/null +++ b/svx/inc/svx/sdr/contact/viewcontactofvirtobj.hxx @@ -0,0 +1,70 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_CONTACT_VIEWCONTACTOFVIRTOBJ_HXX +#define _SDR_CONTACT_VIEWCONTACTOFVIRTOBJ_HXX + +#include <svx/sdr/contact/viewcontactofsdrobj.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations +class SdrVirtObj; + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class SVX_DLLPUBLIC ViewContactOfVirtObj : public ViewContactOfSdrObj + { + protected: + // internal access to SdrObject. Iplementation in *.cxx to avoid + // including SdrVirtObj here. + SdrVirtObj& GetVirtObj() const; + + public: + // basic constructor, used from SdrObject. + ViewContactOfVirtObj(SdrVirtObj& rObj); + virtual ~ViewContactOfVirtObj(); + + // Access to possible sub-hierarchy + virtual sal_uInt32 GetObjectCount() const; + + protected: + // This method is responsible for creating the graphical visualisation data + // ONLY based on model data + virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_CONTACT_VIEWCONTACTOFVIRTOBJ_HXX + +// eof diff --git a/svx/inc/svx/sdr/contact/viewobjectcontact.hxx b/svx/inc/svx/sdr/contact/viewobjectcontact.hxx new file mode 100644 index 000000000000..3917caebef0e --- /dev/null +++ b/svx/inc/svx/sdr/contact/viewobjectcontact.hxx @@ -0,0 +1,157 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_CONTACT_VIEWOBJECTCONTACT_HXX +#define _SDR_CONTACT_VIEWOBJECTCONTACT_HXX + +#include <sal/types.h> + +#include <vector> +#include <tools/debug.hxx> +#include <tools/gen.hxx> +#include "svx/svxdllapi.h" +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +class Region; + +namespace sdr { namespace contact { + class DisplayInfo; + class ObjectContact; + class ViewContact; + class ViewObjectContactRedirector; +}} + +namespace sdr { namespace animation { + class PrimitiveAnimation; +}} + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class SVX_DLLPUBLIC ViewObjectContact + { + private: + // must-exist and constant contacts + ObjectContact& mrObjectContact; + ViewContact& mrViewContact; + + // This range defines the object's BoundRect + basegfx::B2DRange maObjectRange; + + // PrimitiveSequence of the ViewContact. This contains all necessary information + // for the graphical visualisation and needs to be supported by all VCs which + // can be visualized. + drawinglayer::primitive2d::Primitive2DSequence mxPrimitive2DSequence; + + // the PrimitiveAnimation if Primitive2DSequence contains animations + sdr::animation::PrimitiveAnimation* mpPrimitiveAnimation; + + // bitfield + // This bool gets set when the object gets invalidated by ActionChanged() and + // can be used from the OC to late-invalidates + unsigned mbLazyInvalidate : 1; + + protected: + // make redirector a protected friend, it needs to call createPrimitives as default action + friend class ViewObjectContactRedirector; + + // Called from getPrimitive2DSequence() when vector has changed. Evaluate object animation + // and setup accordingly + void checkForPrimitive2DAnimations(); + + // This method is responsible for creating the graphical visualisation data which is + // stored/cached in the local primitive. Default gets view-independent Primitive + // from the ViewContact using ViewContact::getViewIndependentPrimitive2DSequence(), takes care of + // visibility, handles glue and ghosted. + // This method will not handle included hierarchies and not check geometric visibility. + virtual drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const; + + // method for flushing Primitive2DSequence for VOC implementations + void flushPrimitive2DSequence() { mxPrimitive2DSequence.realloc(0); } + + public: + // basic constructor. + ViewObjectContact(ObjectContact& rObjectContact, ViewContact& rViewContact); + virtual ~ViewObjectContact(); + + // access to ObjectContact + ObjectContact& GetObjectContact() const { return mrObjectContact; } + + // access to ViewContact + ViewContact& GetViewContact() const { return mrViewContact; } + + // get the oebject's size range + const basegfx::B2DRange& getObjectRange() const; + + // A ViewObjectContact was deleted and shall be forgotten. + void RemoveViewObjectContact(ViewObjectContact& rVOContact); + + // React on changes of the object of this ViewContact + virtual void ActionChanged(); + + // LazyInvalidate handling + void triggerLazyInvalidate(); + + // Check if this primitive is animated in any OC (View) which means it has + // generated a PrimitiveAnimation + bool isAnimated() const { return (0 != mpPrimitiveAnimation); } + + // Take some action when new objects are inserted + virtual void ActionChildInserted(ViewContact& rChild); + + // access to the local primitive. This will ensure that the local primitive is + // current in comparing the local one with a fresh created incarnation + // This method will not handle included hierarchies and not check visibility. + drawinglayer::primitive2d::Primitive2DSequence getPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const; + + // test this VOC for visibility concerning model-view stuff like e.g. Layer + virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const; + + // test this VOC for ghosted mode + virtual bool isPrimitiveGhosted(const DisplayInfo& rDisplayInfo) const; + + // process this primitive: Eventually also recursively travel an existing hierarchy, + // e.g. for group objects, scenes or pages. This method will test geometrical visibility. + virtual drawinglayer::primitive2d::Primitive2DSequence getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo) const; + + // just process the sub-hierarchy, used as tooling from getPrimitive2DSequenceHierarchy + drawinglayer::primitive2d::Primitive2DSequence getPrimitive2DSequenceSubHierarchy(DisplayInfo& rDisplayInfo) const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_CONTACT_VIEWOBJECTCONTACT_HXX + +// eof diff --git a/svx/inc/svx/sdr/contact/viewobjectcontactofe3d.hxx b/svx/inc/svx/sdr/contact/viewobjectcontactofe3d.hxx new file mode 100644 index 000000000000..9306f76a5371 --- /dev/null +++ b/svx/inc/svx/sdr/contact/viewobjectcontactofe3d.hxx @@ -0,0 +1,82 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_CONTACT_VIEWOBJECTCONTACTOFE3D_HXX +#define _SDR_CONTACT_VIEWOBJECTCONTACTOFE3D_HXX + +#include <svx/sdr/contact/viewobjectcontactofsdrobj.hxx> +#include <drawinglayer/primitive3d/baseprimitive3d.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +namespace sdr { namespace contact { + class ViewObjectContactOfE3dScene; +}} + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class ViewObjectContactOfE3d : public ViewObjectContactOfSdrObj + { + protected: + // Primitive3D sequence of the ViewContact. This contains all necessary information + // for the graphical visualisation and needs to be supported by all VCs which + // can be visualized. + drawinglayer::primitive3d::Primitive3DSequence mxPrimitive3DSequence; + + // This method is responsible for creating the graphical visualisation data which is + // stored/cached in the local primitive. Default gets view-independent Primitive3D + // from the ViewContact using ViewContact::getViewIndependentPrimitive3DSequence(), takes care of + // visibility and ghosted. + // This method will not handle included hierarchies and not check geometric visibility. + drawinglayer::primitive3d::Primitive3DSequence createPrimitive3DSequence(const DisplayInfo& rDisplayInfo) const; + + // also overload the 2d method to deliver a 2d object with embedd3d 3d and the 3d transformation which is able to + // answer the get2DRange question accordingly + virtual drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const; + + public: + ViewObjectContactOfE3d(ObjectContact& rObjectContact, ViewContact& rViewContact); + virtual ~ViewObjectContactOfE3d(); + + // access to the local primitive sequence. This will ensure that the list is + // current in comparing the local list content with a fresh created incarnation + // This method will not handle included hierarchies or visibility. + drawinglayer::primitive3d::Primitive3DSequence getPrimitive3DSequence(const DisplayInfo& rDisplayInfo) const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_CONTACT_VIEWOBJECTCONTACTOFE3D_HXX + +// eof diff --git a/svx/inc/svx/sdr/contact/viewobjectcontactofe3dscene.hxx b/svx/inc/svx/sdr/contact/viewobjectcontactofe3dscene.hxx new file mode 100644 index 000000000000..49d35b90d03f --- /dev/null +++ b/svx/inc/svx/sdr/contact/viewobjectcontactofe3dscene.hxx @@ -0,0 +1,62 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_CONTACT_VIEWOBJECTCONTACTOFE3DSCENE_HXX +#define _SDR_CONTACT_VIEWOBJECTCONTACTOFE3DSCENE_HXX + +#include <svx/sdr/contact/viewobjectcontactofsdrobj.hxx> +#include <basegfx/matrix/b2dhommatrix.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class SVX_DLLPUBLIC ViewObjectContactOfE3dScene : public ViewObjectContactOfSdrObj + { + protected: + // 2d primitive creator + virtual drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const; + + public: + // basic constructor. + ViewObjectContactOfE3dScene(ObjectContact& rObjectContact, ViewContact& rViewContact); + virtual ~ViewObjectContactOfE3dScene(); + + // process this primitive: Eventually also recursively travel an existing hierarchy, + // e.g. for group objects, scenes or pages. This method will test geometrical visibility. + virtual drawinglayer::primitive2d::Primitive2DSequence getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo) const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_CONTACT_VIEWOBJECTCONTACTOFE3DSCENE_HXX + +// eof diff --git a/svx/inc/svx/sdr/contact/viewobjectcontactofgraphic.hxx b/svx/inc/svx/sdr/contact/viewobjectcontactofgraphic.hxx new file mode 100644 index 000000000000..ee0620353765 --- /dev/null +++ b/svx/inc/svx/sdr/contact/viewobjectcontactofgraphic.hxx @@ -0,0 +1,81 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_CONTACT_VIEWOBJECTCONTACTOFGRAPHIC_HXX +#define _SDR_CONTACT_VIEWOBJECTCONTACTOFGRAPHIC_HXX + +#include <svx/sdr/contact/viewobjectcontactofsdrobj.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations +class SdrGrafObj; + +namespace sdr { namespace event { + class AsynchGraphicLoadingEvent; +}} + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class ViewObjectContactOfGraphic : public ViewObjectContactOfSdrObj + { + private: + // allow async loading event helper to call tooling methods + friend class sdr::event::AsynchGraphicLoadingEvent; + + // Member which takes care for the asynch loading events which may be necessary + // for asynch graphics loading. + sdr::event::AsynchGraphicLoadingEvent* mpAsynchLoadEvent; + + // async graphics loading helpers. Only to be used internally or from the + // event helper class (in .cxx file) + bool impPrepareGraphicWithAsynchroniousLoading(); + bool impPrepareGraphicWithSynchroniousLoading(); + void doAsynchGraphicLoading(); + void forgetAsynchGraphicLoadingEvent(sdr::event::AsynchGraphicLoadingEvent* pEvent); + + protected: + SdrGrafObj& getSdrGrafObj(); + + // This method is responsible for creating the graphical visualisation data + virtual drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const; + + public: + ViewObjectContactOfGraphic(ObjectContact& rObjectContact, ViewContact& rViewContact); + virtual ~ViewObjectContactOfGraphic(); + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_CONTACT_VIEWOBJECTCONTACTOFGRAPHIC_HXX + +// eof diff --git a/svx/inc/svx/sdr/contact/viewobjectcontactofgroup.hxx b/svx/inc/svx/sdr/contact/viewobjectcontactofgroup.hxx new file mode 100644 index 000000000000..da92072fef18 --- /dev/null +++ b/svx/inc/svx/sdr/contact/viewobjectcontactofgroup.hxx @@ -0,0 +1,59 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_CONTACT_VIEWOBJECTCONTACTOFGROUP_HXX +#define _SDR_CONTACT_VIEWOBJECTCONTACTOFGROUP_HXX + +#include <svx/sdr/contact/viewobjectcontactofsdrobj.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class SVX_DLLPUBLIC ViewObjectContactOfGroup : public ViewObjectContactOfSdrObj + { + public: + // basic constructor. + ViewObjectContactOfGroup(ObjectContact& rObjectContact, ViewContact& rViewContact); + virtual ~ViewObjectContactOfGroup(); + + // This method recursively paints the draw hierarchy. + virtual drawinglayer::primitive2d::Primitive2DSequence getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo) const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_CONTACT_VIEWOBJECTCONTACTOFGROUP_HXX + +// eof diff --git a/svx/inc/svx/sdr/contact/viewobjectcontactofmasterpagedescriptor.hxx b/svx/inc/svx/sdr/contact/viewobjectcontactofmasterpagedescriptor.hxx new file mode 100644 index 000000000000..3cb7ba2a7f84 --- /dev/null +++ b/svx/inc/svx/sdr/contact/viewobjectcontactofmasterpagedescriptor.hxx @@ -0,0 +1,65 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_CONTACT_VIEWOBJECTCONTACTOFMASTERPAGEDESCRIPTOR_HXX +#define _SDR_CONTACT_VIEWOBJECTCONTACTOFMASTERPAGEDESCRIPTOR_HXX + +#include <svx/sdr/contact/viewobjectcontact.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +namespace sdr { + class MasterPageDescriptor; +} + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class ViewObjectContactOfMasterPageDescriptor : public ViewObjectContact + { + public: + ViewObjectContactOfMasterPageDescriptor(ObjectContact& rObjectContact, ViewContact& rViewContact); + virtual ~ViewObjectContactOfMasterPageDescriptor(); + + // access to MasterPageDescriptor + sdr::MasterPageDescriptor& GetMasterPageDescriptor() const; + + virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const; + virtual drawinglayer::primitive2d::Primitive2DSequence getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo) const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_CONTACT_VIEWOBJECTCONTACTOFSDRPAGE_HXX + +// eof diff --git a/svx/inc/svx/sdr/contact/viewobjectcontactofpageobj.hxx b/svx/inc/svx/sdr/contact/viewobjectcontactofpageobj.hxx new file mode 100644 index 000000000000..747f25cba3b6 --- /dev/null +++ b/svx/inc/svx/sdr/contact/viewobjectcontactofpageobj.hxx @@ -0,0 +1,71 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_CONTACT_VIEWOBJECTCONTACTOFPAGEOBJ_HXX +#define _SDR_CONTACT_VIEWOBJECTCONTACTOFPAGEOBJ_HXX + +#include <svx/sdr/contact/viewobjectcontactofsdrobj.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +namespace sdr { namespace contact { + class PagePrimitiveExtractor; +}} + +class SdrPage; + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class SVX_DLLPUBLIC ViewObjectContactOfPageObj : public ViewObjectContactOfSdrObj + { + private: + // the page painter helper + PagePrimitiveExtractor* mpExtractor; + + protected: + // This method is responsible for creating the graphical visualisation data which is + // stored/cached in the local primitive. + // This method will not handle included hierarchies and not check geometric visibility. + virtual drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const; + + public: + ViewObjectContactOfPageObj(ObjectContact& rObjectContact, ViewContact& rViewContact); + virtual ~ViewObjectContactOfPageObj(); + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_CONTACT_VIEWOBJECTCONTACTOFPAGEOBJ_HXX + +// eof diff --git a/svx/inc/svx/sdr/contact/viewobjectcontactofsdrmediaobj.hxx b/svx/inc/svx/sdr/contact/viewobjectcontactofsdrmediaobj.hxx new file mode 100644 index 000000000000..d0fcfd6698f9 --- /dev/null +++ b/svx/inc/svx/sdr/contact/viewobjectcontactofsdrmediaobj.hxx @@ -0,0 +1,72 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_CONTACT_VIEWOBJECTCONTACTOFSDRMEDIAOBJ_HXX +#define _SDR_CONTACT_VIEWOBJECTCONTACTOFSDRMEDIAOBJ_HXX + +#include <svx/sdr/contact/viewobjectcontactofsdrobj.hxx> +#include <svx/sdr/contact/viewobjectcontact.hxx> + +namespace avmedia { class MediaItem; } +class Window; + +namespace sdr +{ + namespace contact + { + class SdrMediaWindow; + + class ViewObjectContactOfSdrMediaObj : public ViewObjectContactOfSdrObj + { + public: + + ViewObjectContactOfSdrMediaObj( ObjectContact& rObjectContact, + ViewContact& rViewContact, + const ::avmedia::MediaItem& rMediaItem ); + virtual ~ViewObjectContactOfSdrMediaObj(); + + public: + + Window* getWindow() const; + + bool hasPreferredSize() const; + Size getPreferredSize() const; + + void updateMediaItem( ::avmedia::MediaItem& rItem ) const; + void executeMediaItem( const ::avmedia::MediaItem& rItem ); + + private: + + ::sdr::contact::SdrMediaWindow* mpMediaWindow; + + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif // _SDR_CONTACT_VIEWOBJECTCONTACTOFSDRMEDIAOBJ_HXX diff --git a/svx/inc/svx/sdr/contact/viewobjectcontactofsdrobj.hxx b/svx/inc/svx/sdr/contact/viewobjectcontactofsdrobj.hxx new file mode 100644 index 000000000000..88245c46399e --- /dev/null +++ b/svx/inc/svx/sdr/contact/viewobjectcontactofsdrobj.hxx @@ -0,0 +1,61 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_CONTACT_VIEWOBJECTCONTACTOFSDROBJ_HXX +#define _SDR_CONTACT_VIEWOBJECTCONTACTOFSDROBJ_HXX + +#include <svx/sdr/contact/viewobjectcontact.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations +class SdrObject; + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class SVX_DLLPUBLIC ViewObjectContactOfSdrObj : public ViewObjectContact + { + protected: + const SdrObject& getSdrObject() const; + + public: + ViewObjectContactOfSdrObj(ObjectContact& rObjectContact, ViewContact& rViewContact); + virtual ~ViewObjectContactOfSdrObj(); + + virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_CONTACT_VIEWOBJECTCONTACTOFSDROBJ_HXX + +// eof diff --git a/svx/inc/svx/sdr/contact/viewobjectcontactofsdrole2obj.hxx b/svx/inc/svx/sdr/contact/viewobjectcontactofsdrole2obj.hxx new file mode 100644 index 000000000000..db3020023198 --- /dev/null +++ b/svx/inc/svx/sdr/contact/viewobjectcontactofsdrole2obj.hxx @@ -0,0 +1,62 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_CONTACT_VIEWOBJECTCONTACTOFSDROLE2OBJ_HXX +#define _SDR_CONTACT_VIEWOBJECTCONTACTOFSDROLE2OBJ_HXX + +#include <svx/sdr/contact/viewobjectcontactofsdrobj.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations +class SdrOle2Obj; + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class ViewObjectContactOfSdrOle2Obj : public ViewObjectContactOfSdrObj + { + protected: + const SdrOle2Obj& getSdrOle2Object() const; + + // This method is responsible for creating the graphical visualisation data + virtual drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const; + + public: + ViewObjectContactOfSdrOle2Obj(ObjectContact& rObjectContact, ViewContact& rViewContact); + virtual ~ViewObjectContactOfSdrOle2Obj(); + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_CONTACT_VIEWOBJECTCONTACTOFSDROLE2OBJ_HXX + +// eof diff --git a/svx/inc/svx/sdr/contact/viewobjectcontactofsdrpage.hxx b/svx/inc/svx/sdr/contact/viewobjectcontactofsdrpage.hxx new file mode 100644 index 000000000000..379112a35d30 --- /dev/null +++ b/svx/inc/svx/sdr/contact/viewobjectcontactofsdrpage.hxx @@ -0,0 +1,246 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_CONTACT_VIEWOBJECTCONTACTOFSDRPAGE_HXX +#define _SDR_CONTACT_VIEWOBJECTCONTACTOFSDRPAGE_HXX + +#include <svx/sdr/contact/viewobjectcontact.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +class SdrPage; + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class SVX_DLLPUBLIC ViewObjectContactOfPageSubObject : public ViewObjectContact + { + protected: + const SdrPage& getPage() const; + + public: + ViewObjectContactOfPageSubObject(ObjectContact& rObjectContact, ViewContact& rViewContact); + virtual ~ViewObjectContactOfPageSubObject(); + + virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const; + virtual bool isPrimitiveGhosted(const DisplayInfo& rDisplayInfo) const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class SVX_DLLPUBLIC ViewObjectContactOfPageBackground : public ViewObjectContactOfPageSubObject + { + protected: + virtual drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const; + + public: + ViewObjectContactOfPageBackground(ObjectContact& rObjectContact, ViewContact& rViewContact); + virtual ~ViewObjectContactOfPageBackground(); + + virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class SVX_DLLPUBLIC ViewObjectContactOfMasterPage : public ViewObjectContactOfPageSubObject + { + protected: + public: + ViewObjectContactOfMasterPage(ObjectContact& rObjectContact, ViewContact& rViewContact); + virtual ~ViewObjectContactOfMasterPage(); + + virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class SVX_DLLPUBLIC ViewObjectContactOfPageFill : public ViewObjectContactOfPageSubObject + { + protected: + virtual drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const; + + public: + ViewObjectContactOfPageFill(ObjectContact& rObjectContact, ViewContact& rViewContact); + virtual ~ViewObjectContactOfPageFill(); + + virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class SVX_DLLPUBLIC ViewObjectContactOfPageShadow : public ViewObjectContactOfPageSubObject + { + public: + ViewObjectContactOfPageShadow(ObjectContact& rObjectContact, ViewContact& rViewContact); + virtual ~ViewObjectContactOfPageShadow(); + + virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class SVX_DLLPUBLIC ViewObjectContactOfOuterPageBorder : public ViewObjectContactOfPageSubObject + { + public: + ViewObjectContactOfOuterPageBorder(ObjectContact& rObjectContact, ViewContact& rViewContact); + virtual ~ViewObjectContactOfOuterPageBorder(); + + virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class SVX_DLLPUBLIC ViewObjectContactOfInnerPageBorder : public ViewObjectContactOfPageSubObject + { + public: + ViewObjectContactOfInnerPageBorder(ObjectContact& rObjectContact, ViewContact& rViewContact); + virtual ~ViewObjectContactOfInnerPageBorder(); + + virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class SVX_DLLPUBLIC ViewObjectContactOfPageHierarchy : public ViewObjectContactOfPageSubObject + { + public: + ViewObjectContactOfPageHierarchy(ObjectContact& rObjectContact, ViewContact& rViewContact); + virtual ~ViewObjectContactOfPageHierarchy(); + + virtual drawinglayer::primitive2d::Primitive2DSequence getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo) const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class SVX_DLLPUBLIC ViewObjectContactOfPageGrid : public ViewObjectContactOfPageSubObject + { + protected: + virtual drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const; + + public: + ViewObjectContactOfPageGrid(ObjectContact& rObjectContact, ViewContact& rViewContact); + virtual ~ViewObjectContactOfPageGrid(); + + virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class SVX_DLLPUBLIC ViewObjectContactOfPageHelplines : public ViewObjectContactOfPageSubObject + { + protected: + virtual drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const; + + public: + ViewObjectContactOfPageHelplines(ObjectContact& rObjectContact, ViewContact& rViewContact); + virtual ~ViewObjectContactOfPageHelplines(); + + virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class SVX_DLLPUBLIC ViewObjectContactOfSdrPage : public ViewObjectContact + { + public: + ViewObjectContactOfSdrPage(ObjectContact& rObjectContact, ViewContact& rViewContact); + virtual ~ViewObjectContactOfSdrPage(); + + virtual drawinglayer::primitive2d::Primitive2DSequence getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo) const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_CONTACT_VIEWOBJECTCONTACTOFSDRPAGE_HXX + +// eof diff --git a/svx/inc/svx/sdr/contact/viewobjectcontactofunocontrol.hxx b/svx/inc/svx/sdr/contact/viewobjectcontactofunocontrol.hxx new file mode 100644 index 000000000000..9e70771e5844 --- /dev/null +++ b/svx/inc/svx/sdr/contact/viewobjectcontactofunocontrol.hxx @@ -0,0 +1,142 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SVX_SDR_CONTACT_VIEWOBJECTCONTACTOFUNOCONTROL_HXX +#define SVX_SDR_CONTACT_VIEWOBJECTCONTACTOFUNOCONTROL_HXX + +#include <svx/sdr/contact/viewobjectcontactofsdrobj.hxx> + +/** === begin UNO includes === **/ +#include <com/sun/star/uno/Reference.hxx> +/** === end UNO includes === **/ +#include <rtl/ref.hxx> +#include <svx/svxdllapi.h> + +class OutputDevice; +class Window; +class SdrUnoObj; +namespace com { namespace sun { namespace star { + namespace awt { + class XControl; + class XControlContainer; + } +} } } + +//........................................................................ +namespace sdr { namespace contact { +//........................................................................ + + class ViewContactOfUnoControl; + class ObjectContactOfPageView; + //==================================================================== + //= ViewObjectContactOfUnoControl + //==================================================================== + class ViewObjectContactOfUnoControl_Impl; + class SVX_DLLPRIVATE ViewObjectContactOfUnoControl : public ViewObjectContactOfSdrObj + { + protected: + ::rtl::Reference< ViewObjectContactOfUnoControl_Impl > m_pImpl; + + public: + ViewObjectContactOfUnoControl( ObjectContact& _rObjectContact, ViewContactOfUnoControl& _rViewContact ); + /// determines whether an XControl already exists, and is currently visible + bool isControlVisible() const; + + /// returns the ->XControl instance belonging to the instance, creates it if necessary + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > + getControl(); + + /** retrieves a temporary XControl instance, whose parent is the given device + @seealso SdrUnoObj::GetTemporaryControlForWindow + */ + static ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > + getTemporaryControlForWindow( + const Window& _rWindow, + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >& _inout_ControlContainer, + const SdrUnoObj& _rUnoObject + ); + + /// ensures that the control belonging to this instances has a given visibility + void ensureControlVisibility( bool _bVisible ) const; + + /** sets the design/alive mode of the control + */ + void setControlDesignMode( bool _bDesignMode ) const; + + /** callback from impl class to react on changes of properties form the XControlModel + */ + void propertyChange(); + + /** React on changes of the object of this ViewContact + */ + virtual void ActionChanged(); + + /** to be called when any aspect of the control which requires view updates changed + */ + struct ImplAccess { friend class ViewObjectContactOfUnoControl_Impl; friend class ViewObjectContactOfUnoControl; private: ImplAccess() { } }; + void onControlChangedOrModified( ImplAccess ) { impl_onControlChangedOrModified(); } + + protected: + ~ViewObjectContactOfUnoControl(); + + // support for Primitive2D + virtual drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const; + + // visibility check + virtual bool isPrimitiveVisible( const DisplayInfo& _rDisplayInfo ) const; + /// to be called when any aspect of the control which requires view updates changed + void impl_onControlChangedOrModified(); + + private: + ViewObjectContactOfUnoControl(); // never implemented + ViewObjectContactOfUnoControl( const ViewObjectContactOfUnoControl& ); // never implemented + ViewObjectContactOfUnoControl& operator=( const ViewObjectContactOfUnoControl& ); // never implemented + }; + + //==================================================================== + //= UnoControlPrintOrPreviewContact + //==================================================================== + class SVX_DLLPRIVATE UnoControlPrintOrPreviewContact : public ViewObjectContactOfUnoControl + { + public: + UnoControlPrintOrPreviewContact( ObjectContactOfPageView& _rObjectContact, ViewContactOfUnoControl& _rViewContact ); + ~UnoControlPrintOrPreviewContact(); + + private: + UnoControlPrintOrPreviewContact(); // never implemented + UnoControlPrintOrPreviewContact( const UnoControlPrintOrPreviewContact& ); // never implemented + UnoControlPrintOrPreviewContact& operator=( const UnoControlPrintOrPreviewContact& ); // never implemented + + virtual drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequence(const DisplayInfo& rDisplayInfo ) const; + }; + +//........................................................................ +} } // namespace sdr::contact +//........................................................................ + +#endif // SVX_SDR_CONTACT_VIEWOBJECTCONTACTOFUNOCONTROL_HXX + diff --git a/svx/inc/svx/sdr/contact/viewobjectcontactredirector.hxx b/svx/inc/svx/sdr/contact/viewobjectcontactredirector.hxx new file mode 100644 index 000000000000..00f18751fb81 --- /dev/null +++ b/svx/inc/svx/sdr/contact/viewobjectcontactredirector.hxx @@ -0,0 +1,74 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SDR_CONTACT_VIEWOBJECTCONTACTREDIRECTOR_HXX +#define _SDR_CONTACT_VIEWOBJECTCONTACTREDIRECTOR_HXX + +#include "svx/svxdllapi.h" +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +namespace sdr { namespace contact { + class DisplayInfo; + class ViewObjectContact; +}} + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + // This class provides a mechanism to redirect the paint mechanism for all or + // single ViewObjectContacts. An own derivation may be set at single ViewContacts + // or at the ObjectContact for redirecting all. If both is used, the one at single + // objects will have priority. + class SVX_DLLPUBLIC ViewObjectContactRedirector + { + public: + // basic constructor. + ViewObjectContactRedirector(); + + // The destructor. + virtual ~ViewObjectContactRedirector(); + + // all default implementations just call the same methods at the original. To do something + // different, overload the method and at least do what the method does. + virtual drawinglayer::primitive2d::Primitive2DSequence createRedirectedPrimitive2DSequence( + const sdr::contact::ViewObjectContact& rOriginal, + const sdr::contact::DisplayInfo& rDisplayInfo); + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_CONTACT_VIEWOBJECTCONTACTREDIRECTOR_HXX + +// eof |