23#include <rtl/ustrbuf.hxx>
33#include <svx/strings.hrc>
66 virtual void Closed()
override;
68 virtual ::sfx2::SvBaseLink::UpdateResult
DataChanged(
69 const OUString& rMimeType,
const uno::Any & rValue )
override;
82 const OUString& rMimeType,
const uno::Any & rValue )
87 if( pLinkManager && rValue.
hasValue() )
111 SvBaseLink::Closed();
116 return std::make_unique<sdr::properties::GraphicProperties>(*
this);
124 return std::make_unique<sdr::contact::ViewContactOfGraphic>(*
this);
135 auto const & rVectorGraphicDataPtr =
mpGraphicObject->GetGraphic().getVectorGraphicData();
137 if (!rVectorGraphicDataPtr)
143 if (rVectorGraphicDataPtr->getType() == VectorGraphicDataType::Pdf)
146 const std::deque<uno::Reference<graphic::XPrimitive2D>>& rContainer(rVectorGraphicDataPtr->getPrimitive2DSequence());
148 if (rContainer.empty())
154 aProcessor.
process(rContainer);
162 OUString aTitle = pResult->
getTitle();
163 OUString aDesc = pResult->
getDesc();
170 if(!aTitle.isEmpty())
184 ,pGraphicLink(nullptr)
186 ,mbIsSignatureLine(false)
187 ,mbIsSignatureLineShowSignDate(true)
188 ,mbIsSignatureLineCanAddComment(false)
189 ,mbSignatureLineIsSigned(false)
208 ,pGraphicLink(nullptr)
265 ,pGraphicLink(nullptr)
267 ,mbIsSignatureLine(false)
268 ,mbIsSignatureLineShowSignDate(true)
269 ,mbIsSignatureLineCanAddComment(false)
270 ,mbSignatureLineIsSigned(false)
291 ,pGraphicLink(nullptr)
293 ,mbIsSignatureLine(false)
294 ,mbIsSignatureLineShowSignDate(true)
295 ,mbIsSignatureLineCanAddComment(false)
296 ,mbSignatureLineIsSigned(false)
338 auto const & rVectorGraphicDataPtr =
mpGraphicObject->GetGraphic().getVectorGraphicData();
340 if (rVectorGraphicDataPtr)
344 else if (
mpGraphicObject->GetGraphic().GetType() == GraphicType::GdiMetafile)
409 GraphicType::NONE !=
eType )
425 bool bHMirr = nMirrorCase == 2 || nMirrorCase == 4;
426 bool bVMirr = nMirrorCase == 3 || nMirrorCase == 4;
428 aActAttr.
SetMirrorFlags( ( bHMirr ? BmpMirrorFlags::Horizontal : BmpMirrorFlags::NONE ) | ( bVMirr ? BmpMirrorFlags::Vertical : BmpMirrorFlags::NONE ) );
460 if( rGraphicStreamURL.isEmpty() )
491 aSize =
Size(aCroppedWidth, aCroppedHeight);
511 if( pLinkManager !=
nullptr &&
pGraphicLink ==
nullptr )
549 aGraphic.setOriginURL(
"");
604 auto const & rVectorGraphicDataPtr =
mpGraphicObject->GetGraphic().getVectorGraphicData();
606 OUStringBuffer
sName;
608 if (rVectorGraphicDataPtr)
610 switch (rVectorGraphicDataPtr->getType())
612 case VectorGraphicDataType::Svg:
617 case VectorGraphicDataType::Wmf:
622 case VectorGraphicDataType::Emf:
627 case VectorGraphicDataType::Pdf:
638 case GraphicType::Bitmap:
641 (
IsLinkedGraphic() ? STR_ObjNameSingulGRAFBMPTRANSLNK : STR_ObjNameSingulGRAFBMPTRANS ) :
642 (
IsLinkedGraphic() ? STR_ObjNameSingulGRAFBMPLNK : STR_ObjNameSingulGRAFBMP ) );
648 case GraphicType::GdiMetafile:
652 case GraphicType::NONE:
664 if (!
aName.isEmpty())
669 return sName.makeStringAndClear();
677 auto const & rVectorGraphicDataPtr =
mpGraphicObject->GetGraphic().getVectorGraphicData();
679 OUStringBuffer
sName;
681 if (rVectorGraphicDataPtr)
683 switch (rVectorGraphicDataPtr->getType())
685 case VectorGraphicDataType::Svg:
690 case VectorGraphicDataType::Wmf:
695 case VectorGraphicDataType::Emf:
700 case VectorGraphicDataType::Pdf:
711 case GraphicType::Bitmap:
714 (
IsLinkedGraphic() ? STR_ObjNamePluralGRAFBMPTRANSLNK : STR_ObjNamePluralGRAFBMPTRANS ) :
715 (
IsLinkedGraphic() ? STR_ObjNamePluralGRAFBMPLNK : STR_ObjNamePluralGRAFBMP ) );
721 case GraphicType::GdiMetafile:
725 case GraphicType::NONE:
737 if (!
aName.isEmpty())
742 return sName.makeStringAndClear();
776 tempList.
MoveTo(rHdlList);
786 if( bMirrX != bMirrY )
798 return std::make_unique<SdrGrafObjGeoData>();
817 const bool bRemove(pNewPage ==
nullptr && pOldPage !=
nullptr);
818 const bool bInsert(pNewPage !=
nullptr && pOldPage ==
nullptr);
864 pOut->EnableOutput(
false);
870 aRetval.
Move(-aBoundRect.
Left(), -aBoundRect.
Top());
887 rGraphicType = GraphicType::GdiMetafile;
890 else if (GraphicType::GdiMetafile == rGraphicType)
904 case GraphicType::GdiMetafile:
913 if(aFilter.
DoImport(aMtf, *pGrp->GetSubList(), 0))
943 pRetval = pRetval->DoConvertToPolyObj(bBezier, bAddText);
967 pGrp =
dynamic_cast< SdrObjGroup*
>(pRetval.get());
973 pGrp->GetSubList()->NbcInsertObject(pRetval.get());
976 pGrp->GetSubList()->NbcInsertObject(pLineFill.get(), 0);
986 case GraphicType::Bitmap:
1002 pRetval->SetMergedItemSet(aSet);
1006 case GraphicType::NONE:
1007 case GraphicType::Default:
1045 aGrafInfo.
SetCrop( rCrop.GetLeft(), rCrop.GetTop(), rCrop.GetRight(), rCrop.GetBottom() );
1055 if (
mpGraphicObject->GetPrefMapMode().GetMapUnit() == MapUnit::MapPixel)
1060 MapMode( MapUnit::Map100thMM ) );
1068 if ( (!bShrinkOnly ||
1073 float fGrfWH =
static_cast<float>(aSize.
Width()) /
1074 static_cast<float>(aSize.
Height());
1075 float fWinWH =
static_cast<float>(aMaxSize.
Width()) /
1076 static_cast<float>(aMaxSize.
Height());
1079 if ( fGrfWH < fWinWH )
1084 else if ( fGrfWH > 0.F )
1090 aPos = rMaxRect.
Center();
1112 uno::Reference<io::XInputStream>
xStream;
1119 const void* pSourceData =
static_cast<const void*
>(aLink.
GetData());
1120 if( nSize && pSourceData )
1123 memcpy( pBuffer, pSourceData, nSize );
1150 double fShearX(0.0), fRotate(0.0);
1156 aMatrix.
decompose(aScale, aTranslate, fRotate, fShearX);
1174 if(rCrop.GetLeft() || rCrop.GetTop() || rCrop.GetRight() ||rCrop.GetBottom())
1178 double fLclRotate, fLclShearX;
1180 aMatrix.
decompose(aScale, aTranslate, fLclRotate, fLclShearX);
1192 rCrop.GetBottom()));
1195 const double fCropLeft(rCrop.GetLeft() * aCropScaleFactor.
getX());
1196 const double fCropTop(rCrop.GetTop() * aCropScaleFactor.
getY());
1197 const double fCropRight(rCrop.GetRight() * aCropScaleFactor.
getX());
1198 const double fCropBottom(rCrop.GetBottom() * aCropScaleFactor.
getY());
1215 aPreMultiply.
scale(-1.0, 1.0);
1218 aMatrixForCropViewHdl = aMatrixForCropViewHdl * aPreMultiply;
1222 std::make_unique<SdrCropViewHdl>(
1223 aMatrixForCropViewHdl,
static OutputDevice * GetDefaultDevice()
sal_Int32 GetNumerator() const
The transformation of a rectangle into a polygon, by using angle parameters from GeoStat.
double mfCosRotationAngle
double mfSinRotationAngle
Degree100 m_nRotationAngle
const sal_uInt8 * GetData() const
sal_uInt32 GetDataSize() const
void SetGamma(double fGamma)
tools::Long GetTopCrop() const
void SetRotation(Degree10 nRotate10)
void SetChannelR(short nChannelRPercent)
tools::Long GetBottomCrop() const
tools::Long GetRightCrop() const
void SetMirrorFlags(BmpMirrorFlags nMirrFlags)
void SetContrast(short nContrastPercent)
void SetChannelB(short nChannelBPercent)
void SetCrop(tools::Long nLeft_100TH_MM, tools::Long nTop_100TH_MM, tools::Long nRight_100TH_MM, tools::Long nBottom_100TH_MM)
void SetInvert(bool bInvert)
void SetDrawMode(GraphicDrawMode eDrawMode)
void SetLuminance(short nLuminancePercent)
tools::Long GetLeftCrop() const
void SetAlpha(sal_uInt8 cAlpha)
void SetChannelG(short nChannelGPercent)
Graphic GetTransformedGraphic(const Size &rDestSize, const MapMode &rDestMap, const GraphicAttr &rAttr) const
OUString getOriginURL() const
const GDIMetaFile & GetGDIMetaFile() const
GfxLink GetGfxLink() const
const std::shared_ptr< VectorGraphicData > & getVectorGraphicData() const
void setOriginURL(OUString const &rOriginURL)
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
This class represents an embedded or linked bitmap graphic object.
OUString maSignatureLineSigningInstructions
MapMode GetGrafPrefMapMode() const
virtual rtl::Reference< SdrObject > CloneSdrObject(SdrModel &rTargetModel) const override
virtual std::unique_ptr< sdr::properties::BaseProperties > CreateObjectSpecificProperties() override
OUString maSignatureLineId
bool mbGrafAnimationAllowed
virtual std::unique_ptr< SdrObjGeoData > NewGeoData() const override
A derived class must override these 3 methods if it has own geometric data that must be saved for Und...
bool mbSignatureLineIsSigned
virtual void handlePageChange(SdrPage *pOldPage, SdrPage *pNewPage) override
GraphicAttr GetGraphicAttr(SdrGrafObjTransformsAttrs nTransformFlags=SdrGrafObjTransformsAttrs::ALL) const
virtual void AdjustToMaxRect(const tools::Rectangle &rMaxRect, bool bShrinkOnly=false) override
bool IsLinkedGraphic() const
bool HasGDIMetaFile() const
void SetGraphicObject(const GraphicObject &rGrfObj)
bool mbIsSignatureLineShowSignDate
const GraphicObject * GetReplacementGraphicObject() const
virtual OUString TakeObjNamePlural() const override
virtual rtl::Reference< SdrObject > getFullDragClone() const override
virtual std::unique_ptr< sdr::contact::ViewContact > CreateObjectSpecificViewContact() override
std::unique_ptr< GraphicObject > mpReplacementGraphicObject
SdrGrafObj(SdrModel &rSdrModel)
virtual sal_uInt32 GetHdlCount() const override
Via GetHdlCount the number of Handles can be retrieved.
OUString maSignatureLineSuggestedSignerEmail
virtual SdrObjKind GetObjIdentifier() const override
GDIMetaFile getMetafileFromEmbeddedVectorGraphicData() const
Graphic GetTransformedGraphic(SdrGrafObjTransformsAttrs nTransformFlags=SdrGrafObjTransformsAttrs::ALL) const
virtual ~SdrGrafObj() override
const Graphic & GetGraphic() const
OUString maSignatureLineSuggestedSignerTitle
void SetGraphic(const Graphic &rGrf)
void ImpSetAttrToGrafInfo()
std::unique_ptr< GraphicObject > mpGraphicObject
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact) override
virtual void RestoreGeoData(const SdrObjGeoData &rGeo) override
virtual void addCropHandles(SdrHdlList &rTarget) const override
void ReleaseGraphicLink()
void ImpSetLinkedGraphic(const Graphic &rGraphic)
SdrGraphicLink * pGraphicLink
OUString maSignatureLineSuggestedSignerName
virtual void TakeObjInfo(SdrObjTransformInfoRec &rInfo) const override
std::unique_ptr< css::drawing::BarCode > mpBarCode
void SetMirrored(bool _bMirrored)
GraphicType GetGraphicType() const
void SetGrafStreamURL(const OUString &rGraphicStreamURL)
virtual rtl::Reference< SdrObject > DoConvertToPolyObj(bool bBezier, bool bAddText) const override
virtual void AddToHdlList(SdrHdlList &rHdlList) const override
css::uno::Reference< css::graphic::XGraphic > mpSignatureLineUnsignedGraphic
virtual OUString TakeObjNameSingul() const override
void SetGrafAnimationAllowed(bool bNew)
virtual void SaveGeoData(SdrObjGeoData &rGeo) const override
Size GetGrafPrefSize() const
GDIMetaFile GetMetaFile(GraphicType &rGraphicType) const
void SetGraphicLink(const OUString &rFileName)
virtual void NbcMirror(const Point &rRef1, const Point &rRef2) override
const GraphicObject & GetGraphicObject(bool bForceSwapIn=false) const
void NbcSetGraphic(const Graphic &rGrf)
OUString const & GetGrafStreamURL() const
bool isEmbeddedVectorGraphicData() const
bool mbIsSignatureLineCanAddComment
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Detects when a stylesheet is changed.
friend class SdrGraphicLink
css::uno::Reference< css::io::XInputStream > getInputStream() const
Size getOriginalSize() const
SdrGraphicLink(SdrGrafObj &rObj)
virtual void Closed() override
virtual ::sfx2::SvBaseLink::UpdateResult DataChanged(const OUString &rMimeType, const uno::Any &rValue) override
void MoveTo(SdrHdlList &rOther)
std::unique_ptr< SdrHdl > RemoveHdl(size_t nNum)
virtual void SetChanged(bool bFlg=true)
sfx2::LinkManager * GetLinkManager()
All geometrical data of an arbitrary object for use in undo/redo.
void FlattenGroups()
Makes the object list flat, i.e.
const SfxPoolItem & GetMergedItem(const sal_uInt16 nWhich) const
void ActionChanged() const
bool mbLineIsOutsideGeometry
bool LineGeometryUsageIsNecessary() const
void BroadcastObjectChange() const
virtual void SetTitle(const OUString &rStr)
bool mbSupportTextIndentingOnLineWidthChange
virtual void SetDescription(const OUString &rStr)
void SingleObjectPainter(OutputDevice &rOut) const
const SfxPoolItem & GetObjectItem(const sal_uInt16 nWhich) const
virtual const tools::Rectangle & GetCurrentBoundRect() const
SdrModel & getSdrModelFromSdrObject() const
virtual void SetLogicRect(const tools::Rectangle &rRect)
virtual const OUString & GetName() const
virtual void SetChanged()
virtual SdrLayerID GetLayer() const
virtual void SetName(const OUString &rStr, const bool bSetChanged=true)
virtual void SetBoundAndSnapRectsDirty(bool bNotMyself=false, bool bRecursive=true)
const SfxItemSet & GetObjectItemSet() const
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
Rectangle objects (rectangle, circle, ...)
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact) override
virtual rtl::Reference< SdrObject > DoConvertToPolyObj(bool bBezier, bool bAddText) const override
virtual void AddToHdlList(SdrHdlList &rHdlList) const override
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Detects when a stylesheet is changed.
virtual void RestoreGeoData(const SdrObjGeoData &rGeo) override
virtual void NbcMirror(const Point &rRef1, const Point &rRef2) override
virtual void SaveGeoData(SdrObjGeoData &rGeo) const override
tools::Rectangle const & getRectangle() const
virtual const tools::Rectangle & GetLogicRect() const override
virtual void handlePageChange(SdrPage *pOldPage, SdrPage *pNewPage) override
virtual rtl::Reference< SdrObject > getFullDragClone() const override
const GeoStat & GetGeoStat() const
rtl::Reference< SdrObject > ImpConvertAddText(rtl::Reference< SdrObject > pObj, bool bBezier) const
virtual bool TRGetBaseGeometry(basegfx::B2DHomMatrix &rMatrix, basegfx::B2DPolyPolygon &rPolyPolygon) const override
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
constexpr tools::Long getHeight() const
constexpr tools::Long Height() const
constexpr tools::Long getWidth() const
void setWidth(tools::Long nWidth)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
static SotClipboardFormatId GetFormatIdFromMimeType(std::u16string_view rMimeType)
void ObjectOwnsMemory(bool bOwn)
bool decompose(B2DTuple &rScale, B2DTuple &rTranslate, double &rRotate, double &rShearX) const
void translate(double fX, double fY)
void scale(double fX, double fY)
const OUString & getDesc() const
const OUString & getTitle() const
const OUString & getName() const
void process(const primitive2d::Primitive2DContainer &rSource)
void InsertFileLink(sfx2::SvBaseLink &, SvBaseLinkObjectType nFileType, std::u16string_view rFileNm, const OUString *pFilterNm=nullptr, const OUString *pRange=nullptr)
static bool GetDisplayNames(const SvBaseLink *, OUString *pType, OUString *pFile=nullptr, OUString *pLink=nullptr, OUString *pFilter=nullptr)
static SotClipboardFormatId RegisterStatusInfoId()
bool GetGraphicFromAny(std::u16string_view rMimeType, const css::uno::Any &rValue, Graphic &rGrf, weld::Window *pParentWin)
void Remove(SvBaseLink const *pLink)
void SetSynchron(bool bFlag)
SvLinkSource * GetRealObject()
OUString SvxResId(TranslateId aId)
tools::Long FRound(double fVal)
B2DHomMatrix createScaleShearXRotateTranslateB2DHomMatrix(double fScaleX, double fScaleY, double fShearX, double fRadiant, double fTranslateX, double fTranslateY)
B2IRange fround(const B2DRange &rRange)
BitmapEx GetBitmapEx(BitmapEx const &rBitmapEx, DrawModeFlags nDrawMode)
HashMap_OWString_Interface aMap
UNDERLYING_TYPE get() const
constexpr TypedWhichId< SdrGrafGreenItem > SDRATTR_GRAFGREEN(SDRATTR_GRAF_FIRST+1)
constexpr TypedWhichId< SdrGrafLuminanceItem > SDRATTR_GRAFLUMINANCE(SDRATTR_GRAF_FIRST+3)
constexpr TypedWhichId< SdrGrafRedItem > SDRATTR_GRAFRED(SDRATTR_GRAF_FIRST+0)
constexpr TypedWhichId< SdrGrafInvertItem > SDRATTR_GRAFINVERT(SDRATTR_GRAF_FIRST+7)
constexpr TypedWhichId< SdrGrafModeItem > SDRATTR_GRAFMODE(SDRATTR_GRAF_FIRST+8)
constexpr TypedWhichId< SdrGrafContrastItem > SDRATTR_GRAFCONTRAST(SDRATTR_GRAF_FIRST+4)
constexpr TypedWhichId< SdrGrafGamma100Item > SDRATTR_GRAFGAMMA(SDRATTR_GRAF_FIRST+5)
constexpr TypedWhichId< SdrGrafCropItem > SDRATTR_GRAFCROP(SDRATTR_GRAF_FIRST+9)
constexpr TypedWhichId< SdrGrafTransparenceItem > SDRATTR_GRAFTRANSPARENCE(SDRATTR_GRAF_FIRST+6)
constexpr TypedWhichId< SdrGrafBlueItem > SDRATTR_GRAFBLUE(SDRATTR_GRAF_FIRST+2)
@ Graphic
OutlineText, special text object for StarDraw.
SdrGrafObjTransformsAttrs
Options for GetTransformedGraphic()