22 #include <com/sun/star/embed/EmbedStates.hpp>
23 #include <com/sun/star/embed/XEmbeddedObject.hpp>
24 #include <com/sun/star/beans/XPropertySet.hpp>
31 #include <svx/svxids.hrc>
36 #include <dlgedfunc.hxx>
45 #include <UITools.hxx>
47 #include <strings.hxx>
53 #define DEFAUL_MOVE_SIZE 100
61 ForceScroll( m_pParent->PixelToLogic( m_pParent->GetPointerPosPixel() ) );
74 aStartWidth *=
m_pParent->GetMapMode().GetScaleX();
76 aOut.
AdjustWidth( -static_cast<tools::Long>(aStartWidth) );
80 aPos.setX( aPos.X() * 0.5 );
81 aPos.setY( aPos.Y() * 0.5 );
83 aOutRect =
m_pParent->PixelToLogic( aOutRect );
85 aWorkArea.
AdjustRight( -static_cast<tools::Long>(aStartWidth) );
87 if( !aOutRect.
Contains( rPos ) && aWorkArea.Contains( rPos ) )
91 ScrollType eH = ScrollType::LineDown,eV = ScrollType::LineDown;
92 if( rPos.X() < aOutRect.
Left() )
93 eH = ScrollType::LineUp;
94 else if( rPos.X() <= aOutRect.
Right() )
95 eH = ScrollType::DontKnow;
97 if( rPos.Y() < aOutRect.
Top() )
98 eV = ScrollType::LineUp;
99 else if( rPos.Y() <= aOutRect.
Bottom() )
100 eV = ScrollType::DontKnow;
110 : m_pParent(_pParent)
111 , m_rView(_pParent->getSectionView())
112 , aScrollTimer(
"reportdesign DlgEdFunc aScrollTimer")
113 , m_pOverlappingObj(nullptr)
114 , m_nOverlappedControlColor(0)
116 , m_bSelectionMode(
false)
118 , m_bShowPropertyBrowser(
false)
135 uno::Reference<report::XReportComponent> xComponent(_xObj, uno::UNO_QUERY_THROW);
136 uno::Reference< beans::XPropertySet > xProp(xComponent, uno::UNO_QUERY_THROW);
142 uno::Any aBlackColorAny(_nColorTRGB);
146 catch(uno::Exception&)
163 bool bHandled =
false;
170 {
"ShowProperties",
uno::Any(
true) }
172 m_pParent->getSectionWindow()->getViewsWindow()->getView()->getReportView()->getController().executeUnChecked(SID_SHOW_PROPERTYBROWSER,aArgs);
173 m_pParent->getSectionWindow()->getViewsWindow()->getView()->getReportView()->UpdatePropertyBrowserDelayed(
m_rView);
199 m_pParent->getSectionWindow()->getViewsWindow()->unmarkAllObjects(
nullptr);
203 m_pParent->getSectionWindow()->getViewsWindow()->unmarkAllObjects(
nullptr);
207 else if( !rMEvt.
IsLeft() )
217 m_pParent->getSectionWindow()->getViewsWindow()->stopScrollTimer();
225 const sal_uInt16 nClicks = rMEvt.
GetClicks();
226 if ( !(nClicks == 2 && rMEvt.
IsLeft()) )
257 bool bReturn =
false;
268 if (
m_pParent->getSectionWindow()->getViewsWindow()->IsAction() )
270 m_pParent->getSectionWindow()->getViewsWindow()->BrkAction();
283 const_cast<SdrHdlList&
>(rHdlList).ResetFocusHdl();
285 m_pParent->getSectionWindow()->getViewsWindow()->unmarkAllObjects(
nullptr);
337 m_pParent->getSectionWindow()->getViewsWindow()->handleKey(rCode);
367 if ( bReturn &&
m_pParent->IsMouseCaptured() )
382 if (nSdrObjKind != SdrObjKind::OLE2)
386 if (!(pOleObj && pOleObj->
GetObjRef().is()))
398 pOleObj->
GetObjRef()->changeState( embed::EmbedStates::UI_ACTIVE );
400 OReportController& rController =
m_pParent->getSectionWindow()->getViewsWindow()->getView()->getReportView()->getController();
403 rController.executeChecked(SID_SHOW_PROPERTYBROWSER,uno::Sequence< beans::PropertyValue >());
405 catch( uno::Exception& )
414 OReportController& rController =
m_pParent->getSectionWindow()->getViewsWindow()->getView()->getReportView()->getController();
416 for(
size_t i = 0 ;
i < nCount;++
i)
421 uno::Reference< embed::XEmbeddedObject > xObj = pObj->
GetObjRef();
422 if ( xObj.is() && xObj->getCurrentState() == embed::EmbedStates::UI_ACTIVE )
424 xObj->changeState( embed::EmbedStates::RUNNING );
428 rController.executeChecked(SID_SHOW_PROPERTYBROWSER,uno::Sequence< beans::PropertyValue >());
447 const uno::Reference<report::XReportComponent>& xComponent = pObj->
getReportComponent();
479 bool bOverlapping =
m_rView.
PickAnything(rMEvt, SdrMouseEventKind::BUTTONUP, aVEvt) != SdrHitKind::NONE;
480 if (bOverlapping && aVEvt.
mpObj)
494 if (
m_pParent->getSectionWindow()->getViewsWindow()->IsDragObj() )
499 m_pParent->getSectionWindow()->getViewsWindow()->BrkAction();
505 m_pParent->getSectionWindow()->getViewsWindow()->EndAction();
509 bool bControlKeyPressed = rMEvt.
IsMod1();
511 if (bControlKeyPressed && (aPnt.Y() < 0))
523 m_pParent->getSectionWindow()->getViewsWindow()->EndDragObj( bControlKeyPressed, &
m_rView, aPnt );
525 m_pParent->getSectionWindow()->getViewsWindow()->ForceMarkedToAnotherPage();
526 m_pParent->Invalidate(InvalidateFlags::Children);
529 m_pParent->getSectionWindow()->getViewsWindow()->EndAction();
559 bool bIsSetPoint = (eHit == SdrHitKind::UnmarkedObject);
571 if( !pObjIter || bIsSetPoint)
574 && (
dynamic_cast<OUnoObject*
>(pObjIter) !=
nullptr || dynamic_cast<OOle2Obj*>(pObjIter) !=
nullptr) )
579 if ( (nDx + aNewRect.
Left()) < 0 )
580 nDx = -aNewRect.
Left();
581 if ( (nDy + aNewRect.
Top()) < 0 )
582 nDy = -aNewRect.
Top();
585 aNewRect.
Move(nDx,nDy);
591 bIsSetPoint = pObjOverlapped !=
nullptr;
613 m_pParent->SetPointer( PointerStyle::NotAllowed );
616 bool bCtrlKey = rMEvt.
IsMod1();
619 m_pParent->SetPointer( PointerStyle::MoveDataLink );
650 if (eHit == SdrHitKind::UnmarkedObject && nId != SdrObjKind::CustomShape)
653 m_pParent->getSectionWindow()->getViewsWindow()->BrkAction();
658 if (!
m_pParent->getSectionWindow()->getViewsWindow()->IsAction())
661 if (
m_pParent->getSectionWindow()->getViewsWindow()->HasSelection() )
662 m_pParent->getSectionWindow()->getViewsWindow()->unmarkAllObjects(&
m_rView);
664 m_pParent->getSectionWindow()->getViewsWindow()->createDefault();
677 const sal_uInt16 nHitLog = sal_uInt16 (
m_pParent->PixelToLogic(
Size(3,0)).Width() );
685 m_pParent->getSectionWindow()->getViewsWindow()->BrkAction();
701 OReportController& rController =
m_pParent->getSectionWindow()->getViewsWindow()->getView()->getReportView()->getController();
707 if ( pObj && !pObj->
IsEmpty() )
718 std::abs(
m_aMDPos.X() - aPos.X()) < nHitLog &&
719 std::abs(
m_aMDPos.Y() - aPos.Y()) < nHitLog &&
728 m_pParent->getSectionWindow()->getViewsWindow()->getView()->getReportView()->UpdatePropertyBrowserDelayed(
m_rView);
745 bool bIsSetPoint =
false;
758 m_pParent->getSectionWindow()->getViewsWindow()->MovAction(aPos,&
m_rView,
false);
787 if( eHit == SdrHitKind::UnmarkedObject )
791 m_pParent->getSectionWindow()->getViewsWindow()->unmarkAllObjects(
nullptr);
807 m_pParent->getSectionWindow()->getViewsWindow()->unmarkAllObjects(
nullptr);
835 m_pParent->getSectionWindow()->getViewsWindow()->EndAction();
841 m_pParent->getSectionWindow()->getViewsWindow()->getView()->getReportView()->UpdatePropertyBrowserDelayed(
m_rView);
853 bool bIsSetPoint =
false;
862 m_pParent->getSectionWindow()->getViewsWindow()->MovAction(aPnt, &
m_rView,
false);
875 bool bControlKey = rMEvt.
IsMod1();
876 m_pParent->getSectionWindow()->getViewsWindow()->MovAction(aPnt, &
m_rView, bControlKey);
virtual ~DlgEdFuncInsert() override
#define LINK(Instance, Class, Member)
void UnmarkAllObj(SdrPageView const *pPV=nullptr)
virtual bool MouseButtonUp(const MouseEvent &rMEvt)
void ForceScroll(const Point &rPos)
Create an object ob OUndoEnvLock locks the undo possibility As long as in the OUndoEnvLock scope...
bool EndCreateObj(SdrCreateCmd eCmd)
size_t GetMarkCount() const
PointerStyle GetPreferredPointer(const Point &rMousePos, const OutputDevice *pOut, sal_uInt16 nModifier=0, bool bLeftDown=false) const
virtual SdrEndTextEditKind SdrEndTextEdit(bool bDontDeleteReally=false)
tools::Long GetDX() const
css::uno::Reference< css::embed::XEmbeddedObject > const & GetObjRef() const
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.
virtual bool MouseButtonDown(const MouseEvent &rMEvt) override
void activateOle(SdrObject *_pObj)
activate object if it is of type OBJ_OLE2
bool BegCreateObj(const Point &rPnt, OutputDevice *pOut=nullptr, short nMinMov=-3)
tools::Long GetDY() const
DlgEdFunc(const DlgEdFunc &)=delete
bool AreObjectsMarked() const
const SdrDragStat & GetDragStat() const
static bool doConstructOrthogonal(std::u16string_view rName)
void colorizeOverlappedObject(SdrObject *_pOverlappedObj)
virtual bool MouseButtonDown(const MouseEvent &rMEvt)
sal_uInt16 GetCode() const
void checkTwoClicks(const MouseEvent &rMEvt)
virtual bool MouseButtonUp(const MouseEvent &rMEvt) override
SdrMark * GetMark(size_t nNum) const
bool m_bShowPropertyBrowser
virtual bool MouseMove(const MouseEvent &rMEvt)
const Point & GetPos() const
SdrHitKind PickAnything(const MouseEvent &rMEvt, SdrMouseEventKind nMouseDownOrMoveOrUp, SdrViewEvent &rVEvt) const
virtual SdrObjKind GetObjIdentifier() const
void initializeChart(const css::uno::Reference< css::frame::XModel > &_xModel)
const css::uno::Reference< css::report::XReportComponent > & getReportComponent() const
constexpr sal_uInt16 KEY_UP
bool isRectangleHit(const MouseEvent &rMEvt)
sal_uInt16 GetClicks() const
SdrPage * getSdrPageFromSdrObject() const
bool isOnlyCustomShapeMarked() const
returns true, as long as only customshapes in the marked list, custom shapes can drop every where ...
#define SELENG_AUTOREPEAT_INTERVAL
virtual bool MouseMove(const MouseEvent &rMEvt) override
virtual bool MouseButtonDown(const MouseEvent &rMEvt) override
DlgEdFuncSelect(OReportSection *pParent)
#define REPORT_STARTMARKER_WIDTH
void SetEditMode(SdrViewEditMode eMode)
OLEObjCache & GetOLEObjCache()
bool IsMarkedHit(const Point &rPnt, short nTol=-2) const
virtual void MakeVisible(const tools::Rectangle &rRect, vcl::Window &rWin) override
css::uno::Sequence< css::beans::PropertyValue > InitPropertySequence(::std::initializer_list< ::std::pair< OUString, css::uno::Any > > vInit)
bool setMovementPointer(const MouseEvent &rMEvt)
sets the correct mouse pointer when moving an object
constexpr sal_uInt16 KEY_DOWN
SdrObject * GetMarkedSdrObj() const
#define PROPERTY_CONTROLBACKGROUND
#define DBG_UNHANDLED_EXCEPTION(...)
virtual bool MouseButtonUp(const MouseEvent &rMEvt) override
SdrDragMethod * GetDragMethod() const
void SetWindow(const css::uno::Reference< css::awt::XWindow > &_xWindow)
bool isOverlapping(const MouseEvent &rMEvt)
returns if the mouse event is over an existing object
SdrObject * GetCreateObj() const
IMPL_LINK_NOARG(OAddFieldWindow, FocusChangeHdl, weld::Container &, void)
VclPtr< OReportSection > m_pParent
const SdrMarkList & GetMarkedObjectList() const
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)
virtual void Start(bool bStartTimer=true) override
SdrHdl * PickHandle(const Point &rPnt) const
bool IsDragResize() const
SdrModel & getSdrModelFromSdrObject() const
OScrollWindowHelper * getScrollWindow() const
OViewsWindow * getViewsWindow()
Point PixelToLogic(const Point &rDevicePt) const
virtual ~DlgEdFuncSelect() override
void SetActualWin(const OutputDevice *pWin)
void SetTimeout(sal_uInt64 nTimeoutMs)
void checkMovementAllowed(const MouseEvent &rMEvt)
checks that no other object is overlapped.
bool MarkNextObj(bool bPrev=false)
void setOverlappedControlColor(Color _nColor)
const tools::Rectangle & GetAllMarkedRect() const
static Color lcl_setColorOfObject(const uno::Reference< uno::XInterface > &_xObj, Color _nColorTRGB)
constexpr sal_uInt16 KEY_RETURN
Color m_nOverlappedControlColor
const Point & GetRef1() const
constexpr sal_uInt16 KEY_RIGHT
SdrDragMethod * GetDragMethod() const
SdrHdl * GetFocusHdl() const
virtual bool IsAction() const override
void SetAngleSnapEnabled(bool bOn)
Fraction GetXFact() const
SdrGlobalData & GetSdrGlobalData()
virtual const tools::Rectangle & GetLastBoundRect() const
DlgEdFuncInsert(OReportSection *pParent)
const vcl::KeyCode & GetKeyCode() const
const sal_Int16 ISOVER_IGNORE_CUSTOMSHAPES
SdrObject * m_pOverlappingObj
virtual bool IsTextEdit() const final override
OSectionWindow * getSectionWindow() const
constexpr sal_uInt16 KEY_ESCAPE
const OUString & getShapeType() const
returns the currently set shape type.
Fraction GetYFact() const
tools::Long AdjustWidth(tools::Long n)
virtual bool MouseMove(const MouseEvent &rMEvt) override
bool KeyInput(const KeyEvent &rKEvt, vcl::Window *pWin) override
void SetCreateMode(bool bOn=true)
void SetInvokeHandler(const Link< Timer *, void > &rLink)
const Point & GetPosPixel() const
bool handleKeyEvent(const KeyEvent &_rEvent)
checks if the keycode is known by the child windows
SdrPageView * GetSdrPageView() const
Size GetOutputSizePixel() const
void setHeight(tools::Long nHeight)
SdrObjKind GetCurrentObjIdentifier() const
bool MarkObj(const Point &rPnt, short nTol=-2, bool bToggle=false, bool bDeep=false)
constexpr sal_uInt16 KEY_DELETE
constexpr sal_uInt16 KEY_LEFT
const SdrHdlList & GetHdlList() const
OReportSection * getReportSection() const
OXUndoEnvironment & GetUndoEnv()
static css::uno::Reference< css::awt::XWindow > GetInterface(vcl::Window *pWindow)
void unColorizeOverlappedObj()
SVXCORE_DLLPUBLIC size_t size() const
virtual css::uno::Reference< css::frame::XModel > SAL_CALL getModel() override
constexpr sal_uInt16 KEY_TAB
void deactivateOle(bool _bSelect=false)
deactivate all ole object
bool m_bDetectedRangeSegmentation false
css::uno::Reference< css::uno::XInterface > m_xOverlappingObj
bool IsObjMarked(SdrObject const *pObj) const