diff options
Diffstat (limited to 'include/svx/sdr')
111 files changed, 9966 insertions, 0 deletions
diff --git a/include/svx/sdr/animation/animationstate.hxx b/include/svx/sdr/animation/animationstate.hxx new file mode 100644 index 000000000000..39fcf8ae04f1 --- /dev/null +++ b/include/svx/sdr/animation/animationstate.hxx @@ -0,0 +1,75 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_ANIMATION_ANIMATIONSTATE_HXX +#define _SDR_ANIMATION_ANIMATIONSTATE_HXX + +#include <sal/types.h> +#include <vector> +#include <svx/sdr/animation/scheduler.hxx> +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +namespace sdr +{ + namespace contact + { + class ViewObjectContact; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace animation + { + class PrimitiveAnimation : public Event + { + protected: + // the animated VOC + sdr::contact::ViewObjectContact& mrVOContact; + + // the vetor of animated primitives + drawinglayer::primitive2d::Primitive2DSequence maAnimatedPrimitives; + + // local helpers + double getSmallestNextTime(double fCurrentTime); + void prepareNextEvent(); + + public: + // basic constructor. + PrimitiveAnimation(sdr::contact::ViewObjectContact& rVOContact, const drawinglayer::primitive2d::Primitive2DSequence& rAnimatedPrimitives); + + // destructor + virtual ~PrimitiveAnimation(); + + // execute event, from base class Event + virtual void Trigger(sal_uInt32 nTime); + }; + } // end of namespace animation +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_ANIMATION_ANIMATIONSTATE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/animation/objectanimator.hxx b/include/svx/sdr/animation/objectanimator.hxx new file mode 100644 index 000000000000..0c59afee92f5 --- /dev/null +++ b/include/svx/sdr/animation/objectanimator.hxx @@ -0,0 +1,49 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_ANIMATION_OBJECTANIMATOR_HXX +#define _SDR_ANIMATION_OBJECTANIMATOR_HXX + +#include <sal/types.h> +#include <vector> +#include <vcl/timer.hxx> +#include <svx/sdr/animation/scheduler.hxx> +#include <svx/sdr/animation/animationstate.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace animation + { + class primitiveAnimator : public Scheduler + { + public: + // basic constructor and destructor + primitiveAnimator(); + SVX_DLLPUBLIC virtual ~primitiveAnimator(); + }; + } // end of namespace animation +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_ANIMATION_OBJECTANIMATOR_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/animation/scheduler.hxx b/include/svx/sdr/animation/scheduler.hxx new file mode 100644 index 000000000000..a2681b740eb1 --- /dev/null +++ b/include/svx/sdr/animation/scheduler.hxx @@ -0,0 +1,148 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_ANIMATION_SCHEDULER_HXX +#define _SDR_ANIMATION_SCHEDULER_HXX + +#include <sal/types.h> +#include <vcl/timer.hxx> +#include <svx/svxdllapi.h> + +////////////////////////////////////////////////////////////////////////////// +// event class + +namespace sdr +{ + namespace animation + { + class Event + { + // time of event in ms + sal_uInt32 mnTime; + + // pointer for simply linked list + Event* mpNext; + + public: + // constructor/destructor + explicit Event(sal_uInt32 nTime); + SVX_DLLPUBLIC virtual ~Event(); + + // access to mpNext + Event* GetNext() const; + void SetNext(Event* pNew); + + // get/set time + sal_uInt32 GetTime() const; + void SVX_DLLPUBLIC SetTime(sal_uInt32 nNew); + + // execute event + virtual void Trigger(sal_uInt32 nTime) = 0; + }; + } // end of namespace animation +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// +// eventlist class + +namespace sdr +{ + namespace animation + { + class EventList + { + // pointer to first entry + Event* mpHead; + + public: + // constructor/destructor + EventList(); + SVX_DLLPUBLIC virtual ~EventList(); + + // insert/remove time dependent + void Insert(Event* pNew); + void Remove(Event* pOld); + + // clear list + void Clear(); + + // get first + Event* GetFirst(); + }; + } // end of namespace animation +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// +// scheduler class + +namespace sdr +{ + namespace animation + { + class Scheduler : public Timer + { + // time in ms + sal_uInt32 mnTime; + + // next delta time + sal_uInt32 mnDeltaTime; + + // list of events + EventList maList; + + // Flag which remembers if this timer is paused. Default + // is false. + bool mbIsPaused; + + public: + // constructor/destructor + Scheduler(); + SVX_DLLPUBLIC virtual ~Scheduler(); + + // From baseclass Timer, the timeout call + SVX_DLLPUBLIC virtual void Timeout(); + + // get time + sal_uInt32 GetTime(); + + // #i38135# + void SetTime(sal_uInt32 nTime); + + // execute all ripe events, removes executed ones from the scheduler + void triggerEvents(); + + // re-start or stop timer according to event list + void checkTimeout(); + + // insert/remove events, wrapper to EventList methods + void SVX_DLLPUBLIC InsertEvent(Event* pNew); + void RemoveEvent(Event* pOld); + + // get/set pause + bool IsPaused() const { return mbIsPaused; } + void SetPaused(bool bNew); + }; + } // end of namespace animation +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_ANIMATION_SCHEDULER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/attribute/sdrfilltextattribute.hxx b/include/svx/sdr/attribute/sdrfilltextattribute.hxx new file mode 100644 index 000000000000..f64bac542a76 --- /dev/null +++ b/include/svx/sdr/attribute/sdrfilltextattribute.hxx @@ -0,0 +1,65 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_ATTRIBUTE_SDRFILLTEXTATTRIBUTE_HXX +#define _SDR_ATTRIBUTE_SDRFILLTEXTATTRIBUTE_HXX + +#include <sal/types.h> +#include <drawinglayer/attribute/sdrfillattribute.hxx> +#include <drawinglayer/attribute/fillgradientattribute.hxx> +#include <svx/sdr/attribute/sdrtextattribute.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace attribute + { + class SdrFillTextAttribute + { + // shadow and text attributes + SdrFillAttribute maFill; // fill attributes (if used) + FillGradientAttribute maFillFloatTransGradient; // fill float transparence gradient (if used) + SdrTextAttribute maTextAttribute; // text and text attributes (if used) + + public: + SdrFillTextAttribute( + const SdrFillAttribute& rFill, + const FillGradientAttribute& rFillFloatTransGradient, + const SdrTextAttribute& rTextAttribute); + SdrFillTextAttribute(); + SdrFillTextAttribute(const SdrFillTextAttribute& rCandidate); + SdrFillTextAttribute& operator=(const SdrFillTextAttribute& rCandidate); + + // compare operator + bool operator==(const SdrFillTextAttribute& rCandidate) const; + + // data access + const SdrFillAttribute& getFill() const { return maFill; } + const FillGradientAttribute& getFillFloatTransGradient() const { return maFillFloatTransGradient; } + const SdrTextAttribute& getText() const { return maTextAttribute; } + }; + } // end of namespace attribute +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif // _SDR_ATTRIBUTE_SDRFILLTEXTATTRIBUTE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/attribute/sdrformtextattribute.hxx b/include/svx/sdr/attribute/sdrformtextattribute.hxx new file mode 100644 index 000000000000..5a406376dccd --- /dev/null +++ b/include/svx/sdr/attribute/sdrformtextattribute.hxx @@ -0,0 +1,83 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_ATTRIBUTE_SDRFORMTEXTATTRIBUTE_HXX +#define _SDR_ATTRIBUTE_SDRFORMTEXTATTRIBUTE_HXX + +#include <sal/types.h> +#include <svx/xenum.hxx> +#include <tools/color.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predefines + +class SfxItemSet; + +namespace drawinglayer { namespace attribute { + class ImpSdrFormTextAttribute; + class SdrFormTextOutlineAttribute; +}} + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace attribute + { + class SdrFormTextAttribute + { + private: + ImpSdrFormTextAttribute* mpSdrFormTextAttribute; + + public: + /// constructors/assignmentoperator/destructor + SdrFormTextAttribute(const SfxItemSet& rSet); + SdrFormTextAttribute(); + SdrFormTextAttribute(const SdrFormTextAttribute& rCandidate); + SdrFormTextAttribute& operator=(const SdrFormTextAttribute& rCandidate); + ~SdrFormTextAttribute(); + + // checks if the incarnation is default constructed + bool isDefault() const; + + // compare operator + bool operator==(const SdrFormTextAttribute& rCandidate) const; + + // data read access + sal_Int32 getFormTextDistance() const; + sal_Int32 getFormTextStart() const; + sal_Int32 getFormTextShdwXVal() const; + sal_Int32 getFormTextShdwYVal() const; + XFormTextStyle getFormTextStyle() const; + XFormTextAdjust getFormTextAdjust() const; + XFormTextShadow getFormTextShadow() const; + Color getFormTextShdwColor() const; + const SdrFormTextOutlineAttribute& getOutline() const; + const SdrFormTextOutlineAttribute& getShadowOutline() const; + bool getFormTextMirror() const; + bool getFormTextOutline() const; + }; + } // end of namespace attribute +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif // _SDR_ATTRIBUTE_SDRFORMTEXTATTRIBUTE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/attribute/sdrformtextoutlineattribute.hxx b/include/svx/sdr/attribute/sdrformtextoutlineattribute.hxx new file mode 100644 index 000000000000..139fb0fd045e --- /dev/null +++ b/include/svx/sdr/attribute/sdrformtextoutlineattribute.hxx @@ -0,0 +1,74 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_ATTRIBUTE_SDRFORMTEXTOUTLINEATTRIBUTE_HXX +#define _SDR_ATTRIBUTE_SDRFORMTEXTOUTLINEATTRIBUTE_HXX + +#include <sal/types.h> + +////////////////////////////////////////////////////////////////////////////// +// predefines + +namespace drawinglayer { namespace attribute { + class ImpSdrFormTextOutlineAttribute; + class LineAttribute; + class StrokeAttribute; +}} + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace attribute + { + class SdrFormTextOutlineAttribute + { + private: + ImpSdrFormTextOutlineAttribute* mpSdrFormTextOutlineAttribute; + + public: + /// constructors/assignmentoperator/destructor + SdrFormTextOutlineAttribute( + const LineAttribute& rLineAttribute, + const StrokeAttribute& rStrokeAttribute, + sal_uInt8 nTransparence); + SdrFormTextOutlineAttribute(); + SdrFormTextOutlineAttribute(const SdrFormTextOutlineAttribute& rCandidate); + SdrFormTextOutlineAttribute& operator=(const SdrFormTextOutlineAttribute& rCandidate); + ~SdrFormTextOutlineAttribute(); + + // checks if the incarnation is default constructed + bool isDefault() const; + + // compare operator + bool operator==(const SdrFormTextOutlineAttribute& rCandidate) const; + + // data read access + const LineAttribute& getLineAttribute() const; + const StrokeAttribute& getStrokeAttribute() const; + sal_uInt8 getTransparence() const; + }; + } // end of namespace attribute +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif // _SDR_ATTRIBUTE_SDRFORMTEXTOUTLINEATTRIBUTE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/attribute/sdrlinefillshadowtextattribute.hxx b/include/svx/sdr/attribute/sdrlinefillshadowtextattribute.hxx new file mode 100644 index 000000000000..20c853915737 --- /dev/null +++ b/include/svx/sdr/attribute/sdrlinefillshadowtextattribute.hxx @@ -0,0 +1,69 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_ATTRIBUTE_SDRLINEFILLSHADOWTEXTATTRIBUTE_HXX +#define _SDR_ATTRIBUTE_SDRLINEFILLSHADOWTEXTATTRIBUTE_HXX + +#include <sal/types.h> +#include <svx/sdr/attribute/sdrlineshadowtextattribute.hxx> +#include <drawinglayer/attribute/sdrfillattribute.hxx> +#include <drawinglayer/attribute/fillgradientattribute.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace attribute + { + class SdrLineFillShadowTextAttribute : public SdrLineShadowTextAttribute + { + // add fill and transGradient attributes + SdrFillAttribute maFill; // fill attributes (if used) + FillGradientAttribute maFillFloatTransGradient; // fill float transparence gradient (if used) + + public: + SdrLineFillShadowTextAttribute( + const SdrLineAttribute& rLine, + const SdrFillAttribute& rFill, + const SdrLineStartEndAttribute& rLineStartEnd, + const SdrShadowAttribute& rShadow, + const FillGradientAttribute& rFillFloatTransGradient, + const SdrTextAttribute& rTextAttribute); + SdrLineFillShadowTextAttribute(); + SdrLineFillShadowTextAttribute(const SdrLineFillShadowTextAttribute& rCandidate); + SdrLineFillShadowTextAttribute& operator=(const SdrLineFillShadowTextAttribute& rCandidate); + + // checks if the incarnation is default constructed + bool isDefault() const; + + // compare operator + bool operator==(const SdrLineFillShadowTextAttribute& rCandidate) const; + + // data access + const SdrFillAttribute& getFill() const { return maFill; } + const FillGradientAttribute& getFillFloatTransGradient() const { return maFillFloatTransGradient; } + }; + } // end of namespace attribute +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif // _SDR_ATTRIBUTE_SDRLINEFILLSHADOWTEXTATTRIBUTE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/attribute/sdrlineshadowtextattribute.hxx b/include/svx/sdr/attribute/sdrlineshadowtextattribute.hxx new file mode 100644 index 000000000000..4a82d683ec26 --- /dev/null +++ b/include/svx/sdr/attribute/sdrlineshadowtextattribute.hxx @@ -0,0 +1,67 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_ATTRIBUTE_SDRLINESHADOWTEXTATTRIBUTE_HXX +#define _SDR_ATTRIBUTE_SDRLINESHADOWTEXTATTRIBUTE_HXX + +#include <sal/types.h> +#include <svx/sdr/attribute/sdrshadowtextattribute.hxx> +#include <drawinglayer/attribute/sdrlineattribute.hxx> +#include <drawinglayer/attribute/sdrlinestartendattribute.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace attribute + { + class SdrLineShadowTextAttribute : public SdrShadowTextAttribute + { + // line, shadow, lineStartEnd and text attributes + SdrLineAttribute maLine; // line attributes (if used) + SdrLineStartEndAttribute maLineStartEnd; // line start end (if used) + + public: + SdrLineShadowTextAttribute( + const SdrLineAttribute& rLine, + const SdrLineStartEndAttribute& rLineStartEnd, + const SdrShadowAttribute& rShadow, + const SdrTextAttribute& rTextAttribute); + SdrLineShadowTextAttribute(); + SdrLineShadowTextAttribute(const SdrLineShadowTextAttribute& rCandidate); + SdrLineShadowTextAttribute& operator=(const SdrLineShadowTextAttribute& rCandidate); + + // checks if the incarnation is default constructed + bool isDefault() const; + + // compare operator + bool operator==(const SdrLineShadowTextAttribute& rCandidate) const; + + // data access + const SdrLineAttribute& getLine() const { return maLine; } + const SdrLineStartEndAttribute& getLineStartEnd() const { return maLineStartEnd; } + }; + } // end of namespace attribute +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif // _SDR_ATTRIBUTE_SDRLINESHADOWTEXTATTRIBUTE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/attribute/sdrshadowtextattribute.hxx b/include/svx/sdr/attribute/sdrshadowtextattribute.hxx new file mode 100644 index 000000000000..0b82edc12241 --- /dev/null +++ b/include/svx/sdr/attribute/sdrshadowtextattribute.hxx @@ -0,0 +1,64 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_ATTRIBUTE_SDRSHADOWTEXTATTRIBUTE_HXX +#define _SDR_ATTRIBUTE_SDRSHADOWTEXTATTRIBUTE_HXX + +#include <sal/types.h> +#include <drawinglayer/attribute/sdrshadowattribute.hxx> +#include <svx/sdr/attribute/sdrtextattribute.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace attribute + { + class SdrShadowTextAttribute + { + // shadow and text attributes + SdrShadowAttribute maShadow; // shadow attributes (if used) + SdrTextAttribute maTextAttribute; // text and text attributes (if used) + + public: + SdrShadowTextAttribute( + const SdrShadowAttribute& rShadow, + const SdrTextAttribute& rTextAttribute); + SdrShadowTextAttribute(); + SdrShadowTextAttribute(const SdrShadowTextAttribute& rCandidate); + SdrShadowTextAttribute& operator=(const SdrShadowTextAttribute& rCandidate); + + // checks if the incarnation is default constructed + bool isDefault() const; + + // compare operator + bool operator==(const SdrShadowTextAttribute& rCandidate) const; + + // data access + const SdrShadowAttribute& getShadow() const { return maShadow; } + const SdrTextAttribute& getText() const { return maTextAttribute; } + }; + } // end of namespace attribute +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif // _SDR_ATTRIBUTE_SDRSHADOWTEXTATTRIBUTE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/attribute/sdrtextattribute.hxx b/include/svx/sdr/attribute/sdrtextattribute.hxx new file mode 100644 index 000000000000..ac85aebc8d46 --- /dev/null +++ b/include/svx/sdr/attribute/sdrtextattribute.hxx @@ -0,0 +1,122 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_ATTRIBUTE_SDRTEXTATTRIBUTE_HXX +#define _SDR_ATTRIBUTE_SDRTEXTATTRIBUTE_HXX + +#include <sal/types.h> +#include <svx/xenum.hxx> +#include <editeng/outlobj.hxx> +#include <svx/sdtaitm.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predefines + +class SdrText; + +namespace drawinglayer { namespace animation { + class AnimationEntryList; +}} + +namespace drawinglayer { namespace attribute { + class SdrFormTextAttribute; +}} + +namespace drawinglayer { namespace attribute { + class ImpSdrTextAttribute; +}} + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace attribute + { + class SdrTextAttribute + { + private: + ImpSdrTextAttribute* mpSdrTextAttribute; + + public: + /// constructors/assignmentoperator/destructor + SdrTextAttribute( + const SdrText& rSdrText, + const OutlinerParaObject& rOutlinerParaObject, + XFormTextStyle eFormTextStyle, + sal_Int32 aTextLeftDistance, + sal_Int32 aTextUpperDistance, + sal_Int32 aTextRightDistance, + sal_Int32 aTextLowerDistance, + SdrTextHorzAdjust aSdrTextHorzAdjust, + SdrTextVertAdjust aSdrTextVertAdjust, + bool bContour, + bool bFitToSize, + bool bAutoFit, + bool bHideContour, + bool bBlink, + bool bScroll, + bool bInEditMode, + bool bFixedCellHeight, + bool bWrongSpell); + SdrTextAttribute(); + SdrTextAttribute(const SdrTextAttribute& rCandidate); + SdrTextAttribute& operator=(const SdrTextAttribute& rCandidate); + ~SdrTextAttribute(); + + // checks if the incarnation is default constructed + bool isDefault() const; + + // compare operator + bool operator==(const SdrTextAttribute& rCandidate) const; + + // data read access + const SdrText& getSdrText() const; + const OutlinerParaObject& getOutlinerParaObject() const; + bool isContour() const; + bool isFitToSize() const; + bool isAutoFit() const; + bool isHideContour() const; + bool isBlink() const; + bool isScroll() const; + bool isInEditMode() const; + bool isFixedCellHeight() const; + const SdrFormTextAttribute& getSdrFormTextAttribute() const; + sal_Int32 getTextLeftDistance() const; + sal_Int32 getTextUpperDistance() const; + sal_Int32 getTextRightDistance() const; + sal_Int32 getTextLowerDistance() const; + SdrTextHorzAdjust getSdrTextHorzAdjust() const; + SdrTextVertAdjust getSdrTextVertAdjust() const; + + // helpers: animation timing generators + void getBlinkTextTiming( + drawinglayer::animation::AnimationEntryList& rAnimList) const; + void getScrollTextTiming( + drawinglayer::animation::AnimationEntryList& rAnimList, + double fFrameLength, + double fTextLength) const; + }; + } // end of namespace attribute +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif // _SDR_ATTRIBUTE_SDRTEXTATTRIBUTE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/displayinfo.hxx b/include/svx/sdr/contact/displayinfo.hxx new file mode 100644 index 000000000000..6c4b85e6f989 --- /dev/null +++ b/include/svx/sdr/contact/displayinfo.hxx @@ -0,0 +1,107 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_CONTACT_DISPLAYINFO_HXX +#define _SDR_CONTACT_DISPLAYINFO_HXX + +#include <svx/svdsob.hxx> +#include <vcl/region.hxx> +#include "svx/svxdllapi.h" + +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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/objectcontact.hxx b/include/svx/sdr/contact/objectcontact.hxx new file mode 100644 index 000000000000..fb67a18803fd --- /dev/null +++ b/include/svx/sdr/contact/objectcontact.hxx @@ -0,0 +1,221 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/objectcontactofobjlistpainter.hxx b/include/svx/sdr/contact/objectcontactofobjlistpainter.hxx new file mode 100644 index 000000000000..9c4a0bff1763 --- /dev/null +++ b/include/svx/sdr/contact/objectcontactofobjlistpainter.hxx @@ -0,0 +1,145 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/objectcontactofpageview.hxx b/include/svx/sdr/contact/objectcontactofpageview.hxx new file mode 100644 index 000000000000..06371bf35b81 --- /dev/null +++ b/include/svx/sdr/contact/objectcontactofpageview.hxx @@ -0,0 +1,144 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_CONTACT_OBJECTCONTACTOFPAGEVIEW_HXX +#define _SDR_CONTACT_OBJECTCONTACTOFPAGEVIEW_HXX + +#include <svx/sdr/contact/objectcontact.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. + explicit 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewcontact.hxx b/include/svx/sdr/contact/viewcontact.hxx new file mode 100644 index 000000000000..8e136e03afba --- /dev/null +++ b/include/svx/sdr/contact/viewcontact.hxx @@ -0,0 +1,168 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_CONTACT_VIEWCONTACT_HXX +#define _SDR_CONTACT_VIEWCONTACT_HXX + +#include <sal/types.h> +#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; + + // allow embedding if needed (e.g. for SdrObjects, evtl. Name, Title and description get added). This + // is a helper normally used from getViewIndependentPrimitive2DSequence(), but there is one exception + // for 3D scenes + virtual drawinglayer::primitive2d::Primitive2DSequence embedToObjectSpecificInformation(const drawinglayer::primitive2d::Primitive2DSequence& rSource) 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewcontactofe3d.hxx b/include/svx/sdr/contact/viewcontactofe3d.hxx new file mode 100644 index 000000000000..02bdb36e53c0 --- /dev/null +++ b/include/svx/sdr/contact/viewcontactofe3d.hxx @@ -0,0 +1,109 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#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. + explicit 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; + + 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewcontactofe3dcube.hxx b/include/svx/sdr/contact/viewcontactofe3dcube.hxx new file mode 100644 index 000000000000..8207fa558db0 --- /dev/null +++ b/include/svx/sdr/contact/viewcontactofe3dcube.hxx @@ -0,0 +1,61 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_CONTACT_VIEWCONTACTOFE3DCUBE_HXX +#define _SDR_CONTACT_VIEWCONTACTOFE3DCUBE_HXX + +#include <svx/sdr/contact/viewcontactofe3d.hxx> + +////////////////////////////////////////////////////////////////////////////// +// 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewcontactofe3dextrude.hxx b/include/svx/sdr/contact/viewcontactofe3dextrude.hxx new file mode 100644 index 000000000000..53d6b17913d2 --- /dev/null +++ b/include/svx/sdr/contact/viewcontactofe3dextrude.hxx @@ -0,0 +1,61 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_CONTACT_VIEWCONTACTOFE3DEXTRUDE_HXX +#define _SDR_CONTACT_VIEWCONTACTOFE3DEXTRUDE_HXX + +#include <svx/sdr/contact/viewcontactofe3d.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +class E3dExtrudeObj; + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class ViewContactOfE3dExtrude : public ViewContactOfE3d + { + public: + // basic constructor, used from SdrObject. + explicit 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewcontactofe3dlathe.hxx b/include/svx/sdr/contact/viewcontactofe3dlathe.hxx new file mode 100644 index 000000000000..ad57b5588195 --- /dev/null +++ b/include/svx/sdr/contact/viewcontactofe3dlathe.hxx @@ -0,0 +1,61 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_CONTACT_VIEWCONTACTOFE3DLATHE_HXX +#define _SDR_CONTACT_VIEWCONTACTOFE3DLATHE_HXX + +#include <svx/sdr/contact/viewcontactofe3d.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +class E3dLatheObj; + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class ViewContactOfE3dLathe : public ViewContactOfE3d + { + public: + // basic constructor, used from SdrObject. + explicit 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewcontactofe3dpolygon.hxx b/include/svx/sdr/contact/viewcontactofe3dpolygon.hxx new file mode 100644 index 000000000000..295d1c308697 --- /dev/null +++ b/include/svx/sdr/contact/viewcontactofe3dpolygon.hxx @@ -0,0 +1,61 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_CONTACT_VIEWCONTACTOFE3DPOLYGON_HXX +#define _SDR_CONTACT_VIEWCONTACTOFE3DPOLYGON_HXX + +#include <svx/sdr/contact/viewcontactofe3d.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +class E3dPolygonObj; + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class ViewContactOfE3dPolygon : public ViewContactOfE3d + { + public: + // basic constructor, used from SdrObject. + explicit 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewcontactofe3dscene.hxx b/include/svx/sdr/contact/viewcontactofe3dscene.hxx new file mode 100644 index 000000000000..bd5879fc0b9d --- /dev/null +++ b/include/svx/sdr/contact/viewcontactofe3dscene.hxx @@ -0,0 +1,114 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#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. + explicit 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewcontactofe3dsphere.hxx b/include/svx/sdr/contact/viewcontactofe3dsphere.hxx new file mode 100644 index 000000000000..dd245d7efa06 --- /dev/null +++ b/include/svx/sdr/contact/viewcontactofe3dsphere.hxx @@ -0,0 +1,61 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_CONTACT_VIEWCONTACTOFE3DSPHERE_HXX +#define _SDR_CONTACT_VIEWCONTACTOFE3DSPHERE_HXX + +#include <svx/sdr/contact/viewcontactofe3d.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +class E3dSphereObj; + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class ViewContactOfE3dSphere : public ViewContactOfE3d + { + public: + // basic constructor, used from SdrObject. + explicit 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewcontactofgraphic.hxx b/include/svx/sdr/contact/viewcontactofgraphic.hxx new file mode 100644 index 000000000000..303ff79bd180 --- /dev/null +++ b/include/svx/sdr/contact/viewcontactofgraphic.hxx @@ -0,0 +1,86 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#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 + explicit 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewcontactofgroup.hxx b/include/svx/sdr/contact/viewcontactofgroup.hxx new file mode 100644 index 000000000000..eb1c4a2517ce --- /dev/null +++ b/include/svx/sdr/contact/viewcontactofgroup.hxx @@ -0,0 +1,67 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#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. + explicit 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewcontactofmasterpagedescriptor.hxx b/include/svx/sdr/contact/viewcontactofmasterpagedescriptor.hxx new file mode 100644 index 000000000000..fc2df17d9e0a --- /dev/null +++ b/include/svx/sdr/contact/viewcontactofmasterpagedescriptor.hxx @@ -0,0 +1,77 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#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 + explicit 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewcontactofpageobj.hxx b/include/svx/sdr/contact/viewcontactofpageobj.hxx new file mode 100644 index 000000000000..30a53e5eb9ac --- /dev/null +++ b/include/svx/sdr/contact/viewcontactofpageobj.hxx @@ -0,0 +1,68 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#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; + public: + // basic constructor, used from SdrObject. + explicit 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewcontactofsdrcaptionobj.hxx b/include/svx/sdr/contact/viewcontactofsdrcaptionobj.hxx new file mode 100644 index 000000000000..19cc9976dbdf --- /dev/null +++ b/include/svx/sdr/contact/viewcontactofsdrcaptionobj.hxx @@ -0,0 +1,62 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#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. + explicit 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewcontactofsdrcircobj.hxx b/include/svx/sdr/contact/viewcontactofsdrcircobj.hxx new file mode 100644 index 000000000000..27059b275437 --- /dev/null +++ b/include/svx/sdr/contact/viewcontactofsdrcircobj.hxx @@ -0,0 +1,62 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#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. + explicit 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewcontactofsdredgeobj.hxx b/include/svx/sdr/contact/viewcontactofsdredgeobj.hxx new file mode 100644 index 000000000000..0ca7d4101b7b --- /dev/null +++ b/include/svx/sdr/contact/viewcontactofsdredgeobj.hxx @@ -0,0 +1,62 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#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. + explicit 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewcontactofsdrmeasureobj.hxx b/include/svx/sdr/contact/viewcontactofsdrmeasureobj.hxx new file mode 100644 index 000000000000..83a32a17a9ec --- /dev/null +++ b/include/svx/sdr/contact/viewcontactofsdrmeasureobj.hxx @@ -0,0 +1,62 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#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. + explicit 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewcontactofsdrmediaobj.hxx b/include/svx/sdr/contact/viewcontactofsdrmediaobj.hxx new file mode 100644 index 000000000000..3ad8580cf12e --- /dev/null +++ b/include/svx/sdr/contact/viewcontactofsdrmediaobj.hxx @@ -0,0 +1,83 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_CONTACT_VIEWCONTACTOFSDRMEDIAOBJ_HXX +#define _SDR_CONTACT_VIEWCONTACTOFSDRMEDIAOBJ_HXX + +#include <svx/sdr/contact/viewcontactofsdrobj.hxx> +#include "svx/svxdllapi.h" +#include <tools/gen.hxx> + +////////////////////////////////////////////////////////////////////////////// +// 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. + explicit ViewContactOfSdrMediaObj( SdrMediaObj& rMediaObj ); + virtual ~ViewContactOfSdrMediaObj(); + + public: + + // access to SdrMediaObj + SdrMediaObj& GetSdrMediaObj() const + { + return (SdrMediaObj&)GetSdrObject(); + } + + 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewcontactofsdrobj.hxx b/include/svx/sdr/contact/viewcontactofsdrobj.hxx new file mode 100644 index 000000000000..b628637cb707 --- /dev/null +++ b/include/svx/sdr/contact/viewcontactofsdrobj.hxx @@ -0,0 +1,96 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#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. + explicit 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; + + // allow embedding if needed (e.g. for SdrObjects, evtl. Name, Title and description get added). This + // is a helper normally used from getViewIndependentPrimitive2DSequence(), but there is one exception + // for 3D scenes + virtual drawinglayer::primitive2d::Primitive2DSequence embedToObjectSpecificInformation(const drawinglayer::primitive2d::Primitive2DSequence& rSource) const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_CONTACT_VIEWCONTACTOFSDROBJ_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewcontactofsdrobjcustomshape.hxx b/include/svx/sdr/contact/viewcontactofsdrobjcustomshape.hxx new file mode 100644 index 000000000000..8b4e06100a0c --- /dev/null +++ b/include/svx/sdr/contact/viewcontactofsdrobjcustomshape.hxx @@ -0,0 +1,65 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#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. + explicit 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewcontactofsdrole2obj.hxx b/include/svx/sdr/contact/viewcontactofsdrole2obj.hxx new file mode 100644 index 000000000000..fb97f3e49884 --- /dev/null +++ b/include/svx/sdr/contact/viewcontactofsdrole2obj.hxx @@ -0,0 +1,77 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_CONTACT_VIEWCONTACTOFSDROLE2OBJ_HXX +#define _SDR_CONTACT_VIEWCONTACTOFSDROLE2OBJ_HXX + +#include <svx/sdr/contact/viewcontactofsdrrectobj.hxx> +#include <basegfx/matrix/b2dhommatrix.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(); + } + + /// helper to create transformation from SdrObject + basegfx::B2DHomMatrix createObjectTransform() const; + + // basic constructor, used from SdrObject. + explicit 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() 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewcontactofsdrpage.hxx b/include/svx/sdr/contact/viewcontactofsdrpage.hxx new file mode 100644 index 000000000000..b194108541ac --- /dev/null +++ b/include/svx/sdr/contact/viewcontactofsdrpage.hxx @@ -0,0 +1,303 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#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: + explicit 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: + explicit 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: + explicit 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: + explicit 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: + explicit 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: + explicit 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: + explicit 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: + explicit 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. + explicit 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewcontactofsdrpathobj.hxx b/include/svx/sdr/contact/viewcontactofsdrpathobj.hxx new file mode 100644 index 000000000000..19ef798b8aaf --- /dev/null +++ b/include/svx/sdr/contact/viewcontactofsdrpathobj.hxx @@ -0,0 +1,62 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#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. + explicit 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewcontactofsdrrectobj.hxx b/include/svx/sdr/contact/viewcontactofsdrrectobj.hxx new file mode 100644 index 000000000000..7d78befffe0e --- /dev/null +++ b/include/svx/sdr/contact/viewcontactofsdrrectobj.hxx @@ -0,0 +1,62 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#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. + explicit 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewcontactoftextobj.hxx b/include/svx/sdr/contact/viewcontactoftextobj.hxx new file mode 100644 index 000000000000..bb302ad8f9c0 --- /dev/null +++ b/include/svx/sdr/contact/viewcontactoftextobj.hxx @@ -0,0 +1,57 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#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. + explicit ViewContactOfTextObj(SdrTextObj& rTextObj); + virtual ~ViewContactOfTextObj(); + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_CONTACT_VIEWCONTACTOFTEXTOBJ_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewcontactofunocontrol.hxx b/include/svx/sdr/contact/viewcontactofunocontrol.hxx new file mode 100644 index 000000000000..aeeb2d6183c0 --- /dev/null +++ b/include/svx/sdr/contact/viewcontactofunocontrol.hxx @@ -0,0 +1,92 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef SVX_SDR_CONTACT_VIEWCONTACTOFUNOCONTROL_HXX +#define SVX_SDR_CONTACT_VIEWCONTACTOFUNOCONTROL_HXX + +#include <com/sun/star/uno/Reference.hxx> +#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()); + } + + explicit 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewcontactofvirtobj.hxx b/include/svx/sdr/contact/viewcontactofvirtobj.hxx new file mode 100644 index 000000000000..8e3719eae357 --- /dev/null +++ b/include/svx/sdr/contact/viewcontactofvirtobj.hxx @@ -0,0 +1,62 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#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. + explicit 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewobjectcontact.hxx b/include/svx/sdr/contact/viewobjectcontact.hxx new file mode 100644 index 000000000000..96c3918a4c42 --- /dev/null +++ b/include/svx/sdr/contact/viewobjectcontact.hxx @@ -0,0 +1,147 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_CONTACT_VIEWOBJECTCONTACT_HXX +#define _SDR_CONTACT_VIEWOBJECTCONTACT_HXX + +#include <sal/types.h> + +#include <vector> +#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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewobjectcontactofe3d.hxx b/include/svx/sdr/contact/viewobjectcontactofe3d.hxx new file mode 100644 index 000000000000..f0fa2758b7f3 --- /dev/null +++ b/include/svx/sdr/contact/viewobjectcontactofe3d.hxx @@ -0,0 +1,74 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewobjectcontactofe3dscene.hxx b/include/svx/sdr/contact/viewobjectcontactofe3dscene.hxx new file mode 100644 index 000000000000..d6d405f5ef95 --- /dev/null +++ b/include/svx/sdr/contact/viewobjectcontactofe3dscene.hxx @@ -0,0 +1,54 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewobjectcontactofgraphic.hxx b/include/svx/sdr/contact/viewobjectcontactofgraphic.hxx new file mode 100644 index 000000000000..e8200d6a429a --- /dev/null +++ b/include/svx/sdr/contact/viewobjectcontactofgraphic.hxx @@ -0,0 +1,73 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewobjectcontactofgroup.hxx b/include/svx/sdr/contact/viewobjectcontactofgroup.hxx new file mode 100644 index 000000000000..fda5610e0568 --- /dev/null +++ b/include/svx/sdr/contact/viewobjectcontactofgroup.hxx @@ -0,0 +1,54 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#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; + + private: + virtual bool isPrimitiveVisibleOnAnyLayer(const SetOfByte& aLayers) const; + }; + } // end of namespace contact +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_CONTACT_VIEWOBJECTCONTACTOFGROUP_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewobjectcontactofmasterpagedescriptor.hxx b/include/svx/sdr/contact/viewobjectcontactofmasterpagedescriptor.hxx new file mode 100644 index 000000000000..f09bd03d86a9 --- /dev/null +++ b/include/svx/sdr/contact/viewobjectcontactofmasterpagedescriptor.hxx @@ -0,0 +1,57 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewobjectcontactofpageobj.hxx b/include/svx/sdr/contact/viewobjectcontactofpageobj.hxx new file mode 100644 index 000000000000..420a464319d5 --- /dev/null +++ b/include/svx/sdr/contact/viewobjectcontactofpageobj.hxx @@ -0,0 +1,63 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewobjectcontactofsdrmediaobj.hxx b/include/svx/sdr/contact/viewobjectcontactofsdrmediaobj.hxx new file mode 100644 index 000000000000..e1e24dab8442 --- /dev/null +++ b/include/svx/sdr/contact/viewobjectcontactofsdrmediaobj.hxx @@ -0,0 +1,66 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_CONTACT_VIEWOBJECTCONTACTOFSDRMEDIAOBJ_HXX +#define _SDR_CONTACT_VIEWOBJECTCONTACTOFSDRMEDIAOBJ_HXX + +#include <svx/sdr/contact/viewobjectcontactofsdrobj.hxx> +#include <svx/sdr/contact/viewobjectcontact.hxx> +#include <tools/gen.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; + + 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewobjectcontactofsdrobj.hxx b/include/svx/sdr/contact/viewobjectcontactofsdrobj.hxx new file mode 100644 index 000000000000..e0384426add3 --- /dev/null +++ b/include/svx/sdr/contact/viewobjectcontactofsdrobj.hxx @@ -0,0 +1,62 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_CONTACT_VIEWOBJECTCONTACTOFSDROBJ_HXX +#define _SDR_CONTACT_VIEWOBJECTCONTACTOFSDROBJ_HXX + +#include <svx/sdr/contact/viewobjectcontact.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations +class SdrObject; +class SetOfByte; + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace contact + { + class SVX_DLLPUBLIC ViewObjectContactOfSdrObj : public ViewObjectContact + { + /** Test whether the primitive is visible on any layer from @c aLayers + + This should be overriden by ViewObjectContacts of SDR classes + that have subparts which can be on different layers (that is, + SdrObjGroup .-) + */ + virtual bool isPrimitiveVisibleOnAnyLayer(const SetOfByte& aLayers) const; + + 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewobjectcontactofsdrole2obj.hxx b/include/svx/sdr/contact/viewobjectcontactofsdrole2obj.hxx new file mode 100644 index 000000000000..6fe19c742481 --- /dev/null +++ b/include/svx/sdr/contact/viewobjectcontactofsdrole2obj.hxx @@ -0,0 +1,54 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewobjectcontactofsdrpage.hxx b/include/svx/sdr/contact/viewobjectcontactofsdrpage.hxx new file mode 100644 index 000000000000..588554b7dd92 --- /dev/null +++ b/include/svx/sdr/contact/viewobjectcontactofsdrpage.hxx @@ -0,0 +1,238 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewobjectcontactofunocontrol.hxx b/include/svx/sdr/contact/viewobjectcontactofunocontrol.hxx new file mode 100644 index 000000000000..a0077a3aa65e --- /dev/null +++ b/include/svx/sdr/contact/viewobjectcontactofunocontrol.hxx @@ -0,0 +1,131 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef SVX_SDR_CONTACT_VIEWOBJECTCONTACTOFUNOCONTROL_HXX +#define SVX_SDR_CONTACT_VIEWOBJECTCONTACTOFUNOCONTROL_HXX + +#include <svx/sdr/contact/viewobjectcontactofsdrobj.hxx> + +#include <com/sun/star/uno/Reference.hxx> +#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 ); + + /// 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewobjectcontactredirector.hxx b/include/svx/sdr/contact/viewobjectcontactredirector.hxx new file mode 100644 index 000000000000..d7f16e1b60bd --- /dev/null +++ b/include/svx/sdr/contact/viewobjectcontactredirector.hxx @@ -0,0 +1,66 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/event/eventhandler.hxx b/include/svx/sdr/event/eventhandler.hxx new file mode 100644 index 000000000000..91ac5491e5c6 --- /dev/null +++ b/include/svx/sdr/event/eventhandler.hxx @@ -0,0 +1,132 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_EVENT_EVENTHANDLER_HXX +#define _SDR_EVENT_EVENTHANDLER_HXX + +#include <sal/types.h> + +#include <vector> +#include <vcl/timer.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +namespace sdr +{ + namespace event + { + class BaseEvent; + class EventHandler; + + // typedefs for a list of BaseEvents + typedef ::std::vector< BaseEvent* > BaseEventVector; + } // end of namespace event +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace event + { + class BaseEvent + { + // the EventHandler this event is registered at + EventHandler& mrEventHandler; + + public: + // basic constructor. + BaseEvent(EventHandler& rEventHandler); + + // destructor + virtual ~BaseEvent(); + + // the called method if the event is triggered + virtual void ExecuteEvent() = 0; + }; + } // end of namespace event +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace event + { + class EventHandler + { + BaseEventVector maVector; + + // to allow BaseEvents to use the add/remove functionality + friend class BaseEvent; + + // methods to add/remove events. These are private since + // they are used from BaseEvent only. + void AddEvent(BaseEvent& rBaseEvent); + void RemoveEvent(BaseEvent& rBaseEvent); + + // access to a event, 0L when no more events + BaseEvent* GetEvent(); + + public: + // basic constructor. + EventHandler(); + + // destructor + virtual ~EventHandler(); + + // Trigger and consume the events + virtual void ExecuteEvents(); + + // for control + bool IsEmpty() const; + }; + } // end of namespace event +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace event + { + class TimerEventHandler : public EventHandler, public Timer + { + public: + // basic constructor. + TimerEventHandler(sal_uInt32 nTimeout = 1L); + + // destructor + virtual ~TimerEventHandler(); + + // The timer when it is triggered; from class Timer + virtual void Timeout(); + + // reset the timer + void Restart(); + }; + } // end of namespace event +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_EVENT_EVENTHANDLER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/overlay/overlayanimatedbitmapex.hxx b/include/svx/sdr/overlay/overlayanimatedbitmapex.hxx new file mode 100644 index 000000000000..756d2dac3731 --- /dev/null +++ b/include/svx/sdr/overlay/overlayanimatedbitmapex.hxx @@ -0,0 +1,92 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_OVERLAY_OVERLAYANIMATEDBITMAPEX_HXX +#define _SDR_OVERLAY_OVERLAYANIMATEDBITMAPEX_HXX + +#include <svx/sdr/overlay/overlayobject.hxx> +#include <vcl/bitmapex.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace overlay + { + class SVX_DLLPUBLIC OverlayAnimatedBitmapEx : public OverlayObjectWithBasePosition + { + protected: + // the Bitmaps + BitmapEx maBitmapEx1; + BitmapEx maBitmapEx2; + + // position of the basePosition inside the Bitmaps, in pixels + sal_uInt16 mnCenterX1; + sal_uInt16 mnCenterY1; + sal_uInt16 mnCenterX2; + sal_uInt16 mnCenterY2; + + // #i53216# added CursorBlinkTime (in ms) + sal_uInt32 mnBlinkTime; + + // bitfield + // Flag to remember which state to draw. Inited with sal_False (0) + unsigned mbOverlayState : 1; + + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); + + // #i53216# check blink time value range (currently 25 < mnBlinkTime < 10000) + void impCheckBlinkTimeValueRange(); + + public: + OverlayAnimatedBitmapEx( + const basegfx::B2DPoint& rBasePos, + const BitmapEx& rBitmapEx1, + const BitmapEx& rBitmapEx2, + sal_uInt32 nBlinkTime = 500, + sal_uInt16 nCenX1 = 0, + sal_uInt16 nCenY1 = 0, + sal_uInt16 nCenX2 = 0, + sal_uInt16 nCenY2 = 0); + virtual ~OverlayAnimatedBitmapEx(); + + const BitmapEx& getBitmapEx1() const { return maBitmapEx1; } + const BitmapEx& getBitmapEx2() const { return maBitmapEx2; } + + sal_uInt16 getCenterX1() const { return mnCenterX1; } + sal_uInt16 getCenterY1() const { return mnCenterY1; } + sal_uInt16 getCenterX2() const { return mnCenterX2; } + sal_uInt16 getCenterY2() const { return mnCenterY2; } + + // #i53216# added CursorBlinkTime (in ms) + sal_uInt32 getBlinkTime() const { return mnBlinkTime; } + + // execute event from base class ::sdr::animation::Event. Default + // implementation does nothing and does not create a new event. + virtual void Trigger(sal_uInt32 nTime); + }; + } // end of namespace overlay +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_OVERLAY_OVERLAYANIMATEDBITMAPEX_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/overlay/overlaybitmapex.hxx b/include/svx/sdr/overlay/overlaybitmapex.hxx new file mode 100644 index 000000000000..bd841c6b4255 --- /dev/null +++ b/include/svx/sdr/overlay/overlaybitmapex.hxx @@ -0,0 +1,66 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_OVERLAY_OVERLAYBITMAPEX_HXX +#define _SDR_OVERLAY_OVERLAYBITMAPEX_HXX + +#include <svx/sdr/overlay/overlayobject.hxx> +#include <vcl/bitmapex.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace overlay + { + class SVX_DLLPUBLIC OverlayBitmapEx : public OverlayObjectWithBasePosition + { + protected: + // the Bitmap itself + BitmapEx maBitmapEx; + + // position of the basePosition inside the Bitmap, in pixels + sal_uInt16 mnCenterX; + sal_uInt16 mnCenterY; + + // optional transparency + double mfAlpha; + + virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); + + public: + OverlayBitmapEx( + const basegfx::B2DPoint& rBasePos, + const BitmapEx& rBitmapEx, + sal_uInt16 nCenX = 0, sal_uInt16 nCenY = 0, double fAlpha = 0.0 ); + virtual ~OverlayBitmapEx(); + + const BitmapEx& getBitmapEx() const { return maBitmapEx; } + + sal_uInt16 getCenterX() const { return mnCenterX; } + sal_uInt16 getCenterY() const { return mnCenterY; } + }; + } // end of namespace overlay +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_OVERLAY_OVERLAYBITMAPEX_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/overlay/overlaycrosshair.hxx b/include/svx/sdr/overlay/overlaycrosshair.hxx new file mode 100644 index 000000000000..436705536819 --- /dev/null +++ b/include/svx/sdr/overlay/overlaycrosshair.hxx @@ -0,0 +1,51 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_OVERLAY_OVERLAYCROSSHAIR_HXX +#define _SDR_OVERLAY_OVERLAYCROSSHAIR_HXX + +#include <svx/sdr/overlay/overlayobject.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace overlay + { + class OverlayCrosshairStriped : public OverlayObjectWithBasePosition + { + protected: + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); + + public: + explicit OverlayCrosshairStriped(const basegfx::B2DPoint& rBasePos); + virtual ~OverlayCrosshairStriped(); + + // react on stripe definition change + virtual void stripeDefinitionHasChanged(); + }; + } // end of namespace overlay +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_OVERLAY_OVERLAYCROSSHAIR_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/overlay/overlayhatchrect.hxx b/include/svx/sdr/overlay/overlayhatchrect.hxx new file mode 100644 index 000000000000..7f01c3537e42 --- /dev/null +++ b/include/svx/sdr/overlay/overlayhatchrect.hxx @@ -0,0 +1,71 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_OVERLAY_OVERLAYHATCHRECT_HXX +#define _SDR_OVERLAY_OVERLAYHATCHRECT_HXX + +#include <svx/sdr/overlay/overlayobject.hxx> +#include <vcl/hatch.hxx> + +////////////////////////////////////////////////////////////////////////////// + +class PolyPolygon; + +namespace sdr +{ + namespace overlay + { + class OverlayHatchRect : public OverlayObjectWithBasePosition + { + // geometric definitions + basegfx::B2DPoint maSecondPosition; + const double mfDiscreteGrow; + const double mfDiscreteShrink; + const double mfHatchRotation; + const double mfRotation; + + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); + + public: + OverlayHatchRect( + const basegfx::B2DPoint& rBasePosition, + const basegfx::B2DPoint& rSecondPosition, + const Color& rHatchColor, + double fDiscreteGrow, + double fDiscreteShrink, + double fHatchRotation, + double fRotation); + + const basegfx::B2DPoint& getSecondPosition() const { return maSecondPosition; } + + // data read access + double getDiscreteGrow() const { return mfDiscreteGrow; } + double getDiscreteShrink() const { return mfDiscreteShrink; } + double getHatchRotation() const { return mfHatchRotation; } + double getRotation() const { return mfRotation; } + }; + } // end of namespace overlay +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_OVERLAY_OVERLAYHATCHRECT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/overlay/overlayhelpline.hxx b/include/svx/sdr/overlay/overlayhelpline.hxx new file mode 100644 index 000000000000..3ab10df10626 --- /dev/null +++ b/include/svx/sdr/overlay/overlayhelpline.hxx @@ -0,0 +1,60 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_OVERLAY_OVERLAYHELPLINE_HXX +#define _SDR_OVERLAY_OVERLAYHELPLINE_HXX + +#include <svx/sdr/overlay/overlayobject.hxx> +#include <svx/svdhlpln.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace overlay + { + class OverlayHelplineStriped : public OverlayObjectWithBasePosition + { + protected: + // remember HelpLineKind + SdrHelpLineKind meKind; + + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); + + public: + explicit OverlayHelplineStriped( + const basegfx::B2DPoint& rBasePos, + SdrHelpLineKind eNewKind = SDRHELPLINE_POINT); + virtual ~OverlayHelplineStriped(); + + // dat read access + SdrHelpLineKind getKind() const { return meKind; } + + // react on stripe definition change + virtual void stripeDefinitionHasChanged(); + }; + } // end of namespace overlay +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_OVERLAY_OVERLAYHELPLINE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/overlay/overlayline.hxx b/include/svx/sdr/overlay/overlayline.hxx new file mode 100644 index 000000000000..8b093fecbfb4 --- /dev/null +++ b/include/svx/sdr/overlay/overlayline.hxx @@ -0,0 +1,59 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_OVERLAY_OVERLAYLINE_HXX +#define _SDR_OVERLAY_OVERLAYLINE_HXX + +#include <svx/sdr/overlay/overlayobject.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace overlay + { + class OverlayLineStriped : public OverlayObjectWithBasePosition + { + protected: + // second position in pixel + basegfx::B2DPoint maSecondPosition; + + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); + + public: + OverlayLineStriped( + const basegfx::B2DPoint& rBasePos, + const basegfx::B2DPoint& rSecondPos); + virtual ~OverlayLineStriped(); + + // change second position + const basegfx::B2DPoint& getSecondPosition() const { return maSecondPosition; } + + // react on stripe definition change + virtual void stripeDefinitionHasChanged(); + }; + } // end of namespace overlay +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_OVERLAY_OVERLAYLINE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/overlay/overlaymanager.hxx b/include/svx/sdr/overlay/overlaymanager.hxx new file mode 100644 index 000000000000..e2c23b5dc6df --- /dev/null +++ b/include/svx/sdr/overlay/overlaymanager.hxx @@ -0,0 +1,151 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_OVERLAY_OVERLAYMANAGER_HXX +#define _SDR_OVERLAY_OVERLAYMANAGER_HXX + +#include <boost/utility.hpp> +#include <rtl/ref.hxx> +#include <svx/sdr/animation/scheduler.hxx> +#include <svx/sdr/overlay/overlayobject.hxx> +#include <vcl/mapmod.hxx> +#include <tools/color.hxx> +#include "svx/svxdllapi.h" +#include <svtools/optionsdrawinglayer.hxx> +#include <basegfx/matrix/b2dhommatrix.hxx> +#include <drawinglayer/geometry/viewinformation2d.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +class OutputDevice; +class Region; + +namespace sdr { namespace overlay { + class OverlayObject; +}} + +namespace basegfx { + class B2DRange; +} + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace overlay + { + class SVX_DLLPUBLIC OverlayManager + : private boost::noncopyable + , protected ::sdr::animation::Scheduler + , public rtl::IReference + { + private: + oslInterlockedCount mnRefCount; + protected: + // the OutputDevice to work on, set on construction and not to be changed + OutputDevice& rmOutputDevice; + + // the vector of registered OverlayObjects + OverlayObjectVector maOverlayObjects; + + // Stripe support. All striped OverlayObjects use these stripe + // values. Changes change all those objects. + Color maStripeColorA; // defaults to Color(COL_BLACK) + Color maStripeColorB; // defaults to Color(COL_WHITE) + sal_uInt32 mnStripeLengthPixel; // defaults to 4L + + // hold an incarnation of Drawinglayer configuration options + SvtOptionsDrawinglayer maDrawinglayerOpt; + + // hold buffered the logic length of discrete vector (1.0, 0.0) and the + // view transformation belonging to it. Update happens in getDiscreteOne() + basegfx::B2DHomMatrix maViewTransformation; + drawinglayer::geometry::ViewInformation2D maViewInformation2D; + double mfDiscreteOne; + + // internal + void ImpDrawMembers(const basegfx::B2DRange& rRange, OutputDevice& rDestinationDevice) const; + void ImpStripeDefinitionChanged(); + void impApplyRemoveActions(OverlayObject& rTarget); + void impApplyAddActions(OverlayObject& rTarget); + + // return mfDiscreteOne to derivations, but also check for buffered local + // ViewTransformation and evtl. correct mfDiscreteOne + double getDiscreteOne() const; + + OverlayManager(OutputDevice& rOutputDevice); + virtual ~OverlayManager(); + + public: + static rtl::Reference<OverlayManager> create(OutputDevice& rOutputDevice); + + // access to current ViewInformation2D; this call checks and evtl. updates ViewInformation2D + const drawinglayer::geometry::ViewInformation2D getCurrentViewInformation2D() const; + + // complete redraw + virtual void completeRedraw(const Region& rRegion, OutputDevice* pPreRenderDevice = 0) const; + + // flush. Do buffered updates. + virtual void flush(); + + // #i68597# part of content gets copied, react on it + virtual void copyArea(const Point& rDestPt, const Point& rSrcPt, const Size& rSrcSize); + + // restore part of background. Implemented form buffered versions only. + virtual void restoreBackground(const Region& rRegion) const; + + // get the OutputDevice + OutputDevice& getOutputDevice() const { return rmOutputDevice; } + + // add and remove OverlayObjects + void add(OverlayObject& rOverlayObject); + void remove(OverlayObject& rOverlayObject); + + // invalidate the given range at local OutputDevice + virtual void invalidateRange(const basegfx::B2DRange& rRange); + + // stripe support ColA + Color getStripeColorA() const { return maStripeColorA; } + void setStripeColorA(Color aNew= Color(COL_BLACK)); + + // stripe support ColB + Color getStripeColorB() const { return maStripeColorB; } + void setStripeColorB(Color aNew = Color(COL_WHITE)); + + // stripe support StripeLengthPixel + sal_uInt32 getStripeLengthPixel() const { return mnStripeLengthPixel; } + void setStripeLengthPixel(sal_uInt32 nNew = 5L); + + // access to maDrawinglayerOpt + const SvtOptionsDrawinglayer& getDrawinglayerOpt() const { return maDrawinglayerOpt; } + + void InsertEvent(sdr::animation::Event* pNew) { Scheduler::InsertEvent(pNew); } + + virtual oslInterlockedCount SAL_CALL acquire(); + virtual oslInterlockedCount SAL_CALL release(); + }; + } // end of namespace overlay +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_OVERLAY_OVERLAYMANAGER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/overlay/overlaymanagerbuffered.hxx b/include/svx/sdr/overlay/overlaymanagerbuffered.hxx new file mode 100644 index 000000000000..7f6dbe05d9e6 --- /dev/null +++ b/include/svx/sdr/overlay/overlaymanagerbuffered.hxx @@ -0,0 +1,98 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_OVERLAY_OVERLAYMANAGERBUFFERED_HXX +#define _SDR_OVERLAY_OVERLAYMANAGERBUFFERED_HXX + +#include <svx/sdr/overlay/overlaymanager.hxx> +#include <basegfx/range/b2irange.hxx> +#include <vcl/virdev.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace overlay + { + class OverlayManagerBuffered : public OverlayManager + { + protected: + // The VirtualDevice for draw window content buffering, this + // is the view content without overlay + VirtualDevice maBufferDevice; + + // #i73602# The VirtualDevice for OverlayPaint buffering. This + // is an extra device to avoid flickering of overlay paints + VirtualDevice maOutputBufferDevice; + + // Timer for buffering + Timer maBufferTimer; + + // Range for buffering (in pixel to be independent from mapMode) + basegfx::B2IRange maBufferRememberedRangePixel; + + // bitfield + // Flag to decide if PreRendering shall be used for overlay refreshes. + // Default is false. + unsigned mbRefreshWithPreRendering : 1; + + // link for timer + DECL_LINK(ImpBufferTimerHandler, AutoTimer*); + + // Internal methods for buffering + void ImpPrepareBufferDevice(); + void ImpRestoreBackground() const ; + void ImpRestoreBackground(const Region& rRegionPixel) const; + void ImpSaveBackground(const Region& rRegion, OutputDevice* pPreRenderDevice = 0L); + + OverlayManagerBuffered( + OutputDevice& rOutputDevice, + bool bRefreshWithPreRendering = false); + virtual ~OverlayManagerBuffered(); + + public: + static rtl::Reference<OverlayManager> create(OutputDevice& rOutputDevice, + bool bRefreshWithPreRendering = false); + + // complete redraw + virtual void completeRedraw(const Region& rRegion, OutputDevice* pPreRenderDevice = 0L) const; + + // flush. Do buffered updates. + virtual void flush(); + + // #i68597# part of content gets copied, react on it + virtual void copyArea(const Point& rDestPt, const Point& rSrcPt, const Size& rSrcSize); + + // restore part of background. Implemented form buffered versions only. + virtual void restoreBackground(const Region& rRegion) const; + + // invalidate the given range at local OutputDevice + virtual void invalidateRange(const basegfx::B2DRange& rRange); + + // access to RefreshWithPreRendering Flag + bool DoRefreshWithPreRendering() const { return mbRefreshWithPreRendering; } + }; + } // end of namespace overlay +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_OVERLAY_OVERLAYMANAGERBUFFERED_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/overlay/overlayobject.hxx b/include/svx/sdr/overlay/overlayobject.hxx new file mode 100644 index 000000000000..263e9a9ab57c --- /dev/null +++ b/include/svx/sdr/overlay/overlayobject.hxx @@ -0,0 +1,196 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_OVERLAY_OVERLAYOBJECT_HXX +#define _SDR_OVERLAY_OVERLAYOBJECT_HXX + +#include <basegfx/point/b2dpoint.hxx> +#include <basegfx/range/b2drange.hxx> +#include <tools/color.hxx> +#include <rtl/ref.hxx> +#include <svx/sdr/animation/scheduler.hxx> +#include "svx/svxdllapi.h" +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> + +#include <vector> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +class OutputDevice; + +namespace sdr +{ + namespace overlay + { + class OverlayManager; + } // end of namespace overlay +} // end of namespace sdr + +namespace basegfx +{ + class B2DPolygon; + class B2DPolyPolygon; + class B2DRange; +} // end of namespace basegfx + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace overlay + { + class SVX_DLLPUBLIC OverlayObject : private ::boost::noncopyable, public ::sdr::animation::Event + { + private: + // Manager is allowed access to private Member mpOverlayManager + friend class OverlayManager; + + // pointer to OverlayManager, if object is added. Changed by + // OverlayManager, do not chnge Yourself. + OverlayManager* mpOverlayManager; + + // Primitive2DSequence of the OverlayObject + drawinglayer::primitive2d::Primitive2DSequence maPrimitive2DSequence; + + protected: + // access methods to maPrimitive2DSequence. The usage of this methods may allow + // later thread-safe stuff to be added if needed. Only to be used by getPrimitive2DSequence() + // implementations for buffering the last decomposition. + const drawinglayer::primitive2d::Primitive2DSequence& getPrimitive2DSequence() const { return maPrimitive2DSequence; } + void setPrimitive2DSequence(const drawinglayer::primitive2d::Primitive2DSequence& rNew) { maPrimitive2DSequence = rNew; } + + // the creation method for Primitive2DSequence. Called when getPrimitive2DSequence() + // sees that maPrimitive2DSequence is empty. Needs to be supported by all + // OverlayObject implementations. Default implementation will assert + // a missing implementation + virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); + + // region in logical coordinates + basegfx::B2DRange maBaseRange; + + // base color of this OverlayObject + Color maBaseColor; + + // bitfield + // Flag for visibility + unsigned mbIsVisible : 1; + + // Flag to control hittability + unsigned mbIsHittable : 1; + + // Flag to hold info if this objects supports animation. Default is + // false. If true, the Trigger() method should be overloaded + // to implement the animation effect and to re-initiate the event. + unsigned mbAllowsAnimation : 1; + + // Flag tocontrol if this OverlayObject allows AntiAliased visualisation. + // Default is true, but e.g. for selection visualisation in SC and SW, + // it is switched to false + unsigned mbAllowsAntiAliase : 1; + + // set changed flag. Call after change, since the old range is invalidated + // and then the new one is calculated and invalidated, too. This will only + // work after the change. + virtual void objectChange(); + + // write access to AntiAliase flag. This is protected since + // only implementations are allowed to change this, preferrably in their + // constructor + void allowAntiAliase(bool bNew); + + public: + explicit OverlayObject(Color aBaseColor); + virtual ~OverlayObject(); + + // get OverlayManager + OverlayManager* getOverlayManager() const { return mpOverlayManager; } + + // the access method for Primitive2DSequence. Will use createPrimitive2DSequence and + // setPrimitive2DSequence if needed. Overloading may be used to allow disposal of last + // created primitives to react on changed circumstances and to re-create primitives + virtual drawinglayer::primitive2d::Primitive2DSequence getOverlayObjectPrimitive2DSequence() const; + + // access to visibility state + bool isVisible() const { return mbIsVisible; } + void setVisible(bool bNew); + + // access to hittable flag + bool isHittable() const { return mbIsHittable; } + void setHittable(bool bNew); + + // read access to AntiAliase flag + bool allowsAntiAliase() const { return mbAllowsAntiAliase; } + + // read access to baseRange. This may trigger createBaseRange() if + // object is changed. + const basegfx::B2DRange& getBaseRange() const; + + // access to baseColor + Color getBaseColor() const { return maBaseColor; } + void setBaseColor(Color aNew); + + // execute event from base class ::sdr::animation::Event. Default + // implementation does nothing and does not create a new event. + virtual void Trigger(sal_uInt32 nTime); + + // acces to AllowsAnimation flag + bool allowsAnimation() const { return mbAllowsAnimation; } + + // stripe definition has changed. The OverlayManager does have + // support data to draw graphics in two colors striped. This + // method notifies the OverlayObject if that change takes place. + // Default implementation does nothing. + virtual void stripeDefinitionHasChanged(); + }; + + // typedefs for a vector of OverlayObjects + typedef ::std::vector< OverlayObject* > OverlayObjectVector; + + } // end of namespace overlay +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace overlay + { + class SVX_DLLPUBLIC OverlayObjectWithBasePosition : public OverlayObject + { + protected: + // base position in logical coordinates + basegfx::B2DPoint maBasePosition; + + public: + OverlayObjectWithBasePosition(const basegfx::B2DPoint& rBasePos, Color aBaseColor); + virtual ~OverlayObjectWithBasePosition(); + + // access to basePosition + const basegfx::B2DPoint& getBasePosition() const { return maBasePosition; } + void setBasePosition(const basegfx::B2DPoint& rNew); + }; + } // end of namespace overlay +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_OVERLAY_OVERLAYOBJECT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/overlay/overlayobjectcell.hxx b/include/svx/sdr/overlay/overlayobjectcell.hxx new file mode 100644 index 000000000000..6707c0fc61eb --- /dev/null +++ b/include/svx/sdr/overlay/overlayobjectcell.hxx @@ -0,0 +1,62 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_OVERLAY_OVERLAYOBJECTCELL_HXX +#define _SDR_OVERLAY_OVERLAYOBJECTCELL_HXX + +#include <svx/sdr/overlay/overlayobject.hxx> + +#include <vector> + +////////////////////////////////////////////////////////////////////////////// + +// #114409# +namespace sdr +{ + namespace overlay + { + enum CellOverlayType { CELL_OVERLAY_INVERT, CELL_OVERLAY_TRANSPARENT }; + + // OverlayObjectCell - used for cell cursor, selection and AutoFill handle + + class SVX_DLLPUBLIC OverlayObjectCell : public OverlayObject + { + public: + typedef ::std::vector< basegfx::B2DRange > RangeVector; + + private: + CellOverlayType mePaintType; + RangeVector maRectangles; + + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); + + public: + OverlayObjectCell( CellOverlayType eType, const Color& rColor, const RangeVector& rRects); + virtual ~OverlayObjectCell(); + }; + + } // end of namespace overlay +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_OVERLAY_OVERLAYLINE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/overlay/overlayobjectlist.hxx b/include/svx/sdr/overlay/overlayobjectlist.hxx new file mode 100644 index 000000000000..ea75ace1e94a --- /dev/null +++ b/include/svx/sdr/overlay/overlayobjectlist.hxx @@ -0,0 +1,78 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_OVERLAY_OVERLAYOBJECTLIST_HXX +#define _SDR_OVERLAY_OVERLAYOBJECTLIST_HXX + +#include <svx/sdr/overlay/overlayobject.hxx> +#include <sal/types.h> +#include "svx/svxdllapi.h" + +////////////////////////////////////////////////////////////////////////////// + +#define DEFAULT_VALUE_FOR_HITTEST_PIXEL (2L) + +////////////////////////////////////////////////////////////////////////////// + +class Point; + +namespace sdr +{ + namespace overlay + { + class SVX_DLLPUBLIC OverlayObjectList + { + protected: + // the vector of OverlayObjects + OverlayObjectVector maVector; + + // default value for HiTestPixel + sal_uInt32 getDefaultValueForHitTestPixel() const { return 4L; } + + public: + OverlayObjectList() {} + ~OverlayObjectList(); + + // clear list, this includes deletion of all contained objects + void clear(); + + // append objects + void append(OverlayObject& rOverlayObject) { maVector.push_back(&rOverlayObject); } + + // access to objects + sal_uInt32 count() const { return maVector.size(); } + OverlayObject& getOverlayObject(sal_uInt32 nIndex) const { return *(maVector[nIndex]); } + + // Hittest with logical coordinates + bool isHitLogic(const basegfx::B2DPoint& rLogicPosition, double fLogicTolerance = 0.0) const; + + // Hittest with pixel coordinates and pixel tolerance + bool isHitPixel(const Point& rDiscretePosition, sal_uInt32 fDiscreteTolerance = DEFAULT_VALUE_FOR_HITTEST_PIXEL) const; + + // calculate BaseRange of all included OverlayObjects and return + basegfx::B2DRange getBaseRange() const; + }; + } // end of namespace overlay +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_OVERLAY_OVERLAYOBJECTLIST_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/overlay/overlaypolypolygon.hxx b/include/svx/sdr/overlay/overlaypolypolygon.hxx new file mode 100644 index 000000000000..d7dd82751f53 --- /dev/null +++ b/include/svx/sdr/overlay/overlaypolypolygon.hxx @@ -0,0 +1,58 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_OVERLAY_OVERLAYPOLYPOLYGON_HXX +#define _SDR_OVERLAY_OVERLAYPOLYPOLYGON_HXX + +#include <svx/sdr/overlay/overlayobject.hxx> +#include <basegfx/polygon/b2dpolypolygon.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace overlay + { + class SVX_DLLPUBLIC OverlayPolyPolygonStriped : public OverlayObject + { + protected: + // geometry + basegfx::B2DPolyPolygon maPolyPolygon; + + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); + + public: + explicit OverlayPolyPolygonStriped(const basegfx::B2DPolyPolygon& rPolyPolygon); + virtual ~OverlayPolyPolygonStriped(); + + // change geometry + basegfx::B2DPolyPolygon getPolyPolygon() const { return maPolyPolygon; } + + // react on stripe definition change + virtual void stripeDefinitionHasChanged(); + }; + } // end of namespace overlay +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_OVERLAY_OVERLAYPOLYPOLYGON_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/overlay/overlayprimitive2dsequenceobject.hxx b/include/svx/sdr/overlay/overlayprimitive2dsequenceobject.hxx new file mode 100644 index 000000000000..a2e981c2c1a8 --- /dev/null +++ b/include/svx/sdr/overlay/overlayprimitive2dsequenceobject.hxx @@ -0,0 +1,62 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_OVERLAY_OVERLAYPRIMITIVE2DSEQUENCEOBJECT_HXX +#define _SDR_OVERLAY_OVERLAYPRIMITIVE2DSEQUENCEOBJECT_HXX + +#include <svx/sdr/overlay/overlayobject.hxx> +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#include <basegfx/matrix/b2dhommatrix.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace overlay + { + class SVX_DLLPUBLIC OverlayPrimitive2DSequenceObject : public OverlayObjectWithBasePosition + { + protected: + // the sequence of primitives to show + const drawinglayer::primitive2d::Primitive2DSequence maSequence; + + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); + + private: + // internal helper to create a drawinglayer::geometry::ViewInformation2D + // using a OutputDevice and local knowledge + drawinglayer::geometry::ViewInformation2D impCreateViewInformation2D(OutputDevice& rOutputDevice) const; + + public: + explicit OverlayPrimitive2DSequenceObject(const drawinglayer::primitive2d::Primitive2DSequence& rSequence); + + virtual ~OverlayPrimitive2DSequenceObject(); + + // data read access + const drawinglayer::primitive2d::Primitive2DSequence& getSequence() const { return maSequence; } + }; + } // end of namespace overlay +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_OVERLAY_OVERLAYPRIMITIVE2DSEQUENCEOBJECT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/overlay/overlayrollingrectangle.hxx b/include/svx/sdr/overlay/overlayrollingrectangle.hxx new file mode 100644 index 000000000000..3a896aa3cdd8 --- /dev/null +++ b/include/svx/sdr/overlay/overlayrollingrectangle.hxx @@ -0,0 +1,75 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_OVERLAY_OVERLAYROOLINGRECTANGLE_HXX +#define _SDR_OVERLAY_OVERLAYROOLINGRECTANGLE_HXX + +#include <svx/sdr/overlay/overlayobject.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace overlay + { + class OverlayRollingRectangleStriped : public OverlayObjectWithBasePosition + { + protected: + // second position in pixel + basegfx::B2DPoint maSecondPosition; + + // bitfield + // Flag to switch on/off long lines to the OutputDevice bounds + unsigned mbExtendedLines : 1; + + // Flag to switch on/off the bounds itself + unsigned mbShowBounds : 1; + + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); + + public: + OverlayRollingRectangleStriped( + const basegfx::B2DPoint& rBasePos, + const basegfx::B2DPoint& rSecondPos, + bool bExtendedLines = false, + bool bShowBounds = true); + virtual ~OverlayRollingRectangleStriped(); + + // change second position + const basegfx::B2DPoint& getSecondPosition() const { return maSecondPosition; } + void setSecondPosition(const basegfx::B2DPoint& rNew); + + // change extended lines + bool getExtendedLines() const { return mbExtendedLines; } + + // change show bounds + bool getShowBounds() const { return mbShowBounds; } + + // react on stripe definition change + virtual void stripeDefinitionHasChanged(); + }; + } // end of namespace overlay +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_OVERLAY_OVERLAYROOLINGRECTANGLE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/overlay/overlayselection.hxx b/include/svx/sdr/overlay/overlayselection.hxx new file mode 100644 index 000000000000..e96b8fa3281d --- /dev/null +++ b/include/svx/sdr/overlay/overlayselection.hxx @@ -0,0 +1,87 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_OVERLAY_OVERLAYSELECTION_HXX +#define _SDR_OVERLAY_OVERLAYSELECTION_HXX + +#include <svx/sdr/overlay/overlayobject.hxx> +#include <vcl/region.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace overlay + { + // overlay type definition + enum OverlayType + { + OVERLAY_INVERT, + OVERLAY_SOLID, + OVERLAY_TRANSPARENT + }; + + class SVX_DLLPUBLIC OverlaySelection : public OverlayObject + { + protected: + // type of overlay + OverlayType meOverlayType; + + // geometry of overlay + std::vector< basegfx::B2DRange > maRanges; + + // Values of last primitive creation. These are checked in getOverlayObjectPrimitive2DSequence + // to evtl. get rid of last Primitive2DSequence. This ensures that these values are up-to-date + // and are usable when creating primitives + OverlayType maLastOverlayType; + sal_uInt16 mnLastTransparence; + + // bitfield + unsigned mbBorder : 1; + + // geometry creation for OverlayObject, can use local *Last* values + virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); + + public: + OverlaySelection( + OverlayType eType, + const Color& rColor, + const std::vector< basegfx::B2DRange >& rRanges, + bool bBorder); + virtual ~OverlaySelection(); + + // data read access + OverlayType getOverlayType() const { return meOverlayType; } + const std::vector< basegfx::B2DRange >& getRanges() const { return maRanges; } + bool getBorder() const { return mbBorder; } + + // overloaded to check conditions for last createOverlayObjectPrimitive2DSequence + virtual drawinglayer::primitive2d::Primitive2DSequence getOverlayObjectPrimitive2DSequence() const; + + // data write access + void setRanges(const std::vector< basegfx::B2DRange >& rNew); + }; + } // end of namespace overlay +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_OVERLAY_OVERLAYSELECTION_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/overlay/overlaytools.hxx b/include/svx/sdr/overlay/overlaytools.hxx new file mode 100644 index 000000000000..665d445e2d46 --- /dev/null +++ b/include/svx/sdr/overlay/overlaytools.hxx @@ -0,0 +1,270 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_OVERLAY_OVERLAYTOOLS_HXX +#define _SDR_OVERLAY_OVERLAYTOOLS_HXX + +#include <drawinglayer/primitive2d/primitivetools2d.hxx> +#include <vcl/bitmapex.hxx> + +////////////////////////////////////////////////////////////////////////////// +// Overlay helper class which holds a BotmapEx which is to be visualized +// at the given logic position with the Bitmap's pixel size, unscaled and +// unrotated (like a marker). The discrete pixel on the bitmap assocciated +// with the target position is given in discrete X,Y coordinates +namespace drawinglayer +{ + namespace primitive2d + { + class OverlayBitmapExPrimitive : public DiscreteMetricDependentPrimitive2D + { + private: + // The BitmapEx to use, PixelSize is used + BitmapEx maBitmapEx; + + // The logic position + basegfx::B2DPoint maBasePosition; + + // The pixel inside the BitmapEx which is assocciated with + // the target position (offset in the bitmap) + sal_uInt16 mnCenterX; + sal_uInt16 mnCenterY; + + protected: + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + OverlayBitmapExPrimitive( + const BitmapEx& rBitmapEx, + const basegfx::B2DPoint& rBasePosition, + sal_uInt16 nCenterX, + sal_uInt16 nCenterY); + + // data access + const BitmapEx& getBitmapEx() const { return maBitmapEx; } + const basegfx::B2DPoint& getBasePosition() const { return maBasePosition; } + sal_uInt16 getCenterX() const { return mnCenterX; } + sal_uInt16 getCenterY() const { return mnCenterY; } + + // compare operator + virtual bool operator==( const BasePrimitive2D& rPrimitive ) const; + + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// Overlay helper class for a crosshair +namespace drawinglayer +{ + namespace primitive2d + { + class OverlayCrosshairPrimitive : public ViewportDependentPrimitive2D + { + private: + // The logic position + basegfx::B2DPoint maBasePosition; + + // The stripe colors and legth + basegfx::BColor maRGBColorA; + basegfx::BColor maRGBColorB; + double mfDiscreteDashLength; + + protected: + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + OverlayCrosshairPrimitive( + const basegfx::B2DPoint& rBasePosition, + const basegfx::BColor& rRGBColorA, + const basegfx::BColor& rRGBColorB, + double fDiscreteDashLength); + + // data access + const basegfx::B2DPoint& getBasePosition() const { return maBasePosition; } + const basegfx::BColor& getRGBColorA() const { return maRGBColorA; } + const basegfx::BColor& getRGBColorB() const { return maRGBColorB; } + double getDiscreteDashLength() const { return mfDiscreteDashLength; } + + // compare operator + virtual bool operator==( const BasePrimitive2D& rPrimitive ) const; + + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// Overlay helper class for a hatch rectangle as used e.g. for text object +// selection hilighting +namespace drawinglayer +{ + namespace primitive2d + { + class OverlayHatchRectanglePrimitive : public DiscreteMetricDependentPrimitive2D + { + private: + // the logic rectangle definition + basegfx::B2DRange maObjectRange; + + // the hatch definition + double mfDiscreteHatchDistance; + double mfHatchRotation; + basegfx::BColor maHatchColor; + + // the dscrete grow and shrink of the box + double mfDiscreteGrow; + double mfDiscreteShrink; + + // the rotation of the primitive itself + double mfRotation; + + protected: + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + OverlayHatchRectanglePrimitive( + const basegfx::B2DRange& rObjectRange, + double fDiscreteHatchDistance, + double fHatchRotation, + const basegfx::BColor& rHatchColor, + double fDiscreteGrow, + double fDiscreteShrink, + double fRotation); + + // data access + const basegfx::B2DRange& getObjectRange() const { return maObjectRange; } + double getDiscreteHatchDistance() const { return mfDiscreteHatchDistance; } + double getHatchRotation() const { return mfHatchRotation; } + const basegfx::BColor& getHatchColor() const { return maHatchColor; } + double getDiscreteGrow() const { return mfDiscreteGrow; } + double getDiscreteShrink() const { return mfDiscreteShrink; } + double getRotation() const { return mfRotation; } + + // compare operator + virtual bool operator==( const BasePrimitive2D& rPrimitive ) const; + + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// Overlay helper class for a striped helpline + +namespace drawinglayer +{ + namespace primitive2d + { + enum HelplineStyle + { + HELPLINESTYLE_POINT, + HELPLINESTYLE_VERTICAL, + HELPLINESTYLE_HORIZONTAL + }; + + class OverlayHelplineStripedPrimitive : public ViewportDependentPrimitive2D + { + private: + // The logic position + basegfx::B2DPoint maBasePosition; + + // the style + HelplineStyle meStyle; + + // The stripe colors and legth + basegfx::BColor maRGBColorA; + basegfx::BColor maRGBColorB; + double mfDiscreteDashLength; + + protected: + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + OverlayHelplineStripedPrimitive( + const basegfx::B2DPoint& rBasePosition, + HelplineStyle eStyle, + const basegfx::BColor& rRGBColorA, + const basegfx::BColor& rRGBColorB, + double fDiscreteDashLength); + + // data access + const basegfx::B2DPoint& getBasePosition() const { return maBasePosition; } + HelplineStyle getStyle() const { return meStyle; } + const basegfx::BColor& getRGBColorA() const { return maRGBColorA; } + const basegfx::BColor& getRGBColorB() const { return maRGBColorB; } + double getDiscreteDashLength() const { return mfDiscreteDashLength; } + + // compare operator + virtual bool operator==( const BasePrimitive2D& rPrimitive ) const; + + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// Overlay helper class for rolling rectangle helplines. This primitive is +// only for the extended lines to the ends of the view + +namespace drawinglayer +{ + namespace primitive2d + { + class OverlayRollingRectanglePrimitive : public ViewportDependentPrimitive2D + { + private: + // The logic range + basegfx::B2DRange maRollingRectangle; + + // The stripe colors and legth + basegfx::BColor maRGBColorA; + basegfx::BColor maRGBColorB; + double mfDiscreteDashLength; + + protected: + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + OverlayRollingRectanglePrimitive( + const basegfx::B2DRange& aRollingRectangle, + const basegfx::BColor& rRGBColorA, + const basegfx::BColor& rRGBColorB, + double fDiscreteDashLength); + + // data access + const basegfx::B2DRange& getRollingRectangle() const { return maRollingRectangle; } + const basegfx::BColor& getRGBColorA() const { return maRGBColorA; } + const basegfx::BColor& getRGBColorB() const { return maRGBColorB; } + double getDiscreteDashLength() const { return mfDiscreteDashLength; } + + // compare operator + virtual bool operator==( const BasePrimitive2D& rPrimitive ) const; + + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_OVERLAY_OVERLAYTOOLS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/overlay/overlaytriangle.hxx b/include/svx/sdr/overlay/overlaytriangle.hxx new file mode 100644 index 000000000000..b17e6be8a8c6 --- /dev/null +++ b/include/svx/sdr/overlay/overlaytriangle.hxx @@ -0,0 +1,62 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_OVERLAY_OVERLAYTRIANGLE_HXX +#define _SDR_OVERLAY_OVERLAYTRIANGLE_HXX + +#include <svx/sdr/overlay/overlayobject.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace overlay + { + class OverlayTriangle : public OverlayObjectWithBasePosition + { + protected: + // second and third position in pixel + basegfx::B2DPoint maSecondPosition; + basegfx::B2DPoint maThirdPosition; + + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); + + public: + OverlayTriangle( + const basegfx::B2DPoint& rBasePos, + const basegfx::B2DPoint& rSecondPos, + const basegfx::B2DPoint& rThirdPos, + Color aTriangleColor); + virtual ~OverlayTriangle(); + + // change second position + const basegfx::B2DPoint& getSecondPosition() const { return maSecondPosition; } + + // change third position + const basegfx::B2DPoint& getThirdPosition() const { return maThirdPosition; } + }; + } // end of namespace overlay +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_OVERLAY_OVERLAYTRIANGLE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/primitive2d/primitiveFactory2d.hxx b/include/svx/sdr/primitive2d/primitiveFactory2d.hxx new file mode 100644 index 000000000000..d602d28d4f5c --- /dev/null +++ b/include/svx/sdr/primitive2d/primitiveFactory2d.hxx @@ -0,0 +1,76 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SDR_PRIMITIVE2D_PRIMITIVEFACTORY2D_HXX +#define INCLUDED_SDR_PRIMITIVE2D_PRIMITIVEFACTORY2D_HXX + +#include <com/sun/star/graphic/XPrimitiveFactory2D.hpp> +#include <cppuhelper/compbase1.hxx> +#include <comphelper/broadcasthelper.hxx> + +#include <svx/svxdllapi.h> + +////////////////////////////////////////////////////////////////////////////// +// UNO API helper methods + +namespace drawinglayer +{ + namespace primitive2d + { + SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL XPrimitiveFactory2DProvider_createInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) throw( ::com::sun::star::uno::Exception ); + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// PrimitiveFactory2D class + +namespace drawinglayer +{ + namespace primitive2d + { + // typedef for PrimitiveFactory2DImplBase + typedef cppu::WeakComponentImplHelper1< ::com::sun::star::graphic::XPrimitiveFactory2D > PrimitiveFactory2DImplBase; + + // base class for C++ implementation of com::sun::star::graphic::XPrimitiveFactory2D + class PrimitiveFactory2D + : protected comphelper::OBaseMutex, + public PrimitiveFactory2DImplBase + { + private: + protected: + public: + // constructor + PrimitiveFactory2D(); + + // Methods from XPrimitiveFactory2D + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XPrimitive2D > > SAL_CALL createPrimitivesFromXShape( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aParms ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XPrimitive2D > > SAL_CALL createPrimitivesFromXDrawPage( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& xDrawPage, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aParms ) throw (::com::sun::star::uno::RuntimeException); + + // UNO API helpers + SVX_DLLPUBLIC static OUString getImplementationName_Static(); + SVX_DLLPUBLIC static com::sun::star::uno::Sequence< OUString > getSupportedServiceNames_Static(); + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_SDR_PRIMITIVE2D_PRIMITIVEFACTORY2D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/primitive2d/sdrattributecreator.hxx b/include/svx/sdr/primitive2d/sdrattributecreator.hxx new file mode 100644 index 000000000000..e3e940993790 --- /dev/null +++ b/include/svx/sdr/primitive2d/sdrattributecreator.hxx @@ -0,0 +1,133 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SDR_PRIMITIVE2D_SDRATTRIBUTECREATOR_HXX +#define INCLUDED_SDR_PRIMITIVE2D_SDRATTRIBUTECREATOR_HXX + +#include <sal/types.h> + +////////////////////////////////////////////////////////////////////////////// +// predefines +class SfxItemSet; +class SdrText; + +namespace drawinglayer { namespace attribute { + class SdrLineAttribute; + class SdrLineStartEndAttribute; + class SdrShadowAttribute; + class SdrFillAttribute; + class SdrTextAttribute; + class FillGradientAttribute; + class SdrFillBitmapAttribute; + class SdrShadowTextAttribute; + class SdrLineShadowTextAttribute; + class SdrLineFillShadowTextAttribute; + class SdrLineFillShadowAttribute3D; + class SdrSceneAttribute; + class SdrLightingAttribute; + class SdrFillTextAttribute; +}} + +namespace basegfx { + class B2DRange; +} + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + // SdrAttribute creators + attribute::SdrLineAttribute createNewSdrLineAttribute( + const SfxItemSet& rSet); + + attribute::SdrLineStartEndAttribute createNewSdrLineStartEndAttribute( + const SfxItemSet& rSet, + double fWidth); + + attribute::SdrShadowAttribute createNewSdrShadowAttribute( + const SfxItemSet& rSet); + + attribute::SdrFillAttribute createNewSdrFillAttribute( + const SfxItemSet& rSet); + + // #i101508# Support handing over given text-to-border distances + attribute::SdrTextAttribute createNewSdrTextAttribute( + const SfxItemSet& rSet, + const SdrText& rText, + const sal_Int32* pLeft = 0, + const sal_Int32* pUpper = 0, + const sal_Int32* pRight = 0, + const sal_Int32* pLower = 0); + + attribute::FillGradientAttribute createNewTransparenceGradientAttribute( + const SfxItemSet& rSet); + + attribute::SdrFillBitmapAttribute createNewSdrFillBitmapAttribute( + const SfxItemSet& rSet); + + attribute::SdrShadowTextAttribute createNewSdrShadowTextAttribute( + const SfxItemSet& rSet, + const SdrText* pText, + bool bSuppressText); // #i98072# added option to suppress text on demand + + attribute::SdrLineShadowTextAttribute createNewSdrLineShadowTextAttribute( + const SfxItemSet& rSet, + const SdrText* pText); + + attribute::SdrLineFillShadowTextAttribute createNewSdrLineFillShadowTextAttribute( + const SfxItemSet& rSet, + const SdrText* pText, + bool bHasContent); // used from OLE and graphic + + attribute::SdrLineFillShadowAttribute3D createNewSdrLineFillShadowAttribute( + const SfxItemSet& rSet, + bool bSuppressFill); + + attribute::SdrSceneAttribute createNewSdrSceneAttribute( + const SfxItemSet& rSet); + + attribute::SdrLightingAttribute createNewSdrLightingAttribute( + const SfxItemSet& rSet); + + // #i101508# Support handing over given text-to-border distances + attribute::SdrFillTextAttribute createNewSdrFillTextAttribute( + const SfxItemSet& rSet, + const SdrText* pSdrText, + const sal_Int32* pLeft = 0, + const sal_Int32* pUpper = 0, + const sal_Int32* pRight = 0, + const sal_Int32* pLower = 0); + + // helpers + void calculateRelativeCornerRadius( + sal_Int32 nRadius, + const ::basegfx::B2DRange& rObjectRange, + double& rfCornerRadiusX, + double& rfCornerRadiusY); + + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_SDR_PRIMITIVE2D_SDRATTRIBUTECREATOR_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx b/include/svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx new file mode 100644 index 000000000000..472c08861412 --- /dev/null +++ b/include/svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx @@ -0,0 +1,79 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SDR_PRIMITIVE2D_SDRCAPTIONPRIMITIVE2D_HXX +#define INCLUDED_SDR_PRIMITIVE2D_SDRCAPTIONPRIMITIVE2D_HXX + +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#include <basegfx/matrix/b2dhommatrix.hxx> +#include <svx/sdr/attribute/sdrlinefillshadowtextattribute.hxx> +#include <basegfx/polygon/b2dpolygon.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predefines + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + class SdrCaptionPrimitive2D : public BufferedDecompositionPrimitive2D + { + private: + ::basegfx::B2DHomMatrix maTransform; + attribute::SdrLineFillShadowTextAttribute maSdrLFSTAttribute; + ::basegfx::B2DPolygon maTail; + double mfCornerRadiusX; // [0.0..1.0] relative to 1/2 width + double mfCornerRadiusY; // [0.0..1.0] relative to 1/2 height + + protected: + // local decomposition. + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const; + + public: + SdrCaptionPrimitive2D( + const ::basegfx::B2DHomMatrix& rTransform, + const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute, + const ::basegfx::B2DPolygon& rTail, + double fCornerRadiusX = 0.0, + double fCornerRadiusY = 0.0); + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // data access + const ::basegfx::B2DHomMatrix& getTransform() const { return maTransform; } + const attribute::SdrLineFillShadowTextAttribute& getSdrLFSTAttribute() const { return maSdrLFSTAttribute; } + const ::basegfx::B2DPolygon& getTail() const { return maTail; } + double getCornerRadiusX() const { return mfCornerRadiusX; } + double getCornerRadiusY() const { return mfCornerRadiusY; } + bool isCornerRadiusUsed() const { return (0.0 != mfCornerRadiusX || 0.0 != mfCornerRadiusY); } + + // provide unique ID + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_SDR_PRIMITIVE2D_SDRCAPTIONPRIMITIVE2D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/primitive2d/sdrconnectorprimitive2d.hxx b/include/svx/sdr/primitive2d/sdrconnectorprimitive2d.hxx new file mode 100644 index 000000000000..882c2895e0b8 --- /dev/null +++ b/include/svx/sdr/primitive2d/sdrconnectorprimitive2d.hxx @@ -0,0 +1,68 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SDR_PRIMITIVE2D_SDRCONNECTORPRIMITIVE2D_HXX +#define INCLUDED_SDR_PRIMITIVE2D_SDRCONNECTORPRIMITIVE2D_HXX + +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#include <svx/sdr/attribute/sdrlineshadowtextattribute.hxx> +#include <basegfx/polygon/b2dpolygon.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predefines + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + class SdrConnectorPrimitive2D : public BufferedDecompositionPrimitive2D + { + private: + attribute::SdrLineShadowTextAttribute maSdrLSTAttribute; + ::basegfx::B2DPolygon maUnitPolygon; + + protected: + // local decomposition. + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const; + + public: + SdrConnectorPrimitive2D( + const attribute::SdrLineShadowTextAttribute& rSdrLSTAttribute, + const ::basegfx::B2DPolygon& rUnitPolygon); + + // data access + const attribute::SdrLineShadowTextAttribute& getSdrLSTAttribute() const { return maSdrLSTAttribute; } + const ::basegfx::B2DPolygon& getUnitPolygon() const { return maUnitPolygon; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // provide unique ID + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_SDR_PRIMITIVE2D_SDRCONNECTORPRIMITIVE2D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx b/include/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx new file mode 100644 index 000000000000..a43bd2df72bd --- /dev/null +++ b/include/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx @@ -0,0 +1,89 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SDR_PRIMITIVE2D_SDCUSTOMSHAPEPRIMITIVE2D_HXX +#define INCLUDED_SDR_PRIMITIVE2D_SDCUSTOMSHAPEPRIMITIVE2D_HXX + +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#include <basegfx/matrix/b2dhommatrix.hxx> +#include <svx/sdr/attribute/sdrshadowtextattribute.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predefines + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + class SdrCustomShapePrimitive2D : public BufferedDecompositionPrimitive2D + { + private: + attribute::SdrShadowTextAttribute maSdrSTAttribute; + Primitive2DSequence maSubPrimitives; + basegfx::B2DHomMatrix maTextBox; + + // bitfield + // defines if SdrTextWordWrapItem was set at SdrObjCustomShape which means + // that the text needs to be block formatted + unsigned mbWordWrap : 1; + + // defines that the object contains/is a 3D AutoShape. Needed for + // making exceptions with shadow generation + unsigned mb3DShape : 1; + + // #SJ# Allow text clipping against TextBox in special cases (used for SC) + unsigned mbForceTextClipToTextRange : 1; + + protected: + // local decomposition. + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const; + + public: + SdrCustomShapePrimitive2D( + const attribute::SdrShadowTextAttribute& rSdrSTAttribute, + const Primitive2DSequence& rSubPrimitives, + const basegfx::B2DHomMatrix& rTextBox, + bool bWordWrap, + bool b3DShape, + bool bForceTextClipToTextRange); + + // data access + const attribute::SdrShadowTextAttribute& getSdrSTAttribute() const { return maSdrSTAttribute; } + const Primitive2DSequence& getSubPrimitives() const { return maSubPrimitives; } + const basegfx::B2DHomMatrix& getTextBox() const { return maTextBox; } + bool getWordWrap() const { return mbWordWrap; } + bool get3DShape() const { return mb3DShape; } + bool isForceTextClipToTextRange() const { return mbForceTextClipToTextRange; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // provide unique ID + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_SDR_PRIMITIVE2D_SDCUSTOMSHAPEPRIMITIVE2D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/primitive2d/sdrdecompositiontools.hxx b/include/svx/sdr/primitive2d/sdrdecompositiontools.hxx new file mode 100644 index 000000000000..cac426980dee --- /dev/null +++ b/include/svx/sdr/primitive2d/sdrdecompositiontools.hxx @@ -0,0 +1,80 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SDR_PRIMITIVE2D_SDRDECOMPOSITIONTOOLS_HXX +#define INCLUDED_SDR_PRIMITIVE2D_SDRDECOMPOSITIONTOOLS_HXX + +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predefines +namespace basegfx { + class B2DPolygon; + class B2DPolyPolygon; + class B2DHomMatrix; +} + +namespace drawinglayer { namespace attribute { + class SdrFillAttribute; + class SdrLineAttribute; + class FillGradientAttribute; + class SdrShadowAttribute; + class SdrLineStartEndAttribute; + class SdrTextAttribute; +}} + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + Primitive2DReference createPolyPolygonFillPrimitive( + const basegfx::B2DPolyPolygon& rUnitPolyPolygon, + const basegfx::B2DHomMatrix& rObjectTransform, + const attribute::SdrFillAttribute& rFill, + const attribute::FillGradientAttribute& rFillGradient); + + Primitive2DReference createPolygonLinePrimitive( + const basegfx::B2DPolygon& rUnitPolygon, + const basegfx::B2DHomMatrix& rObjectTransform, + const attribute::SdrLineAttribute& rLine, + const attribute::SdrLineStartEndAttribute& rStroke); + + Primitive2DReference createTextPrimitive( + const basegfx::B2DPolyPolygon& rUnitPolyPolygon, + const basegfx::B2DHomMatrix& rObjectTransform, + const attribute::SdrTextAttribute& rText, + const attribute::SdrLineAttribute& rStroke, + bool bCellText, + bool bWordWrap, + bool bClipOnBounds); + + Primitive2DSequence createEmbeddedShadowPrimitive( + const Primitive2DSequence& rContent, + const attribute::SdrShadowAttribute& rShadow); + + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_SDR_PRIMITIVE2D_SDRDECOMPOSITIONTOOLS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/primitive2d/sdrellipseprimitive2d.hxx b/include/svx/sdr/primitive2d/sdrellipseprimitive2d.hxx new file mode 100644 index 000000000000..338fc52567c3 --- /dev/null +++ b/include/svx/sdr/primitive2d/sdrellipseprimitive2d.hxx @@ -0,0 +1,112 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SDR_PRIMITIVE2D_SDRELLIPSEPRIMITIVE2D_HXX +#define INCLUDED_SDR_PRIMITIVE2D_SDRELLIPSEPRIMITIVE2D_HXX + +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#include <basegfx/matrix/b2dhommatrix.hxx> +#include <svx/sdr/attribute/sdrlinefillshadowtextattribute.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predefines + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + class SdrEllipsePrimitive2D : public BufferedDecompositionPrimitive2D + { + private: + ::basegfx::B2DHomMatrix maTransform; + attribute::SdrLineFillShadowTextAttribute maSdrLFSTAttribute; + + protected: + // local decomposition. + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const; + + public: + SdrEllipsePrimitive2D( + const ::basegfx::B2DHomMatrix& rTransform, + const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute); + + // data access + const ::basegfx::B2DHomMatrix& getTransform() const { return maTransform; } + const attribute::SdrLineFillShadowTextAttribute& getSdrLFSTAttribute() const { return maSdrLFSTAttribute; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // provide unique ID + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + class SdrEllipseSegmentPrimitive2D : public SdrEllipsePrimitive2D + { + private: + double mfStartAngle; + double mfEndAngle; + + // bitfield + unsigned mbCloseSegment : 1; + unsigned mbCloseUsingCenter : 1; + + protected: + // local decomposition. + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const; + + public: + SdrEllipseSegmentPrimitive2D( + const ::basegfx::B2DHomMatrix& rTransform, + const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute, + double fStartAngle, + double fEndAngle, + bool bCloseSegment, + bool bCloseUsingCenter); + + // data access + double getStartAngle() const { return mfStartAngle; } + double getEndAngle() const { return mfEndAngle; } + bool getCloseSegment() const { return mbCloseSegment; } + bool getCloseUsingCenter() const { return mbCloseUsingCenter; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // provide unique ID + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_SDR_PRIMITIVE2D_SDRELLIPSEPRIMITIVE2D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/primitive2d/sdrgrafprimitive2d.hxx b/include/svx/sdr/primitive2d/sdrgrafprimitive2d.hxx new file mode 100644 index 000000000000..dfb098e9c010 --- /dev/null +++ b/include/svx/sdr/primitive2d/sdrgrafprimitive2d.hxx @@ -0,0 +1,76 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SDR_PRIMITIVE2D_SDRGRAFPRIMITIVE2D_HXX +#define INCLUDED_SDR_PRIMITIVE2D_SDRGRAFPRIMITIVE2D_HXX + +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#include <basegfx/matrix/b2dhommatrix.hxx> +#include <svtools/grfmgr.hxx> +#include <svx/sdr/attribute/sdrlinefillshadowtextattribute.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predefines + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + class SdrGrafPrimitive2D : public BufferedDecompositionPrimitive2D + { + private: + ::basegfx::B2DHomMatrix maTransform; + attribute::SdrLineFillShadowTextAttribute maSdrLFSTAttribute; + GraphicObject maGraphicObject; + GraphicAttr maGraphicAttr; + + protected: + // local decomposition. + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const; + + public: + SdrGrafPrimitive2D( + const ::basegfx::B2DHomMatrix& rTransform, + const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute, + const GraphicObject& rGraphicObject, + const GraphicAttr& rGraphicAttr); + + // data access + const ::basegfx::B2DHomMatrix& getTransform() const { return maTransform; } + const attribute::SdrLineFillShadowTextAttribute& getSdrLFSTAttribute() const { return maSdrLFSTAttribute; } + const GraphicObject& getGraphicObject() const { return maGraphicObject; } + const GraphicAttr& getGraphicAttr() const { return maGraphicAttr; } + bool isTransparent() const; + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // provide unique ID + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_SDR_PRIMITIVE2D_SDRGRAFPRIMITIVE2D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx b/include/svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx new file mode 100644 index 000000000000..592f14afe742 --- /dev/null +++ b/include/svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx @@ -0,0 +1,125 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SDR_PRIMITIVE2D_SDRMEASUREPRIMITIVE2D_HXX +#define INCLUDED_SDR_PRIMITIVE2D_SDRMEASUREPRIMITIVE2D_HXX + +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#include <svx/sdr/attribute/sdrlineshadowtextattribute.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predefines + +namespace drawinglayer { namespace primitive2d { + enum MeasureTextPosition + { + MEASURETEXTPOSITION_AUTOMATIC, + MEASURETEXTPOSITION_NEGATIVE, + MEASURETEXTPOSITION_CENTERED, + MEASURETEXTPOSITION_POSITIVE + }; +}} + +namespace drawinglayer { namespace attribute { + class SdrLineAttribute; +}} + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + class SdrMeasurePrimitive2D : public BufferedDecompositionPrimitive2D + { + private: + attribute::SdrLineShadowTextAttribute maSdrLSTAttribute; + basegfx::B2DPoint maStart; + basegfx::B2DPoint maEnd; + MeasureTextPosition meHorizontal; + MeasureTextPosition meVertical; + double mfDistance; + double mfUpper; + double mfLower; + double mfLeftDelta; + double mfRightDelta; + + // bitfield + unsigned mbBelow : 1; + unsigned mbTextRotation : 1; + unsigned mbTextAutoAngle : 1; + + // internal decomposition helper + Primitive2DReference impCreatePart( + const attribute::SdrLineAttribute& rLineAttribute, + const basegfx::B2DHomMatrix& rObjectMatrix, + const basegfx::B2DPoint& rStart, + const basegfx::B2DPoint& rEnd, + bool bLeftActive, + bool bRightActive) const; + + protected: + // local decomposition. + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const; + + public: + SdrMeasurePrimitive2D( + const attribute::SdrLineShadowTextAttribute& rSdrLSTAttribute, + const basegfx::B2DPoint& rStart, + const basegfx::B2DPoint& rEnd, + MeasureTextPosition eHorizontal, + MeasureTextPosition eVertical, + double fDistance, + double fUpper, + double fLower, + double fLeftDelta, + double fRightDelta, + bool bBelow, + bool bTextRotation, + bool bTextAutoAngle); + + // data access + const attribute::SdrLineShadowTextAttribute& getSdrLSTAttribute() const { return maSdrLSTAttribute; } + const basegfx::B2DPoint& getStart() const { return maStart; } + const basegfx::B2DPoint& getEnd() const { return maEnd; } + MeasureTextPosition getHorizontal() const { return meHorizontal; } + MeasureTextPosition getVertical() const { return meVertical; } + double getDistance() const { return mfDistance; } + double getUpper() const { return mfUpper; } + double getLower() const { return mfLower; } + double getLeftDelta() const { return mfLeftDelta; } + double getRightDelta() const { return mfRightDelta; } + bool getBelow() const { return mbBelow; } + bool getTextRotation() const { return mbTextRotation; } + bool getTextAutoAngle() const { return mbTextAutoAngle; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // provide unique ID + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_SDR_PRIMITIVE2D_SDRMEASUREPRIMITIVE2D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/primitive2d/sdrole2primitive2d.hxx b/include/svx/sdr/primitive2d/sdrole2primitive2d.hxx new file mode 100644 index 000000000000..0ab554706493 --- /dev/null +++ b/include/svx/sdr/primitive2d/sdrole2primitive2d.hxx @@ -0,0 +1,70 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SDR_PRIMITIVE2D_SDROLE2PRIMITIVE2D_HXX +#define INCLUDED_SDR_PRIMITIVE2D_SDROLE2PRIMITIVE2D_HXX + +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#include <basegfx/matrix/b2dhommatrix.hxx> +#include <svx/sdr/attribute/sdrlinefillshadowtextattribute.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predefines + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + class SdrOle2Primitive2D : public BasePrimitive2D + { + private: + Primitive2DSequence maOLEContent; + basegfx::B2DHomMatrix maTransform; + attribute::SdrLineFillShadowTextAttribute maSdrLFSTAttribute; + + public: + SdrOle2Primitive2D( + const Primitive2DSequence& rOLEContent, + const basegfx::B2DHomMatrix& rTransform, + const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute); + + // data access + const Primitive2DSequence& getOLEContent() const { return maOLEContent; } + const basegfx::B2DHomMatrix& getTransform() const { return maTransform; } + const attribute::SdrLineFillShadowTextAttribute& getSdrLFSTAttribute() const { return maSdrLFSTAttribute; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // local decomposition. + virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const; + + // provide unique ID + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_SDR_PRIMITIVE2D_SDROLE2PRIMITIVE2D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/primitive2d/sdrolecontentprimitive2d.hxx b/include/svx/sdr/primitive2d/sdrolecontentprimitive2d.hxx new file mode 100644 index 000000000000..2dfe0243717a --- /dev/null +++ b/include/svx/sdr/primitive2d/sdrolecontentprimitive2d.hxx @@ -0,0 +1,80 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SDR_PRIMITIVE2D_SdrOleContentPrimitive2D_HXX +#define INCLUDED_SDR_PRIMITIVE2D_SDROLECONTENTPRIMITIVE2D_HXX + +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#include <basegfx/matrix/b2dhommatrix.hxx> +#include <svx/svdobj.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predefinitions + +class SdrOle2Obj; + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + class SdrOleContentPrimitive2D : public BufferedDecompositionPrimitive2D + { + private: + SdrObjectWeakRef mpSdrOle2Obj; + basegfx::B2DHomMatrix maObjectTransform; + + // #i104867# The GraphicVersion number to identify in operator== if + // the graphic has changed, but without fetching it (which may + // be expensive, e.g. triggering chart creation) + sal_uInt32 mnGraphicVersion; + + protected: + // local decomposition. + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const; + + public: + SdrOleContentPrimitive2D( + const SdrOle2Obj& rSdrOle2Obj, + const basegfx::B2DHomMatrix& rObjectTransform, + sal_uInt32 nGraphicVersion + ); + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // The default implementation will use getDecomposition results to create the range + virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; + + // data access + const basegfx::B2DHomMatrix& getObjectTransform() const { return maObjectTransform; } + sal_uInt32 getGraphicVersion() const { return mnGraphicVersion; } + + // provide unique ID + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_SDR_PRIMITIVE2D_SDROLECONTENTPRIMITIVE2D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/primitive2d/sdrpathprimitive2d.hxx b/include/svx/sdr/primitive2d/sdrpathprimitive2d.hxx new file mode 100644 index 000000000000..a4047bbe3d78 --- /dev/null +++ b/include/svx/sdr/primitive2d/sdrpathprimitive2d.hxx @@ -0,0 +1,72 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SDR_PRIMITIVE2D_SDRPATHPRIMITIVE2D_HXX +#define INCLUDED_SDR_PRIMITIVE2D_SDRPATHPRIMITIVE2D_HXX + +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#include <basegfx/matrix/b2dhommatrix.hxx> +#include <svx/sdr/attribute/sdrlinefillshadowtextattribute.hxx> +#include <basegfx/polygon/b2dpolypolygon.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predefines + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + class SdrPathPrimitive2D : public BufferedDecompositionPrimitive2D + { + private: + basegfx::B2DHomMatrix maTransform; + attribute::SdrLineFillShadowTextAttribute maSdrLFSTAttribute; + basegfx::B2DPolyPolygon maUnitPolyPolygon; + + protected: + // local decomposition. + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const; + + public: + SdrPathPrimitive2D( + const basegfx::B2DHomMatrix& rTransform, + const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute, + const basegfx::B2DPolyPolygon& rUnitPolyPolygon); + + // data access + const basegfx::B2DHomMatrix& getTransform() const { return maTransform; } + const attribute::SdrLineFillShadowTextAttribute& getSdrLFSTAttribute() const { return maSdrLFSTAttribute; } + const basegfx::B2DPolyPolygon& getUnitPolyPolygon() const { return maUnitPolyPolygon; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // provide unique ID + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_SDR_PRIMITIVE2D_SDRPATHPRIMITIVE2D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/primitive2d/sdrprimitivetools.hxx b/include/svx/sdr/primitive2d/sdrprimitivetools.hxx new file mode 100644 index 000000000000..885b9c945da5 --- /dev/null +++ b/include/svx/sdr/primitive2d/sdrprimitivetools.hxx @@ -0,0 +1,49 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SDR_PRIMITIVE2D_PRIMITIVETOOLS_HXX +#define INCLUDED_SDR_PRIMITIVE2D_PRIMITIVETOOLS_HXX + +#include <vcl/bitmapex.hxx> +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predefines + +namespace basegfx { + class BColor; +} + +////////////////////////////////////////////////////////////////////////////// +// helper methods + +namespace drawinglayer +{ + namespace primitive2d + { + // create a 3x3 cross in given color as BitmapEx + BitmapEx createDefaultCross_3x3(const basegfx::BColor& rBColor); + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_SDR_PRIMITIVE2D_PRIMITIVETOOLS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx b/include/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx new file mode 100644 index 000000000000..4c685497b1bc --- /dev/null +++ b/include/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx @@ -0,0 +1,81 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SDR_PRIMITIVE2D_SDRRECTANGLEPRIMITIVE2D_HXX +#define INCLUDED_SDR_PRIMITIVE2D_SDRRECTANGLEPRIMITIVE2D_HXX + +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#include <basegfx/matrix/b2dhommatrix.hxx> +#include <svx/sdr/attribute/sdrlinefillshadowtextattribute.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predefines + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + class SdrRectanglePrimitive2D : public BufferedDecompositionPrimitive2D + { + private: + basegfx::B2DHomMatrix maTransform; + attribute::SdrLineFillShadowTextAttribute maSdrLFSTAttribute; + double mfCornerRadiusX; // [0.0..1.0] relative to 1/2 width + double mfCornerRadiusY; // [0.0..1.0] relative to 1/2 height + + // bitfield + // flag which decides if the HitArea should be the filled geometry + bool mbForceFillForHitTest : 1; + + protected: + // local decomposition. + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const; + + public: + SdrRectanglePrimitive2D( + const basegfx::B2DHomMatrix& rTransform, + const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute, + double fCornerRadiusX, + double fCornerRadiusY, + bool bForceFillForHitTest); + + // data access + const basegfx::B2DHomMatrix& getTransform() const { return maTransform; } + const attribute::SdrLineFillShadowTextAttribute& getSdrLFSTAttribute() const { return maSdrLFSTAttribute; } + double getCornerRadiusX() const { return mfCornerRadiusX; } + double getCornerRadiusY() const { return mfCornerRadiusY; } + bool isCornerRadiusUsed() const { return (0.0 != mfCornerRadiusX || 0.0 != mfCornerRadiusY); } + bool getForceFillForHitTest() const { return mbForceFillForHitTest; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // provide unique ID + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_SDR_PRIMITIVE2D_SDRRECTANGLEPRIMITIVE2D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/primitive2d/sdrtextprimitive2d.hxx b/include/svx/sdr/primitive2d/sdrtextprimitive2d.hxx new file mode 100644 index 000000000000..37264692f2d8 --- /dev/null +++ b/include/svx/sdr/primitive2d/sdrtextprimitive2d.hxx @@ -0,0 +1,338 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SDR_PRIMITIVE2D_SDRTEXTPRIMITIVE2D_HXX +#define INCLUDED_SDR_PRIMITIVE2D_SDRTEXTPRIMITIVE2D_HXX + +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#include <basegfx/polygon/b2dpolypolygon.hxx> +#include <basegfx/matrix/b2dhommatrix.hxx> +#include <com/sun/star/drawing/XDrawPage.hpp> +#include <editeng/outlobj.hxx> +#include <tools/color.hxx> +#include <svx/sdr/attribute/sdrformtextattribute.hxx> +#include <tools/weakbase.hxx> +#include <svx/sdtaitm.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predefines +class SdrText; + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + class SdrTextPrimitive2D : public BufferedDecompositionPrimitive2D + { + private: + // The text model data; this sould later just be the OutlinerParaObject or + // something equal + ::tools::WeakReference< SdrText > mrSdrText; + + // #i97628# + // The text content; now as local OutlinerParaObject copy (internally RefCounted and + // COW) and in exclusive, local form as needed in a primitive + const OutlinerParaObject maOutlinerParaObject; + + // remember last VisualizingPage for which a decomposition was made. If the new target + // is not given or different, the decomposition needs to be potentially removed + // for supporting e.g. page number change on MasterPage objects or the different + // field renderings in SubGeometry and MasterPage mnode + com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage > mxLastVisualizingPage; + + // remember last PageNumber for which a decomposition was made. This is only used + // when mbContainsPageField is true, else it is 0 + sal_Int16 mnLastPageNumber; + + // remember last PageCount for which a decomposition was made. This is only used + // when mbContainsPageCountField is true, else it is 0 + sal_Int16 mnLastPageCount; + + // #i101443# remember last TextBackgroundColor to decide if a new decomposition is + // needed because of background color change + Color maLastTextBackgroundColor; + + // bitfield + // is there a PageNumber, Header, Footer or DateTimeField used? Evaluated at construction + unsigned mbContainsPageField : 1; + unsigned mbContainsPageCountField : 1; + unsigned mbContainsOtherFields : 1; + + protected: + // support for XTEXT_PAINTSHAPE_BEGIN/XTEXT_PAINTSHAPE_END Metafile comments + Primitive2DSequence encapsulateWithTextHierarchyBlockPrimitive2D(const Primitive2DSequence& rCandidate) const; + + public: + SdrTextPrimitive2D( + const SdrText* pSdrText, + const OutlinerParaObject& rOutlinerParaObjectPtr); + + // get data + const SdrText* getSdrText() const { return mrSdrText.get(); } + const OutlinerParaObject& getOutlinerParaObject() const { return maOutlinerParaObject; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // own get2DDecomposition to take aspect of decomposition with or without spell checker + // into account + virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + // transformed clone operator + virtual SdrTextPrimitive2D* createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const = 0; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + class SdrContourTextPrimitive2D : public SdrTextPrimitive2D + { + private: + // unit contour polygon (scaled to [0.0 .. 1.0]) + basegfx::B2DPolyPolygon maUnitPolyPolygon; + + // complete contour polygon transform (scale, rotate, shear, translate) + basegfx::B2DHomMatrix maObjectTransform; + + protected: + // local decomposition. + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const; + + public: + SdrContourTextPrimitive2D( + const SdrText* pSdrText, + const OutlinerParaObject& rOutlinerParaObjectPtr, + const basegfx::B2DPolyPolygon& rUnitPolyPolygon, + const basegfx::B2DHomMatrix& rObjectTransform); + + // get data + const basegfx::B2DPolyPolygon& getUnitPolyPolygon() const { return maUnitPolyPolygon; } + const basegfx::B2DHomMatrix& getObjectTransform() const { return maObjectTransform; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // transformed clone operator + virtual SdrTextPrimitive2D* createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const; + + // provide unique ID + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + class SdrPathTextPrimitive2D : public SdrTextPrimitive2D + { + private: + // the path to use. Each paragraph will use one Polygon. + basegfx::B2DPolyPolygon maPathPolyPolygon; + + // the Fontwork parameters + attribute::SdrFormTextAttribute maSdrFormTextAttribute; + + protected: + // local decomposition. + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const; + + public: + SdrPathTextPrimitive2D( + const SdrText* pSdrText, + const OutlinerParaObject& rOutlinerParaObjectPtr, + const basegfx::B2DPolyPolygon& rPathPolyPolygon, + const attribute::SdrFormTextAttribute& rSdrFormTextAttribute); + + // get data + const basegfx::B2DPolyPolygon& getPathPolyPolygon() const { return maPathPolyPolygon; } + const attribute::SdrFormTextAttribute& getSdrFormTextAttribute() const { return maSdrFormTextAttribute; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // transformed clone operator + virtual SdrTextPrimitive2D* createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const; + + // provide unique ID + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + class SdrBlockTextPrimitive2D : public SdrTextPrimitive2D + { + private: + // text range transformation from unit range ([0.0 .. 1.0]) to text range + basegfx::B2DHomMatrix maTextRangeTransform; + + // text alignments + SdrTextHorzAdjust maSdrTextHorzAdjust; + SdrTextVertAdjust maSdrTextVertAdjust; + + // bitfield + unsigned mbFixedCellHeight : 1; + unsigned mbUnlimitedPage : 1; // force layout with no text break + unsigned mbCellText : 1; // this is a cell text as block text + unsigned mbWordWrap : 1; // for CustomShapes text layout + unsigned mbClipOnBounds : 1; // for CustomShapes text layout + + protected: + // local decomposition. + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const; + + public: + SdrBlockTextPrimitive2D( + const SdrText* pSdrText, + const OutlinerParaObject& rOutlinerParaObjectPtr, + const basegfx::B2DHomMatrix& rTextRangeTransform, + SdrTextHorzAdjust aSdrTextHorzAdjust, + SdrTextVertAdjust aSdrTextVertAdjust, + bool bFixedCellHeight, + bool bUnlimitedPage, + bool bCellText, + bool bWordWrap, + bool bClipOnBounds); + + // get data + const basegfx::B2DHomMatrix& getTextRangeTransform() const { return maTextRangeTransform; } + SdrTextHorzAdjust getSdrTextHorzAdjust() const { return maSdrTextHorzAdjust; } + SdrTextVertAdjust getSdrTextVertAdjust() const { return maSdrTextVertAdjust; } + bool isFixedCellHeight() const { return mbFixedCellHeight; } + bool getUnlimitedPage() const { return mbUnlimitedPage; } + bool getCellText() const { return mbCellText; } + bool getWordWrap() const { return mbWordWrap; } + bool getClipOnBounds() const { return mbClipOnBounds; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // transformed clone operator + virtual SdrTextPrimitive2D* createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const; + + // provide unique ID + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + class SdrStretchTextPrimitive2D : public SdrTextPrimitive2D + { + private: + // text range transformation from unit range ([0.0 .. 1.0]) to text range + basegfx::B2DHomMatrix maTextRangeTransform; + + // bitfield + unsigned mbFixedCellHeight : 1; + + protected: + // local decomposition. + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const; + + public: + SdrStretchTextPrimitive2D( + const SdrText* pSdrText, + const OutlinerParaObject& rOutlinerParaObjectPtr, + const basegfx::B2DHomMatrix& rTextRangeTransform, + bool bFixedCellHeight); + + // get data + const basegfx::B2DHomMatrix& getTextRangeTransform() const { return maTextRangeTransform; } + bool isFixedCellHeight() const { return mbFixedCellHeight; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // transformed clone operator + virtual SdrTextPrimitive2D* createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const; + + // provide unique ID + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + class SdrAutoFitTextPrimitive2D : public SdrTextPrimitive2D + { + private: + ::basegfx::B2DHomMatrix maTextRangeTransform; // text range transformation from unit range ([0.0 .. 1.0]) to text range + + // bitfield + unsigned mbWordWrap : 1; // for CustomShapes text layout + + protected: + // local decomposition. + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const; + + public: + SdrAutoFitTextPrimitive2D( + const SdrText* pSdrText, + const OutlinerParaObject& rOutlinerParaObjectPtr, + const ::basegfx::B2DHomMatrix& rTextRangeTransform, + bool bWordWrap); + + // get data + const basegfx::B2DHomMatrix& getTextRangeTransform() const { return maTextRangeTransform; } + bool getWordWrap() const { return mbWordWrap; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // transformed clone operator + virtual SdrTextPrimitive2D* createTransformedClone(const ::basegfx::B2DHomMatrix& rTransform) const; + + // provide unique ID + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_SDR_PRIMITIVE2D_SDRTEXTPRIMITIVE2D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/primitive2d/svx_primitivetypes2d.hxx b/include/svx/sdr/primitive2d/svx_primitivetypes2d.hxx new file mode 100644 index 000000000000..6178695bf66d --- /dev/null +++ b/include/svx/sdr/primitive2d/svx_primitivetypes2d.hxx @@ -0,0 +1,56 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_PRIMITIVE2D_PRIMITIVETYPES2D_HXX +#define INCLUDED_SVX_PRIMITIVE2D_PRIMITIVETYPES2D_HXX + +#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx> + +////////////////////////////////////////////////////////////////////////////// + +#define PRIMITIVE2D_ID_SDRCAPTIONPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 0) +#define PRIMITIVE2D_ID_SDRCONNECTORPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 1) +#define PRIMITIVE2D_ID_SDRCUSTOMSHAPEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 2) +#define PRIMITIVE2D_ID_SDRELLIPSEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 3) +#define PRIMITIVE2D_ID_SDRELLIPSESEGMENTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 4) +#define PRIMITIVE2D_ID_SDRGRAFPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 5) +#define PRIMITIVE2D_ID_SDRMEASUREPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 6) +#define PRIMITIVE2D_ID_SDROLE2PRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 7) +#define PRIMITIVE2D_ID_SDRPATHPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 8) +#define PRIMITIVE2D_ID_SDRRECTANGLEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 9) +#define PRIMITIVE2D_ID_SDRCONTOURTEXTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 10) +#define PRIMITIVE2D_ID_SDRPATHTEXTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 11) +#define PRIMITIVE2D_ID_SDRBLOCKTEXTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 12) +#define PRIMITIVE2D_ID_SDRSTRETCHTEXTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 13) +#define PRIMITIVE2D_ID_SDRCELLPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 14) +#define PRIMITIVE2D_ID_SDRBORDERLINEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 15) +#define PRIMITIVE2D_ID_OVERLAYBITMAPEXPRIMITIVE (PRIMITIVE2D_ID_RANGE_SVX| 16) +#define PRIMITIVE2D_ID_OVERLAYCROSSHAIRPRIMITIVE (PRIMITIVE2D_ID_RANGE_SVX| 17) +#define PRIMITIVE2D_ID_OVERLAYHATCHRECTANGLEPRIMITIVE (PRIMITIVE2D_ID_RANGE_SVX| 18) +#define PRIMITIVE2D_ID_OVERLAYHELPLINESTRIPEDPRIMITIVE (PRIMITIVE2D_ID_RANGE_SVX| 19) +#define PRIMITIVE2D_ID_OVERLAYROLLINGRECTANGLEPRIMITIVE (PRIMITIVE2D_ID_RANGE_SVX| 20) +#define PRIMITIVE2D_ID_SDRCONTROLPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 21) +#define PRIMITIVE2D_ID_SDROLECONTENTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 22) +#define PRIMITIVE2D_ID_SDRAUTOFITTEXTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 23) + +////////////////////////////////////////////////////////////////////////////// + +#endif // INCLUDED_SVX_PRIMITIVE2D_PRIMITIVETYPES2D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/primitive3d/sdrattributecreator3d.hxx b/include/svx/sdr/primitive3d/sdrattributecreator3d.hxx new file mode 100644 index 000000000000..1d730c054651 --- /dev/null +++ b/include/svx/sdr/primitive3d/sdrattributecreator3d.hxx @@ -0,0 +1,55 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_PRIMITIVE3D_SDRATTRIBUTECREATOR3D_HXX +#define _SDR_PRIMITIVE3D_SDRATTRIBUTECREATOR3D_HXX + +#include <sal/types.h> + +////////////////////////////////////////////////////////////////////////////// +// predefines +class SfxItemSet; + +namespace drawinglayer { namespace attribute { + class Sdr3DObjectAttribute; +}} + +namespace basegfx { + class B2DRange; +} + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + // SdrAttribute creators + attribute::Sdr3DObjectAttribute* createNewSdr3DObjectAttribute(const SfxItemSet& rSet); + + // helpers + + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_PRIMITIVE3D_SDRATTRIBUTECREATOR3D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/properties/attributeproperties.hxx b/include/svx/sdr/properties/attributeproperties.hxx new file mode 100644 index 000000000000..9f3e4d9f9ad3 --- /dev/null +++ b/include/svx/sdr/properties/attributeproperties.hxx @@ -0,0 +1,96 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_PROPERTIES_ATTRIBUTEPROPERTIES_HXX +#define _SDR_PROPERTIES_ATTRIBUTEPROPERTIES_HXX + +#include <svl/lstner.hxx> +#include <svl/stylesheetuser.hxx> +#include <svx/sdr/properties/defaultproperties.hxx> +#include "svx/svxdllapi.h" + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace properties + { + class SVX_DLLPUBLIC AttributeProperties : public DefaultProperties, public SfxListener, public svl::StyleSheetUser + { + // add style sheet, do all the necessary handling + void ImpAddStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr); + + // remove StyleSheet, do all the necessary handling + void ImpRemoveStyleSheet(); + + protected: + // the SytleSheet of this object + SfxStyleSheet* mpStyleSheet; + + // create a new itemset + virtual SfxItemSet& CreateObjectSpecificItemSet(SfxItemPool& pPool); + + // Do the ItemChange, may do special handling + virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = 0); + + // react on ItemSet changes + virtual void ItemSetChanged(const SfxItemSet& rSet); + + public: + // basic constructor + explicit AttributeProperties(SdrObject& rObj); + + // constructor for copying, but using new object + AttributeProperties(const AttributeProperties& rProps, SdrObject& rObj); + + // Clone() operator, normally just calls the local copy constructor + virtual BaseProperties& Clone(SdrObject& rObj) const; + + // destructor + virtual ~AttributeProperties(); + + // set a new StyleSheet and broadcast + virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr); + + // get the installed StyleSheet + virtual SfxStyleSheet* GetStyleSheet() const; + + // Move properties to a new ItemPool. + virtual void MoveToItemPool(SfxItemPool* pSrcPool, SfxItemPool* pDestPool, SdrModel* pNewModel = 0L); + + // Set new model. + virtual void SetModel(SdrModel* pOldModel, SdrModel* pNewModel); + + // force all attributes which come from styles to hard attributes + // to be able to live without the style. + virtual void ForceStyleToHardAttributes(); + + // This is the Notify(...) from 2nd base class SfxListener + virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint); + + virtual bool isUsedByModel() const; + }; + } // end of namespace properties +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_PROPERTIES_ATTRIBUTEPROPERTIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/properties/captionproperties.hxx b/include/svx/sdr/properties/captionproperties.hxx new file mode 100644 index 000000000000..484d3139817c --- /dev/null +++ b/include/svx/sdr/properties/captionproperties.hxx @@ -0,0 +1,67 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_PROPERTIES_CAPTIONPROPERTIES_HXX +#define _SDR_PROPERTIES_CAPTIONPROPERTIES_HXX + +#include <svx/sdr/properties/rectangleproperties.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace properties + { + class CaptionProperties : public RectangleProperties + { + protected: + // create a new itemset + virtual SfxItemSet& CreateObjectSpecificItemSet(SfxItemPool& rPool); + + // react on ItemSet changes + virtual void ItemSetChanged(const SfxItemSet& rSet); + + public: + // basic constructor + explicit CaptionProperties(SdrObject& rObj); + + // constructor for copying, but using new object + CaptionProperties(const CaptionProperties& rProps, SdrObject& rObj); + + // destructor + virtual ~CaptionProperties(); + + // Clone() operator, normally just calls the local copy constructor + virtual BaseProperties& Clone(SdrObject& rObj) const; + + // set a new StyleSheet and broadcast + virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr); + + // force default attributes for a specific object type, called from + // DefaultProperties::GetObjectItemSet() if a new ItemSet is created + virtual void ForceDefaultAttributes(); + }; + } // end of namespace properties +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif // _SDR_PROPERTIES_CAPTIONPROPERTIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/properties/circleproperties.hxx b/include/svx/sdr/properties/circleproperties.hxx new file mode 100644 index 000000000000..3a5ddb910d42 --- /dev/null +++ b/include/svx/sdr/properties/circleproperties.hxx @@ -0,0 +1,67 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_PROPERTIES_CIRCLEPROPERTIES_HXX +#define _SDR_PROPERTIES_CIRCLEPROPERTIES_HXX + +#include <svx/sdr/properties/rectangleproperties.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace properties + { + class CircleProperties : public RectangleProperties + { + protected: + // create a new itemset + virtual SfxItemSet& CreateObjectSpecificItemSet(SfxItemPool& rPool); + + // react on ItemSet changes + virtual void ItemSetChanged(const SfxItemSet& rSet); + + public: + // basic constructor + explicit CircleProperties(SdrObject& rObj); + + // constructor for copying, but using new object + CircleProperties(const CircleProperties& rProps, SdrObject& rObj); + + // destructor + virtual ~CircleProperties(); + + // Clone() operator, normally just calls the local copy constructor + virtual BaseProperties& Clone(SdrObject& rObj) const; + + // set a new StyleSheet and broadcast + virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr); + + // force default attributes for a specific object type, called from + // DefaultProperties::GetObjectItemSet() if a new ItemSet is created + virtual void ForceDefaultAttributes(); + }; + } // end of namespace properties +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_PROPERTIES_CIRCLEPROPERTIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/properties/connectorproperties.hxx b/include/svx/sdr/properties/connectorproperties.hxx new file mode 100644 index 000000000000..ae70c1d8b3d6 --- /dev/null +++ b/include/svx/sdr/properties/connectorproperties.hxx @@ -0,0 +1,63 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_PROPERTIES_CONNECTORPROPERTIES_HXX +#define _SDR_PROPERTIES_CONNECTORPROPERTIES_HXX + +#include <svx/sdr/properties/textproperties.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace properties + { + class ConnectorProperties : public TextProperties + { + protected: + // create a new itemset + virtual SfxItemSet& CreateObjectSpecificItemSet(SfxItemPool& rPool); + + // react on ItemSet changes + virtual void ItemSetChanged(const SfxItemSet& rSet); + + public: + // basic constructor + explicit ConnectorProperties(SdrObject& rObj); + + // constructor for copying, but using new object + ConnectorProperties(const ConnectorProperties& rProps, SdrObject& rObj); + + // destructor + virtual ~ConnectorProperties(); + + // Clone() operator, normally just calls the local copy constructor + virtual BaseProperties& Clone(SdrObject& rObj) const; + + // set a new StyleSheet and broadcast + virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr); + }; + } // end of namespace properties +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_PROPERTIES_CONNECTORPROPERTIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/properties/customshapeproperties.hxx b/include/svx/sdr/properties/customshapeproperties.hxx new file mode 100644 index 000000000000..ae1e7a70451f --- /dev/null +++ b/include/svx/sdr/properties/customshapeproperties.hxx @@ -0,0 +1,86 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_PROPERTIES_CUSTOMSHAPEPROPERTIES_HXX +#define _SDR_PROPERTIES_CUSTOMSHAPEPROPERTIES_HXX + +#include <svx/sdr/properties/textproperties.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace properties + { + class CustomShapeProperties : public TextProperties + { + void UpdateTextFrameStatus(); + + protected: + // create a new itemset + virtual SfxItemSet& CreateObjectSpecificItemSet(SfxItemPool& rPool); + + // test changeability for a single item + virtual sal_Bool AllowItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = 0) const; + + // react on ItemSet changes + virtual void ItemSetChanged(const SfxItemSet& rSet); + + // react on Item change + virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem); + + // clear single item + virtual void ClearObjectItem(const sal_uInt16 nWhich = 0); + + // clear single item direct, do not do any notifies or things like that. + // Also supports complete deleteion of items when default parameter 0 is used. + virtual void ClearObjectItemDirect(const sal_uInt16 nWhich = 0); + + public: + + // set a new StyleSheet and broadcast + virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr); + + // force default attributes for a specific object type, called from + // DefaultProperties::GetObjectItemSet() if a new ItemSet is created + virtual void ForceDefaultAttributes(); + + // basic constructor + explicit CustomShapeProperties(SdrObject& rObj); + + // constructor for copying, but using new object + CustomShapeProperties(const CustomShapeProperties& rProps, SdrObject& rObj); + + // destructor + virtual ~CustomShapeProperties(); + + // Clone() operator, normally just calls the local copy constructor + virtual BaseProperties& Clone(SdrObject& rObj) const; + + // This is the notifyer from SfxListener + virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint); + }; + } // end of namespace properties +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_PROPERTIES_CUSTOMSHAPEPROPERTIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/properties/defaultproperties.hxx b/include/svx/sdr/properties/defaultproperties.hxx new file mode 100644 index 000000000000..5b8b9f4f1c0e --- /dev/null +++ b/include/svx/sdr/properties/defaultproperties.hxx @@ -0,0 +1,104 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_PROPERTIES_DEFAULTPROPERTIES_HXX +#define _SDR_PROPERTIES_DEFAULTPROPERTIES_HXX + +#include <svx/sdr/properties/properties.hxx> +#include "svx/svxdllapi.h" + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace properties + { + class SVX_DLLPUBLIC DefaultProperties : public BaseProperties + { + protected: + // the to be used ItemSet + SfxItemSet* mpItemSet; + + // create a new itemset + virtual SfxItemSet& CreateObjectSpecificItemSet(SfxItemPool& rPool); + + // test changeability for a single item + virtual sal_Bool AllowItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = 0) const; + + // Do the ItemChange, may do special handling + virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = 0); + + // Called after ItemChange() is done for all items. + virtual void PostItemChange(const sal_uInt16 nWhich); + + // react on ItemSet changes + virtual void ItemSetChanged(const SfxItemSet& rSet); + + public: + // basic constructor + explicit DefaultProperties(SdrObject& rObj); + + // constructor for copying, but using new object + DefaultProperties(const DefaultProperties& rProps, SdrObject& rObj); + + // destructor + virtual ~DefaultProperties(); + + // Clone() operator, normally just calls the local copy constructor + virtual BaseProperties& Clone(SdrObject& rObj) const; + + // get itemset + virtual const SfxItemSet& GetObjectItemSet() const; + + // set single item + virtual void SetObjectItem(const SfxPoolItem& rItem); + + // set single item direct, do not do any notifies or things like that + virtual void SetObjectItemDirect(const SfxPoolItem& rItem); + + // clear single item + virtual void ClearObjectItem(const sal_uInt16 nWhich = 0); + + // clear single item direct, do not do any notifies or things like that. + // Also supports complete deleteion of items when default parameter 0 is used. + virtual void ClearObjectItemDirect(const sal_uInt16 nWhich = 0); + + // set complete item set + virtual void SetObjectItemSet(const SfxItemSet& rSet); + + // set a new StyleSheet and broadcast + virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr); + + // get the installed StyleSheet + virtual SfxStyleSheet* GetStyleSheet() const; + + // force default attributes for a specific object type, called from + // DefaultProperties::GetObjectItemSet() if a new ItemSet is created. + // Default implementation does nothing. + virtual void ForceDefaultAttributes(); + + // Scale the included ItemSet. + virtual void Scale(const Fraction& rScale); + }; + } // end of namespace properties +} // end of namespace sdr + +#endif //_SDR_PROPERTIES_DEFAULTPROPERTIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/properties/e3dcompoundproperties.hxx b/include/svx/sdr/properties/e3dcompoundproperties.hxx new file mode 100644 index 000000000000..9175042084aa --- /dev/null +++ b/include/svx/sdr/properties/e3dcompoundproperties.hxx @@ -0,0 +1,71 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_PROPERTIES_E3DCOMPOUNDPROPERTIES_HXX +#define _SDR_PROPERTIES_E3DCOMPOUNDPROPERTIES_HXX + +#include <svx/sdr/properties/e3dproperties.hxx> +#include "svx/svxdllapi.h" + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace properties + { + class SVX_DLLPUBLIC E3dCompoundProperties : public E3dProperties + { + protected: + // Called after ItemChange() is done for all items. + virtual void PostItemChange(const sal_uInt16 nWhich); + + public: + // basic constructor + explicit E3dCompoundProperties(SdrObject& rObj); + + // constructor for copying, but using new object + E3dCompoundProperties(const E3dCompoundProperties& rProps, SdrObject& rObj); + + // destructor + virtual ~E3dCompoundProperties(); + + // Clone() operator, normally just calls the local copy constructor + virtual BaseProperties& Clone(SdrObject& rObj) const; + + // get itemset + virtual const SfxItemSet& GetObjectItemSet() const; + + // Get merged ItemSet. Normally, this maps directly to GetObjectItemSet(), but may + // be overloaded e.g for group objects to return a merged ItemSet of the object. + // When using this method the returned ItemSet may contain items in the state + // SFX_ITEM_DONTCARE which means there were several such items with different + // values. + virtual const SfxItemSet& GetMergedItemSet() const; + + // Set merged ItemSet. Normally, this maps to SetObjectItemSet(). + virtual void SetMergedItemSet(const SfxItemSet& rSet, sal_Bool bClearAllItems = sal_False); + }; + } // end of namespace properties +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif // _SDR_PROPERTIES_E3DCOMPOUNDPROPERTIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/properties/e3dextrudeproperties.hxx b/include/svx/sdr/properties/e3dextrudeproperties.hxx new file mode 100644 index 000000000000..ad7aa529a36c --- /dev/null +++ b/include/svx/sdr/properties/e3dextrudeproperties.hxx @@ -0,0 +1,58 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_PROPERTIES_E3DEXTRUDEPROPERTIES_HXX +#define _SDR_PROPERTIES_E3DEXTRUDEPROPERTIES_HXX + +#include <svx/sdr/properties/e3dcompoundproperties.hxx> +#include "svx/svxdllapi.h" + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace properties + { + class SVX_DLLPUBLIC E3dExtrudeProperties : public E3dCompoundProperties + { + protected: + // Called after ItemChange() is done for all items. + virtual void PostItemChange(const sal_uInt16 nWhich); + + public: + // basic constructor + explicit E3dExtrudeProperties(SdrObject& rObj); + + // constructor for copying, but using new object + E3dExtrudeProperties(const E3dExtrudeProperties& rProps, SdrObject& rObj); + + // destructor + virtual ~E3dExtrudeProperties(); + + // Clone() operator, normally just calls the local copy constructor + virtual BaseProperties& Clone(SdrObject& rObj) const; + }; + } // end of namespace properties +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif // _SDR_PROPERTIES_E3DEXTRUDEPROPERTIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/properties/e3dlatheproperties.hxx b/include/svx/sdr/properties/e3dlatheproperties.hxx new file mode 100644 index 000000000000..17855a6b0658 --- /dev/null +++ b/include/svx/sdr/properties/e3dlatheproperties.hxx @@ -0,0 +1,58 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_PROPERTIES_E3DLATHEPROPERTIES_HXX +#define _SDR_PROPERTIES_E3DLATHEPROPERTIES_HXX + +#include <svx/sdr/properties/e3dcompoundproperties.hxx> +#include "svx/svxdllapi.h" + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace properties + { + class SVX_DLLPUBLIC E3dLatheProperties : public E3dCompoundProperties + { + protected: + // Called after ItemChange() is done for all items. + virtual void PostItemChange(const sal_uInt16 nWhich); + + public: + // basic constructor + explicit E3dLatheProperties(SdrObject& rObj); + + // constructor for copying, but using new object + E3dLatheProperties(const E3dLatheProperties& rProps, SdrObject& rObj); + + // destructor + virtual ~E3dLatheProperties(); + + // Clone() operator, normally just calls the local copy constructor + virtual BaseProperties& Clone(SdrObject& rObj) const; + }; + } // end of namespace properties +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif // _SDR_PROPERTIES_E3DLATHEPROPERTIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/properties/e3dproperties.hxx b/include/svx/sdr/properties/e3dproperties.hxx new file mode 100644 index 000000000000..4bebaab05c2a --- /dev/null +++ b/include/svx/sdr/properties/e3dproperties.hxx @@ -0,0 +1,64 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_PROPERTIES_E3DPROPERTIES_HXX +#define _SDR_PROPERTIES_E3DPROPERTIES_HXX + +#include <svx/sdr/properties/attributeproperties.hxx> +#include "svx/svxdllapi.h" + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace properties + { + class SVX_DLLPUBLIC E3dProperties : public AttributeProperties + { + protected: + // create a new itemset + virtual SfxItemSet& CreateObjectSpecificItemSet(SfxItemPool& rPool); + + // react on ItemSet changes + virtual void ItemSetChanged(const SfxItemSet& rSet); + + public: + // basic constructor + explicit E3dProperties(SdrObject& rObj); + + // constructor for copying, but using new object + E3dProperties(const E3dProperties& rProps, SdrObject& rObj); + + // destructor + virtual ~E3dProperties(); + + // Clone() operator, normally just calls the local copy constructor + virtual BaseProperties& Clone(SdrObject& rObj) const; + + // set a new StyleSheet and broadcast + virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr); + }; + } // end of namespace properties +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif // _SDR_PROPERTIES_E3DPROPERTIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/properties/e3dsceneproperties.hxx b/include/svx/sdr/properties/e3dsceneproperties.hxx new file mode 100644 index 000000000000..e52c483b14e6 --- /dev/null +++ b/include/svx/sdr/properties/e3dsceneproperties.hxx @@ -0,0 +1,88 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_PROPERTIES_E3DSCENEPROPERTIES_HXX +#define _SDR_PROPERTIES_E3DSCENEPROPERTIES_HXX + +#include <svx/sdr/properties/e3dproperties.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace properties + { + class E3dSceneProperties : public E3dProperties + { + protected: + // Called after ItemChange() is done for all items. + virtual void PostItemChange(const sal_uInt16 nWhich); + + public: + // basic constructor + explicit E3dSceneProperties(SdrObject& rObj); + + // constructor for copying, but using new object + E3dSceneProperties(const E3dSceneProperties& rProps, SdrObject& rObj); + + // destructor + virtual ~E3dSceneProperties(); + + // Clone() operator, normally just calls the local copy constructor + virtual BaseProperties& Clone(SdrObject& rObj) const; + + // get itemset + virtual const SfxItemSet& GetObjectItemSet() const; + + // get merged ItemSet. Normappl, this maps directly to GetObjectItemSet(), but may + // be overloaded e.g for group objects to return a merged ItemSet of the object. + // When using this method the returned ItemSet may contain items in the state + // SFX_ITEM_DONTCARE which means there were several such items with different + // values. + virtual const SfxItemSet& GetMergedItemSet() const; + + // Set merged ItemSet. Normally, this maps to SetObjectItemSet(). + virtual void SetMergedItemSet(const SfxItemSet& rSet, sal_Bool bClearAllItems = sal_False); + + // Set a single item, iterate over hierarchies if necessary. + virtual void SetMergedItem(const SfxPoolItem& rItem); + + // Clear a single item, iterate over hierarchies if necessary. + virtual void ClearMergedItem(const sal_uInt16 nWhich = 0); + + // set a new StyleSheet and broadcast + virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr); + + // get the installed StyleSheet + virtual SfxStyleSheet* GetStyleSheet() const; + + // Move properties to a new ItemPool. Default implementation does nothing. + virtual void MoveToItemPool(SfxItemPool* pSrcPool, SfxItemPool* pDestPool, SdrModel* pNewModel = 0L); + + // Special for scene: + void SetSceneItemsFromCamera(); + }; + } // end of namespace properties +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif // _SDR_PROPERTIES_E3DSCENEPROPERTIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/properties/e3dsphereproperties.hxx b/include/svx/sdr/properties/e3dsphereproperties.hxx new file mode 100644 index 000000000000..d99af2d38c85 --- /dev/null +++ b/include/svx/sdr/properties/e3dsphereproperties.hxx @@ -0,0 +1,57 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_PROPERTIES_E3DSPHEREPROPERTIES_HXX +#define _SDR_PROPERTIES_E3DSPHEREPROPERTIES_HXX + +#include <svx/sdr/properties/e3dcompoundproperties.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace properties + { + class E3dSphereProperties : public E3dCompoundProperties + { + protected: + // Called after ItemChange() is done for all items. + virtual void PostItemChange(const sal_uInt16 nWhich); + + public: + // basic constructor + explicit E3dSphereProperties(SdrObject& rObj); + + // constructor for copying, but using new object + E3dSphereProperties(const E3dSphereProperties& rProps, SdrObject& rObj); + + // destructor + virtual ~E3dSphereProperties(); + + // Clone() operator, normally just calls the local copy constructor + virtual BaseProperties& Clone(SdrObject& rObj) const; + }; + } // end of namespace properties +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif // _SDR_PROPERTIES_E3DSPHEREPROPERTIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/properties/emptyproperties.hxx b/include/svx/sdr/properties/emptyproperties.hxx new file mode 100644 index 000000000000..102af739dcf6 --- /dev/null +++ b/include/svx/sdr/properties/emptyproperties.hxx @@ -0,0 +1,96 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_PROPERTIES_EMPTYPROPERTIES_HXX +#define _SDR_PROPERTIES_EMPTYPROPERTIES_HXX + +#include <svx/sdr/properties/properties.hxx> +#include "svx/svxdllapi.h" + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace properties + { + class SVX_DLLPUBLIC EmptyProperties : public BaseProperties + { + protected: + // the to be used ItemSet + SfxItemSet* mpEmptyItemSet; + + // create a new itemset + virtual SfxItemSet& CreateObjectSpecificItemSet(SfxItemPool& rPool); + + // test changeability for a single item + virtual sal_Bool AllowItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = 0) const; + + // Do the ItemChange, may do special handling + virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = 0); + + // Called after ItemChange() is done for all items. + virtual void PostItemChange(const sal_uInt16 nWhich); + + // react on ItemSet changes + virtual void ItemSetChanged(const SfxItemSet& rSet); + + public: + // basic constructor + explicit EmptyProperties(SdrObject& rObj); + + // constructor for copying, but using new object + EmptyProperties(const EmptyProperties& rProps, SdrObject& rObj); + + // destructor + virtual ~EmptyProperties(); + + // Clone() operator, normally just calls the local copy constructor + virtual BaseProperties& Clone(SdrObject& rObj) const; + + // get itemset + virtual const SfxItemSet& GetObjectItemSet() const; + + // set single item + virtual void SetObjectItem(const SfxPoolItem& rItem); + + // set single item direct, do not do any notifies or things like that + virtual void SetObjectItemDirect(const SfxPoolItem& rItem); + + // clear single item + virtual void ClearObjectItem(const sal_uInt16 nWhich = 0); + + // clear single item direct, do not do any notifies or things like that. + // Also supports complete deleteion of items when default parameter 0 is used. + virtual void ClearObjectItemDirect(const sal_uInt16 nWhich = 0); + + // set complete item set + virtual void SetObjectItemSet(const SfxItemSet& rSet); + + // set a new StyleSheet and broadcast + virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr); + + // get the installed StyleSheet + virtual SfxStyleSheet* GetStyleSheet() const; + }; + } // end of namespace properties +} // end of namespace sdr + +#endif //_SDR_PROPERTIES_EMPTYPROPERTIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/properties/graphicproperties.hxx b/include/svx/sdr/properties/graphicproperties.hxx new file mode 100644 index 000000000000..e2a3562440af --- /dev/null +++ b/include/svx/sdr/properties/graphicproperties.hxx @@ -0,0 +1,67 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_PROPERTIES_GRAPHICPROPERTIES_HXX +#define _SDR_PROPERTIES_GRAPHICPROPERTIES_HXX + +#include <svx/sdr/properties/rectangleproperties.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace properties + { + class GraphicProperties : public RectangleProperties + { + protected: + // create a new itemset + virtual SfxItemSet& CreateObjectSpecificItemSet(SfxItemPool& rPool); + + // react on ItemSet changes + virtual void ItemSetChanged(const SfxItemSet& rSet); + + public: + // basic constructor + explicit GraphicProperties(SdrObject& rObj); + + // constructor for copying, but using new object + GraphicProperties(const GraphicProperties& rProps, SdrObject& rObj); + + // destructor + virtual ~GraphicProperties(); + + // Clone() operator, normally just calls the local copy constructor + virtual BaseProperties& Clone(SdrObject& rObj) const; + + // set a new StyleSheet and broadcast + virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr); + + // force default attributes for a specific object type, called from + // DefaultProperties::GetObjectItemSet() if a new ItemSet is created + virtual void ForceDefaultAttributes(); + }; + } // end of namespace properties +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_PROPERTIES_GRAPHICPROPERTIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/properties/groupproperties.hxx b/include/svx/sdr/properties/groupproperties.hxx new file mode 100644 index 000000000000..3de8abf71ea2 --- /dev/null +++ b/include/svx/sdr/properties/groupproperties.hxx @@ -0,0 +1,121 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_PROPERTIES_GROUPPROPERTIES_HXX +#define _SDR_PROPERTIES_GROUPPROPERTIES_HXX + +#include <svx/sdr/properties/defaultproperties.hxx> + +///////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace properties + { + class GroupProperties : public DefaultProperties + { + protected: + // create a new itemset + virtual SfxItemSet& CreateObjectSpecificItemSet(SfxItemPool& rPool); + + // test changeability for a single item + virtual sal_Bool AllowItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = 0) const; + + // Do the ItemChange, may do special handling + virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = 0); + + // Called after ItemChange() is done for all items. + virtual void PostItemChange(const sal_uInt16 nWhich); + + // react on ItemSet changes + virtual void ItemSetChanged(const SfxItemSet& rSet); + + public: + // basic constructor + explicit GroupProperties(SdrObject& rObj); + + // copy constructor + GroupProperties(const GroupProperties& rProps, SdrObject& rObj); + + // destructor + virtual ~GroupProperties(); + + // Clone() operator, normally just calls the local copy constructor + virtual BaseProperties& Clone(SdrObject& rObj) const; + + // get itemset + virtual const SfxItemSet& GetObjectItemSet() const; + + // get merged ItemSet. Normally, this maps directly to GetObjectItemSet(), but may + // be overloaded e.g for group objects to return a merged ItemSet of the object. + // When using this method the returned ItemSet may contain items in the state + // SFX_ITEM_DONTCARE which means there were several such items with different + // values. + virtual const SfxItemSet& GetMergedItemSet() const; + + // Set merged ItemSet. Normally, this maps to SetObjectItemSet(). + virtual void SetMergedItemSet(const SfxItemSet& rSet, sal_Bool bClearAllItems = sal_False); + + // set single item + virtual void SetObjectItem(const SfxPoolItem& rItem); + + // set single item direct, do not do any notifies or things like that + virtual void SetObjectItemDirect(const SfxPoolItem& rItem); + + // clear single item + virtual void ClearObjectItem(const sal_uInt16 nWhich = 0); + + // clear single item direct, do not do any notifies or things like that. + // Also supports complete deleteion of items when default parameter 0 is used. + virtual void ClearObjectItemDirect(const sal_uInt16 nWhich = 0); + + // Set a single item, iterate over hierarchies if necessary. + virtual void SetMergedItem(const SfxPoolItem& rItem); + + // Clear a single item, iterate over hierarchies if necessary. + virtual void ClearMergedItem(const sal_uInt16 nWhich = 0); + + // set complete item set + virtual void SetObjectItemSet(const SfxItemSet& rSet); + + // set a new StyleSheet + virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr); + + // get the local StyleSheet + virtual SfxStyleSheet* GetStyleSheet() const; + + // force default attributes for a specific object type, called from + // DefaultProperties::GetObjectItemSet() if a new ItemSet is created + virtual void ForceDefaultAttributes(); + + // Move properties to a new ItemPool. + virtual void MoveToItemPool(SfxItemPool* pSrcPool, SfxItemPool* pDestPool, SdrModel* pNewModel = 0L); + + // force all attributes which come from styles to hard attributes + // to be able to live without the style. + virtual void ForceStyleToHardAttributes(); + }; + } // end of namespace properties +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_PROPERTIES_GROUPPROPERTIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/properties/itemsettools.hxx b/include/svx/sdr/properties/itemsettools.hxx new file mode 100644 index 000000000000..8649ffb3c10d --- /dev/null +++ b/include/svx/sdr/properties/itemsettools.hxx @@ -0,0 +1,68 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_PROPERTIES_ITEMSETTOOLS_HXX +#define _SDR_PROPERTIES_ITEMSETTOOLS_HXX + +#include <sal/types.h> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +class SdrObject; +class SfxItemSet; +class Rectangle; +class Fraction; + +////////////////////////////////////////////////////////////////////////////// +// class to remember broadcast start positions +namespace sdr +{ + namespace properties + { + class ItemChangeBroadcaster + { + sal_uInt32 mnCount; + void* mpData; + + public: + explicit ItemChangeBroadcaster(const SdrObject& rObj); + ~ItemChangeBroadcaster(); + + sal_uInt32 GetRectangleCount() const; + const Rectangle& GetRectangle(sal_uInt32 nIndex) const; + }; + } // end of namespace properties +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace properties + { + void ScaleItemSet(SfxItemSet& rSet, const Fraction& rScale); + } // end of namespace properties +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_PROPERTIES_ITEMSETTOOLS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/properties/measureproperties.hxx b/include/svx/sdr/properties/measureproperties.hxx new file mode 100644 index 000000000000..22e42b80dac6 --- /dev/null +++ b/include/svx/sdr/properties/measureproperties.hxx @@ -0,0 +1,67 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_PROPERTIES_MEASUREPROPERTIES_HXX +#define _SDR_PROPERTIES_MEASUREPROPERTIES_HXX + +#include <svx/sdr/properties/textproperties.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace properties + { + class MeasureProperties : public TextProperties + { + protected: + // create a new itemset + virtual SfxItemSet& CreateObjectSpecificItemSet(SfxItemPool& rPool); + + // react on ItemSet changes + virtual void ItemSetChanged(const SfxItemSet& rSet); + + public: + // basic constructor + explicit MeasureProperties(SdrObject& rObj); + + // constructor for copying, but using new object + MeasureProperties(const MeasureProperties& rProps, SdrObject& rObj); + + // destructor + virtual ~MeasureProperties(); + + // Clone() operator, normally just calls the local copy constructor + virtual BaseProperties& Clone(SdrObject& rObj) const; + + // set a new StyleSheet and broadcast + virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr); + + // force default attributes for a specific object type, called from + // DefaultProperties::GetObjectItemSet() if a new ItemSet is created + virtual void ForceDefaultAttributes(); + }; + } // end of namespace properties +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_PROPERTIES_MEASUREPROPERTIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/properties/oleproperties.hxx b/include/svx/sdr/properties/oleproperties.hxx new file mode 100644 index 000000000000..184f840af272 --- /dev/null +++ b/include/svx/sdr/properties/oleproperties.hxx @@ -0,0 +1,58 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_PROPERTIES_OLEPROPERTIES_HXX +#define _SDR_PROPERTIES_OLEPROPERTIES_HXX + +#include <svx/sdr/properties/rectangleproperties.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace properties + { + class OleProperties : public RectangleProperties + { + protected: + public: + // basic constructor + explicit OleProperties(SdrObject& rObj); + + // constructor for copying, but using new object + OleProperties(const OleProperties& rProps, SdrObject& rObj); + + // destructor + virtual ~OleProperties(); + + // Clone() operator, normally just calls the local copy constructor + virtual BaseProperties& Clone(SdrObject& rObj) const; + + // force default attributes for a specific object type, called from + // DefaultProperties::GetObjectItemSet() if a new ItemSet is created + virtual void ForceDefaultAttributes(); + }; + } // end of namespace properties +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_PROPERTIES_OLEPROPERTIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/properties/pageproperties.hxx b/include/svx/sdr/properties/pageproperties.hxx new file mode 100644 index 000000000000..fe7c333cec71 --- /dev/null +++ b/include/svx/sdr/properties/pageproperties.hxx @@ -0,0 +1,73 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_PROPERTIES_PAGEPROPERTIES_HXX +#define _SDR_PROPERTIES_PAGEPROPERTIES_HXX + +#include <svx/sdr/properties/emptyproperties.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace properties + { + class PageProperties : public EmptyProperties + { + protected: + // create a new object specific itemset with object specific ranges. + virtual SfxItemSet& CreateObjectSpecificItemSet(SfxItemPool& pPool); + + // Do the ItemChange, may do special handling + virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = 0); + + // Called after ItemChange() is done for all items. + virtual void PostItemChange(const sal_uInt16 nWhich); + + public: + // basic constructor + explicit PageProperties(SdrObject& rObj); + + // constructor for copying, but using new object + PageProperties(const PageProperties& rProps, SdrObject& rObj); + + // destructor + virtual ~PageProperties(); + + // Clone() operator, normally just calls the local copy constructor + virtual BaseProperties& Clone(SdrObject& rObj) const; + + // get itemset. Overloaded here to allow creating the empty itemset + // without asserting + virtual const SfxItemSet& GetObjectItemSet() const; + + // get the installed StyleSheet + virtual SfxStyleSheet* GetStyleSheet() const; + + // clear single item + virtual void ClearObjectItem(const sal_uInt16 nWhich = 0); + }; + } // end of namespace properties +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_PROPERTIES_PAGEPROPERTIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/properties/properties.hxx b/include/svx/sdr/properties/properties.hxx new file mode 100644 index 000000000000..287cd5b93ef2 --- /dev/null +++ b/include/svx/sdr/properties/properties.hxx @@ -0,0 +1,193 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_PROPERTIES_PROPERTIES_HXX +#define _SDR_PROPERTIES_PROPERTIES_HXX + +#include <sal/types.h> +#include "svx/svxdllapi.h" + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +class SdrObject; +class SfxItemSet; +class SfxPoolItem; +class SfxStyleSheet; +class Fraction; +class SfxItemPool; +class SdrModel; + +namespace sdr +{ + namespace properties + { + class ItemChangeBroadcaster; + } // end of namespace properties +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace properties + { + class SVX_DLLPUBLIC BaseProperties + { + protected: + // the owner of this Properties. Set from constructor and not + // to be changed in any way. + SdrObject& mrObject; + + // create a new object specific itemset with object specific ranges. + virtual SfxItemSet& CreateObjectSpecificItemSet(SfxItemPool& pPool) = 0; + + // internal access to SdrObject + SdrObject& GetSdrObject() const + { + return mrObject; + } + + // Test changeability for a single item. If a implementation wants to prevent + // changing an item this method may be overloaded. + virtual sal_Bool AllowItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = 0) const = 0; + + // Do the internal ItemChange. If only nWhich is given, the item needs to be cleared. + // Also needs to handle if nWhich and pNewItem is 0, which means to clear all items. + virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = 0) = 0; + + // Called after ItemChange() is done for all items. Allows local reactions on + // specific item changes + virtual void PostItemChange(const sal_uInt16 nWhich) = 0; + + // Internally react on ItemSet changes. The given ItemSet contains all changed items, the new ones. + virtual void ItemSetChanged(const SfxItemSet& rSet) = 0; + + public: + // basic constructor, used from SdrObject. + explicit BaseProperties(SdrObject& rObj); + + // constructor for copying, but using new object. Used from the Clone() + // method. + BaseProperties(const BaseProperties& rProps, SdrObject& rObj); + + // destructor + virtual ~BaseProperties(); + + // Clone() operator, normally just calls the local copy constructor, + // see above. + virtual BaseProperties& Clone(SdrObject& rObj) const = 0; + + // Get the local ItemSet. This directly returns the local ItemSet of the object. No + // merging of ItemSets is done for e.g. Group objects. + virtual const SfxItemSet& GetObjectItemSet() const = 0; + + // get merged ItemSet. Normappl, this maps directly to GetObjectItemSet(), but may + // be overloaded e.g for group objects to return a merged ItemSet of the object. + // When using this method the returned ItemSet may contain items in the state + // SFX_ITEM_DONTCARE which means there were several such items with different + // values. + virtual const SfxItemSet& GetMergedItemSet() const; + + // Sets all items which are on state SFX_ITEM_SET in rSet at the local ItemSet. + // Uses AllowItemChange(), ItemChange(), PostItemChange() and ItemSetChanged() calls. + virtual void SetObjectItemSet(const SfxItemSet& rSet) = 0; + + // Set merged ItemSet. Normally, this maps to SetObjectItemSet(). + virtual void SetMergedItemSet(const SfxItemSet& rSet, sal_Bool bClearAllItems = sal_False); + + // Set single item at the local ItemSet. Uses AllowItemChange(), + // ItemChange(), PostItemChange() and ItemSetChanged() calls. + virtual void SetObjectItem(const SfxPoolItem& rItem) = 0; + + // Set a single item direct. Only uses AllowItemChange() and ItemChange(), + // but not PostItemChange() and ItemSetChanged() calls. + virtual void SetObjectItemDirect(const SfxPoolItem& rItem) = 0; + + // Clear a single local item. Uses AllowItemChange(), + // ItemChange(), PostItemChange() and ItemSetChanged() calls. + virtual void ClearObjectItem(const sal_uInt16 nWhich = 0) = 0; + + // Set a single item, iterate over hierarchies if necessary. Default + // Implementation falls back to ClearObjectItem(). + virtual void SetMergedItem(const SfxPoolItem& rItem); + + // Clear a single item, iterate over hierarchies if necessary. Default + // Implementation falls back to ClearObjectItem(). + virtual void ClearMergedItem(const sal_uInt16 nWhich = 0); + + // Clear single item direct. Only uses AllowItemChange() and ItemChange(), + // but not PostItemChange() and ItemSetChanged() calls. + // Also supports complete deletion of items when default parameter 0 is used. + virtual void ClearObjectItemDirect(const sal_uInt16 nWhich = 0) = 0; + + // Set a new StyleSheet. Registers as listener at the StyleSheet to get knowledge + // of StyleSheet changes. + virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr) = 0; + + // Get the installed StyleSheet. + virtual SfxStyleSheet* GetStyleSheet() const = 0; + + // Scale the local ItemSet as far as it contains metric items. This needs to be + // overloaded to do it for hierarchical objects like e.g. groups. + virtual void Scale(const Fraction& rScale); + + // Move local items to a new ItemPool. This needs to be + // overloaded to do it for hierarchical objects like e.g. groups. + virtual void MoveToItemPool(SfxItemPool* pSrcPool, SfxItemPool* pDestPool, SdrModel* pNewModel = 0L); + + // Set new model. + virtual void SetModel(SdrModel* pOldModel, SdrModel* pNewModel); + + // force all attributes which come from styles to hard attributes + // to be able to live without the style. + virtual void ForceStyleToHardAttributes(); + + // syntactical sugar for ItemSet accesses. Broadcasts before and after the changes + // to invalidate views in old and new BoundRects. As soon as the repaint mechanism + // will be changed these broadcasts will no longer be needed. + //void SetItemAndBroadcast(const SfxPoolItem& rItem); + //void ClearItemAndBroadcast(const sal_uInt16 nWhich = 0); + void SetMergedItemSetAndBroadcast(const SfxItemSet& rSet, sal_Bool bClearAllItems = sal_False); + + // Just a convenient shortcut for GetObjectItemSet().Get(nWhich). + const SfxPoolItem& GetItem(const sal_uInt16 nWhich) const; + + // support for convenient broadcasting. Used from SetMergedItemAndBroadcast(), + // ClearItemAndBroadcast() and SetItemSetAndBroadcast(), see above. + // But also from inside SdrObjects. + void BroadcastItemChange(const ItemChangeBroadcaster& rChange); + + // #i101556# add versioning mechanism; used from e.g. text attribute set to + // allow detection of e.g. style sheet or single text attribute changes. The + // default implementation returns 0 (zero) + virtual sal_uInt32 getVersion() const; + }; + + // checks the FillStyle item and removes unneeded Gradient, FillBitmap and Hatch items + void SVX_DLLPUBLIC CleanupFillProperties( SfxItemSet& rItemSet ); + + } // end of namespace properties +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_PROPERTIES_PROPERTIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/properties/rectangleproperties.hxx b/include/svx/sdr/properties/rectangleproperties.hxx new file mode 100644 index 000000000000..6314f1b136ca --- /dev/null +++ b/include/svx/sdr/properties/rectangleproperties.hxx @@ -0,0 +1,61 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_PROPERTIES_RECTANGLEPROPERTIES_HXX +#define _SDR_PROPERTIES_RECTANGLEPROPERTIES_HXX + +#include <svx/sdr/properties/textproperties.hxx> +#include "svx/svxdllapi.h" + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace properties + { + class SVX_DLLPUBLIC RectangleProperties : public TextProperties + { + protected: + // react on ItemSet changes + virtual void ItemSetChanged(const SfxItemSet& rSet); + + public: + // basic constructor + explicit RectangleProperties(SdrObject& rObj); + + // constructor for copying, but using new object + RectangleProperties(const RectangleProperties& rProps, SdrObject& rObj); + + // destructor + virtual ~RectangleProperties(); + + // Clone() operator, normally just calls the local copy constructor + virtual BaseProperties& Clone(SdrObject& rObj) const; + + // set a new StyleSheet and broadcast + virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr); + }; + } // end of namespace properties +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_PROPERTIES_RECTANGLEPROPERTIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/properties/textproperties.hxx b/include/svx/sdr/properties/textproperties.hxx new file mode 100644 index 000000000000..456b104e60ec --- /dev/null +++ b/include/svx/sdr/properties/textproperties.hxx @@ -0,0 +1,93 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_PROPERTIES_TEXTPROPERTIES_HXX +#define _SDR_PROPERTIES_TEXTPROPERTIES_HXX + +#include <svx/itextprovider.hxx> +#include <svx/sdr/properties/attributeproperties.hxx> +#include "svx/svxdllapi.h" + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace properties + { + class SVX_DLLPUBLIC TextProperties : public AttributeProperties + { + private: + // #i101556# versioning support + sal_uInt32 maVersion; + + protected: + // create a new itemset + virtual SfxItemSet& CreateObjectSpecificItemSet(SfxItemPool& rPool); + + // Do the ItemChange, may do special handling + virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = 0); + + // react on ItemSet changes + virtual void ItemSetChanged(const SfxItemSet& rSet); + + /// Get the TextProvider related to our SdrObject + virtual const svx::ITextProvider& getTextProvider() const; + + public: + // basic constructor + explicit TextProperties(SdrObject& rObj); + + // constructor for copying, but using new object + TextProperties(const TextProperties& rProps, SdrObject& rObj); + + // destructor + virtual ~TextProperties(); + + // Clone() operator, normally just calls the local copy constructor + virtual BaseProperties& Clone(SdrObject& rObj) const; + + // set a new StyleSheet and broadcast + virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr); + + // force default attributes for a specific object type, called from + // DefaultProperties::GetObjectItemSet() if a new ItemSet is created + virtual void ForceDefaultAttributes(); + + // force all attributes which come from styles to hard attributes + // to be able to live without the style. + virtual void ForceStyleToHardAttributes(); + + // This is the notifyer from SfxListener + virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint); + + // Set single item at the local ItemSet. *Does not use* AllowItemChange(), + // ItemChange(), PostItemChange() and ItemSetChanged() calls. + void SetObjectItemNoBroadcast(const SfxPoolItem& rItem); + + // #i101556# versioning support + virtual sal_uInt32 getVersion() const; + }; + } // end of namespace properties +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_PROPERTIES_TEXTPROPERTIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/table/tabledesign.hxx b/include/svx/sdr/table/tabledesign.hxx new file mode 100644 index 000000000000..8de846375f5b --- /dev/null +++ b/include/svx/sdr/table/tabledesign.hxx @@ -0,0 +1,48 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SDR_TABLE_DESIGN_HXX +#define _SDR_TABLE_DESIGN_HXX + +#include "svx/svxdllapi.h" + +#include <com/sun/star/container/XNameAccess.hpp> + +namespace sdr { namespace table { + +const sal_Int32 first_row_style = 0; +const sal_Int32 last_row_style = 1; +const sal_Int32 first_column_style = 2; +const sal_Int32 last_column_style = 3; +const sal_Int32 even_rows_style = 4; +const sal_Int32 odd_rows_style = 5; +const sal_Int32 even_columns_style = 6; +const sal_Int32 odd_columns_style = 7; +const sal_Int32 body_style = 8; +const sal_Int32 background_style = 9; +const sal_Int32 style_count = 10; + +extern SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > CreateTableDesignFamily(); + +} } + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |