diff options
Diffstat (limited to 'svx/inc/sdr')
84 files changed, 6530 insertions, 0 deletions
diff --git a/svx/inc/sdr/attribute/sdreffectstextattribute.hxx b/svx/inc/sdr/attribute/sdreffectstextattribute.hxx new file mode 100644 index 000000000..7a209c739 --- /dev/null +++ b/svx/inc/sdr/attribute/sdreffectstextattribute.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 . + */ + +#pragma once + +#include <drawinglayer/attribute/sdrshadowattribute.hxx> +#include <sdr/attribute/sdrtextattribute.hxx> +#include <drawinglayer/attribute/sdrglowattribute.hxx> + + +namespace drawinglayer +{ + namespace attribute + { + class SdrEffectsTextAttribute + { + // shadow and text attributes + SdrShadowAttribute maShadow; // shadow attributes (if used) + SdrTextAttribute maTextAttribute; // text and text attributes (if used) + + // glow effect + SdrGlowAttribute maGlow; + + // soft edge + sal_Int32 mnSoftEdgeRadius = 0; + + public: + SdrEffectsTextAttribute( + const SdrShadowAttribute& rShadow, + const SdrTextAttribute& rTextAttribute, + const SdrGlowAttribute& rGlow, + sal_Int32 nSoftEdgeRadius); + SdrEffectsTextAttribute(); + SdrEffectsTextAttribute(const SdrEffectsTextAttribute& rCandidate); + SdrEffectsTextAttribute& operator=(const SdrEffectsTextAttribute& rCandidate); + + // checks if the incarnation is default constructed + bool isDefault() const; + + // compare operator + bool operator==(const SdrEffectsTextAttribute& rCandidate) const; + + // data access + const SdrShadowAttribute& getShadow() const { return maShadow; } + const SdrTextAttribute& getText() const { return maTextAttribute; } + const SdrGlowAttribute& getGlow() const { return maGlow; } + sal_Int32 getSoftEdgeRadius() const { return mnSoftEdgeRadius; } + }; + } // end of namespace attribute +} // end of namespace drawinglayer + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/attribute/sdrfilltextattribute.hxx b/svx/inc/sdr/attribute/sdrfilltextattribute.hxx new file mode 100644 index 000000000..bef9d5430 --- /dev/null +++ b/svx/inc/sdr/attribute/sdrfilltextattribute.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 INCLUDED_SVX_INC_SDR_ATTRIBUTE_SDRFILLTEXTATTRIBUTE_HXX +#define INCLUDED_SVX_INC_SDR_ATTRIBUTE_SDRFILLTEXTATTRIBUTE_HXX + +#include <drawinglayer/attribute/sdrfillattribute.hxx> +#include <drawinglayer/attribute/fillgradientattribute.hxx> +#include <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 // INCLUDED_SVX_INC_SDR_ATTRIBUTE_SDRFILLTEXTATTRIBUTE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/attribute/sdrformtextattribute.hxx b/svx/inc/sdr/attribute/sdrformtextattribute.hxx new file mode 100644 index 000000000..06b0fd363 --- /dev/null +++ b/svx/inc/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 . + */ + +#pragma once + +#include <sal/types.h> +#include <svx/xenum.hxx> +#include <tools/color.hxx> +#include <o3tl/cow_wrapper.hxx> + +// predefines + +class SfxItemSet; + +namespace drawinglayer::attribute { + class ImpSdrFormTextAttribute; + class SdrFormTextOutlineAttribute; +} + + +namespace drawinglayer +{ + namespace attribute + { + class SdrFormTextAttribute + { + public: + typedef o3tl::cow_wrapper< ImpSdrFormTextAttribute > ImplType; + + private: + ImplType mpSdrFormTextAttribute; + + public: + /// constructors/assignmentoperator/destructor + SdrFormTextAttribute(const SfxItemSet& rSet); + SdrFormTextAttribute(); + SdrFormTextAttribute(const SdrFormTextAttribute& rCandidate); + SdrFormTextAttribute(SdrFormTextAttribute&& rCandidate) noexcept; + SdrFormTextAttribute& operator=(const SdrFormTextAttribute& rCandidate); + SdrFormTextAttribute& operator=(SdrFormTextAttribute&& rCandidate) noexcept; + ~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 const & getFormTextShdwColor() const; + const SdrFormTextOutlineAttribute& getOutline() const; + const SdrFormTextOutlineAttribute& getShadowOutline() const; + bool getFormTextMirror() const; + bool getFormTextOutline() const; + }; + } // end of namespace attribute +} // end of namespace drawinglayer + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/attribute/sdrformtextoutlineattribute.hxx b/svx/inc/sdr/attribute/sdrformtextoutlineattribute.hxx new file mode 100644 index 000000000..826475ed9 --- /dev/null +++ b/svx/inc/sdr/attribute/sdrformtextoutlineattribute.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_SVX_INC_SDR_ATTRIBUTE_SDRFORMTEXTOUTLINEATTRIBUTE_HXX +#define INCLUDED_SVX_INC_SDR_ATTRIBUTE_SDRFORMTEXTOUTLINEATTRIBUTE_HXX + +#include <sal/types.h> +#include <o3tl/cow_wrapper.hxx> + +// predefines + +namespace drawinglayer::attribute { + class ImpSdrFormTextOutlineAttribute; + class LineAttribute; + class StrokeAttribute; +} + + +namespace drawinglayer +{ + namespace attribute + { + class SdrFormTextOutlineAttribute + { + public: + typedef o3tl::cow_wrapper< ImpSdrFormTextOutlineAttribute > ImplType; + + private: + ImplType 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& operator=(SdrFormTextOutlineAttribute&& rCandidate) noexcept; + ~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 // INCLUDED_SVX_INC_SDR_ATTRIBUTE_SDRFORMTEXTOUTLINEATTRIBUTE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/attribute/sdrlineeffectstextattribute.hxx b/svx/inc/sdr/attribute/sdrlineeffectstextattribute.hxx new file mode 100644 index 000000000..c53650bfc --- /dev/null +++ b/svx/inc/sdr/attribute/sdrlineeffectstextattribute.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 . + */ + +#pragma once + +#include <sdr/attribute/sdreffectstextattribute.hxx> +#include <drawinglayer/attribute/sdrglowattribute.hxx> +#include <drawinglayer/attribute/sdrlineattribute.hxx> +#include <drawinglayer/attribute/sdrlinestartendattribute.hxx> + + +namespace drawinglayer +{ + namespace attribute + { + class SdrLineEffectsTextAttribute : public SdrEffectsTextAttribute + { + // line, shadow, lineStartEnd and text attributes + SdrLineAttribute maLine; // line attributes (if used) + SdrLineStartEndAttribute maLineStartEnd; // line start end (if used) + + public: + SdrLineEffectsTextAttribute( + const SdrLineAttribute& rLine, + const SdrLineStartEndAttribute& rLineStartEnd, + const SdrShadowAttribute& rShadow, + const SdrTextAttribute& rTextAttribute, + const SdrGlowAttribute& rGlow, + sal_Int32 nSoftEdgeRadius); + SdrLineEffectsTextAttribute(); + SdrLineEffectsTextAttribute(const SdrLineEffectsTextAttribute& rCandidate); + SdrLineEffectsTextAttribute& operator=(const SdrLineEffectsTextAttribute& rCandidate); + + // checks if the incarnation is default constructed + bool isDefault() const; + + // compare operator + bool operator==(const SdrLineEffectsTextAttribute& rCandidate) const; + + // data access + const SdrLineAttribute& getLine() const { return maLine; } + const SdrLineStartEndAttribute& getLineStartEnd() const { return maLineStartEnd; } + }; + } // end of namespace attribute +} // end of namespace drawinglayer + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/attribute/sdrlinefilleffectstextattribute.hxx b/svx/inc/sdr/attribute/sdrlinefilleffectstextattribute.hxx new file mode 100644 index 000000000..7fb25a4f5 --- /dev/null +++ b/svx/inc/sdr/attribute/sdrlinefilleffectstextattribute.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 . + */ + +#pragma once + +#include <sdr/attribute/sdrlineeffectstextattribute.hxx> +#include <drawinglayer/attribute/sdrfillattribute.hxx> +#include <drawinglayer/attribute/fillgradientattribute.hxx> + + +namespace drawinglayer +{ + namespace attribute + { + class SdrLineFillEffectsTextAttribute : public SdrLineEffectsTextAttribute + { + // add fill and transGradient attributes + SdrFillAttribute maFill; // fill attributes (if used) + FillGradientAttribute maFillFloatTransGradient; // fill float transparence gradient (if used) + + public: + SdrLineFillEffectsTextAttribute( + const SdrLineAttribute& rLine, + const SdrFillAttribute& rFill, + const SdrLineStartEndAttribute& rLineStartEnd, + const SdrShadowAttribute& rShadow, + const FillGradientAttribute& rFillFloatTransGradient, + const SdrTextAttribute& rTextAttribute, + const SdrGlowAttribute& rGlow, + sal_Int32 nSoftEdgeRadius); + SdrLineFillEffectsTextAttribute(); + SdrLineFillEffectsTextAttribute(const SdrLineFillEffectsTextAttribute& rCandidate); + SdrLineFillEffectsTextAttribute& operator=(const SdrLineFillEffectsTextAttribute& rCandidate); + + // checks if the incarnation is default constructed + bool isDefault() const; + + // compare operator + bool operator==(const SdrLineFillEffectsTextAttribute& rCandidate) const; + + // data access + const SdrFillAttribute& getFill() const { return maFill; } + const FillGradientAttribute& getFillFloatTransGradient() const { return maFillFloatTransGradient; } + }; + } // end of namespace attribute +} // end of namespace drawinglayer + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/attribute/sdrtextattribute.hxx b/svx/inc/sdr/attribute/sdrtextattribute.hxx new file mode 100644 index 000000000..5cb40ebb0 --- /dev/null +++ b/svx/inc/sdr/attribute/sdrtextattribute.hxx @@ -0,0 +1,118 @@ +/* -*- 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 . + */ + +#pragma once + +#include <sal/types.h> +#include <svx/xenum.hxx> +#include <editeng/outlobj.hxx> +#include <svx/sdtaitm.hxx> +#include <o3tl/cow_wrapper.hxx> + +// predefines + +class SdrText; +namespace drawinglayer::animation { class AnimationEntryList; } +namespace drawinglayer::attribute { class SdrFormTextAttribute; } +namespace drawinglayer::attribute { class ImpSdrTextAttribute; } + + +namespace drawinglayer +{ + namespace attribute + { + class SdrTextAttribute + { + public: + typedef o3tl::cow_wrapper< ImpSdrTextAttribute > ImplType; + + private: + ImplType 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, + bool bChainable); + + SdrTextAttribute(); + SdrTextAttribute(const SdrTextAttribute& rCandidate); + SdrTextAttribute(SdrTextAttribute&& rCandidate) noexcept; + SdrTextAttribute& operator=(const SdrTextAttribute& rCandidate); + SdrTextAttribute& operator=(SdrTextAttribute&& rCandidate) noexcept; + ~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; + + bool isChainable() 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 + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/contact/objectcontactofobjlistpainter.hxx b/svx/inc/sdr/contact/objectcontactofobjlistpainter.hxx new file mode 100644 index 000000000..724855d8b --- /dev/null +++ b/svx/inc/sdr/contact/objectcontactofobjlistpainter.hxx @@ -0,0 +1,113 @@ +/* -*- 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 . + */ + +#pragma once + +#include <config_options.h> +#include <svx/sdr/contact/objectcontact.hxx> +#include <svx/svxdllapi.h> +#include <svx/svdpage.hxx> +#include <tools/weakbase.hxx> + +class SdrPage; +class SdrObject; + +namespace sdr::contact { + +class UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) ObjectContactPainter : public ObjectContact +{ +protected: + // Hierarchy access methods + virtual sal_uInt32 GetPaintObjectCount() const = 0; + virtual ViewContact& GetPaintObjectViewContact(sal_uInt32 nIndex) = 0; + +public: + // basic constructor/destructor + ObjectContactPainter(); + virtual ~ObjectContactPainter() override; +}; + +// typedef for transferring SdrObject +typedef ::std::vector< SdrObject* > SdrObjectVector; + +class SVXCORE_DLLPUBLIC ObjectContactOfObjListPainter final : public ObjectContactPainter +{ + // 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 override; + virtual ViewContact& GetPaintObjectViewContact(sal_uInt32 nIndex) override; + +public: + // basic constructor/destructor + ObjectContactOfObjListPainter( + OutputDevice& rTargetDevice, + const SdrObjectVector& rObjects, + const SdrPage* pProcessedPage); + virtual ~ObjectContactOfObjListPainter() override; + + // Process the whole displaying + virtual void ProcessDisplay(DisplayInfo& rDisplayInfo) override; + + // recording MetaFile? Default is false + virtual bool isOutputToRecordingMetaFile() const override; + + // pdf export? Default is false + virtual bool isOutputToPDFFile() const override; + + virtual OutputDevice* TryToGetOutputDevice() const override; +}; + +class ObjectContactOfPagePainter : public ObjectContactPainter +{ + // the original ObjectContact this painter is working on + ObjectContact& mrOriginalObjectContact; + + // Set StartPoint for next run, also given in constructor + tools::WeakReference<SdrPage> mxStartPage; + +protected: + // Hierarchy access methods + virtual sal_uInt32 GetPaintObjectCount() const override; + virtual ViewContact& GetPaintObjectViewContact(sal_uInt32 nIndex) override; + +public: + // basic constructor + ObjectContactOfPagePainter(ObjectContact& rOriginalObjectContact); + virtual ~ObjectContactOfPagePainter() override; + + // set another page + void SetStartPage(const SdrPage* pPage); + const SdrPage* GetStartPage() const { return mxStartPage.get(); } + SdrPage* GetStartPage() { return mxStartPage.get(); } + + virtual OutputDevice* TryToGetOutputDevice() const override; +}; + +} + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/contact/viewcontactofe3d.hxx b/svx/inc/sdr/contact/viewcontactofe3d.hxx new file mode 100644 index 000000000..982d28752 --- /dev/null +++ b/svx/inc/sdr/contact/viewcontactofe3d.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 . + */ + +#pragma once + +#include <svx/obj3d.hxx> +#include <svx/sdr/contact/viewcontactofsdrobj.hxx> +#include <drawinglayer/primitive3d/baseprimitive3d.hxx> + +namespace drawinglayer::attribute { class SdrLineAttribute; } +namespace basegfx { + class BColor; + class B3DHomMatrix; +} + +namespace sdr::contact { + +class ViewContactOfE3dScene; + +class ViewContactOfE3d : public ViewContactOfSdrObj +{ +protected: + // Create an Object-Specific ViewObjectContact, set ViewContact and + // ObjectContact. Always needs to return something. + virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) override; + +public: + // basic constructor, used from E3dObject. + explicit ViewContactOfE3d(E3dObject& rObj); + virtual ~ViewContactOfE3d() override; + + // access to E3dObject + const E3dObject& GetE3dObject() const + { + return static_cast<const E3dObject&>(GetSdrObject()); + } + + // public helpers + drawinglayer::primitive2d::Primitive2DContainer impCreateWithGivenPrimitive3DContainer( + const drawinglayer::primitive3d::Primitive3DContainer& rxContent3D) const; + + + // primitive stuff + + // Primitive3DContainer 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::Primitive3DContainer mxViewIndependentPrimitive3DContainer; + +protected: + // This method is responsible for creating the graphical visualisation data which is + // stored in mxViewIndependentPrimitive3DContainer, but without object transformation + virtual drawinglayer::primitive3d::Primitive3DContainer createViewIndependentPrimitive3DContainer() 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::Primitive2DContainer createViewIndependentPrimitive2DSequence() const override; + +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::Primitive3DContainer const & 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::Primitive3DContainer getViewIndependentPrimitive3DContainer() const; +}; + +} + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/contact/viewcontactofe3dcube.hxx b/svx/inc/sdr/contact/viewcontactofe3dcube.hxx new file mode 100644 index 000000000..933bc8d14 --- /dev/null +++ b/svx/inc/sdr/contact/viewcontactofe3dcube.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 INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFE3DCUBE_HXX +#define INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFE3DCUBE_HXX + +#include <sdr/contact/viewcontactofe3d.hxx> +#include <svx/cube3d.hxx> + +namespace sdr +{ + namespace contact + { + class ViewContactOfE3dCube final : public ViewContactOfE3d + { + public: + // basic constructor, used from SdrObject. + ViewContactOfE3dCube(E3dCubeObj& rCubeObj); + virtual ~ViewContactOfE3dCube() override; + + // access to SdrObject + const E3dCubeObj& GetE3dCubeObj() const + { + return static_cast<const E3dCubeObj&>(GetE3dObject()); + } + + private: + // 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::Primitive3DContainer createViewIndependentPrimitive3DContainer() const override; + }; + } // end of namespace contact +} // end of namespace sdr + + +#endif // INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFE3DCUBE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/contact/viewcontactofe3dextrude.hxx b/svx/inc/sdr/contact/viewcontactofe3dextrude.hxx new file mode 100644 index 000000000..0d96fb989 --- /dev/null +++ b/svx/inc/sdr/contact/viewcontactofe3dextrude.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 INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFE3DEXTRUDE_HXX +#define INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFE3DEXTRUDE_HXX + +#include <sdr/contact/viewcontactofe3d.hxx> +#include <extrud3d.hxx> + + +namespace sdr +{ + namespace contact + { + class ViewContactOfE3dExtrude final : public ViewContactOfE3d + { + public: + // basic constructor, used from SdrObject. + explicit ViewContactOfE3dExtrude(E3dExtrudeObj& rExtrude); + virtual ~ViewContactOfE3dExtrude() override; + + // access to SdrObject + const E3dExtrudeObj& GetE3dExtrudeObj() const + { + return static_cast<const E3dExtrudeObj&>(GetE3dObject()); + } + + private: + // 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::Primitive3DContainer createViewIndependentPrimitive3DContainer() const override; + }; + } // end of namespace contact +} // end of namespace sdr + + +#endif // INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFE3DEXTRUDE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/contact/viewcontactofe3dlathe.hxx b/svx/inc/sdr/contact/viewcontactofe3dlathe.hxx new file mode 100644 index 000000000..00e42754f --- /dev/null +++ b/svx/inc/sdr/contact/viewcontactofe3dlathe.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 INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFE3DLATHE_HXX +#define INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFE3DLATHE_HXX + +#include <sdr/contact/viewcontactofe3d.hxx> +#include <svx/lathe3d.hxx> + + +namespace sdr +{ + namespace contact + { + class ViewContactOfE3dLathe final : public ViewContactOfE3d + { + public: + // basic constructor, used from SdrObject. + explicit ViewContactOfE3dLathe(E3dLatheObj& rLathe); + virtual ~ViewContactOfE3dLathe() override; + + // access to SdrObject + const E3dLatheObj& GetE3dLatheObj() const + { + return static_cast<const E3dLatheObj&>(GetE3dObject()); + } + + private: + // 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::Primitive3DContainer createViewIndependentPrimitive3DContainer() const override; + }; + } // end of namespace contact +} // end of namespace sdr + + +#endif // INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFE3DLATHE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/contact/viewcontactofe3dpolygon.hxx b/svx/inc/sdr/contact/viewcontactofe3dpolygon.hxx new file mode 100644 index 000000000..16116cc19 --- /dev/null +++ b/svx/inc/sdr/contact/viewcontactofe3dpolygon.hxx @@ -0,0 +1,53 @@ +/* -*- 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_INC_SDR_CONTACT_VIEWCONTACTOFE3DPOLYGON_HXX +#define INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFE3DPOLYGON_HXX + +#include <sdr/contact/viewcontactofe3d.hxx> +#include <polygn3d.hxx> + +namespace sdr +{ + namespace contact + { + class ViewContactOfE3dPolygon final : public ViewContactOfE3d + { + public: + // basic constructor, used from SdrObject. + explicit ViewContactOfE3dPolygon(E3dPolygonObj& rPolygon); + virtual ~ViewContactOfE3dPolygon() override; + + // access to SdrObject + const E3dPolygonObj& GetE3dPolygonObj() const + { + return static_cast<const E3dPolygonObj&>(GetE3dObject()); + } + + // 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::Primitive3DContainer createViewIndependentPrimitive3DContainer() const override; + }; + } // end of namespace contact +} // end of namespace sdr + + +#endif // INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFE3DPOLYGON_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/contact/viewcontactofe3dsphere.hxx b/svx/inc/sdr/contact/viewcontactofe3dsphere.hxx new file mode 100644 index 000000000..78d9a7ca7 --- /dev/null +++ b/svx/inc/sdr/contact/viewcontactofe3dsphere.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 INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFE3DSPHERE_HXX +#define INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFE3DSPHERE_HXX + +#include <sdr/contact/viewcontactofe3d.hxx> +#include <svx/sphere3d.hxx> + + +namespace sdr +{ + namespace contact + { + class ViewContactOfE3dSphere final : public ViewContactOfE3d + { + public: + // basic constructor, used from SdrObject. + explicit ViewContactOfE3dSphere(E3dSphereObj& rSphere); + virtual ~ViewContactOfE3dSphere() override; + + // access to SdrObject + const E3dSphereObj& GetE3dSphereObj() const + { + return static_cast<const E3dSphereObj&>(GetE3dObject()); + } + + private: + // 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::Primitive3DContainer createViewIndependentPrimitive3DContainer() const override; + }; + } // end of namespace contact +} // end of namespace sdr + + +#endif // INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFE3DSPHERE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/contact/viewcontactofgraphic.hxx b/svx/inc/sdr/contact/viewcontactofgraphic.hxx new file mode 100644 index 000000000..fa2138adb --- /dev/null +++ b/svx/inc/sdr/contact/viewcontactofgraphic.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 INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFGRAPHIC_HXX +#define INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFGRAPHIC_HXX + +#include <sdr/contact/viewcontactoftextobj.hxx> +#include <svx/svdograf.hxx> + +namespace drawinglayer::attribute { class SdrLineFillEffectsTextAttribute; } +class GraphicAttr; + +namespace sdr +{ + namespace contact + { + class ViewContactOfGraphic final : public ViewContactOfTextObj + { + private: + // helpers for constructing various primitive visualisations in various states + drawinglayer::primitive2d::Primitive2DContainer createVIP2DSForPresObj( + const basegfx::B2DHomMatrix& rObjectMatrix, + const drawinglayer::attribute::SdrLineFillEffectsTextAttribute& rAttribute) const; + drawinglayer::primitive2d::Primitive2DContainer createVIP2DSForDraft( + const basegfx::B2DHomMatrix& rObjectMatrix, + const drawinglayer::attribute::SdrLineFillEffectsTextAttribute& rAttribute) const; + + // Create an Object-Specific ViewObjectContact, set ViewContact and + // ObjectContact. Always needs to return something. + virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) override; + + public: + // access to SdrObject + const SdrGrafObj& GetGrafObject() const + { + return static_cast<const SdrGrafObj&>(GetSdrObject()); + } + SdrGrafObj& GetGrafObject() + { + return static_cast<SdrGrafObj&>(GetSdrObject()); + } + + // basic constructor, destructor + explicit ViewContactOfGraphic(SdrGrafObj& rGrafObj); + virtual ~ViewContactOfGraphic() override; + + // helpers for visualisation state + bool visualisationUsesPresObj() const; + bool visualisationUsesDraft() const; + + private: + // This method is responsible for creating the graphical visualisation data + // ONLY based on model data + virtual drawinglayer::primitive2d::Primitive2DContainer createViewIndependentPrimitive2DSequence() const override; + }; + } // end of namespace contact +} // end of namespace sdr + +#endif // INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFGRAPHIC_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/contact/viewcontactofgroup.hxx b/svx/inc/sdr/contact/viewcontactofgroup.hxx new file mode 100644 index 000000000..2e952d3bb --- /dev/null +++ b/svx/inc/sdr/contact/viewcontactofgroup.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 INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFGROUP_HXX +#define INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFGROUP_HXX + +#include <svx/sdr/contact/viewcontactofsdrobj.hxx> +#include <svx/svdogrp.hxx> + + +namespace sdr +{ + namespace contact + { + class ViewContactOfGroup final : public ViewContactOfSdrObj + { + public: + // basic constructor, used from SdrObject. + explicit ViewContactOfGroup(SdrObjGroup& rGroup); + virtual ~ViewContactOfGroup() override; + + private: + // Create an 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) override; + + // internal access to SdrObject + const SdrObjGroup& GetSdrObjGroup() const + { + return static_cast<const SdrObjGroup&>(GetSdrObject()); + } + + // This method is responsible for creating the graphical visualisation data + // ONLY based on model data + virtual drawinglayer::primitive2d::Primitive2DContainer createViewIndependentPrimitive2DSequence() const override; + }; + } // end of namespace contact +} // end of namespace sdr + + +#endif // INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFGROUP_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/contact/viewcontactofmasterpagedescriptor.hxx b/svx/inc/sdr/contact/viewcontactofmasterpagedescriptor.hxx new file mode 100644 index 000000000..5b3823508 --- /dev/null +++ b/svx/inc/sdr/contact/viewcontactofmasterpagedescriptor.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_SVX_INC_SDR_CONTACT_VIEWCONTACTOFMASTERPAGEDESCRIPTOR_HXX +#define INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFMASTERPAGEDESCRIPTOR_HXX + +#include <sal/types.h> +#include <svx/sdr/contact/viewcontact.hxx> +#include <svx/sdrmasterpagedescriptor.hxx> + +class SfxItemSet; +class Bitmap; +class MapMode; + +namespace sdr +{ + namespace contact + { + class ViewContactOfMasterPageDescriptor final : public ViewContact + { + // the owner of this ViewContact. Set from constructor and not + // to be changed in any way. + sdr::MasterPageDescriptor& mrMasterPageDescriptor; + + // Create an Object-Specific ViewObjectContact + virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) override; + + // This method is responsible for creating the graphical visualisation data + virtual drawinglayer::primitive2d::Primitive2DContainer createViewIndependentPrimitive2DSequence() const override; + + public: + // basic constructor + explicit ViewContactOfMasterPageDescriptor(sdr::MasterPageDescriptor& rDescriptor); + + // The destructor. + virtual ~ViewContactOfMasterPageDescriptor() override; + + // access to MasterPageDescriptor + sdr::MasterPageDescriptor& GetMasterPageDescriptor() const + { + return mrMasterPageDescriptor; + } + + // Access to possible sub-hierarchy and parent + virtual sal_uInt32 GetObjectCount() const override; + virtual ViewContact& GetViewContact(sal_uInt32 nIndex) const override; + virtual ViewContact* GetParentContact() const override; + }; + } // end of namespace contact +} // end of namespace sdr + +#endif // INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFMASTERPAGEDESCRIPTOR_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/contact/viewcontactofpageobj.hxx b/svx/inc/sdr/contact/viewcontactofpageobj.hxx new file mode 100644 index 000000000..e1cb66a8b --- /dev/null +++ b/svx/inc/sdr/contact/viewcontactofpageobj.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 . + */ + +#pragma once + +#include <svx/sdr/contact/viewcontactofsdrobj.hxx> +#include <svx/svxdllapi.h> +#include <svx/svdopage.hxx> + +class SdrPage; + +namespace sdr::contact { + +class ViewContactOfPageObj final : public ViewContactOfSdrObj +{ + // Create an Object-Specific ViewObjectContact, set ViewContact and + // ObjectContact. Always needs to return something. + virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) override; + + // create graphical visualisation data + virtual drawinglayer::primitive2d::Primitive2DContainer createViewIndependentPrimitive2DSequence() const override; +public: + // basic constructor, used from SdrObject. + explicit ViewContactOfPageObj(SdrPageObj& rPageObj); + virtual ~ViewContactOfPageObj() override; + + // #WIP# React on changes of the object of this ViewContact + virtual void ActionChanged() override; + + // access to SdrObject + const SdrPageObj& GetPageObj() const + { + return static_cast<const SdrPageObj&>(GetSdrObject()); + } +}; + +} + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/contact/viewcontactofsdrcaptionobj.hxx b/svx/inc/sdr/contact/viewcontactofsdrcaptionobj.hxx new file mode 100644 index 000000000..6e2f07b5a --- /dev/null +++ b/svx/inc/sdr/contact/viewcontactofsdrcaptionobj.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_SVX_INC_SDR_CONTACT_VIEWCONTACTOFSDRCAPTIONOBJ_HXX +#define INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFSDRCAPTIONOBJ_HXX + +#include <sdr/contact/viewcontactofsdrrectobj.hxx> +#include <svx/svdocapt.hxx> + + +namespace sdr +{ + namespace contact + { + class ViewContactOfSdrCaptionObj final : public ViewContactOfSdrRectObj + { + public: + // basic constructor, used from SdrObject. + explicit ViewContactOfSdrCaptionObj(SdrCaptionObj& rCaptionObj); + virtual ~ViewContactOfSdrCaptionObj() override; + + private: + // This method is responsible for creating the graphical visualisation data + // ONLY based on model data + virtual drawinglayer::primitive2d::Primitive2DContainer createViewIndependentPrimitive2DSequence() const override; + }; + } // end of namespace contact +} // end of namespace sdr + + +#endif // INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFSDRCAPTIONOBJ_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/contact/viewcontactofsdrcircobj.hxx b/svx/inc/sdr/contact/viewcontactofsdrcircobj.hxx new file mode 100644 index 000000000..64972ebee --- /dev/null +++ b/svx/inc/sdr/contact/viewcontactofsdrcircobj.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 INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFSDRCIRCOBJ_HXX +#define INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFSDRCIRCOBJ_HXX + +#include <sdr/contact/viewcontactofsdrrectobj.hxx> +#include <svx/svdocirc.hxx> + + +namespace sdr +{ + namespace contact + { + class ViewContactOfSdrCircObj final : public ViewContactOfSdrRectObj + { + public: + // basic constructor, used from SdrObject. + explicit ViewContactOfSdrCircObj(SdrCircObj& rCircObj); + virtual ~ViewContactOfSdrCircObj() override; + + private: + // internal access to SdrCircObj + const SdrCircObj& GetCircObj() const + { + return static_cast<const SdrCircObj&>(GetSdrObject()); + } + + // This method is responsible for creating the graphical visualisation data + // ONLY based on model data + virtual drawinglayer::primitive2d::Primitive2DContainer createViewIndependentPrimitive2DSequence() const override; + }; + } // end of namespace contact +} // end of namespace sdr + + +#endif // INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFSDRCIRCOBJ_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/contact/viewcontactofsdredgeobj.hxx b/svx/inc/sdr/contact/viewcontactofsdredgeobj.hxx new file mode 100644 index 000000000..fb22bf97d --- /dev/null +++ b/svx/inc/sdr/contact/viewcontactofsdredgeobj.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 INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFSDREDGEOBJ_HXX +#define INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFSDREDGEOBJ_HXX + +#include <sdr/contact/viewcontactoftextobj.hxx> +#include <svx/svdoedge.hxx> + + +namespace sdr +{ + namespace contact + { + class ViewContactOfSdrEdgeObj final : public ViewContactOfTextObj + { + public: + // basic constructor, used from SdrObject. + explicit ViewContactOfSdrEdgeObj(SdrEdgeObj& rEdgeObj); + virtual ~ViewContactOfSdrEdgeObj() override; + + private: + // internal access to SdrEdgeObj + const SdrEdgeObj& GetEdgeObj() const + { + return static_cast<const SdrEdgeObj&>(GetSdrObject()); + } + + // This method is responsible for creating the graphical visualisation data + // ONLY based on model data + virtual drawinglayer::primitive2d::Primitive2DContainer createViewIndependentPrimitive2DSequence() const override; + }; + } // end of namespace contact +} // end of namespace sdr + + +#endif // INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFSDREDGEOBJ_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/contact/viewcontactofsdrmeasureobj.hxx b/svx/inc/sdr/contact/viewcontactofsdrmeasureobj.hxx new file mode 100644 index 000000000..caeaa283c --- /dev/null +++ b/svx/inc/sdr/contact/viewcontactofsdrmeasureobj.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 INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFSDRMEASUREOBJ_HXX +#define INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFSDRMEASUREOBJ_HXX + +#include <sdr/contact/viewcontactoftextobj.hxx> +#include <svx/svdomeas.hxx> + + +namespace sdr +{ + namespace contact + { + class ViewContactOfSdrMeasureObj final : public ViewContactOfTextObj + { + public: + // basic constructor, used from SdrObject. + explicit ViewContactOfSdrMeasureObj(SdrMeasureObj& rMeasureObj); + virtual ~ViewContactOfSdrMeasureObj() override; + + private: + // internal access to SdrMeasureObj + const SdrMeasureObj& GetMeasureObj() const + { + return static_cast<const SdrMeasureObj&>(GetSdrObject()); + } + + // This method is responsible for creating the graphical visualisation data + // ONLY based on model data + virtual drawinglayer::primitive2d::Primitive2DContainer createViewIndependentPrimitive2DSequence() const override; + }; + } // end of namespace contact +} // end of namespace sdr + + +#endif // INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFSDRMEASUREOBJ_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/contact/viewcontactofsdrobjcustomshape.hxx b/svx/inc/sdr/contact/viewcontactofsdrobjcustomshape.hxx new file mode 100644 index 000000000..9834de646 --- /dev/null +++ b/svx/inc/sdr/contact/viewcontactofsdrobjcustomshape.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 INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFSDROBJCUSTOMSHAPE_HXX +#define INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFSDROBJCUSTOMSHAPE_HXX + +#include <sdr/contact/viewcontactoftextobj.hxx> +#include <svx/svdoashp.hxx> + + +namespace sdr +{ + namespace contact + { + class ViewContactOfSdrObjCustomShape final : public ViewContactOfTextObj + { + public: + // basic constructor, used from SdrObject. + explicit ViewContactOfSdrObjCustomShape(SdrObjCustomShape& rCustomShape); + virtual ~ViewContactOfSdrObjCustomShape() override; + + private: + // internal access to SdrObjCustomShape + const SdrObjCustomShape& GetCustomShapeObj() const + { + return static_cast<const SdrObjCustomShape&>(GetSdrObject()); + } + + // #i101684# internal tooling + basegfx::B2DRange getCorrectedTextBoundRect() const; + + // This method is responsible for creating the graphical visualisation data + // ONLY based on model data + virtual drawinglayer::primitive2d::Primitive2DContainer createViewIndependentPrimitive2DSequence() const override; + }; + } // end of namespace contact +} // end of namespace sdr + + +#endif // INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFSDROBJCUSTOMSHAPE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/contact/viewcontactofsdrole2obj.hxx b/svx/inc/sdr/contact/viewcontactofsdrole2obj.hxx new file mode 100644 index 000000000..7a79e3ee4 --- /dev/null +++ b/svx/inc/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 INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFSDROLE2OBJ_HXX +#define INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFSDROLE2OBJ_HXX + +#include <sdr/contact/viewcontactofsdrrectobj.hxx> +#include <svx/svdoole2.hxx> +#include <basegfx/matrix/b2dhommatrix.hxx> + +class Graphic; + +namespace sdr::contact { + +class ViewContactOfSdrOle2Obj final : public ViewContactOfSdrRectObj +{ +private: + // #i123539# allow local buffering of chart data (if chart) + drawinglayer::primitive2d::Primitive2DReference mxChartContent; + + // Create an Object-Specific ViewObjectContact, set ViewContact and + // ObjectContact. Always needs to return something. + virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) override; + +public: + // access to SdrOle2Obj + const SdrOle2Obj& GetOle2Obj() const + { + return static_cast<const SdrOle2Obj&>(GetSdrObject()); + } + + /// helper to create transformation from SdrObject + basegfx::B2DHomMatrix createObjectTransform() const; + + // basic constructor, used from SdrObject. + explicit ViewContactOfSdrOle2Obj(SdrOle2Obj& rOle2Obj); + virtual ~ViewContactOfSdrOle2Obj() override; + + // helper for creating an 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::Primitive2DContainer createPrimitive2DSequenceWithParameters() const; + + // #i123539# get rid of buffered chart content (if there) on change + virtual void ActionChanged() override; + + virtual basegfx::B2DRange getRange( const drawinglayer::geometry::ViewInformation2D& rViewInfo2D ) const override; + +private: + // This method is responsible for creating the graphical visualisation data + // ONLY based on model data, just wraps to call createPrimitive2DSequenceWithParameters(false) + virtual drawinglayer::primitive2d::Primitive2DContainer createViewIndependentPrimitive2DSequence() const override; +}; + +} + + +#endif // INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFSDROLE2OBJ_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/contact/viewcontactofsdrpage.hxx b/svx/inc/sdr/contact/viewcontactofsdrpage.hxx new file mode 100644 index 000000000..4168d1aa7 --- /dev/null +++ b/svx/inc/sdr/contact/viewcontactofsdrpage.hxx @@ -0,0 +1,205 @@ +/* -*- 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_INC_SDR_CONTACT_VIEWCONTACTOFSDRPAGE_HXX +#define INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFSDRPAGE_HXX + +#include <sal/types.h> +#include <svx/sdr/contact/viewcontact.hxx> + +class SdrPage; + +namespace sdr::contact { + +class ViewContactOfSdrPage; + +class ViewContactOfPageSubObject : public ViewContact +{ + ViewContactOfSdrPage& mrParentViewContactOfSdrPage; + +public: + explicit ViewContactOfPageSubObject(ViewContactOfSdrPage& rParentViewContactOfSdrPage); + virtual ~ViewContactOfPageSubObject() override; + + virtual ViewContact* GetParentContact() const override; + const SdrPage& getPage() const; +}; + +class ViewContactOfPageBackground final : public ViewContactOfPageSubObject +{ + virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) override; + virtual drawinglayer::primitive2d::Primitive2DContainer createViewIndependentPrimitive2DSequence() const override; + +public: + explicit ViewContactOfPageBackground(ViewContactOfSdrPage& rParentViewContactOfSdrPage); + virtual ~ViewContactOfPageBackground() override; +}; + +class ViewContactOfPageShadow final : public ViewContactOfPageSubObject +{ + virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) override; + virtual drawinglayer::primitive2d::Primitive2DContainer createViewIndependentPrimitive2DSequence() const override; + +public: + explicit ViewContactOfPageShadow(ViewContactOfSdrPage& rParentViewContactOfSdrPage); + virtual ~ViewContactOfPageShadow() override; +}; + +class ViewContactOfPageFill final : public ViewContactOfPageSubObject +{ + virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) override; + virtual drawinglayer::primitive2d::Primitive2DContainer createViewIndependentPrimitive2DSequence() const override; + +public: + explicit ViewContactOfPageFill(ViewContactOfSdrPage& rParentViewContactOfSdrPage); + virtual ~ViewContactOfPageFill() override; +}; + +class ViewContactOfMasterPage final : public ViewContactOfPageSubObject +{ + virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) override; + virtual drawinglayer::primitive2d::Primitive2DContainer createViewIndependentPrimitive2DSequence() const override; + +public: + explicit ViewContactOfMasterPage(ViewContactOfSdrPage& rParentViewContactOfSdrPage); + virtual ~ViewContactOfMasterPage() override; +}; + +class ViewContactOfOuterPageBorder final : public ViewContactOfPageSubObject +{ + virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) override; + virtual drawinglayer::primitive2d::Primitive2DContainer createViewIndependentPrimitive2DSequence() const override; + +public: + explicit ViewContactOfOuterPageBorder(ViewContactOfSdrPage& rParentViewContactOfSdrPage); + virtual ~ViewContactOfOuterPageBorder() override; +}; + +class ViewContactOfInnerPageBorder final : public ViewContactOfPageSubObject +{ + virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) override; + virtual drawinglayer::primitive2d::Primitive2DContainer createViewIndependentPrimitive2DSequence() const override; + +public: + explicit ViewContactOfInnerPageBorder(ViewContactOfSdrPage& rParentViewContactOfSdrPage); + virtual ~ViewContactOfInnerPageBorder() override; +}; + +/** + * This view contact corresponds with all SdrObject instances in a single + * SdrPage. Its GetObjectCount() returns the number of SdrObject instances + * in the SdrPage that it represents, and its GetViewContact() returns the + * view contact of the SdrObject instance associated with the identifier + * passed to the method. + */ +class ViewContactOfPageHierarchy final : public ViewContactOfPageSubObject +{ + virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) override; + virtual drawinglayer::primitive2d::Primitive2DContainer createViewIndependentPrimitive2DSequence() const override; + +public: + explicit ViewContactOfPageHierarchy(ViewContactOfSdrPage& rParentViewContactOfSdrPage); + virtual ~ViewContactOfPageHierarchy() override; + + virtual sal_uInt32 GetObjectCount() const override; + virtual ViewContact& GetViewContact(sal_uInt32 nIndex) const override; +}; + +class ViewContactOfGrid final : public ViewContactOfPageSubObject +{ + bool mbFront : 1; + + virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) override; + virtual drawinglayer::primitive2d::Primitive2DContainer createViewIndependentPrimitive2DSequence() const override; + +public: + ViewContactOfGrid(ViewContactOfSdrPage& rParentViewContactOfSdrPage, bool bFront); + virtual ~ViewContactOfGrid() override; + + bool getFront() const { return mbFront; } +}; + +class ViewContactOfHelplines final : public ViewContactOfPageSubObject +{ + bool mbFront : 1; + + virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) override; + virtual drawinglayer::primitive2d::Primitive2DContainer createViewIndependentPrimitive2DSequence() const override; + +public: + ViewContactOfHelplines(ViewContactOfSdrPage& rParentViewContactOfSdrPage, bool bFront); + virtual ~ViewContactOfHelplines() override; + + bool getFront() const { return mbFront; } +}; + +class ViewContactOfSdrPage : public ViewContact +{ + // 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; + +protected: + // Create an 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) override; + +public: + // access to SdrObject + SdrPage& GetSdrPage() const + { + return mrPage; + } + + // basic constructor, used from SdrPage. + explicit ViewContactOfSdrPage(SdrPage& rObj); + virtual ~ViewContactOfSdrPage() override; + + // Access to possible sub-hierarchy + virtual sal_uInt32 GetObjectCount() const override; + virtual ViewContact& GetViewContact(sal_uInt32 nIndex) const override; + + // React on changes of the object of this ViewContact + virtual void ActionChanged() override; + +protected: + // This method is responsible for creating the graphical visualisation data + // ONLY based on model data + virtual drawinglayer::primitive2d::Primitive2DContainer createViewIndependentPrimitive2DSequence() const override; +}; + +} + +#endif // INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFSDRPAGE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/contact/viewcontactofsdrpathobj.hxx b/svx/inc/sdr/contact/viewcontactofsdrpathobj.hxx new file mode 100644 index 000000000..f2055f74c --- /dev/null +++ b/svx/inc/sdr/contact/viewcontactofsdrpathobj.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 INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFSDRPATHOBJ_HXX +#define INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFSDRPATHOBJ_HXX + +#include <sdr/contact/viewcontactoftextobj.hxx> +#include <svx/svdopath.hxx> + + +namespace sdr +{ + namespace contact + { + class ViewContactOfSdrPathObj final : public ViewContactOfTextObj + { + public: + // basic constructor, used from SdrObject. + explicit ViewContactOfSdrPathObj(SdrPathObj& rTextObj); + virtual ~ViewContactOfSdrPathObj() override; + + private: + // internal access to SdrPathObj + const SdrPathObj& GetPathObj() const + { + return static_cast<const SdrPathObj&>(GetSdrObject()); + } + + // This method is responsible for creating the graphical visualisation data + // ONLY based on model data + virtual drawinglayer::primitive2d::Primitive2DContainer createViewIndependentPrimitive2DSequence() const override; + }; + } // end of namespace contact +} // end of namespace sdr + + +#endif // INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFSDRPATHOBJ_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/contact/viewcontactofsdrrectobj.hxx b/svx/inc/sdr/contact/viewcontactofsdrrectobj.hxx new file mode 100644 index 000000000..b1de079e3 --- /dev/null +++ b/svx/inc/sdr/contact/viewcontactofsdrrectobj.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 . + */ + +#pragma once + +#include <sdr/contact/viewcontactoftextobj.hxx> +#include <svx/svdorect.hxx> + +namespace sdr::contact { + +class ViewContactOfSdrRectObj : public ViewContactOfTextObj +{ +protected: + // internal access to SdrRectObj + const SdrRectObj& GetRectObj() const + { + return static_cast<const SdrRectObj&>(GetSdrObject()); + } + +public: + // basic constructor, used from SdrObject. + explicit ViewContactOfSdrRectObj(SdrRectObj& rTextObj); + virtual ~ViewContactOfSdrRectObj() override; + +protected: + // This method is responsible for creating the graphical visualisation data + // ONLY based on model data + virtual drawinglayer::primitive2d::Primitive2DContainer createViewIndependentPrimitive2DSequence() const override; +}; + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/contact/viewcontactoftextobj.hxx b/svx/inc/sdr/contact/viewcontactoftextobj.hxx new file mode 100644 index 000000000..132744d00 --- /dev/null +++ b/svx/inc/sdr/contact/viewcontactoftextobj.hxx @@ -0,0 +1,38 @@ +/* -*- 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 . + */ + +#pragma once + +#include <svx/sdr/contact/viewcontactofsdrobj.hxx> + +class SdrTextObj; + +namespace sdr::contact { + +class ViewContactOfTextObj : public ViewContactOfSdrObj +{ +public: + // basic constructor, used from SdrObject. + explicit ViewContactOfTextObj(SdrTextObj& rTextObj); + virtual ~ViewContactOfTextObj() override; +}; + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/contact/viewcontactofunocontrol.hxx b/svx/inc/sdr/contact/viewcontactofunocontrol.hxx new file mode 100644 index 000000000..824051543 --- /dev/null +++ b/svx/inc/sdr/contact/viewcontactofunocontrol.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_SVX_INC_SDR_CONTACT_VIEWCONTACTOFUNOCONTROL_HXX +#define INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFUNOCONTROL_HXX + +#include <com/sun/star/uno/Reference.hxx> +#include <svx/sdr/contact/viewcontactofsdrobj.hxx> +#include <svx/svdouno.hxx> + +class OutputDevice; +namespace vcl { class Window; } +namespace com::sun::star { + namespace awt { + class XControl; + class XControlContainer; + } +} + + +namespace sdr::contact { + + + //= ViewContactOfUnoControl + + class ViewContactOfUnoControl : public ViewContactOfSdrObj + { + public: + // access to SdrObject + const SdrUnoObj& GetSdrUnoObj() const + { + return static_cast<const SdrUnoObj&>(GetSdrObject()); + } + + explicit ViewContactOfUnoControl( SdrUnoObj& _rUnoObject ); + virtual ~ViewContactOfUnoControl() override; + + /** retrieves a temporary XControl instance, whose parent is the given window + @seealso SdrUnoObj::GetTemporaryControlForWindow + */ + css::uno::Reference< css::awt::XControl > + getTemporaryControlForWindow( const vcl::Window& _rWindow, css::uno::Reference< css::awt::XControlContainer >& _inout_ControlContainer ) const; + + protected: + virtual ViewObjectContact& CreateObjectSpecificViewObjectContact( ObjectContact& _rObjectContact ) override; + + private: + ViewContactOfUnoControl( const ViewContactOfUnoControl& ) = delete; + ViewContactOfUnoControl& operator=( const ViewContactOfUnoControl& ) = delete; + + protected: + // This method is responsible for creating the graphical visualisation data + // ONLY based on model data + virtual drawinglayer::primitive2d::Primitive2DContainer createViewIndependentPrimitive2DSequence() const override; + }; + + +} // namespace sdr::contact + + +#endif // INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFUNOCONTROL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/contact/viewobjectcontactofe3d.hxx b/svx/inc/sdr/contact/viewobjectcontactofe3d.hxx new file mode 100644 index 000000000..321bc4f8c --- /dev/null +++ b/svx/inc/sdr/contact/viewobjectcontactofe3d.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 INCLUDED_SVX_INC_SDR_CONTACT_VIEWOBJECTCONTACTOFE3D_HXX +#define INCLUDED_SVX_INC_SDR_CONTACT_VIEWOBJECTCONTACTOFE3D_HXX + +#include <svx/sdr/contact/viewobjectcontactofsdrobj.hxx> +#include <drawinglayer/primitive3d/baseprimitive3d.hxx> + +namespace sdr::contact { + class ViewObjectContactOfE3dScene; +} + +namespace sdr +{ + namespace contact + { + class ViewObjectContactOfE3d final : public ViewObjectContactOfSdrObj + { + // 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::Primitive3DContainer mxPrimitive3DContainer; + + // 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::getViewIndependentPrimitive3DContainer(), takes care of + // visibility and ghosted. + // This method will not handle included hierarchies and not check geometric visibility. + drawinglayer::primitive3d::Primitive3DContainer createPrimitive3DContainer(const DisplayInfo& rDisplayInfo) const; + + // also override the 2d method to deliver a 2d object with embedded 3d and the 3d transformation which is able to + // answer the get2DRange question accordingly + virtual drawinglayer::primitive2d::Primitive2DContainer createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const override; + + public: + ViewObjectContactOfE3d(ObjectContact& rObjectContact, ViewContact& rViewContact); + virtual ~ViewObjectContactOfE3d() override; + + // 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::Primitive3DContainer const & getPrimitive3DContainer(const DisplayInfo& rDisplayInfo) const; + }; + } // end of namespace contact +} // end of namespace sdr + +#endif // INCLUDED_SVX_INC_SDR_CONTACT_VIEWOBJECTCONTACTOFE3D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/contact/viewobjectcontactofe3dscene.hxx b/svx/inc/sdr/contact/viewobjectcontactofe3dscene.hxx new file mode 100644 index 000000000..2174462c6 --- /dev/null +++ b/svx/inc/sdr/contact/viewobjectcontactofe3dscene.hxx @@ -0,0 +1,50 @@ +/* -*- 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_INC_SDR_CONTACT_VIEWOBJECTCONTACTOFE3DSCENE_HXX +#define INCLUDED_SVX_INC_SDR_CONTACT_VIEWOBJECTCONTACTOFE3DSCENE_HXX + +#include <svx/sdr/contact/viewobjectcontactofsdrobj.hxx> + + +namespace sdr +{ + namespace contact + { + class ViewObjectContactOfE3dScene final : public ViewObjectContactOfSdrObj + { + // 2d primitive creator + virtual drawinglayer::primitive2d::Primitive2DContainer createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const override; + + public: + // basic constructor. + ViewObjectContactOfE3dScene(ObjectContact& rObjectContact, ViewContact& rViewContact); + virtual ~ViewObjectContactOfE3dScene() override; + + // 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::Primitive2DContainer getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo) const override; + }; + } // end of namespace contact +} // end of namespace sdr + + +#endif // INCLUDED_SVX_INC_SDR_CONTACT_VIEWOBJECTCONTACTOFE3DSCENE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/contact/viewobjectcontactofgraphic.hxx b/svx/inc/sdr/contact/viewobjectcontactofgraphic.hxx new file mode 100644 index 000000000..7b12c8332 --- /dev/null +++ b/svx/inc/sdr/contact/viewobjectcontactofgraphic.hxx @@ -0,0 +1,45 @@ +/* -*- 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_INC_SDR_CONTACT_VIEWOBJECTCONTACTOFGRAPHIC_HXX +#define INCLUDED_SVX_INC_SDR_CONTACT_VIEWOBJECTCONTACTOFGRAPHIC_HXX + +#include <svx/sdr/contact/viewobjectcontactofsdrobj.hxx> + +class SdrGrafObj; + +namespace sdr +{ + namespace contact + { + class ViewObjectContactOfGraphic final : public ViewObjectContactOfSdrObj + { + // This method is responsible for creating the graphical visualisation data + virtual drawinglayer::primitive2d::Primitive2DContainer createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const override; + + public: + ViewObjectContactOfGraphic(ObjectContact& rObjectContact, ViewContact& rViewContact); + virtual ~ViewObjectContactOfGraphic() override; + }; + } // end of namespace contact +} // end of namespace sdr + +#endif // INCLUDED_SVX_INC_SDR_CONTACT_VIEWOBJECTCONTACTOFGRAPHIC_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/contact/viewobjectcontactofgroup.hxx b/svx/inc/sdr/contact/viewobjectcontactofgroup.hxx new file mode 100644 index 000000000..3dc8873bc --- /dev/null +++ b/svx/inc/sdr/contact/viewobjectcontactofgroup.hxx @@ -0,0 +1,47 @@ +/* -*- 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_INC_SDR_CONTACT_VIEWOBJECTCONTACTOFGROUP_HXX +#define INCLUDED_SVX_INC_SDR_CONTACT_VIEWOBJECTCONTACTOFGROUP_HXX + +#include <svx/sdr/contact/viewobjectcontactofsdrobj.hxx> + +namespace sdr +{ + namespace contact + { + class ViewObjectContactOfGroup final : public ViewObjectContactOfSdrObj + { + public: + // basic constructor. + ViewObjectContactOfGroup(ObjectContact& rObjectContact, ViewContact& rViewContact); + virtual ~ViewObjectContactOfGroup() override; + + // This method recursively paints the draw hierarchy. + virtual drawinglayer::primitive2d::Primitive2DContainer getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo) const override; + + private: + virtual bool isPrimitiveVisibleOnAnyLayer(const SdrLayerIDSet& aLayers) const override; + }; + } // end of namespace contact +} // end of namespace sdr + +#endif // INCLUDED_SVX_INC_SDR_CONTACT_VIEWOBJECTCONTACTOFGROUP_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/contact/viewobjectcontactofmasterpagedescriptor.hxx b/svx/inc/sdr/contact/viewobjectcontactofmasterpagedescriptor.hxx new file mode 100644 index 000000000..8b30d772e --- /dev/null +++ b/svx/inc/sdr/contact/viewobjectcontactofmasterpagedescriptor.hxx @@ -0,0 +1,47 @@ +/* -*- 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_INC_SDR_CONTACT_VIEWOBJECTCONTACTOFMASTERPAGEDESCRIPTOR_HXX +#define INCLUDED_SVX_INC_SDR_CONTACT_VIEWOBJECTCONTACTOFMASTERPAGEDESCRIPTOR_HXX + +#include <svx/sdr/contact/viewobjectcontact.hxx> + +namespace sdr { + class MasterPageDescriptor; +} + +namespace sdr +{ + namespace contact + { + class ViewObjectContactOfMasterPageDescriptor final : public ViewObjectContact + { + public: + ViewObjectContactOfMasterPageDescriptor(ObjectContact& rObjectContact, ViewContact& rViewContact); + virtual ~ViewObjectContactOfMasterPageDescriptor() override; + + virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const override; + virtual drawinglayer::primitive2d::Primitive2DContainer getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo) const override; + }; + } // end of namespace contact +} // end of namespace sdr + +#endif // INCLUDED_SVX_INC_SDR_CONTACT_VIEWOBJECTCONTACTOFMASTERPAGEDESCRIPTOR_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/contact/viewobjectcontactofpageobj.hxx b/svx/inc/sdr/contact/viewobjectcontactofpageobj.hxx new file mode 100644 index 000000000..c0f67e83e --- /dev/null +++ b/svx/inc/sdr/contact/viewobjectcontactofpageobj.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 . + */ + +#pragma once + +#include <svx/sdr/contact/viewobjectcontactofsdrobj.hxx> +#include <memory> + +class SdrPage; + +namespace sdr::contact { + +class PagePrimitiveExtractor; + +class ViewObjectContactOfPageObj final : public ViewObjectContactOfSdrObj +{ +private: + // the page painter helper + std::unique_ptr<PagePrimitiveExtractor> mpExtractor; + + // 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::Primitive2DContainer createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const override; + +public: + ViewObjectContactOfPageObj(ObjectContact& rObjectContact, ViewContact& rViewContact); + virtual ~ViewObjectContactOfPageObj() override; +}; + +} + + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/contact/viewobjectcontactofsdrmediaobj.hxx b/svx/inc/sdr/contact/viewobjectcontactofsdrmediaobj.hxx new file mode 100644 index 000000000..6b0b4c476 --- /dev/null +++ b/svx/inc/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 INCLUDED_SVX_INC_SDR_CONTACT_VIEWOBJECTCONTACTOFSDRMEDIAOBJ_HXX +#define INCLUDED_SVX_INC_SDR_CONTACT_VIEWOBJECTCONTACTOFSDRMEDIAOBJ_HXX + +#include <svx/sdr/contact/viewobjectcontactofsdrobj.hxx> +#include <svx/sdr/contact/viewobjectcontact.hxx> +#include <tools/gen.hxx> +#include <memory> + +namespace avmedia { class MediaItem; } +namespace vcl { class Window; } + +namespace sdr +{ + namespace contact + { + class SdrMediaWindow; + + class ViewObjectContactOfSdrMediaObj final : public ViewObjectContactOfSdrObj + { + public: + + ViewObjectContactOfSdrMediaObj( ObjectContact& rObjectContact, + ViewContact& rViewContact, + const ::avmedia::MediaItem& rMediaItem ); + virtual ~ViewObjectContactOfSdrMediaObj() override; + + public: + + vcl::Window* getWindow() const; + + Size getPreferredSize() const; + + void updateMediaItem( ::avmedia::MediaItem& rItem ) const; + void executeMediaItem( const ::avmedia::MediaItem& rItem ); + + private: + + std::unique_ptr<sdr::contact::SdrMediaWindow> mpMediaWindow; + + }; + } // end of namespace contact +} // end of namespace sdr + + +#endif // INCLUDED_SVX_INC_SDR_CONTACT_VIEWOBJECTCONTACTOFSDRMEDIAOBJ_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/contact/viewobjectcontactofsdrole2obj.hxx b/svx/inc/sdr/contact/viewobjectcontactofsdrole2obj.hxx new file mode 100644 index 000000000..4d227a9c2 --- /dev/null +++ b/svx/inc/sdr/contact/viewobjectcontactofsdrole2obj.hxx @@ -0,0 +1,43 @@ +/* -*- 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_INC_SDR_CONTACT_VIEWOBJECTCONTACTOFSDROLE2OBJ_HXX +#define INCLUDED_SVX_INC_SDR_CONTACT_VIEWOBJECTCONTACTOFSDROLE2OBJ_HXX + +#include <svx/sdr/contact/viewobjectcontactofsdrobj.hxx> + +class SdrOle2Obj; + +namespace sdr::contact { + +class ViewObjectContactOfSdrOle2Obj final : public ViewObjectContactOfSdrObj +{ + // This method is responsible for creating the graphical visualisation data + virtual drawinglayer::primitive2d::Primitive2DContainer createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const override; + +public: + ViewObjectContactOfSdrOle2Obj(ObjectContact& rObjectContact, ViewContact& rViewContact); + virtual ~ViewObjectContactOfSdrOle2Obj() override; +}; + +} + +#endif // INCLUDED_SVX_INC_SDR_CONTACT_VIEWOBJECTCONTACTOFSDROLE2OBJ_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/contact/viewobjectcontactofsdrpage.hxx b/svx/inc/sdr/contact/viewobjectcontactofsdrpage.hxx new file mode 100644 index 000000000..758b0bfb0 --- /dev/null +++ b/svx/inc/sdr/contact/viewobjectcontactofsdrpage.hxx @@ -0,0 +1,207 @@ +/* -*- 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_INC_SDR_CONTACT_VIEWOBJECTCONTACTOFSDRPAGE_HXX +#define INCLUDED_SVX_INC_SDR_CONTACT_VIEWOBJECTCONTACTOFSDRPAGE_HXX + +#include <svx/sdr/contact/viewobjectcontact.hxx> + +class SdrPage; + +namespace sdr +{ + namespace contact + { + class ViewObjectContactOfPageSubObject : public ViewObjectContact + { + protected: + const SdrPage& getPage() const; + + public: + ViewObjectContactOfPageSubObject(ObjectContact& rObjectContact, ViewContact& rViewContact); + virtual ~ViewObjectContactOfPageSubObject() override; + + virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const override; + virtual bool isPrimitiveGhosted(const DisplayInfo& rDisplayInfo) const override; + }; + } // end of namespace contact +} // end of namespace sdr + +namespace sdr +{ + namespace contact + { + class ViewObjectContactOfPageBackground final : public ViewObjectContactOfPageSubObject + { + virtual drawinglayer::primitive2d::Primitive2DContainer createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const override; + + public: + ViewObjectContactOfPageBackground(ObjectContact& rObjectContact, ViewContact& rViewContact); + virtual ~ViewObjectContactOfPageBackground() override; + + virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const override; + }; + } // end of namespace contact +} // end of namespace sdr + +namespace sdr +{ + namespace contact + { + class ViewObjectContactOfMasterPage final : public ViewObjectContactOfPageSubObject + { + protected: + public: + ViewObjectContactOfMasterPage(ObjectContact& rObjectContact, ViewContact& rViewContact); + virtual ~ViewObjectContactOfMasterPage() override; + + virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const override; + }; + } // end of namespace contact +} // end of namespace sdr + +namespace sdr +{ + namespace contact + { + class ViewObjectContactOfPageFill final : public ViewObjectContactOfPageSubObject + { + virtual drawinglayer::primitive2d::Primitive2DContainer createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const override; + + public: + ViewObjectContactOfPageFill(ObjectContact& rObjectContact, ViewContact& rViewContact); + virtual ~ViewObjectContactOfPageFill() override; + + virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const override; + }; + } // end of namespace contact +} // end of namespace sdr + +namespace sdr +{ + namespace contact + { + class ViewObjectContactOfPageShadow final : public ViewObjectContactOfPageSubObject + { + public: + ViewObjectContactOfPageShadow(ObjectContact& rObjectContact, ViewContact& rViewContact); + virtual ~ViewObjectContactOfPageShadow() override; + + virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const override; + }; + } // end of namespace contact +} // end of namespace sdr + +namespace sdr +{ + namespace contact + { + class ViewObjectContactOfOuterPageBorder final : public ViewObjectContactOfPageSubObject + { + public: + ViewObjectContactOfOuterPageBorder(ObjectContact& rObjectContact, ViewContact& rViewContact); + virtual ~ViewObjectContactOfOuterPageBorder() override; + + virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const override; + }; + } // end of namespace contact +} // end of namespace sdr + +namespace sdr +{ + namespace contact + { + class ViewObjectContactOfInnerPageBorder final : public ViewObjectContactOfPageSubObject + { + public: + ViewObjectContactOfInnerPageBorder(ObjectContact& rObjectContact, ViewContact& rViewContact); + virtual ~ViewObjectContactOfInnerPageBorder() override; + + virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const override; + }; + } // end of namespace contact +} // end of namespace sdr + +namespace sdr +{ + namespace contact + { + class ViewObjectContactOfPageHierarchy final : public ViewObjectContactOfPageSubObject + { + public: + ViewObjectContactOfPageHierarchy(ObjectContact& rObjectContact, ViewContact& rViewContact); + virtual ~ViewObjectContactOfPageHierarchy() override; + + virtual drawinglayer::primitive2d::Primitive2DContainer getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo) const override; + }; + } // end of namespace contact +} // end of namespace sdr + +namespace sdr +{ + namespace contact + { + class ViewObjectContactOfPageGrid final : public ViewObjectContactOfPageSubObject + { + virtual drawinglayer::primitive2d::Primitive2DContainer createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const override; + + public: + ViewObjectContactOfPageGrid(ObjectContact& rObjectContact, ViewContact& rViewContact); + virtual ~ViewObjectContactOfPageGrid() override; + + virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const override; + }; + } // end of namespace contact +} // end of namespace sdr + +namespace sdr +{ + namespace contact + { + class ViewObjectContactOfPageHelplines final : public ViewObjectContactOfPageSubObject + { + virtual drawinglayer::primitive2d::Primitive2DContainer createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const override; + + public: + ViewObjectContactOfPageHelplines(ObjectContact& rObjectContact, ViewContact& rViewContact); + virtual ~ViewObjectContactOfPageHelplines() override; + + virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const override; + }; + } // end of namespace contact +} // end of namespace sdr + +namespace sdr +{ + namespace contact + { + class ViewObjectContactOfSdrPage final : public ViewObjectContact + { + public: + ViewObjectContactOfSdrPage(ObjectContact& rObjectContact, ViewContact& rViewContact); + virtual ~ViewObjectContactOfSdrPage() override; + + virtual drawinglayer::primitive2d::Primitive2DContainer getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo) const override; + }; + } // end of namespace contact +} // end of namespace sdr + +#endif // INCLUDED_SVX_INC_SDR_CONTACT_VIEWOBJECTCONTACTOFSDRPAGE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/contact/viewobjectcontactofunocontrol.hxx b/svx/inc/sdr/contact/viewobjectcontactofunocontrol.hxx new file mode 100644 index 000000000..2c708ec73 --- /dev/null +++ b/svx/inc/sdr/contact/viewobjectcontactofunocontrol.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_SVX_INC_SDR_CONTACT_VIEWOBJECTCONTACTOFUNOCONTROL_HXX +#define INCLUDED_SVX_INC_SDR_CONTACT_VIEWOBJECTCONTACTOFUNOCONTROL_HXX + +#include <svx/sdr/contact/viewobjectcontactofsdrobj.hxx> + +#include <com/sun/star/uno/Reference.hxx> +#include <rtl/ref.hxx> + +class OutputDevice; +namespace vcl { class Window; } +class SdrUnoObj; +namespace com::sun::star { + namespace awt { + class XControl; + class XControlContainer; + } +} + + +namespace sdr::contact { + + + class ViewContactOfUnoControl; + class ObjectContactOfPageView; + + //= ViewObjectContactOfUnoControl + + class ViewObjectContactOfUnoControl_Impl; + class 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 + css::uno::Reference< css::awt::XControl > + getControl(); + + /** retrieves a temporary XControl instance, whose parent is the given device + @seealso SdrUnoObj::GetTemporaryControlForWindow + */ + static css::uno::Reference< css::awt::XControl > + getTemporaryControlForWindow( + const vcl::Window& _rWindow, + css::uno::Reference< css::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() override; + + /** 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: + virtual ~ViewObjectContactOfUnoControl() override; + + // support for Primitive2D + virtual drawinglayer::primitive2d::Primitive2DContainer createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const override; + + // visibility check + virtual bool isPrimitiveVisible( const DisplayInfo& _rDisplayInfo ) const override; + /// to be called when any aspect of the control which requires view updates changed + void impl_onControlChangedOrModified(); + + private: + ViewObjectContactOfUnoControl( const ViewObjectContactOfUnoControl& ) = delete; + ViewObjectContactOfUnoControl& operator=( const ViewObjectContactOfUnoControl& ) = delete; + }; + + class UnoControlPrintOrPreviewContact final : public ViewObjectContactOfUnoControl + { + public: + UnoControlPrintOrPreviewContact( ObjectContactOfPageView& _rObjectContact, ViewContactOfUnoControl& _rViewContact ); + virtual ~UnoControlPrintOrPreviewContact() override; + + private: + UnoControlPrintOrPreviewContact( const UnoControlPrintOrPreviewContact& ) = delete; + UnoControlPrintOrPreviewContact& operator=( const UnoControlPrintOrPreviewContact& ) = delete; + + virtual drawinglayer::primitive2d::Primitive2DContainer createPrimitive2DSequence(const DisplayInfo& rDisplayInfo ) const override; + }; + + +} // namespace sdr::contact + + +#endif // INCLUDED_SVX_INC_SDR_CONTACT_VIEWOBJECTCONTACTOFUNOCONTROL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/overlay/overlaycrosshair.hxx b/svx/inc/sdr/overlay/overlaycrosshair.hxx new file mode 100644 index 000000000..e297f4a4f --- /dev/null +++ b/svx/inc/sdr/overlay/overlaycrosshair.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 INCLUDED_SVX_INC_SDR_OVERLAY_OVERLAYCROSSHAIR_HXX +#define INCLUDED_SVX_INC_SDR_OVERLAY_OVERLAYCROSSHAIR_HXX + +#include <svx/sdr/overlay/overlayobject.hxx> + + +namespace sdr +{ + namespace overlay + { + class OverlayCrosshairStriped final : public OverlayObjectWithBasePosition + { + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DContainer createOverlayObjectPrimitive2DSequence() override; + + public: + explicit OverlayCrosshairStriped(const basegfx::B2DPoint& rBasePos); + virtual ~OverlayCrosshairStriped() override; + + // react on stripe definition change + virtual void stripeDefinitionHasChanged() override; + }; + } // end of namespace overlay +} // end of namespace sdr + + +#endif // INCLUDED_SVX_INC_SDR_OVERLAY_OVERLAYCROSSHAIR_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/overlay/overlayhandle.hxx b/svx/inc/sdr/overlay/overlayhandle.hxx new file mode 100644 index 000000000..882fb702c --- /dev/null +++ b/svx/inc/sdr/overlay/overlayhandle.hxx @@ -0,0 +1,41 @@ +/* -*- 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/. + * + */ + +#ifndef INCLUDED_SVX_SDR_OVERLAY_OVERLAYHANDLE_HXX +#define INCLUDED_SVX_SDR_OVERLAY_OVERLAYHANDLE_HXX + +#include <svx/sdr/overlay/overlayobject.hxx> +#include <basegfx/vector/b2dsize.hxx> + +namespace sdr::overlay { + + +class OverlayHandle final : public OverlayObjectWithBasePosition +{ + basegfx::B2DSize maSize; + Color maStrokeColor; + + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DContainer createOverlayObjectPrimitive2DSequence() override; + +public: + OverlayHandle(const basegfx::B2DPoint& rBasePos, + const basegfx::B2DSize& rSize, + Color const & rStrokeColor, + Color const & rFillColor); + + virtual ~OverlayHandle() override; +}; + +} // end of namespace sdr::overlay + +#endif // INCLUDED_SVX_SDR_OVERLAY_OVERLAYHANDLE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/overlay/overlayhelpline.hxx b/svx/inc/sdr/overlay/overlayhelpline.hxx new file mode 100644 index 000000000..84077f103 --- /dev/null +++ b/svx/inc/sdr/overlay/overlayhelpline.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 INCLUDED_SVX_INC_SDR_OVERLAY_OVERLAYHELPLINE_HXX +#define INCLUDED_SVX_INC_SDR_OVERLAY_OVERLAYHELPLINE_HXX + +#include <svx/sdr/overlay/overlayobject.hxx> +#include <svx/svdhlpln.hxx> + + +namespace sdr +{ + namespace overlay + { + class OverlayHelplineStriped final : public OverlayObjectWithBasePosition + { + // remember HelpLineKind + SdrHelpLineKind meKind; + + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DContainer createOverlayObjectPrimitive2DSequence() override; + + public: + explicit OverlayHelplineStriped( + const basegfx::B2DPoint& rBasePos, + SdrHelpLineKind eNewKind); + virtual ~OverlayHelplineStriped() override; + + // dat read access + SdrHelpLineKind getKind() const { return meKind; } + + // react on stripe definition change + virtual void stripeDefinitionHasChanged() override; + }; + } // end of namespace overlay +} // end of namespace sdr + + +#endif // INCLUDED_SVX_INC_SDR_OVERLAY_OVERLAYHELPLINE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/overlay/overlayline.hxx b/svx/inc/sdr/overlay/overlayline.hxx new file mode 100644 index 000000000..33ec22c0e --- /dev/null +++ b/svx/inc/sdr/overlay/overlayline.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_INC_SDR_OVERLAY_OVERLAYLINE_HXX +#define INCLUDED_SVX_INC_SDR_OVERLAY_OVERLAYLINE_HXX + +#include <svx/sdr/overlay/overlayobject.hxx> + + +namespace sdr +{ + namespace overlay + { + class OverlayLineStriped final : public OverlayObjectWithBasePosition + { + // second position in pixel + basegfx::B2DPoint maSecondPosition; + + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DContainer createOverlayObjectPrimitive2DSequence() override; + + public: + OverlayLineStriped( + const basegfx::B2DPoint& rBasePos, + const basegfx::B2DPoint& rSecondPos); + virtual ~OverlayLineStriped() override; + + // change second position + const basegfx::B2DPoint& getSecondPosition() const { return maSecondPosition; } + + // react on stripe definition change + virtual void stripeDefinitionHasChanged() override; + }; + } // end of namespace overlay +} // end of namespace sdr + + +#endif // INCLUDED_SVX_INC_SDR_OVERLAY_OVERLAYLINE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/overlay/overlaymanagerbuffered.hxx b/svx/inc/sdr/overlay/overlaymanagerbuffered.hxx new file mode 100644 index 000000000..1970131c7 --- /dev/null +++ b/svx/inc/sdr/overlay/overlaymanagerbuffered.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_SVX_INC_SDR_OVERLAY_OVERLAYMANAGERBUFFERED_HXX +#define INCLUDED_SVX_INC_SDR_OVERLAY_OVERLAYMANAGERBUFFERED_HXX + +#include <svx/sdr/overlay/overlaymanager.hxx> +#include <basegfx/range/b2irange.hxx> +#include <vcl/virdev.hxx> +#include <vcl/idle.hxx> + + +namespace sdr +{ + namespace overlay + { + class OverlayManagerBuffered final : public OverlayManager + { + // The VirtualDevice for draw window content buffering, this + // is the view content without overlay + ScopedVclPtr<VirtualDevice> mpBufferDevice; + + // #i73602# The VirtualDevice for OverlayPaint buffering. This + // is an extra device to avoid flickering of overlay paints + ScopedVclPtr<VirtualDevice> mpOutputBufferDevice; + + // Idle for buffering + Idle maBufferIdle; + + // Range for buffering (in pixel to be independent from mapMode) + basegfx::B2IRange maBufferRememberedRangePixel; + + // link for timer + DECL_LINK(ImpBufferTimerHandler, Timer*, void); + + // Internal methods for buffering + void ImpPrepareBufferDevice(); + void ImpRestoreBackground() const ; + void ImpRestoreBackground(const vcl::Region& rRegionPixel) const; + void ImpSaveBackground(const vcl::Region& rRegion, OutputDevice* pPreRenderDevice); + + OverlayManagerBuffered(OutputDevice& rOutputDevice); + virtual ~OverlayManagerBuffered() override; + + public: + static rtl::Reference<OverlayManager> create(OutputDevice& rOutputDevice); + + // complete redraw + virtual void completeRedraw(const vcl::Region& rRegion, OutputDevice* pPreRenderDevice = nullptr) const override; + + // flush. Do buffered updates. + virtual void flush() override; + + // invalidate the given range at local OutputDevice + virtual void invalidateRange(const basegfx::B2DRange& rRange) override; + }; + } // end of namespace overlay +} // end of namespace sdr + + +#endif // INCLUDED_SVX_INC_SDR_OVERLAY_OVERLAYMANAGERBUFFERED_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/overlay/overlayobjectcell.hxx b/svx/inc/sdr/overlay/overlayobjectcell.hxx new file mode 100644 index 000000000..63669ba06 --- /dev/null +++ b/svx/inc/sdr/overlay/overlayobjectcell.hxx @@ -0,0 +1,53 @@ +/* -*- 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 . + */ + +#pragma once + +#include <svx/sdr/overlay/overlayobject.hxx> + +#include <vector> + + +namespace sdr +{ + namespace overlay + { + // OverlayObjectCell - used for cell cursor, selection and AutoFill handle + + class OverlayObjectCell final : public OverlayObject + { + public: + typedef ::std::vector< basegfx::B2DRange > RangeVector; + + private: + RangeVector maRectangles; + + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DContainer createOverlayObjectPrimitive2DSequence() override; + + public: + OverlayObjectCell( const Color& rColor, const RangeVector& rRects); + virtual ~OverlayObjectCell() override; + }; + + } // end of namespace overlay +} // end of namespace sdr + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/overlay/overlayrectangle.hxx b/svx/inc/sdr/overlay/overlayrectangle.hxx new file mode 100644 index 000000000..7f4dfd895 --- /dev/null +++ b/svx/inc/sdr/overlay/overlayrectangle.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_SVX_INC_SDR_OVERLAY_OVERLAYRECTANGLE_HXX +#define INCLUDED_SVX_INC_SDR_OVERLAY_OVERLAYRECTANGLE_HXX + +#include <svx/sdr/overlay/overlayobject.hxx> + +namespace tools { class PolyPolygon; } + +namespace sdr +{ + namespace overlay + { + class OverlayRectangle final : public OverlayObjectWithBasePosition + { + // geometric definitions + basegfx::B2DPoint maSecondPosition; + const double mfTransparence; + const double mfDiscreteGrow; + const double mfDiscreteShrink; + const double mfRotation; + + // #i53216# added CursorBlinkTime (in ms) + sal_uInt32 mnBlinkTime; + + // Flag to remember which state to draw. Inited with false (0) + bool mbOverlayState : 1; + + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DContainer createOverlayObjectPrimitive2DSequence() override; + + public: + OverlayRectangle( + const basegfx::B2DPoint& rBasePosition, + const basegfx::B2DPoint& rSecondPosition, + const Color& rHatchColor, + double fTransparence, + double fDiscreteGrow, + double fDiscreteShrink, + double fRotation, + bool bAnimate); + + // 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) override; + }; + } // end of namespace overlay +} // end of namespace sdr + +#endif // INCLUDED_SVX_INC_SDR_OVERLAY_OVERLAYRECTANGLE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/overlay/overlayrollingrectangle.hxx b/svx/inc/sdr/overlay/overlayrollingrectangle.hxx new file mode 100644 index 000000000..7a18f1cb4 --- /dev/null +++ b/svx/inc/sdr/overlay/overlayrollingrectangle.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 INCLUDED_SVX_INC_SDR_OVERLAY_OVERLAYROLLINGRECTANGLE_HXX +#define INCLUDED_SVX_INC_SDR_OVERLAY_OVERLAYROLLINGRECTANGLE_HXX + +#include <svx/sdr/overlay/overlayobject.hxx> + + +namespace sdr +{ + namespace overlay + { + class OverlayRollingRectangleStriped final : public OverlayObjectWithBasePosition + { + // second position in pixel + basegfx::B2DPoint maSecondPosition; + + // Flag to switch on/off long lines to the OutputDevice bounds + bool mbExtendedLines : 1; + + // Flag to switch on/off the bounds itself + bool mbShowBounds : 1; + + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DContainer createOverlayObjectPrimitive2DSequence() override; + + public: + OverlayRollingRectangleStriped( + const basegfx::B2DPoint& rBasePos, + const basegfx::B2DPoint& rSecondPos, + bool bExtendedLines, + bool bShowBounds = true); + virtual ~OverlayRollingRectangleStriped() override; + + // change second position + const basegfx::B2DPoint& getSecondPosition() const { return maSecondPosition; } + void setSecondPosition(const basegfx::B2DPoint& rNew); + + // react on stripe definition change + virtual void stripeDefinitionHasChanged() override; + }; + } // end of namespace overlay +} // end of namespace sdr + + +#endif // INCLUDED_SVX_INC_SDR_OVERLAY_OVERLAYROLLINGRECTANGLE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/overlay/overlaytools.hxx b/svx/inc/sdr/overlay/overlaytools.hxx new file mode 100644 index 000000000..c5df8fe09 --- /dev/null +++ b/svx/inc/sdr/overlay/overlaytools.hxx @@ -0,0 +1,304 @@ +/* -*- 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_INC_SDR_OVERLAY_OVERLAYTOOLS_HXX +#define INCLUDED_SVX_INC_SDR_OVERLAY_OVERLAYTOOLS_HXX + +#include <drawinglayer/primitive2d/primitivetools2d.hxx> +#include <vcl/bitmapex.hxx> +#include <basegfx/vector/b2dsize.hxx> + +namespace drawinglayer::primitive2d { + +class OverlayStaticRectanglePrimitive final : public DiscreteMetricDependentPrimitive2D +{ +private: + basegfx::B2DPoint maPosition; + basegfx::B2DSize maSize; + + // the graphic definition + basegfx::BColor maStrokeColor; + basegfx::BColor maFillColor; + double mfTransparence; + + // the rotation of the primitive itself + double mfRotation; + + virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override; + +public: + OverlayStaticRectanglePrimitive( + const basegfx::B2DPoint& rPosition, + const basegfx::B2DSize& rSize, + const basegfx::BColor& rStrokeColor, + const basegfx::BColor& rFillColor, + double fTransparence, + double fRotation); + + // compare operator + virtual bool operator==( const BasePrimitive2D& rPrimitive ) const override; + + virtual sal_uInt32 getPrimitive2DID() const override; +}; + +} // end of namespace drawinglayer::primitive2d + +// 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 final : 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; + + // evtl. rotation and shear around center + double mfShearX; + double mfRotation; + + virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override; + + public: + OverlayBitmapExPrimitive( + const BitmapEx& rBitmapEx, + const basegfx::B2DPoint& rBasePosition, + sal_uInt16 nCenterX, + sal_uInt16 nCenterY, + double fShearX, + double fRotation); + + // 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; } + double getShearX() const { return mfShearX; } + double getRotation() const { return mfRotation; } + + // compare operator + virtual bool operator==( const BasePrimitive2D& rPrimitive ) const override; + + virtual sal_uInt32 getPrimitive2DID() const override; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + + +// Overlay helper class for a crosshair +namespace drawinglayer +{ + namespace primitive2d + { + class OverlayCrosshairPrimitive final : public ViewportDependentPrimitive2D + { + private: + // The logic position + basegfx::B2DPoint maBasePosition; + + // The stripe colors and length + basegfx::BColor maRGBColorA; + basegfx::BColor maRGBColorB; + double mfDiscreteDashLength; + + virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override; + + 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 override; + + virtual sal_uInt32 getPrimitive2DID() const override; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + + +// Overlay helper class for a hatch rectangle as used e.g. for text object +// selection highlighting +namespace drawinglayer +{ + namespace primitive2d + { + class OverlayRectanglePrimitive final : public DiscreteMetricDependentPrimitive2D + { + private: + // the logic rectangle definition + basegfx::B2DRange maObjectRange; + + // the graphic definition + basegfx::BColor maColor; + double mfTransparence; + + // the discrete grow and shrink of the box + double mfDiscreteGrow; + double mfDiscreteShrink; + + // the rotation of the primitive itself + double mfRotation; + + virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override; + + public: + OverlayRectanglePrimitive( + const basegfx::B2DRange& rObjectRange, + const basegfx::BColor& rColor, + double fTransparence, + double fDiscreteGrow, + double fDiscreteShrink, + double fRotation); + + // data access + const basegfx::B2DRange& getObjectRange() const { return maObjectRange; } + const basegfx::BColor& getColor() const { return maColor; } + double getTransparence() const { return mfTransparence; } + double getDiscreteGrow() const { return mfDiscreteGrow; } + double getDiscreteShrink() const { return mfDiscreteShrink; } + double getRotation() const { return mfRotation; } + + // compare operator + virtual bool operator==( const BasePrimitive2D& rPrimitive ) const override; + + virtual sal_uInt32 getPrimitive2DID() const override; + }; + } // 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 final : public ViewportDependentPrimitive2D + { + private: + // The logic position + basegfx::B2DPoint maBasePosition; + + // the style + HelplineStyle meStyle; + + // The stripe colors and length + basegfx::BColor maRGBColorA; + basegfx::BColor maRGBColorB; + double mfDiscreteDashLength; + + virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override; + + 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 override; + + virtual sal_uInt32 getPrimitive2DID() const override; + }; + } // 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 final : public ViewportDependentPrimitive2D + { + private: + // The logic range + basegfx::B2DRange maRollingRectangle; + + // The stripe colors and length + basegfx::BColor maRGBColorA; + basegfx::BColor maRGBColorB; + double mfDiscreteDashLength; + + virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override; + + 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 override; + + virtual sal_uInt32 getPrimitive2DID() const override; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + + +#endif // INCLUDED_SVX_INC_SDR_OVERLAY_OVERLAYTOOLS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/overlay/overlaytriangle.hxx b/svx/inc/sdr/overlay/overlaytriangle.hxx new file mode 100644 index 000000000..76e481e64 --- /dev/null +++ b/svx/inc/sdr/overlay/overlaytriangle.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 . + */ + +#pragma once + +#include <svx/sdr/overlay/overlayobject.hxx> + +namespace sdr +{ + namespace overlay + { + class OverlayTriangle final : public OverlayObjectWithBasePosition + { + // second and third position in pixel + basegfx::B2DPoint maSecondPosition; + basegfx::B2DPoint maThirdPosition; + + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DContainer createOverlayObjectPrimitive2DSequence() override; + + public: + OverlayTriangle( + const basegfx::B2DPoint& rBasePos, + const basegfx::B2DPoint& rSecondPos, + const basegfx::B2DPoint& rThirdPos, + Color aTriangleColor); + virtual ~OverlayTriangle() override; + }; + } // end of namespace overlay +} // end of namespace sdr + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/primitive2d/sdrattributecreator.hxx b/svx/inc/sdr/primitive2d/sdrattributecreator.hxx new file mode 100644 index 000000000..1bcc8e229 --- /dev/null +++ b/svx/inc/sdr/primitive2d/sdrattributecreator.hxx @@ -0,0 +1,130 @@ +/* -*- 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 . + */ + +#pragma once + +#include <sal/types.h> +#include <svx/svxdllapi.h> + + +// predefines +class SfxItemSet; +class SdrText; + +namespace drawinglayer::attribute { + class SdrLineAttribute; + class SdrLineStartEndAttribute; + class SdrShadowAttribute; + class SdrGlowAttribute; + class SdrFillAttribute; + class SdrTextAttribute; + class FillGradientAttribute; + class SdrFillGraphicAttribute; + class SdrEffectsTextAttribute; + class SdrLineEffectsTextAttribute; + class SdrLineFillEffectsTextAttribute; + class SdrLineFillShadowAttribute3D; + class SdrSceneAttribute; + class SdrLightingAttribute; + class SdrFillTextAttribute; +} + +namespace basegfx { + class B2DRange; +} + + +namespace drawinglayer +{ + namespace primitive2d + { + // SdrAttribute creators + attribute::SdrLineAttribute SVXCORE_DLLPUBLIC createNewSdrLineAttribute( + const SfxItemSet& rSet); + + attribute::SdrLineStartEndAttribute SVXCORE_DLLPUBLIC createNewSdrLineStartEndAttribute( + const SfxItemSet& rSet, + double fWidth); + + attribute::SdrShadowAttribute createNewSdrShadowAttribute( + const SfxItemSet& rSet); + + attribute::SdrFillAttribute SVXCORE_DLLPUBLIC 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 = nullptr, + const sal_Int32* pUpper = nullptr, + const sal_Int32* pRight = nullptr, + const sal_Int32* pLower = nullptr); + + attribute::FillGradientAttribute SVXCORE_DLLPUBLIC createNewTransparenceGradientAttribute( + const SfxItemSet& rSet); + + attribute::SdrFillGraphicAttribute createNewSdrFillGraphicAttribute( + const SfxItemSet& rSet); + + attribute::SdrEffectsTextAttribute createNewSdrEffectsTextAttribute( + const SfxItemSet& rSet, + const SdrText* pText, + bool bSuppressText); // #i98072# added option to suppress text on demand + + attribute::SdrLineEffectsTextAttribute createNewSdrLineEffectsTextAttribute( + const SfxItemSet& rSet, + const SdrText* pText); + + attribute::SdrLineFillEffectsTextAttribute createNewSdrLineFillEffectsTextAttribute( + 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 = nullptr, + const sal_Int32* pUpper = nullptr, + const sal_Int32* pRight = nullptr, + const sal_Int32* pLower = nullptr); + + // helpers + void calculateRelativeCornerRadius( + sal_Int32 nRadius, + const ::basegfx::B2DRange& rObjectRange, + double& rfCornerRadiusX, + double& rfCornerRadiusY); + + } // end of namespace primitive2d +} // end of namespace drawinglayer + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/primitive2d/sdrcaptionprimitive2d.hxx b/svx/inc/sdr/primitive2d/sdrcaptionprimitive2d.hxx new file mode 100644 index 000000000..4ed7d7f1f --- /dev/null +++ b/svx/inc/sdr/primitive2d/sdrcaptionprimitive2d.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 INCLUDED_SVX_INC_SDR_PRIMITIVE2D_SDRCAPTIONPRIMITIVE2D_HXX +#define INCLUDED_SVX_INC_SDR_PRIMITIVE2D_SDRCAPTIONPRIMITIVE2D_HXX + +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#include <basegfx/matrix/b2dhommatrix.hxx> +#include <sdr/attribute/sdrlinefilleffectstextattribute.hxx> +#include <basegfx/polygon/b2dpolygon.hxx> + + +// predefines + + +namespace drawinglayer +{ + namespace primitive2d + { + class SdrCaptionPrimitive2D final : public BufferedDecompositionPrimitive2D + { + private: + ::basegfx::B2DHomMatrix maTransform; + attribute::SdrLineFillEffectsTextAttribute 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 + + // local decomposition. + virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& aViewInformation) const override; + + public: + SdrCaptionPrimitive2D( + const ::basegfx::B2DHomMatrix& rTransform, + const attribute::SdrLineFillEffectsTextAttribute& rSdrLFSTAttribute, + const ::basegfx::B2DPolygon& rTail, + double fCornerRadiusX, + double fCornerRadiusY); + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const override; + + // data access + const ::basegfx::B2DHomMatrix& getTransform() const { return maTransform; } + const attribute::SdrLineFillEffectsTextAttribute& getSdrLFSTAttribute() const { return maSdrLFSTAttribute; } + const ::basegfx::B2DPolygon& getTail() const { return maTail; } + double getCornerRadiusX() const { return mfCornerRadiusX; } + double getCornerRadiusY() const { return mfCornerRadiusY; } + + // provide unique ID + virtual sal_uInt32 getPrimitive2DID() const override; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + + +#endif // INCLUDED_SVX_INC_SDR_PRIMITIVE2D_SDRCAPTIONPRIMITIVE2D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/primitive2d/sdrconnectorprimitive2d.hxx b/svx/inc/sdr/primitive2d/sdrconnectorprimitive2d.hxx new file mode 100644 index 000000000..8a2d75ae1 --- /dev/null +++ b/svx/inc/sdr/primitive2d/sdrconnectorprimitive2d.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 INCLUDED_SVX_INC_SDR_PRIMITIVE2D_SDRCONNECTORPRIMITIVE2D_HXX +#define INCLUDED_SVX_INC_SDR_PRIMITIVE2D_SDRCONNECTORPRIMITIVE2D_HXX + +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#include <sdr/attribute/sdrlineeffectstextattribute.hxx> +#include <basegfx/polygon/b2dpolygon.hxx> + + +// predefines + + +namespace drawinglayer +{ + namespace primitive2d + { + class SdrConnectorPrimitive2D final : public BufferedDecompositionPrimitive2D + { + private: + attribute::SdrLineEffectsTextAttribute maSdrLSTAttribute; + ::basegfx::B2DPolygon maUnitPolygon; + + // local decomposition. + virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& aViewInformation) const override; + + public: + SdrConnectorPrimitive2D( + const attribute::SdrLineEffectsTextAttribute& rSdrLSTAttribute, + const ::basegfx::B2DPolygon& rUnitPolygon); + + // data access + const attribute::SdrLineEffectsTextAttribute& getSdrLSTAttribute() const { return maSdrLSTAttribute; } + const ::basegfx::B2DPolygon& getUnitPolygon() const { return maUnitPolygon; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const override; + + // provide unique ID + virtual sal_uInt32 getPrimitive2DID() const override; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + + +#endif // INCLUDED_SVX_INC_SDR_PRIMITIVE2D_SDRCONNECTORPRIMITIVE2D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx b/svx/inc/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx new file mode 100644 index 000000000..063f6ec92 --- /dev/null +++ b/svx/inc/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx @@ -0,0 +1,84 @@ +/* -*- 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_INC_SDR_PRIMITIVE2D_SDRCUSTOMSHAPEPRIMITIVE2D_HXX +#define INCLUDED_SVX_INC_SDR_PRIMITIVE2D_SDRCUSTOMSHAPEPRIMITIVE2D_HXX + +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#include <basegfx/matrix/b2dhommatrix.hxx> +#include <sdr/attribute/sdreffectstextattribute.hxx> + + +// predefines + + +namespace drawinglayer +{ + namespace primitive2d + { + class SdrCustomShapePrimitive2D : public BufferedDecompositionPrimitive2D + { + private: + attribute::SdrEffectsTextAttribute maSdrSTAttribute; + Primitive2DContainer maSubPrimitives; + basegfx::B2DHomMatrix maTextBox; + + // defines if SdrTextWordWrapItem was set at SdrObjCustomShape which means + // that the text needs to be block formatted + bool mbWordWrap : 1; + + // defines that the object contains/is a 3D AutoShape. Needed for + // making exceptions with shadow generation + bool mb3DShape : 1; + + basegfx::B2DHomMatrix maTransform; + + protected: + // local decomposition. + virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& aViewInformation) const override; + + public: + SdrCustomShapePrimitive2D( + const attribute::SdrEffectsTextAttribute& rSdrSTAttribute, + const Primitive2DContainer& rSubPrimitives, + const basegfx::B2DHomMatrix& rTextBox, + bool bWordWrap, + bool b3DShape, + const basegfx::B2DHomMatrix& rObjectMatrix); + + // data access + const attribute::SdrEffectsTextAttribute& getSdrSTAttribute() const { return maSdrSTAttribute; } + const Primitive2DContainer& getSubPrimitives() const { return maSubPrimitives; } + const basegfx::B2DHomMatrix& getTextBox() const { return maTextBox; } + bool getWordWrap() const { return mbWordWrap; } + bool get3DShape() const { return mb3DShape; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const override; + + // provide unique ID + virtual sal_uInt32 getPrimitive2DID() const override; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + + +#endif // INCLUDED_SVX_INC_SDR_PRIMITIVE2D_SDRCUSTOMSHAPEPRIMITIVE2D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/primitive2d/sdrdecompositiontools.hxx b/svx/inc/sdr/primitive2d/sdrdecompositiontools.hxx new file mode 100644 index 000000000..e61920630 --- /dev/null +++ b/svx/inc/sdr/primitive2d/sdrdecompositiontools.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 . + */ + +#pragma once + +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#include <drawinglayer/attribute/sdrglowattribute.hxx> + +#include <svx/svxdllapi.h> + +// predefines +namespace basegfx { + class B2DPolygon; + class B2DPolyPolygon; + class B2DHomMatrix; +} + +namespace drawinglayer::attribute { + class SdrFillAttribute; + class SdrLineAttribute; + class FillGradientAttribute; + class SdrShadowAttribute; + class SdrLineStartEndAttribute; + class SdrTextAttribute; +} + + +namespace drawinglayer +{ + namespace primitive2d + { + Primitive2DReference SVXCORE_DLLPUBLIC createPolyPolygonFillPrimitive( + const basegfx::B2DPolyPolygon& rPolyPolygon, + const attribute::SdrFillAttribute& rFill, + const attribute::FillGradientAttribute& rFillGradient); + + Primitive2DReference SVXCORE_DLLPUBLIC createPolyPolygonFillPrimitive( + const basegfx::B2DPolyPolygon& rPolyPolygon, + const basegfx::B2DRange& rDefinitionRange, + const attribute::SdrFillAttribute& rFill, + const attribute::FillGradientAttribute& rFillGradient); + + Primitive2DReference SVXCORE_DLLPUBLIC createPolygonLinePrimitive( + const basegfx::B2DPolygon& rPolygon, + const attribute::SdrLineAttribute& rLine, + const attribute::SdrLineStartEndAttribute& rStroke); + + Primitive2DReference SVXCORE_DLLPUBLIC createTextPrimitive( + const basegfx::B2DPolyPolygon& rUnitPolyPolygon, + const basegfx::B2DHomMatrix& rObjectTransform, + const attribute::SdrTextAttribute& rText, + const attribute::SdrLineAttribute& rStroke, + bool bCellText, + bool bWordWrap); + + Primitive2DContainer SVXCORE_DLLPUBLIC createEmbeddedShadowPrimitive( + const Primitive2DContainer& rContent, + const attribute::SdrShadowAttribute& rShadow, + const basegfx::B2DHomMatrix& rObjectMatrix = basegfx::B2DHomMatrix()); + + Primitive2DContainer SVXCORE_DLLPUBLIC createEmbeddedGlowPrimitive( + const Primitive2DContainer& rContent, + const attribute::SdrGlowAttribute& rGlow); + + Primitive2DContainer SVXCORE_DLLPUBLIC createEmbeddedSoftEdgePrimitive( + const Primitive2DContainer& rContent, + sal_Int32 nRadius); + + } // end of namespace primitive2d +} // end of namespace drawinglayer + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/primitive2d/sdrellipseprimitive2d.hxx b/svx/inc/sdr/primitive2d/sdrellipseprimitive2d.hxx new file mode 100644 index 000000000..2e2c0e20a --- /dev/null +++ b/svx/inc/sdr/primitive2d/sdrellipseprimitive2d.hxx @@ -0,0 +1,100 @@ +/* -*- 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_INC_SDR_PRIMITIVE2D_SDRELLIPSEPRIMITIVE2D_HXX +#define INCLUDED_SVX_INC_SDR_PRIMITIVE2D_SDRELLIPSEPRIMITIVE2D_HXX + +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#include <basegfx/matrix/b2dhommatrix.hxx> +#include <sdr/attribute/sdrlinefilleffectstextattribute.hxx> + + +// predefines + + +namespace drawinglayer +{ + namespace primitive2d + { + class SdrEllipsePrimitive2D : public BufferedDecompositionPrimitive2D + { + private: + ::basegfx::B2DHomMatrix maTransform; + attribute::SdrLineFillEffectsTextAttribute maSdrLFSTAttribute; + + // local decomposition. + virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& aViewInformation) const override; + + public: + SdrEllipsePrimitive2D( + const ::basegfx::B2DHomMatrix& rTransform, + const attribute::SdrLineFillEffectsTextAttribute& rSdrLFSTAttribute); + + // data access + const ::basegfx::B2DHomMatrix& getTransform() const { return maTransform; } + const attribute::SdrLineFillEffectsTextAttribute& getSdrLFSTAttribute() const { return maSdrLFSTAttribute; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const override; + + // provide unique ID + virtual sal_uInt32 getPrimitive2DID() const override; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + + +namespace drawinglayer +{ + namespace primitive2d + { + class SdrEllipseSegmentPrimitive2D final : public SdrEllipsePrimitive2D + { + private: + double mfStartAngle; + double mfEndAngle; + + bool mbCloseSegment : 1; + bool mbCloseUsingCenter : 1; + + // local decomposition. + virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& aViewInformation) const override; + + public: + SdrEllipseSegmentPrimitive2D( + const ::basegfx::B2DHomMatrix& rTransform, + const attribute::SdrLineFillEffectsTextAttribute& rSdrLFSTAttribute, + double fStartAngle, + double fEndAngle, + bool bCloseSegment, + bool bCloseUsingCenter); + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const override; + + // provide unique ID + virtual sal_uInt32 getPrimitive2DID() const override; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + + +#endif // INCLUDED_SVX_INC_SDR_PRIMITIVE2D_SDRELLIPSEPRIMITIVE2D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/primitive2d/sdrgrafprimitive2d.hxx b/svx/inc/sdr/primitive2d/sdrgrafprimitive2d.hxx new file mode 100644 index 000000000..31b5f444f --- /dev/null +++ b/svx/inc/sdr/primitive2d/sdrgrafprimitive2d.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 INCLUDED_SVX_INC_SDR_PRIMITIVE2D_SDRGRAFPRIMITIVE2D_HXX +#define INCLUDED_SVX_INC_SDR_PRIMITIVE2D_SDRGRAFPRIMITIVE2D_HXX + +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#include <basegfx/matrix/b2dhommatrix.hxx> +#include <vcl/GraphicObject.hxx> +#include <sdr/attribute/sdrlinefilleffectstextattribute.hxx> + + +// predefines + + +namespace drawinglayer +{ + namespace primitive2d + { + class SdrGrafPrimitive2D final : public BufferedDecompositionPrimitive2D + { + private: + ::basegfx::B2DHomMatrix maTransform; + attribute::SdrLineFillEffectsTextAttribute maSdrLFSTAttribute; + GraphicObject maGraphicObject; + GraphicAttr maGraphicAttr; + + // local decomposition. + virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& aViewInformation) const override; + + public: + SdrGrafPrimitive2D( + const ::basegfx::B2DHomMatrix& rTransform, + const attribute::SdrLineFillEffectsTextAttribute& rSdrLFSTAttribute, + const GraphicObject& rGraphicObject, + const GraphicAttr& rGraphicAttr); + + // data access + const ::basegfx::B2DHomMatrix& getTransform() const { return maTransform; } + const attribute::SdrLineFillEffectsTextAttribute& 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 override; + + // provide unique ID + virtual sal_uInt32 getPrimitive2DID() const override; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + + +#endif // INCLUDED_SVX_INC_SDR_PRIMITIVE2D_SDRGRAFPRIMITIVE2D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/primitive2d/sdrmeasureprimitive2d.hxx b/svx/inc/sdr/primitive2d/sdrmeasureprimitive2d.hxx new file mode 100644 index 000000000..4e28aad88 --- /dev/null +++ b/svx/inc/sdr/primitive2d/sdrmeasureprimitive2d.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 INCLUDED_SVX_INC_SDR_PRIMITIVE2D_SDRMEASUREPRIMITIVE2D_HXX +#define INCLUDED_SVX_INC_SDR_PRIMITIVE2D_SDRMEASUREPRIMITIVE2D_HXX + +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#include <sdr/attribute/sdrlineeffectstextattribute.hxx> + + +// predefines + +namespace drawinglayer::primitive2d { + enum MeasureTextPosition + { + MEASURETEXTPOSITION_AUTOMATIC, + MEASURETEXTPOSITION_NEGATIVE, + MEASURETEXTPOSITION_CENTERED, + MEASURETEXTPOSITION_POSITIVE + }; +} + +namespace drawinglayer::attribute { + class SdrLineAttribute; +} + + +namespace drawinglayer +{ + namespace primitive2d + { + class SdrMeasurePrimitive2D final : public BufferedDecompositionPrimitive2D + { + private: + attribute::SdrLineEffectsTextAttribute maSdrLSTAttribute; + basegfx::B2DPoint maStart; + basegfx::B2DPoint maEnd; + MeasureTextPosition meHorizontal; + MeasureTextPosition meVertical; + double mfDistance; + double mfUpper; + double mfLower; + double mfLeftDelta; + double mfRightDelta; + + bool mbBelow : 1; + bool mbTextRotation : 1; + bool 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; + + // local decomposition. + virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& aViewInformation) const override; + + public: + SdrMeasurePrimitive2D( + const attribute::SdrLineEffectsTextAttribute& 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::SdrLineEffectsTextAttribute& 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 override; + + // provide unique ID + virtual sal_uInt32 getPrimitive2DID() const override; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + + +#endif // INCLUDED_SVX_INC_SDR_PRIMITIVE2D_SDRMEASUREPRIMITIVE2D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/primitive2d/sdrole2primitive2d.hxx b/svx/inc/sdr/primitive2d/sdrole2primitive2d.hxx new file mode 100644 index 000000000..8b3ce0bfb --- /dev/null +++ b/svx/inc/sdr/primitive2d/sdrole2primitive2d.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_SVX_INC_SDR_PRIMITIVE2D_SDROLE2PRIMITIVE2D_HXX +#define INCLUDED_SVX_INC_SDR_PRIMITIVE2D_SDROLE2PRIMITIVE2D_HXX + +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#include <basegfx/matrix/b2dhommatrix.hxx> +#include <sdr/attribute/sdrlinefilleffectstextattribute.hxx> + + +// predefines + + +namespace drawinglayer +{ + namespace primitive2d + { + class SdrOle2Primitive2D final : public BasePrimitive2D + { + private: + Primitive2DContainer maOLEContent; + basegfx::B2DHomMatrix maTransform; + attribute::SdrLineFillEffectsTextAttribute maSdrLFSTAttribute; + + public: + SdrOle2Primitive2D( + const Primitive2DContainer& rOLEContent, + const basegfx::B2DHomMatrix& rTransform, + const attribute::SdrLineFillEffectsTextAttribute& rSdrLFSTAttribute); + + // data access + const Primitive2DContainer& getOLEContent() const { return maOLEContent; } + const basegfx::B2DHomMatrix& getTransform() const { return maTransform; } + const attribute::SdrLineFillEffectsTextAttribute& getSdrLFSTAttribute() const { return maSdrLFSTAttribute; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const override; + + // local decomposition. + virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& aViewInformation) const override; + + // provide unique ID + virtual sal_uInt32 getPrimitive2DID() const override; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + + +#endif // INCLUDED_SVX_INC_SDR_PRIMITIVE2D_SDROLE2PRIMITIVE2D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/primitive2d/sdrolecontentprimitive2d.hxx b/svx/inc/sdr/primitive2d/sdrolecontentprimitive2d.hxx new file mode 100644 index 000000000..2dec9b986 --- /dev/null +++ b/svx/inc/sdr/primitive2d/sdrolecontentprimitive2d.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_SVX_INC_SDR_PRIMITIVE2D_SDROLECONTENTPRIMITIVE2D_HXX +#define INCLUDED_SVX_INC_SDR_PRIMITIVE2D_SDROLECONTENTPRIMITIVE2D_HXX + +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#include <basegfx/matrix/b2dhommatrix.hxx> +#include <tools/weakbase.h> + + +// predefinitions + +class SdrOle2Obj; + + +namespace drawinglayer +{ + namespace primitive2d + { + class SdrOleContentPrimitive2D final : public BufferedDecompositionPrimitive2D + { + private: + tools::WeakReference<SdrOle2Obj> 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; + + // local decomposition. + virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& aViewInformation) const override; + + public: + SdrOleContentPrimitive2D( + const SdrOle2Obj& rSdrOle2Obj, + const basegfx::B2DHomMatrix& rObjectTransform, + sal_uInt32 nGraphicVersion + ); + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const override; + + // The default implementation will use getDecomposition results to create the range + virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const override; + + // data access + const basegfx::B2DHomMatrix& getObjectTransform() const { return maObjectTransform; } + + // provide unique ID + virtual sal_uInt32 getPrimitive2DID() const override; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + + +#endif // INCLUDED_SVX_INC_SDR_PRIMITIVE2D_SDROLECONTENTPRIMITIVE2D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/primitive2d/sdrpathprimitive2d.hxx b/svx/inc/sdr/primitive2d/sdrpathprimitive2d.hxx new file mode 100644 index 000000000..fe823eb7a --- /dev/null +++ b/svx/inc/sdr/primitive2d/sdrpathprimitive2d.hxx @@ -0,0 +1,85 @@ +/* -*- 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_INC_SDR_PRIMITIVE2D_SDRPATHPRIMITIVE2D_HXX +#define INCLUDED_SVX_INC_SDR_PRIMITIVE2D_SDRPATHPRIMITIVE2D_HXX + +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#include <basegfx/matrix/b2dhommatrix.hxx> +#include <sdr/attribute/sdrlinefilleffectstextattribute.hxx> +#include <basegfx/polygon/b2dpolypolygon.hxx> + + +// predefines + + +namespace drawinglayer +{ + namespace primitive2d + { + class SdrPathPrimitive2D final : public BufferedDecompositionPrimitive2D + { + private: + basegfx::B2DHomMatrix maTransform; + attribute::SdrLineFillEffectsTextAttribute maSdrLFSTAttribute; + basegfx::B2DPolyPolygon maUnitPolyPolygon; + + // OperationSmiley: Added to be able to define a FillGeometry different from local + // geometry. It is ignored when empty and/or equal to UnitPolyPolygon. + // If used and there is a fill, the object's geometry (maUnitPolyPolygon) will be filled, + // but UnitDefinitionPolyPolygon will be used to define the FillStyle. Thus when + // using the 'same' UnitDefinitionPolyPolygon for multiple definitions, + // all filled stuff using it will fit seamlessly together. + // 'same' is in quotes since it is a UnitPolygon, so being relative to the + // unit polygon of the local geometry (UnitPolyPolygon). The definition is complete + // when applying the also given transformation (maTransform) + basegfx::B2DPolyPolygon maUnitDefinitionPolyPolygon; + + // local decomposition. + virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& aViewInformation) const override; + + public: + // OperationSmiley: Extended to UnitDefinitionPolyPolygon, but when needed + // a 2nd version without can be defined that just does not set the + // maUnitDefinitionPolyPolygon or set equal to UnitPolyPolygon + SdrPathPrimitive2D( + const basegfx::B2DHomMatrix& rTransform, + const attribute::SdrLineFillEffectsTextAttribute& rSdrLFSTAttribute, + const basegfx::B2DPolyPolygon& rUnitPolyPolygon, + const basegfx::B2DPolyPolygon& rUnitDefinitionPolyPolygon); + + // data access + const basegfx::B2DHomMatrix& getTransform() const { return maTransform; } + const attribute::SdrLineFillEffectsTextAttribute& getSdrLFSTAttribute() const { return maSdrLFSTAttribute; } + const basegfx::B2DPolyPolygon& getUnitPolyPolygon() const { return maUnitPolyPolygon; } + const basegfx::B2DPolyPolygon& getUnitDefinitionPolyPolygon() const { return maUnitDefinitionPolyPolygon; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const override; + + // provide unique ID + virtual sal_uInt32 getPrimitive2DID() const override; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + + +#endif // INCLUDED_SVX_INC_SDR_PRIMITIVE2D_SDRPATHPRIMITIVE2D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/primitive2d/sdrprimitivetools.hxx b/svx/inc/sdr/primitive2d/sdrprimitivetools.hxx new file mode 100644 index 000000000..9afff3ecc --- /dev/null +++ b/svx/inc/sdr/primitive2d/sdrprimitivetools.hxx @@ -0,0 +1,47 @@ +/* -*- 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_INC_SDR_PRIMITIVE2D_SDRPRIMITIVETOOLS_HXX +#define INCLUDED_SVX_INC_SDR_PRIMITIVE2D_SDRPRIMITIVETOOLS_HXX + +#include <vcl/bitmapex.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_SVX_INC_SDR_PRIMITIVE2D_SDRPRIMITIVETOOLS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/primitive2d/sdrrectangleprimitive2d.hxx b/svx/inc/sdr/primitive2d/sdrrectangleprimitive2d.hxx new file mode 100644 index 000000000..d9c411996 --- /dev/null +++ b/svx/inc/sdr/primitive2d/sdrrectangleprimitive2d.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_SVX_INC_SDR_PRIMITIVE2D_SDRRECTANGLEPRIMITIVE2D_HXX +#define INCLUDED_SVX_INC_SDR_PRIMITIVE2D_SDRRECTANGLEPRIMITIVE2D_HXX + +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#include <basegfx/matrix/b2dhommatrix.hxx> +#include <sdr/attribute/sdrlinefilleffectstextattribute.hxx> + + +// predefines + + +namespace drawinglayer +{ + namespace primitive2d + { + class SdrRectanglePrimitive2D final : public BufferedDecompositionPrimitive2D + { + private: + basegfx::B2DHomMatrix maTransform; + attribute::SdrLineFillEffectsTextAttribute maSdrLFSTAttribute; + double mfCornerRadiusX; // [0.0..1.0] relative to 1/2 width + double mfCornerRadiusY; // [0.0..1.0] relative to 1/2 height + + // flag which decides if the HitArea should be the filled geometry + bool mbForceFillForHitTest : 1; + + // local decomposition. + virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& aViewInformation) const override; + + public: + SdrRectanglePrimitive2D( + const basegfx::B2DHomMatrix& rTransform, + const attribute::SdrLineFillEffectsTextAttribute& rSdrLFSTAttribute, + double fCornerRadiusX, + double fCornerRadiusY, + bool bForceFillForHitTest); + + // data access + const basegfx::B2DHomMatrix& getTransform() const { return maTransform; } + const attribute::SdrLineFillEffectsTextAttribute& getSdrLFSTAttribute() const { return maSdrLFSTAttribute; } + double getCornerRadiusX() const { return mfCornerRadiusX; } + double getCornerRadiusY() const { return mfCornerRadiusY; } + bool getForceFillForHitTest() const { return mbForceFillForHitTest; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const override; + + // provide unique ID + virtual sal_uInt32 getPrimitive2DID() const override; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + + +#endif // INCLUDED_SVX_INC_SDR_PRIMITIVE2D_SDRRECTANGLEPRIMITIVE2D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx b/svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx new file mode 100644 index 000000000..eac15db3b --- /dev/null +++ b/svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx @@ -0,0 +1,355 @@ +/* -*- 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_INC_SDR_PRIMITIVE2D_SDRTEXTPRIMITIVE2D_HXX +#define INCLUDED_SVX_INC_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 <sdr/attribute/sdrformtextattribute.hxx> +#include <tools/weakbase.h> +#include <svx/sdtaitm.hxx> + + +// predefines +class SdrText; + + +namespace drawinglayer +{ + namespace primitive2d + { + class SdrTextPrimitive2D : public BufferedDecompositionPrimitive2D + { + private: + // The text model data; this should 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 node + css::uno::Reference< css::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; + + // is there a PageNumber, Header, Footer or DateTimeField used? Evaluated at construction + bool mbContainsPageField : 1; + bool mbContainsPageCountField : 1; + bool mbContainsOtherFields : 1; + + protected: + // support for XTEXT_PAINTSHAPE_BEGIN/XTEXT_PAINTSHAPE_END Metafile comments + static void encapsulateWithTextHierarchyBlockPrimitive2D(Primitive2DContainer& rContainer, const Primitive2DContainer& rCandidate); + + public: + SdrTextPrimitive2D( + const SdrText* pSdrText, + const OutlinerParaObject& rOutlinerParaObjectPtr); + + // get data + const SdrText* getSdrText() const; + const OutlinerParaObject& getOutlinerParaObject() const { return maOutlinerParaObject; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const override; + + // own get2DDecomposition to take aspect of decomposition with or without spell checker + // into account + virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const override; + + // transformed clone operator + virtual std::unique_ptr<SdrTextPrimitive2D> createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const = 0; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + + +namespace drawinglayer +{ + namespace primitive2d + { + class SdrContourTextPrimitive2D final : 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; + + // local decomposition. + virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& aViewInformation) const override; + + 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 override; + + // transformed clone operator + virtual std::unique_ptr<SdrTextPrimitive2D> createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const override; + + // provide unique ID + virtual sal_uInt32 getPrimitive2DID() const override; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + + +namespace drawinglayer +{ + namespace primitive2d + { + class SdrPathTextPrimitive2D final : public SdrTextPrimitive2D + { + private: + // the path to use. Each paragraph will use one Polygon. + basegfx::B2DPolyPolygon maPathPolyPolygon; + + // the Fontwork parameters + attribute::SdrFormTextAttribute maSdrFormTextAttribute; + + // local decomposition. + virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& aViewInformation) const override; + + 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 override; + + // transformed clone operator + virtual std::unique_ptr<SdrTextPrimitive2D> createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const override; + + // provide unique ID + virtual sal_uInt32 getPrimitive2DID() const override; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + + +namespace drawinglayer +{ + namespace primitive2d + { + class SdrBlockTextPrimitive2D final : 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; + + bool mbFixedCellHeight : 1; + bool mbUnlimitedPage : 1; // force layout with no text break + bool mbCellText : 1; // this is a cell text as block text + bool mbWordWrap : 1; // for CustomShapes text layout + + // local decomposition. + virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& aViewInformation) const override; + + public: + SdrBlockTextPrimitive2D( + const SdrText* pSdrText, + const OutlinerParaObject& rOutlinerParaObjectPtr, + const basegfx::B2DHomMatrix& rTextRangeTransform, + SdrTextHorzAdjust aSdrTextHorzAdjust, + SdrTextVertAdjust aSdrTextVertAdjust, + bool bFixedCellHeight, + bool bUnlimitedPage, + bool bCellText, + bool bWordWrap); + + // 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; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const override; + + // transformed clone operator + virtual std::unique_ptr<SdrTextPrimitive2D> createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const override; + + // provide unique ID + virtual sal_uInt32 getPrimitive2DID() const override; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + + +namespace drawinglayer +{ + namespace primitive2d + { + class SdrStretchTextPrimitive2D final : public SdrTextPrimitive2D + { + private: + // text range transformation from unit range ([0.0 .. 1.0]) to text range + basegfx::B2DHomMatrix maTextRangeTransform; + + bool mbFixedCellHeight : 1; + + // local decomposition. + virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& aViewInformation) const override; + + 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 override; + + // transformed clone operator + virtual std::unique_ptr<SdrTextPrimitive2D> createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const override; + + // provide unique ID + virtual sal_uInt32 getPrimitive2DID() const override; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + + +namespace drawinglayer +{ + namespace primitive2d + { + class SdrAutoFitTextPrimitive2D final : public SdrTextPrimitive2D + { + private: + ::basegfx::B2DHomMatrix maTextRangeTransform; // text range transformation from unit range ([0.0 .. 1.0]) to text range + + bool mbWordWrap : 1; // for CustomShapes text layout + + // local decomposition. + virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& aViewInformation) const override; + + 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 override; + + // transformed clone operator + virtual std::unique_ptr<SdrTextPrimitive2D> createTransformedClone(const ::basegfx::B2DHomMatrix& rTransform) const override; + + // provide unique ID + virtual sal_uInt32 getPrimitive2DID() const override; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +namespace drawinglayer +{ + namespace primitive2d + { + class SdrChainedTextPrimitive2D final : public SdrTextPrimitive2D + { + private: + // XXX: might have position of overflowing text + + ::basegfx::B2DHomMatrix maTextRangeTransform; // text range transformation from unit range ([0.0 .. 1.0]) to text range + + // local decomposition. + virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& aViewInformation) const override; + + public: + SdrChainedTextPrimitive2D( + const SdrText* pSdrText, + const OutlinerParaObject& rOutlinerParaObjectPtrs, + const ::basegfx::B2DHomMatrix& rTextRangeTransform); + + // get data + const basegfx::B2DHomMatrix& getTextRangeTransform() const { return maTextRangeTransform; } + //bool getWordWrap() const { return true; } // XXX: Hack! Should have a proper implementation// + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const override; + + // transformed clone operator + virtual std::unique_ptr<SdrTextPrimitive2D> createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const override; + + // provide unique ID + virtual sal_uInt32 getPrimitive2DID() const override; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + + +#endif // INCLUDED_SVX_INC_SDR_PRIMITIVE2D_SDRTEXTPRIMITIVE2D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/primitive3d/sdrattributecreator3d.hxx b/svx/inc/sdr/primitive3d/sdrattributecreator3d.hxx new file mode 100644 index 000000000..89f8f5d12 --- /dev/null +++ b/svx/inc/sdr/primitive3d/sdrattributecreator3d.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 INCLUDED_SVX_INC_SDR_PRIMITIVE3D_SDRATTRIBUTECREATOR3D_HXX +#define INCLUDED_SVX_INC_SDR_PRIMITIVE3D_SDRATTRIBUTECREATOR3D_HXX + + +// predefines +class SfxItemSet; + +namespace drawinglayer::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 // INCLUDED_SVX_INC_SDR_PRIMITIVE3D_SDRATTRIBUTECREATOR3D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/properties/attributeproperties.hxx b/svx/inc/sdr/properties/attributeproperties.hxx new file mode 100644 index 000000000..aa02c9484 --- /dev/null +++ b/svx/inc/sdr/properties/attributeproperties.hxx @@ -0,0 +1,94 @@ +/* -*- 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_SDR_PROPERTIES_ATTRIBUTEPROPERTIES_HXX +#define INCLUDED_SVX_SDR_PROPERTIES_ATTRIBUTEPROPERTIES_HXX + +#include <svl/lstner.hxx> +#include <svl/stylesheetuser.hxx> +#include <svx/sdr/properties/defaultproperties.hxx> + + +namespace sdr +{ + namespace properties + { + class AttributeProperties : public DefaultProperties, public SfxListener, public svl::StyleSheetUser + { + // core to set parent at SfxItemSet and to execute the hard attribute computations + void ImpSetParentAtSfxItemSet(bool bDontRemoveHardAttr); + + // add style sheet, do all the necessary handling + void ImpAddStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr); + + // remove StyleSheet, do all the necessary handling + void ImpRemoveStyleSheet(); + + protected: + // the StyleSheet of this object + SfxStyleSheet* mpStyleSheet; + + // create a new itemset + virtual std::unique_ptr<SfxItemSet> CreateObjectSpecificItemSet(SfxItemPool& pPool) override; + + // Do the ItemChange, may do special handling + virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = nullptr) override; + + // react on ItemSet changes + virtual void ItemSetChanged(const SfxItemSet& rSet) override; + + 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 std::unique_ptr<BaseProperties> Clone(SdrObject& rObj) const override; + + // 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 override; + + // destructor + virtual ~AttributeProperties() override; + + // set a new StyleSheet and broadcast + virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr) override; + + // get the installed StyleSheet + virtual SfxStyleSheet* GetStyleSheet() const override; + + // force all attributes which come from styles to hard attributes + // to be able to live without the style. + virtual void ForceStyleToHardAttributes() override; + + // This is the Notify(...) from 2nd base class SfxListener + virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override; + + virtual bool isUsedByModel() const override; + }; + } // end of namespace properties +} // end of namespace sdr + + +#endif // INCLUDED_SVX_SDR_PROPERTIES_ATTRIBUTEPROPERTIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/properties/captionproperties.hxx b/svx/inc/sdr/properties/captionproperties.hxx new file mode 100644 index 000000000..6e313daa3 --- /dev/null +++ b/svx/inc/sdr/properties/captionproperties.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 INCLUDED_SVX_INC_SDR_PROPERTIES_CAPTIONPROPERTIES_HXX +#define INCLUDED_SVX_INC_SDR_PROPERTIES_CAPTIONPROPERTIES_HXX + +#include <sdr/properties/rectangleproperties.hxx> + + +namespace sdr +{ + namespace properties + { + class CaptionProperties final : public RectangleProperties + { + // create a new itemset + virtual std::unique_ptr<SfxItemSet> CreateObjectSpecificItemSet(SfxItemPool& rPool) override; + + // react on ItemSet changes + virtual void ItemSetChanged(const SfxItemSet& rSet) override; + + public: + // basic constructor + explicit CaptionProperties(SdrObject& rObj); + + // constructor for copying, but using new object + CaptionProperties(const CaptionProperties& rProps, SdrObject& rObj); + + // destructor + virtual ~CaptionProperties() override; + + // Clone() operator, normally just calls the local copy constructor + virtual std::unique_ptr<BaseProperties> Clone(SdrObject& rObj) const override; + + // set a new StyleSheet and broadcast + virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr) override; + + // force default attributes for a specific object type, called from + // DefaultProperties::GetObjectItemSet() if a new ItemSet is created + virtual void ForceDefaultAttributes() override; + }; + } // end of namespace properties +} // end of namespace sdr + + +#endif // INCLUDED_SVX_INC_SDR_PROPERTIES_CAPTIONPROPERTIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/properties/circleproperties.hxx b/svx/inc/sdr/properties/circleproperties.hxx new file mode 100644 index 000000000..eb5c1980d --- /dev/null +++ b/svx/inc/sdr/properties/circleproperties.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 INCLUDED_SVX_INC_SDR_PROPERTIES_CIRCLEPROPERTIES_HXX +#define INCLUDED_SVX_INC_SDR_PROPERTIES_CIRCLEPROPERTIES_HXX + +#include <sdr/properties/rectangleproperties.hxx> + + +namespace sdr +{ + namespace properties + { + class CircleProperties final : public RectangleProperties + { + // create a new itemset + virtual std::unique_ptr<SfxItemSet> CreateObjectSpecificItemSet(SfxItemPool& rPool) override; + + // react on ItemSet changes + virtual void ItemSetChanged(const SfxItemSet& rSet) override; + + public: + // basic constructor + explicit CircleProperties(SdrObject& rObj); + + // constructor for copying, but using new object + CircleProperties(const CircleProperties& rProps, SdrObject& rObj); + + // destructor + virtual ~CircleProperties() override; + + // Clone() operator, normally just calls the local copy constructor + virtual std::unique_ptr<BaseProperties> Clone(SdrObject& rObj) const override; + + // set a new StyleSheet and broadcast + virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr) override; + + // force default attributes for a specific object type, called from + // DefaultProperties::GetObjectItemSet() if a new ItemSet is created + virtual void ForceDefaultAttributes() override; + }; + } // end of namespace properties +} // end of namespace sdr + + +#endif // INCLUDED_SVX_INC_SDR_PROPERTIES_CIRCLEPROPERTIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/properties/connectorproperties.hxx b/svx/inc/sdr/properties/connectorproperties.hxx new file mode 100644 index 000000000..f5d5c3892 --- /dev/null +++ b/svx/inc/sdr/properties/connectorproperties.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 INCLUDED_SVX_INC_SDR_PROPERTIES_CONNECTORPROPERTIES_HXX +#define INCLUDED_SVX_INC_SDR_PROPERTIES_CONNECTORPROPERTIES_HXX + +#include <sdr/properties/textproperties.hxx> + + +namespace sdr +{ + namespace properties + { + class ConnectorProperties final : public TextProperties + { + // create a new itemset + virtual std::unique_ptr<SfxItemSet> CreateObjectSpecificItemSet(SfxItemPool& rPool) override; + + // react on ItemSet changes + virtual void ItemSetChanged(const SfxItemSet& rSet) override; + + public: + // basic constructor + explicit ConnectorProperties(SdrObject& rObj); + + // constructor for copying, but using new object + ConnectorProperties(const ConnectorProperties& rProps, SdrObject& rObj); + + // destructor + virtual ~ConnectorProperties() override; + + // Clone() operator, normally just calls the local copy constructor + virtual std::unique_ptr<BaseProperties> Clone(SdrObject& rObj) const override; + + // set a new StyleSheet and broadcast + virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr) override; + }; + } // end of namespace properties +} // end of namespace sdr + + +#endif // INCLUDED_SVX_INC_SDR_PROPERTIES_CONNECTORPROPERTIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/properties/customshapeproperties.hxx b/svx/inc/sdr/properties/customshapeproperties.hxx new file mode 100644 index 000000000..696243bb3 --- /dev/null +++ b/svx/inc/sdr/properties/customshapeproperties.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 INCLUDED_SVX_INC_SDR_PROPERTIES_CUSTOMSHAPEPROPERTIES_HXX +#define INCLUDED_SVX_INC_SDR_PROPERTIES_CUSTOMSHAPEPROPERTIES_HXX + +#include <sdr/properties/textproperties.hxx> + + +namespace sdr +{ + namespace properties + { + class CustomShapeProperties final : public TextProperties + { + private: + void UpdateTextFrameStatus(bool bInvalidateRenderGeometry); + + // create a new itemset + virtual std::unique_ptr<SfxItemSet> CreateObjectSpecificItemSet(SfxItemPool& rPool) override; + + // test changeability for a single item + virtual bool AllowItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = nullptr) const override; + + // react on ItemSet changes + virtual void ItemSetChanged(const SfxItemSet& rSet) override; + + // react on Item change + virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = nullptr) override; + + // Called after ItemChange() is done for all items. Allows local reactions on + // specific item changes + virtual void PostItemChange(const sal_uInt16 nWhich) override; + + // clear single item + virtual void ClearObjectItem(const sal_uInt16 nWhich = 0) override; + + // clear single item direct, do not do any notifies or things like that. + // Also supports complete deletion of items when default parameter 0 is used. + virtual void ClearObjectItemDirect(const sal_uInt16 nWhich) override; + + public: + + // set a new StyleSheet and broadcast + virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr) override; + + // force default attributes for a specific object type, called from + // DefaultProperties::GetObjectItemSet() if a new ItemSet is created + virtual void ForceDefaultAttributes() override; + + // basic constructor + explicit CustomShapeProperties(SdrObject& rObj); + + // constructor for copying, but using new object + CustomShapeProperties(const CustomShapeProperties& rProps, SdrObject& rObj); + + // destructor + virtual ~CustomShapeProperties() override; + + // Clone() operator, normally just calls the local copy constructor + virtual std::unique_ptr<BaseProperties> Clone(SdrObject& rObj) const override; + + // This is the notifier from SfxListener + virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override; + }; + } // end of namespace properties +} // end of namespace sdr + + +#endif // INCLUDED_SVX_INC_SDR_PROPERTIES_CUSTOMSHAPEPROPERTIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/properties/e3dcompoundproperties.hxx b/svx/inc/sdr/properties/e3dcompoundproperties.hxx new file mode 100644 index 000000000..22da0bfca --- /dev/null +++ b/svx/inc/sdr/properties/e3dcompoundproperties.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 INCLUDED_SVX_SDR_PROPERTIES_E3DCOMPOUNDPROPERTIES_HXX +#define INCLUDED_SVX_SDR_PROPERTIES_E3DCOMPOUNDPROPERTIES_HXX + +#include <sdr/properties/e3dproperties.hxx> + + +namespace sdr +{ + namespace properties + { + class E3dCompoundProperties : public E3dProperties + { + protected: + // Called after ItemChange() is done for all items. + virtual void PostItemChange(const sal_uInt16 nWhich) override; + + public: + // basic constructor + explicit E3dCompoundProperties(SdrObject& rObj); + + // constructor for copying, but using new object + E3dCompoundProperties(const E3dCompoundProperties& rProps, SdrObject& rObj); + + // destructor + virtual ~E3dCompoundProperties() override; + + // Clone() operator, normally just calls the local copy constructor + virtual std::unique_ptr<BaseProperties> Clone(SdrObject& rObj) const override; + + // Get merged ItemSet. Normally, this maps directly to GetObjectItemSet(), but may + // be overridden 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 + // SfxItemState::DONTCARE which means there were several such items with different + // values. + virtual const SfxItemSet& GetMergedItemSet() const override; + + // Set merged ItemSet. Normally, this maps to SetObjectItemSet(). + virtual void SetMergedItemSet(const SfxItemSet& rSet, bool bClearAllItems = false) override; + }; + } // end of namespace properties +} // end of namespace sdr + + +#endif // INCLUDED_SVX_SDR_PROPERTIES_E3DCOMPOUNDPROPERTIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/properties/e3dextrudeproperties.hxx b/svx/inc/sdr/properties/e3dextrudeproperties.hxx new file mode 100644 index 000000000..b614a9082 --- /dev/null +++ b/svx/inc/sdr/properties/e3dextrudeproperties.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 INCLUDED_SVX_INC_SDR_PROPERTIES_E3DEXTRUDEPROPERTIES_HXX +#define INCLUDED_SVX_INC_SDR_PROPERTIES_E3DEXTRUDEPROPERTIES_HXX + +#include <sdr/properties/e3dcompoundproperties.hxx> + + +namespace sdr +{ + namespace properties + { + class E3dExtrudeProperties final : public E3dCompoundProperties + { + // Called after ItemChange() is done for all items. + virtual void PostItemChange(const sal_uInt16 nWhich) override; + + public: + // basic constructor + explicit E3dExtrudeProperties(SdrObject& rObj); + + // constructor for copying, but using new object + E3dExtrudeProperties(const E3dExtrudeProperties& rProps, SdrObject& rObj); + + // destructor + virtual ~E3dExtrudeProperties() override; + + // Clone() operator, normally just calls the local copy constructor + virtual std::unique_ptr<BaseProperties> Clone(SdrObject& rObj) const override; + }; + } // end of namespace properties +} // end of namespace sdr + + +#endif // INCLUDED_SVX_INC_SDR_PROPERTIES_E3DEXTRUDEPROPERTIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/properties/e3dlatheproperties.hxx b/svx/inc/sdr/properties/e3dlatheproperties.hxx new file mode 100644 index 000000000..8b8030052 --- /dev/null +++ b/svx/inc/sdr/properties/e3dlatheproperties.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 INCLUDED_SVX_INC_SDR_PROPERTIES_E3DLATHEPROPERTIES_HXX +#define INCLUDED_SVX_INC_SDR_PROPERTIES_E3DLATHEPROPERTIES_HXX + +#include <sdr/properties/e3dcompoundproperties.hxx> + + +namespace sdr +{ + namespace properties + { + class E3dLatheProperties final : public E3dCompoundProperties + { + // Called after ItemChange() is done for all items. + virtual void PostItemChange(const sal_uInt16 nWhich) override; + + public: + // basic constructor + explicit E3dLatheProperties(SdrObject& rObj); + + // constructor for copying, but using new object + E3dLatheProperties(const E3dLatheProperties& rProps, SdrObject& rObj); + + // destructor + virtual ~E3dLatheProperties() override; + + // Clone() operator, normally just calls the local copy constructor + virtual std::unique_ptr<BaseProperties> Clone(SdrObject& rObj) const override; + }; + } // end of namespace properties +} // end of namespace sdr + + +#endif // INCLUDED_SVX_INC_SDR_PROPERTIES_E3DLATHEPROPERTIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/properties/e3dproperties.hxx b/svx/inc/sdr/properties/e3dproperties.hxx new file mode 100644 index 000000000..2a6eb0e9e --- /dev/null +++ b/svx/inc/sdr/properties/e3dproperties.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 INCLUDED_SVX_SDR_PROPERTIES_E3DPROPERTIES_HXX +#define INCLUDED_SVX_SDR_PROPERTIES_E3DPROPERTIES_HXX + +#include <sdr/properties/attributeproperties.hxx> + + +namespace sdr +{ + namespace properties + { + class E3dProperties : public AttributeProperties + { + protected: + // create a new itemset + virtual std::unique_ptr<SfxItemSet> CreateObjectSpecificItemSet(SfxItemPool& rPool) override; + + // react on ItemSet changes + virtual void ItemSetChanged(const SfxItemSet& rSet) override; + + public: + // basic constructor + explicit E3dProperties(SdrObject& rObj); + + // constructor for copying, but using new object + E3dProperties(const E3dProperties& rProps, SdrObject& rObj); + + // destructor + virtual ~E3dProperties() override; + + // Clone() operator, normally just calls the local copy constructor + virtual std::unique_ptr<BaseProperties> Clone(SdrObject& rObj) const override; + }; + } // end of namespace properties +} // end of namespace sdr + + +#endif // INCLUDED_SVX_SDR_PROPERTIES_E3DPROPERTIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/properties/e3dsceneproperties.hxx b/svx/inc/sdr/properties/e3dsceneproperties.hxx new file mode 100644 index 000000000..269ecf83d --- /dev/null +++ b/svx/inc/sdr/properties/e3dsceneproperties.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_SVX_INC_SDR_PROPERTIES_E3DSCENEPROPERTIES_HXX +#define INCLUDED_SVX_INC_SDR_PROPERTIES_E3DSCENEPROPERTIES_HXX + +#include <sdr/properties/e3dproperties.hxx> + + +namespace sdr +{ + namespace properties + { + class E3dSceneProperties final : public E3dProperties + { + // Called after ItemChange() is done for all items. + virtual void PostItemChange(const sal_uInt16 nWhich) override; + + public: + // basic constructor + explicit E3dSceneProperties(SdrObject& rObj); + + // constructor for copying, but using new object + E3dSceneProperties(const E3dSceneProperties& rProps, SdrObject& rObj); + + // destructor + virtual ~E3dSceneProperties() override; + + // Clone() operator, normally just calls the local copy constructor + virtual std::unique_ptr<BaseProperties> Clone(SdrObject& rObj) const override; + + // get merged ItemSet. Normally, this maps directly to GetObjectItemSet(), but may + // be overridden 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 + // SfxItemState::DONTCARE which means there were several such items with different + // values. + virtual const SfxItemSet& GetMergedItemSet() const override; + + // Set merged ItemSet. Normally, this maps to SetObjectItemSet(). + virtual void SetMergedItemSet(const SfxItemSet& rSet, bool bClearAllItems = false) override; + + // Set a single item, iterate over hierarchies if necessary. + virtual void SetMergedItem(const SfxPoolItem& rItem) override; + + // Clear a single item, iterate over hierarchies if necessary. + virtual void ClearMergedItem(const sal_uInt16 nWhich) override; + + // set a new StyleSheet and broadcast + virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr) override; + + // get the installed StyleSheet + virtual SfxStyleSheet* GetStyleSheet() const override; + + // Special for scene: + void SetSceneItemsFromCamera(); + }; + } // end of namespace properties +} // end of namespace sdr + + +#endif // INCLUDED_SVX_INC_SDR_PROPERTIES_E3DSCENEPROPERTIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/properties/e3dsphereproperties.hxx b/svx/inc/sdr/properties/e3dsphereproperties.hxx new file mode 100644 index 000000000..b1ef923cb --- /dev/null +++ b/svx/inc/sdr/properties/e3dsphereproperties.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 INCLUDED_SVX_INC_SDR_PROPERTIES_E3DSPHEREPROPERTIES_HXX +#define INCLUDED_SVX_INC_SDR_PROPERTIES_E3DSPHEREPROPERTIES_HXX + +#include <sdr/properties/e3dcompoundproperties.hxx> + + +namespace sdr +{ + namespace properties + { + class E3dSphereProperties final : public E3dCompoundProperties + { + // Called after ItemChange() is done for all items. + virtual void PostItemChange(const sal_uInt16 nWhich) override; + + public: + // basic constructor + explicit E3dSphereProperties(SdrObject& rObj); + + // constructor for copying, but using new object + E3dSphereProperties(const E3dSphereProperties& rProps, SdrObject& rObj); + + // destructor + virtual ~E3dSphereProperties() override; + + // Clone() operator, normally just calls the local copy constructor + virtual std::unique_ptr<BaseProperties> Clone(SdrObject& rObj) const override; + }; + } // end of namespace properties +} // end of namespace sdr + + +#endif // INCLUDED_SVX_INC_SDR_PROPERTIES_E3DSPHEREPROPERTIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/properties/emptyproperties.hxx b/svx/inc/sdr/properties/emptyproperties.hxx new file mode 100644 index 000000000..734f7be37 --- /dev/null +++ b/svx/inc/sdr/properties/emptyproperties.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 INCLUDED_SVX_SDR_PROPERTIES_EMPTYPROPERTIES_HXX +#define INCLUDED_SVX_SDR_PROPERTIES_EMPTYPROPERTIES_HXX + +#include <sal/config.h> + +#include <memory> + +#include <svx/sdr/properties/properties.hxx> +#include <svl/itemset.hxx> + + +namespace sdr +{ + namespace properties + { + class EmptyProperties : public BaseProperties + { + protected: + // the to be used ItemSet + std::unique_ptr<SfxItemSet> mpEmptyItemSet; + + // create a new itemset + virtual std::unique_ptr<SfxItemSet> CreateObjectSpecificItemSet(SfxItemPool& rPool) override; + + // test changeability for a single item + virtual bool AllowItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = nullptr) const override; + + // Do the ItemChange, may do special handling + virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = nullptr) override; + + // Called after ItemChange() is done for all items. + virtual void PostItemChange(const sal_uInt16 nWhich) override; + + // react on ItemSet changes + virtual void ItemSetChanged(const SfxItemSet& rSet) override; + + public: + // basic constructor + explicit EmptyProperties(SdrObject& rObj); + + // Clone() operator, normally just calls the local copy constructor + virtual std::unique_ptr<BaseProperties> Clone(SdrObject& rObj) const override; + + // get itemset + virtual const SfxItemSet& GetObjectItemSet() const override; + + // set single item + virtual void SetObjectItem(const SfxPoolItem& rItem) override; + + // set single item direct, do not do any notifies or things like that + virtual void SetObjectItemDirect(const SfxPoolItem& rItem) override; + + // clear single item + virtual void ClearObjectItem(const sal_uInt16 nWhich = 0) override; + + // clear single item direct, do not do any notifies or things like that. + // Also supports complete deletion of items when default parameter 0 is used. + virtual void ClearObjectItemDirect(const sal_uInt16 nWhich) override; + + // set complete item set + virtual void SetObjectItemSet(const SfxItemSet& rSet) override; + + // set a new StyleSheet and broadcast + virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr) override; + + // get the installed StyleSheet + virtual SfxStyleSheet* GetStyleSheet() const override; + }; + } // end of namespace properties +} // end of namespace sdr + +#endif // INCLUDED_SVX_SDR_PROPERTIES_EMPTYPROPERTIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/properties/graphicproperties.hxx b/svx/inc/sdr/properties/graphicproperties.hxx new file mode 100644 index 000000000..018c76435 --- /dev/null +++ b/svx/inc/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 INCLUDED_SVX_INC_SDR_PROPERTIES_GRAPHICPROPERTIES_HXX +#define INCLUDED_SVX_INC_SDR_PROPERTIES_GRAPHICPROPERTIES_HXX + +#include <sdr/properties/rectangleproperties.hxx> + + +namespace sdr +{ + namespace properties + { + class GraphicProperties final : public RectangleProperties + { + // apply the correct SfyStyleSheet from SdrObject's SdrModel + virtual void applyDefaultStyleSheetFromSdrModel() override; + + // create a new itemset + virtual std::unique_ptr<SfxItemSet> CreateObjectSpecificItemSet(SfxItemPool& rPool) override; + + // react on ItemSet changes + virtual void ItemSetChanged(const SfxItemSet& rSet) override; + + public: + // basic constructor + explicit GraphicProperties(SdrObject& rObj); + + // constructor for copying, but using new object + GraphicProperties(const GraphicProperties& rProps, SdrObject& rObj); + + // destructor + virtual ~GraphicProperties() override; + + // Clone() operator, normally just calls the local copy constructor + virtual std::unique_ptr<BaseProperties> Clone(SdrObject& rObj) const override; + + // set a new StyleSheet and broadcast + virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr) override; + + // force default attributes for a specific object type, called from + // DefaultProperties::GetObjectItemSet() if a new ItemSet is created + virtual void ForceDefaultAttributes() override; + }; + } // end of namespace properties +} // end of namespace sdr + + +#endif // INCLUDED_SVX_INC_SDR_PROPERTIES_GRAPHICPROPERTIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/properties/groupproperties.hxx b/svx/inc/sdr/properties/groupproperties.hxx new file mode 100644 index 000000000..412881708 --- /dev/null +++ b/svx/inc/sdr/properties/groupproperties.hxx @@ -0,0 +1,115 @@ +/* -*- 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_INC_SDR_PROPERTIES_GROUPPROPERTIES_HXX +#define INCLUDED_SVX_INC_SDR_PROPERTIES_GROUPPROPERTIES_HXX + +#include <svx/sdr/properties/defaultproperties.hxx> + + +namespace sdr +{ + namespace properties + { + class GroupProperties final : public DefaultProperties + { + // create a new itemset + virtual std::unique_ptr<SfxItemSet> CreateObjectSpecificItemSet(SfxItemPool& rPool) override; + + // test changeability for a single item + virtual bool AllowItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = nullptr) const override; + + // Do the ItemChange, may do special handling + virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = nullptr) override; + + // Called after ItemChange() is done for all items. + virtual void PostItemChange(const sal_uInt16 nWhich) override; + + // react on ItemSet changes + virtual void ItemSetChanged(const SfxItemSet& rSet) override; + + public: + // basic constructor + explicit GroupProperties(SdrObject& rObj); + + // copy constructor + GroupProperties(const GroupProperties& rProps, SdrObject& rObj); + + // destructor + virtual ~GroupProperties() override; + + // Clone() operator, normally just calls the local copy constructor + virtual std::unique_ptr<BaseProperties> Clone(SdrObject& rObj) const override; + + // get itemset + virtual const SfxItemSet& GetObjectItemSet() const override; + + // get merged ItemSet. Normally, this maps directly to GetObjectItemSet(), but may + // be overridden 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 + // SfxItemState::DONTCARE which means there were several such items with different + // values. + virtual const SfxItemSet& GetMergedItemSet() const override; + + // Set merged ItemSet. Normally, this maps to SetObjectItemSet(). + virtual void SetMergedItemSet(const SfxItemSet& rSet, bool bClearAllItems = false) override; + + // set single item + virtual void SetObjectItem(const SfxPoolItem& rItem) override; + + // set single item direct, do not do any notifies or things like that + virtual void SetObjectItemDirect(const SfxPoolItem& rItem) override; + + // clear single item + virtual void ClearObjectItem(const sal_uInt16 nWhich = 0) override; + + // clear single item direct, do not do any notifies or things like that. + // Also supports complete deletion of items when default parameter 0 is used. + virtual void ClearObjectItemDirect(const sal_uInt16 nWhich) override; + + // Set a single item, iterate over hierarchies if necessary. + virtual void SetMergedItem(const SfxPoolItem& rItem) override; + + // Clear a single item, iterate over hierarchies if necessary. + virtual void ClearMergedItem(const sal_uInt16 nWhich) override; + + // set complete item set + virtual void SetObjectItemSet(const SfxItemSet& rSet) override; + + // set a new StyleSheet + virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr) override; + + // get the local StyleSheet + virtual SfxStyleSheet* GetStyleSheet() const override; + + // force default attributes for a specific object type, called from + // DefaultProperties::GetObjectItemSet() if a new ItemSet is created + virtual void ForceDefaultAttributes() override; + + // force all attributes which come from styles to hard attributes + // to be able to live without the style. + virtual void ForceStyleToHardAttributes() override; + }; + } // end of namespace properties +} // end of namespace sdr + + +#endif // INCLUDED_SVX_INC_SDR_PROPERTIES_GROUPPROPERTIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/properties/itemsettools.hxx b/svx/inc/sdr/properties/itemsettools.hxx new file mode 100644 index 000000000..4559f8f2e --- /dev/null +++ b/svx/inc/sdr/properties/itemsettools.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 INCLUDED_SVX_INC_SDR_PROPERTIES_ITEMSETTOOLS_HXX +#define INCLUDED_SVX_INC_SDR_PROPERTIES_ITEMSETTOOLS_HXX + +#include <sal/types.h> +#include <tools/gen.hxx> +#include <vector> + +class SdrObject; +class SfxItemSet; +class Fraction; + +// class to remember broadcast start positions +namespace sdr +{ + namespace properties + { + class ItemChangeBroadcaster + { + std::vector< tools::Rectangle > maRectangles; + + public: + explicit ItemChangeBroadcaster(const SdrObject& rObj); + + sal_uInt32 GetRectangleCount() const + { + return maRectangles.size(); + } + const tools::Rectangle& GetRectangle(sal_uInt32 nIndex) const + { + return maRectangles[nIndex]; + } + }; + } // 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 // INCLUDED_SVX_INC_SDR_PROPERTIES_ITEMSETTOOLS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/properties/measureproperties.hxx b/svx/inc/sdr/properties/measureproperties.hxx new file mode 100644 index 000000000..70f3812e3 --- /dev/null +++ b/svx/inc/sdr/properties/measureproperties.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 INCLUDED_SVX_INC_SDR_PROPERTIES_MEASUREPROPERTIES_HXX +#define INCLUDED_SVX_INC_SDR_PROPERTIES_MEASUREPROPERTIES_HXX + +#include <sdr/properties/textproperties.hxx> + + +namespace sdr +{ + namespace properties + { + class MeasureProperties final : public TextProperties + { + // create a new itemset + virtual std::unique_ptr<SfxItemSet> CreateObjectSpecificItemSet(SfxItemPool& rPool) override; + + // react on ItemSet changes + virtual void ItemSetChanged(const SfxItemSet& rSet) override; + + public: + // basic constructor + explicit MeasureProperties(SdrObject& rObj); + + // constructor for copying, but using new object + MeasureProperties(const MeasureProperties& rProps, SdrObject& rObj); + + // destructor + virtual ~MeasureProperties() override; + + // Clone() operator, normally just calls the local copy constructor + virtual std::unique_ptr<BaseProperties> Clone(SdrObject& rObj) const override; + + // set a new StyleSheet and broadcast + virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr) override; + + // force default attributes for a specific object type, called from + // DefaultProperties::GetObjectItemSet() if a new ItemSet is created + virtual void ForceDefaultAttributes() override; + }; + } // end of namespace properties +} // end of namespace sdr + + +#endif // INCLUDED_SVX_INC_SDR_PROPERTIES_MEASUREPROPERTIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/properties/oleproperties.hxx b/svx/inc/sdr/properties/oleproperties.hxx new file mode 100644 index 000000000..49629be3d --- /dev/null +++ b/svx/inc/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 INCLUDED_SVX_INC_SDR_PROPERTIES_OLEPROPERTIES_HXX +#define INCLUDED_SVX_INC_SDR_PROPERTIES_OLEPROPERTIES_HXX + +#include <sdr/properties/rectangleproperties.hxx> + + +namespace sdr +{ + namespace properties + { + class OleProperties final : public RectangleProperties + { + // apply the correct SfyStyleSheet from SdrObject's SdrModel + virtual void applyDefaultStyleSheetFromSdrModel() override; + + public: + // basic constructor + explicit OleProperties(SdrObject& rObj); + + // constructor for copying, but using new object + OleProperties(const OleProperties& rProps, SdrObject& rObj); + + // destructor + virtual ~OleProperties() override; + + // Clone() operator, normally just calls the local copy constructor + virtual std::unique_ptr<BaseProperties> Clone(SdrObject& rObj) const override; + + // force default attributes for a specific object type, called from + // DefaultProperties::GetObjectItemSet() if a new ItemSet is created + virtual void ForceDefaultAttributes() override; + }; + } // end of namespace properties +} // end of namespace sdr + + +#endif // INCLUDED_SVX_INC_SDR_PROPERTIES_OLEPROPERTIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/properties/pageproperties.hxx b/svx/inc/sdr/properties/pageproperties.hxx new file mode 100644 index 000000000..1aab9c2f6 --- /dev/null +++ b/svx/inc/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 INCLUDED_SVX_INC_SDR_PROPERTIES_PAGEPROPERTIES_HXX +#define INCLUDED_SVX_INC_SDR_PROPERTIES_PAGEPROPERTIES_HXX + +#include <sdr/properties/emptyproperties.hxx> + + +namespace sdr +{ + namespace properties + { + class PageProperties final : public EmptyProperties + { + // create a new object specific itemset with object specific ranges. + virtual std::unique_ptr<SfxItemSet> CreateObjectSpecificItemSet(SfxItemPool& pPool) override; + + // Do the ItemChange, may do special handling + virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = nullptr) override; + + // Called after ItemChange() is done for all items. + virtual void PostItemChange(const sal_uInt16 nWhich) override; + + public: + // basic constructor + explicit PageProperties(SdrObject& rObj); + + // constructor for copying, but using new object + PageProperties(const PageProperties& rProps, SdrObject& rObj); + + // destructor + virtual ~PageProperties() override; + + // Clone() operator, normally just calls the local copy constructor + virtual std::unique_ptr<BaseProperties> Clone(SdrObject& rObj) const override; + + // get itemset. Override here to allow creating the empty itemset + // without asserting + virtual const SfxItemSet& GetObjectItemSet() const override; + + // get the installed StyleSheet + virtual SfxStyleSheet* GetStyleSheet() const override; + + // set the installed StyleSheet + virtual void SetStyleSheet(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr) override; + + // clear single item + virtual void ClearObjectItem(const sal_uInt16 nWhich = 0) override; + }; + } // end of namespace properties +} // end of namespace sdr + + +#endif // INCLUDED_SVX_INC_SDR_PROPERTIES_PAGEPROPERTIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/properties/rectangleproperties.hxx b/svx/inc/sdr/properties/rectangleproperties.hxx new file mode 100644 index 000000000..5512ffb5b --- /dev/null +++ b/svx/inc/sdr/properties/rectangleproperties.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 INCLUDED_SVX_SDR_PROPERTIES_RECTANGLEPROPERTIES_HXX +#define INCLUDED_SVX_SDR_PROPERTIES_RECTANGLEPROPERTIES_HXX + +#include <sdr/properties/textproperties.hxx> + + +namespace sdr +{ + namespace properties + { + class RectangleProperties : public TextProperties + { + protected: + // react on ItemSet changes + virtual void ItemSetChanged(const SfxItemSet& rSet) override; + + public: + // basic constructor + explicit RectangleProperties(SdrObject& rObj); + + // constructor for copying, but using new object + RectangleProperties(const RectangleProperties& rProps, SdrObject& rObj); + + // destructor + virtual ~RectangleProperties() override; + + // Clone() operator, normally just calls the local copy constructor + virtual std::unique_ptr<BaseProperties> Clone(SdrObject& rObj) const override; + + // set a new StyleSheet and broadcast + virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr) override; + }; + } // end of namespace properties +} // end of namespace sdr + + +#endif // INCLUDED_SVX_SDR_PROPERTIES_RECTANGLEPROPERTIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/properties/textproperties.hxx b/svx/inc/sdr/properties/textproperties.hxx new file mode 100644 index 000000000..5e6482a4f --- /dev/null +++ b/svx/inc/sdr/properties/textproperties.hxx @@ -0,0 +1,90 @@ +/* -*- 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_SDR_PROPERTIES_TEXTPROPERTIES_HXX +#define INCLUDED_SVX_SDR_PROPERTIES_TEXTPROPERTIES_HXX + +#include <svx/itextprovider.hxx> +#include <sdr/properties/attributeproperties.hxx> + + +namespace sdr +{ + namespace properties + { + class TextProperties : public AttributeProperties + { + private: + // #i101556# versioning support + sal_uInt32 maVersion; + + protected: + // create a new itemset + virtual std::unique_ptr<SfxItemSet> CreateObjectSpecificItemSet(SfxItemPool& rPool) override; + + // Do the ItemChange, may do special handling + virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = nullptr) override; + + // react on ItemSet changes + virtual void ItemSetChanged(const SfxItemSet& rSet) override; + + /// 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() override; + + // Clone() operator, normally just calls the local copy constructor + virtual std::unique_ptr<BaseProperties> Clone(SdrObject& rObj) const override; + + // set a new StyleSheet and broadcast + virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr) override; + + // force default attributes for a specific object type, called from + // DefaultProperties::GetObjectItemSet() if a new ItemSet is created + virtual void ForceDefaultAttributes() override; + + // force all attributes which come from styles to hard attributes + // to be able to live without the style. + virtual void ForceStyleToHardAttributes() override; + + // This is the notifier from SfxListener + virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override; + + // 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 override; + }; + } // end of namespace properties +} // end of namespace sdr + + +#endif // INCLUDED_SVX_SDR_PROPERTIES_TEXTPROPERTIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |