21#include <com/sun/star/embed/EmbedStates.hpp>
22#include <com/sun/star/embed/XEmbeddedObject.hpp>
23#include <com/sun/star/beans/XPropertySet.hpp>
30#include <svx/svxids.hrc>
35#include <dlgedfunc.hxx>
52#define DEFAUL_MOVE_SIZE 100
60 ForceScroll( m_pParent->PixelToLogic( m_pParent->GetPointerPosPixel() ) );
73 aStartWidth *=
m_pParent->GetMapMode().GetScaleX();
79 aPos.
setX( aPos.
X() * 0.5 );
80 aPos.
setY( aPos.
Y() * 0.5 );
82 aOutRect =
m_pParent->PixelToLogic( aOutRect );
90 ScrollType eH = ScrollType::LineDown,eV = ScrollType::LineDown;
91 if( rPos.
X() < aOutRect.
Left() )
92 eH = ScrollType::LineUp;
93 else if( rPos.
X() <= aOutRect.
Right() )
94 eH = ScrollType::DontKnow;
96 if( rPos.
Y() < aOutRect.
Top() )
97 eV = ScrollType::LineUp;
98 else if( rPos.
Y() <= aOutRect.
Bottom() )
99 eV = ScrollType::DontKnow;
101 if (eH != ScrollType::DontKnow)
105 assert(eH == ScrollType::LineUp || eH == ScrollType::LineDown);
106 rHScroll.
DoScroll(eH == ScrollType::LineUp ? (nCurrentPos - nLineSize) : (nCurrentPos + nLineSize));
109 if (eV != ScrollType::DontKnow)
113 assert(eV == ScrollType::LineUp || eV == ScrollType::LineDown);
114 rVScroll.
DoScroll(eV == ScrollType::LineUp ? (nCurrentPos - nLineSize) : (nCurrentPos + nLineSize));
122 : m_pParent(_pParent)
123 , m_rView(_pParent->getSectionView())
124 , aScrollTimer(
"reportdesign DlgEdFunc aScrollTimer")
125 , m_pOverlappingObj(nullptr)
126 , m_nOverlappedControlColor(0)
128 , m_bSelectionMode(false)
130 , m_bShowPropertyBrowser(false)
147 uno::Reference<report::XReportComponent> xComponent(_xObj, uno::UNO_QUERY_THROW);
148 uno::Reference< beans::XPropertySet > xProp(xComponent, uno::UNO_QUERY_THROW);
154 uno::Any aBlackColorAny(_nColorTRGB);
158 catch(uno::Exception&)
175 bool bHandled =
false;
182 {
"ShowProperties",
uno::Any(
true) }
184 m_pParent->getSectionWindow()->getViewsWindow()->getView()->getReportView()->getController().executeUnChecked(SID_SHOW_PROPERTYBROWSER,aArgs);
185 m_pParent->getSectionWindow()->getViewsWindow()->getView()->getReportView()->UpdatePropertyBrowserDelayed(
m_rView);
211 m_pParent->getSectionWindow()->getViewsWindow()->unmarkAllObjects(
nullptr);
215 m_pParent->getSectionWindow()->getViewsWindow()->unmarkAllObjects(
nullptr);
219 else if( !rMEvt.
IsLeft() )
229 m_pParent->getSectionWindow()->getViewsWindow()->stopScrollTimer();
237 const sal_uInt16 nClicks = rMEvt.
GetClicks();
238 if ( !(nClicks == 2 && rMEvt.
IsLeft()) )
269 bool bReturn =
false;
274 sal_uInt16 nCode = rCode.
GetCode();
280 if (
m_pParent->getSectionWindow()->getViewsWindow()->IsAction() )
282 m_pParent->getSectionWindow()->getViewsWindow()->BrkAction();
295 const_cast<SdrHdlList&
>(rHdlList).ResetFocusHdl();
297 m_pParent->getSectionWindow()->getViewsWindow()->unmarkAllObjects(
nullptr);
349 m_pParent->getSectionWindow()->getViewsWindow()->handleKey(rCode);
379 if ( bReturn &&
m_pParent->IsMouseCaptured() )
394 if (nSdrObjKind != SdrObjKind::OLE2)
398 if (!(pOleObj && pOleObj->
GetObjRef().is()))
410 pOleObj->
GetObjRef()->changeState( embed::EmbedStates::UI_ACTIVE );
412 OReportController& rController =
m_pParent->getSectionWindow()->getViewsWindow()->getView()->getReportView()->getController();
415 rController.executeChecked(SID_SHOW_PROPERTYBROWSER,uno::Sequence< beans::PropertyValue >());
417 catch( uno::Exception& )
426 OReportController& rController =
m_pParent->getSectionWindow()->getViewsWindow()->getView()->getReportView()->getController();
433 uno::Reference< embed::XEmbeddedObject > xObj = pObj->
GetObjRef();
434 if ( xObj.is() && xObj->getCurrentState() == embed::EmbedStates::UI_ACTIVE )
436 xObj->changeState( embed::EmbedStates::RUNNING );
440 rController.executeChecked(SID_SHOW_PROPERTYBROWSER,uno::Sequence< beans::PropertyValue >());
455 OObjectBase* pObj =
dynamic_cast<OObjectBase*
>(_pOverlappedObj);
459 const uno::Reference<report::XReportComponent>& xComponent = pObj->getReportComponent();
491 bool bOverlapping =
m_rView.
PickAnything(rMEvt, SdrMouseEventKind::BUTTONUP, aVEvt) != SdrHitKind::NONE;
492 if (bOverlapping && aVEvt.
mpObj)
506 if (
m_pParent->getSectionWindow()->getViewsWindow()->IsDragObj() )
511 m_pParent->getSectionWindow()->getViewsWindow()->BrkAction();
517 m_pParent->getSectionWindow()->getViewsWindow()->EndAction();
521 bool bControlKeyPressed = rMEvt.
IsMod1();
523 if (bControlKeyPressed && (aPnt.
Y() < 0))
535 m_pParent->getSectionWindow()->getViewsWindow()->EndDragObj( bControlKeyPressed, &
m_rView, aPnt );
537 m_pParent->getSectionWindow()->getViewsWindow()->ForceMarkedToAnotherPage();
538 m_pParent->Invalidate(InvalidateFlags::Children);
541 m_pParent->getSectionWindow()->getViewsWindow()->EndAction();
571 bool bIsSetPoint = (eHit == SdrHitKind::UnmarkedObject);
583 if( !pObjIter || bIsSetPoint)
586 && (
dynamic_cast<OUnoObject*
>(pObjIter) !=
nullptr ||
dynamic_cast<OOle2Obj*
>(pObjIter) !=
nullptr) )
591 if ( (nDx + aNewRect.
Left()) < 0 )
592 nDx = -aNewRect.
Left();
593 if ( (nDy + aNewRect.
Top()) < 0 )
594 nDy = -aNewRect.
Top();
597 aNewRect.
Move(nDx,nDy);
603 bIsSetPoint = pObjOverlapped !=
nullptr;
625 m_pParent->SetPointer( PointerStyle::NotAllowed );
628 bool bCtrlKey = rMEvt.
IsMod1();
631 m_pParent->SetPointer( PointerStyle::MoveDataLink );
662 if (eHit == SdrHitKind::UnmarkedObject &&
nId != SdrObjKind::CustomShape)
665 m_pParent->getSectionWindow()->getViewsWindow()->BrkAction();
670 if (!
m_pParent->getSectionWindow()->getViewsWindow()->IsAction())
673 if (
m_pParent->getSectionWindow()->getViewsWindow()->HasSelection() )
674 m_pParent->getSectionWindow()->getViewsWindow()->unmarkAllObjects(&
m_rView);
676 m_pParent->getSectionWindow()->getViewsWindow()->createDefault();
697 m_pParent->getSectionWindow()->getViewsWindow()->BrkAction();
713 OReportController& rController =
m_pParent->getSectionWindow()->getViewsWindow()->getView()->getReportView()->getController();
719 if ( pObj && !pObj->
IsEmpty() )
730 std::abs(
m_aMDPos.
X() - aPos.
X()) < nHitLog &&
731 std::abs(
m_aMDPos.
Y() - aPos.
Y()) < nHitLog &&
740 m_pParent->getSectionWindow()->getViewsWindow()->getView()->getReportView()->UpdatePropertyBrowserDelayed(
m_rView);
757 bool bIsSetPoint =
false;
770 m_pParent->getSectionWindow()->getViewsWindow()->MovAction(aPos,&
m_rView,
false);
799 if( eHit == SdrHitKind::UnmarkedObject )
803 m_pParent->getSectionWindow()->getViewsWindow()->unmarkAllObjects(
nullptr);
819 m_pParent->getSectionWindow()->getViewsWindow()->unmarkAllObjects(
nullptr);
847 m_pParent->getSectionWindow()->getViewsWindow()->EndAction();
853 m_pParent->getSectionWindow()->getViewsWindow()->getView()->getReportView()->UpdatePropertyBrowserDelayed(
m_rView);
865 bool bIsSetPoint =
false;
874 m_pParent->getSectionWindow()->getViewsWindow()->MovAction(aPnt, &
m_rView,
false);
887 bool bControlKey = rMEvt.
IsMod1();
888 m_pParent->getSectionWindow()->getViewsWindow()->MovAction(aPnt, &
m_rView, bControlKey);
#define REPORT_STARTMARKER_WIDTH
const vcl::KeyCode & GetKeyCode() const
sal_uInt16 GetClicks() const
const Point & GetPosPixel() const
SVXCORE_DLLPUBLIC size_t size() const
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
constexpr tools::Long X() const
bool BegCreateObj(const Point &rPnt, OutputDevice *pOut=nullptr, short nMinMov=-3)
void SetEditMode(SdrViewEditMode eMode)
bool EndCreateObj(SdrCreateCmd eCmd)
SdrObjKind GetCurrentObjIdentifier() const
void SetCreateMode(bool bOn=true)
virtual bool IsAction() const override
SdrObject * GetCreateObj() const
Fraction GetYFact() const
const Point & GetRef1() const
tools::Long GetDY() const
SdrDragMethod * GetDragMethod() const
Fraction GetXFact() const
tools::Long GetDX() const
SdrDragMethod * GetDragMethod() const
OLEObjCache & GetOLEObjCache()
SdrHdl * GetFocusHdl() const
const Point & GetPos() const
size_t GetMarkCount() const
SdrMark * GetMark(size_t nNum) const
SdrHdl * PickHandle(const Point &rPnt) const
bool IsObjMarked(SdrObject const *pObj) const
const SdrMarkList & GetMarkedObjectList() const
bool AreObjectsMarked() const
const SdrHdlList & GetHdlList() const
void UnmarkAllObj(SdrPageView const *pPV=nullptr)
bool IsMarkedHit(const Point &rPnt, short nTol=-2) const
const tools::Rectangle & GetAllMarkedRect() const
bool MarkNextObj(bool bPrev=false)
bool MarkObj(const Point &rPnt, short nTol=-2, bool bToggle=false, bool bDeep=false)
SdrObject * GetMarkedSdrObj() const
static bool doConstructOrthogonal(std::u16string_view rName)
virtual SdrEndTextEditKind SdrEndTextEdit(bool bDontDeleteReally=false)
virtual bool IsTextEdit() const final override
virtual bool SdrBeginTextEdit(SdrObject *pObj, SdrPageView *pPV=nullptr, vcl::Window *pWin=nullptr, bool bIsNewObj=false, SdrOutliner *pGivenOutliner=nullptr, OutlinerView *pGivenOutlinerView=nullptr, bool bDontDeleteOutliner=false, bool bOnlyOneView=false, bool bGrabFocus=true)
SdrModel & getSdrModelFromSdrObject() const
virtual SdrObjKind GetObjIdentifier() const
virtual const tools::Rectangle & GetLastBoundRect() const
SdrPage * getSdrPageFromSdrObject() const
void SetWindow(const css::uno::Reference< css::awt::XWindow > &_xWindow)
css::uno::Reference< css::embed::XEmbeddedObject > const & GetObjRef() const
const SdrDragStat & GetDragStat() const
SdrPageView * GetSdrPageView() const
void SetAngleSnapEnabled(bool bOn)
void SetActualWin(const OutputDevice *pWin)
bool KeyInput(const KeyEvent &rKEvt, vcl::Window *pWin) override
SdrHitKind PickAnything(const MouseEvent &rMEvt, SdrMouseEventKind nMouseDownOrMoveOrUp, SdrViewEvent &rVEvt) const
PointerStyle GetPreferredPointer(const Point &rMousePos, const OutputDevice *pOut, sal_uInt16 nModifier=0, bool bLeftDown=false) const
tools::Long AdjustWidth(tools::Long n)
void setHeight(tools::Long nHeight)
void SetTimeout(sal_uInt64 nTimeoutMs)
void SetInvokeHandler(const Link< Timer *, void > &rLink)
virtual void Start(bool bStartTimer=true) override
static css::uno::Reference< css::awt::XWindow > GetInterface(vcl::Window *pWindow)
virtual ~DlgEdFuncInsert() override
virtual bool MouseMove(const MouseEvent &rMEvt) override
virtual bool MouseButtonDown(const MouseEvent &rMEvt) override
DlgEdFuncInsert(OReportSection *pParent)
virtual bool MouseButtonUp(const MouseEvent &rMEvt) override
DlgEdFuncSelect(OReportSection *pParent)
virtual bool MouseMove(const MouseEvent &rMEvt) override
virtual ~DlgEdFuncSelect() override
virtual bool MouseButtonDown(const MouseEvent &rMEvt) override
virtual bool MouseButtonUp(const MouseEvent &rMEvt) override
void checkMovementAllowed(const MouseEvent &rMEvt)
checks that no other object is overlapped.
virtual bool MouseMove(const MouseEvent &rMEvt)
bool handleKeyEvent(const KeyEvent &_rEvent)
checks if the keycode is known by the child windows
bool isOverlapping(const MouseEvent &rMEvt)
returns <TRUE> if the mouse event is over an existing object
DlgEdFunc(const DlgEdFunc &)=delete
void setOverlappedControlColor(Color _nColor)
bool isRectangleHit(const MouseEvent &rMEvt)
VclPtr< OReportSection > m_pParent
void checkTwoClicks(const MouseEvent &rMEvt)
bool m_bShowPropertyBrowser
bool isOnlyCustomShapeMarked() const
returns true, as long as only customshapes in the marked list, custom shapes can drop every where
virtual bool MouseButtonDown(const MouseEvent &rMEvt)
css::uno::Reference< css::uno::XInterface > m_xOverlappingObj
void ForceScroll(const Point &rPos)
virtual bool MouseButtonUp(const MouseEvent &rMEvt)
void activateOle(SdrObject *_pObj)
activate object if it is of type OBJ_OLE2
SdrObject * m_pOverlappingObj
bool setMovementPointer(const MouseEvent &rMEvt)
sets the correct mouse pointer when moving an object
void colorizeOverlappedObject(SdrObject *_pOverlappedObj)
void deactivateOle(bool _bSelect=false)
deactivate all ole object
void unColorizeOverlappedObj()
Color m_nOverlappedControlColor
void initializeChart(const css::uno::Reference< css::frame::XModel > &_xModel)
virtual css::uno::Reference< css::frame::XModel > SAL_CALL getModel() override
OXUndoEnvironment & GetUndoEnv()
OSectionWindow * getSectionWindow() const
OScrollWindowHelper * getScrollWindow() const
OReportSection * getReportSection() const
bool IsDragResize() const
virtual void MakeVisible(const tools::Rectangle &rRect, vcl::Window &rWin) override
OViewsWindow * getViewsWindow()
const OUString & getShapeType() const
returns the currently set shape type.
Create an object ob OUndoEnvLock locks the undo possibility As long as in the OUndoEnvLock scope,...
sal_uInt16 GetCode() const
Point PixelToLogic(const Point &rDevicePt) const
Size GetOutputSizePixel() const
#define DBG_UNHANDLED_EXCEPTION(...)
constexpr sal_uInt16 KEY_RETURN
constexpr sal_uInt16 KEY_ESCAPE
constexpr sal_uInt16 KEY_LEFT
constexpr sal_uInt16 KEY_TAB
constexpr sal_uInt16 KEY_UP
constexpr sal_uInt16 KEY_RIGHT
constexpr sal_uInt16 KEY_DELETE
constexpr sal_uInt16 KEY_DOWN
#define LINK(Instance, Class, Member)
css::uno::Sequence< css::beans::PropertyValue > InitPropertySequence(::std::initializer_list< ::std::pair< OUString, css::uno::Any > > vInit)
static Color lcl_setColorOfObject(const uno::Reference< uno::XInterface > &_xObj, Color _nColorTRGB)
IMPL_LINK_NOARG(OAddFieldWindow, FocusChangeHdl, weld::Container &, void)
const sal_Int16 ISOVER_IGNORE_CUSTOMSHAPES
SdrObject * isOver(const tools::Rectangle &_rRect, SdrPage const &_rPage, SdrView const &_rView, bool _bAllObjects=false, SdrObject const *_pIgnore=nullptr, sal_Int16 _nIgnoreType=0)
checks whether the given rectangle overlapps another OUnoObject object in that view.
#define SELENG_AUTOREPEAT_INTERVAL
constexpr OUStringLiteral PROPERTY_CONTROLBACKGROUND
SVXCORE_DLLPUBLIC SdrGlobalData & GetSdrGlobalData()