19#ifndef INCLUDED_SW_INC_FESH_HXX
20#define INCLUDED_SW_INC_FESH_HXX
22#include <com/sun/star/text/RelOrientation.hpp>
23#include <com/sun/star/text/XPasteListener.hpp>
32#include <rtl/ustring.hxx>
39namespace editeng {
class SvxBorderLine; }
57 class ISdrObjectFilter;
166#define SW_ADD_SELECT 1
167#define SW_ENTER_GROUP 2
168#define SW_LEAVE_FRAME 4
170#define SW_ALLOW_TEXTBOX 8
215 SAL_DLLPRIVATE
SwFlyFrame *FindFlyFrame(
const css::uno::Reference < css::embed::XEmbeddedObject >& )
const;
218 SAL_DLLPRIVATE
void EndAllActionAndCall();
220 SAL_DLLPRIVATE
void ScrollTo(
const Point &rPt );
222 SAL_DLLPRIVATE
void ChangeOpaque(
SdrLayerID nLayerId );
226 SAL_DLLPRIVATE
const SwFrame *GetBox(
const Point &rPt,
bool* pbRow =
nullptr,
bool* pbCol =
nullptr )
const;
229 SAL_DLLPRIVATE
static sal_uInt16 GetCurColNum_(
const SwFrame *pFrame,
232 SAL_DLLPRIVATE
void GetTabCols_(
SwTabCols &rToFill,
const SwFrame *pBox)
const;
233 SAL_DLLPRIVATE
void GetTabRows_(
SwTabCols &rToFill,
const SwFrame *pBox)
const;
235 SAL_DLLPRIVATE
bool ImpEndCreate();
238 SAL_DLLPRIVATE
bool CopyDrawSel(
SwFEShell& rDestShell,
const Point& rSttPt,
239 const Point& rInsPt,
bool bIsMove,
240 bool bSelectInsert );
244 SAL_DLLPRIVATE
const SdrMarkList* GetMarkList_()
const;
246 SAL_DLLPRIVATE
bool CheckHeadline(
bool bRepeat )
const;
259 void Copy(
SwDoc& rClpDoc,
const OUString* pNewClpText =
nullptr );
260 bool Paste(
SwDoc& rClpDoc,
bool bNestedTable =
false );
263 void PastePages(
SwFEShell& rToFill, sal_uInt16 nStartPage, sal_uInt16 nEndPage);
267 bool bIsMove =
false,
bool bSelectInsert =
true );
277 void DelSelectedObj();
282 void SelectionToTop (
bool bTop =
true );
283 void SelectionToBottom(
bool bBottom =
true );
286 void SelectionToHeaven();
287 void SelectionToHell();
291 bool IsObjSelectable(
const Point& rPt );
294 bool IsInsideSelectedObj(
const Point& rPt );
298 bool ShouldObjectBeSelected(
const Point& rPt);
300 bool MoveAnchor(
SwMove nDir );
305 bool IsDirectlyInSection()
const;
317 bool IsSelContainsControl()
const;
324 SwRect GetObjRect()
const;
327 SwRect GetFlyRect()
const;
332 void CalcBoundRect(
SwRect& _orRect,
334 const sal_Int16 _eHoriRelOrient = css::text::RelOrientation::FRAME,
335 const sal_Int16 _eVertRelOrient = css::text::RelOrientation::FRAME,
337 const bool _bFollowTextFlow =
false,
338 bool _bMirror =
false,
339 Point* _opRef =
nullptr,
340 Size* _opPercent =
nullptr,
344 void SetObjRect(
const SwRect& rRect );
346 void BeginDrag(
const Point *pPt,
bool bProp );
347 void Drag (
const Point *pPt,
bool bProp );
352 Point GetAnchorObjDiff()
const;
353 Point GetObjAbsPos()
const;
354 Size GetObjSize()
const;
357 void GetPageObjs( std::vector<SwFrameFormat*>& rFillArr );
358 void SetPageObjsNewPage( std::vector<SwFrameFormat*>& rFillArr );
376 OUString &rName,
bool &rbLink )
const;
378 OUString GetObjTitle()
const;
379 void SetObjTitle(
const OUString& rTitle );
380 OUString GetObjDescription()
const;
381 void SetObjDescription(
const OUString& rDescription );
382 bool IsObjDecorative()
const;
383 void SetObjDecorative(
bool isDecorative);
385 bool IsFrameSelected()
const;
386 bool GetFlyFrameAttr(
SfxItemSet &rSet )
const;
389 void ResetFlyFrameAttr(
const SfxItemSet* pSet );
392 void SetFlyPos(
const Point &rAbsPos);
393 Point FindAnchorPos(
const Point &rAbsPos,
bool bMoveIt =
false );
398 bool IsFrameVertical(
const bool bEnvironment,
bool& bRightToLeft,
bool& bVertL2R)
const;
401 void SetFrameFormat(
SwFrameFormat *pFormat,
bool bKeepOrient =
false,
Point const * pDocPos =
nullptr );
407 SwFlyFrame* GetCurrFlyFrame(
const bool bCalcFrame =
true)
const;
410 SwFlyFrame* GetSelectedOrCurrFlyFrame()
const;
417 {
return GotoObj(
true,
eType ); }
419 {
return GotoObj(
false,
eType); }
422 size_t GetFlyCount(
FlyCntType eType,
bool bIgnoreTextBoxes =
false )
const;
425 std::vector<SwFrameFormat const*> GetFlyFrameFormats(
439 Size RequestObjectResize(
const SwRect &rRect,
const css::uno::Reference < css::embed::XEmbeddedObject >& );
449 const SwRect *pFlyPrtRect =
nullptr,
450 const SwRect *pFlyFrameRect =
nullptr,
451 const bool bNoTextFramePrtAreaChanged =
false ) = 0;
457 const SwRect &rFrame ) = 0;
464 void SetFlyName(
const OUString& rName );
465 OUString GetFlyName()
const;
468 css::uno::Reference < css::embed::XEmbeddedObject > GetOleRef()
const;
471 OUString GetUniqueGrfName()
const;
472 OUString GetUniqueOLEName()
const;
473 OUString GetUniqueFrameName()
const;
476 bool GotoFly(
const OUString& rName,
FlyCntType eType,
481 OUString *pTargetFrameName =
nullptr,
482 OUString *pURLDescription =
nullptr )
const;
490 void HideChainMarker();
491 void SetChainMarker();
493 Size GetGraphicDefaultSize()
const;
496 void CheckUnboundObjects();
504 bool* pbWrapped =
nullptr);
514 void StartCropImage();
517 bool IsRotationOfSwGrfNodePossible()
const;
519 size_t IsObjSelected()
const;
520 bool IsObjSelected(
const SdrObject& rObj )
const;
521 bool IsObjSameLevelWithMarked(
const SdrObject* pObj)
const;
537 void MoveCreate (
const Point &rPos );
540 bool IsDrawCreate()
const;
545 void MoveMark (
const Point &rPos );
549 bool IsGroupSelected(
bool bAllowDiagams);
550 void GroupSelection();
551 void UnGroupSelection();
554 bool IsGroupAllowed()
const;
555 bool IsUnGroupAllowed()
const;
557 void MirrorSelection(
bool bHorizontal );
562 void ChgAnchor(
RndStdIds eAnchorId,
bool bSameOnly =
false,
563 bool bPosCorr =
true );
572 bool Paste(
const Graphic &rGrf,
const OUString& rURL );
576 bool IsAlignPossible()
const;
577 void SetCalcFieldValueHdl(
Outliner* pOutliner);
579 void Insert(
const OUString& rGrfName,
580 const OUString& rFltName,
586 const Point& rInsertPosition );
588 void ReplaceSdrObj(
const OUString& rGrfName,
const Graphic* pGrf );
593 void AlignFormulaToBaseline(
const css::uno::Reference < css::embed::XEmbeddedObject >& xObj );
596 void AlignAllFormulasToBaseline();
599 Point GetContentPos(
const Point& rPoint,
bool bNext )
const;
602 Point GetRelativePagePosition(
const Point& rDocPos);
610 size_t GetCurPageDesc(
const bool bCalcFrame =
true )
const;
611 size_t GetMousePageDesc(
const Point &rPt )
const;
612 size_t GetPageDescCnt()
const;
613 SwPageDesc* FindPageDescByName(
const OUString& rName,
614 bool bGetFromPool =
false,
615 size_t* pPos =
nullptr );
617 const SwPageDesc& GetPageDesc(
size_t i )
const;
618 void ChgPageDesc(
size_t i,
const SwPageDesc& );
621 const SwPageDesc* GetSelectedPageDescs()
const;
624 const Point* pPt =
nullptr,
625 const css::uno::Reference < css::embed::XEmbeddedObject >& =
626 css::uno::Reference < css::embed::XEmbeddedObject >() )
const;
629 sal_uInt16 GetPageNumber(
const Point &rPoint )
const;
630 bool GetPageNumber(
tools::Long nYPos,
bool bAtCursorPos, sal_uInt16& rPhyNum, sal_uInt16& rVirtNum, OUString &rDisplay )
const;
639 bool HasWholeTabSelection()
const;
642 bool HasBoxSelection()
const;
644 void InsertRow( sal_uInt16 nCnt,
bool bBehind );
645 void InsertCol( sal_uInt16 nCnt,
bool bBehind );
648 bool DeleteRow(
bool bCompleteTable =
false);
656 bool DeleteTableSel();
661 void SplitTab(
bool bVert, sal_uInt16 nCnt,
bool bSameHeight );
667 std::unique_ptr<SwFormatFrameSize> GetRowHeight()
const;
670 std::unique_ptr<SwFormatRowSplit> GetRowSplit()
const;
672 void SetBoxAlign( sal_uInt16 nOrient );
673 sal_uInt16 GetBoxAlign()
const;
675 bool BalanceRowHeight(
bool bTstOnly,
const bool bOptimize =
false );
682 void GetTabBackground( std::unique_ptr<SvxBrushItem>& rToFill )
const;
685 bool GetBoxBackground( std::unique_ptr<SvxBrushItem>& rToFill )
const;
688 bool GetBoxDirection( std::unique_ptr<SvxFrameDirectionItem>& rToFill )
const;
691 bool GetRowBackground( std::unique_ptr<SvxBrushItem>& rToFill )
const;
693 SwTab WhichMouseTabCol(
const Point &rPt )
const;
694 void GetTabCols(
SwTabCols &rToFill )
const;
695 void SetTabCols(
const SwTabCols &rNew,
bool bCurRowOnly );
696 void GetMouseTabCols(
SwTabCols &rToFill,
const Point &rPt )
const;
697 void SetMouseTabCols(
const SwTabCols &rNew,
bool bCurRowOnly,
701 bool SelTableRowCol(
const Point& rPt,
const Point* pEnd,
bool bRowDrag );
703 void GetTabRows(
SwTabCols &rToFill )
const;
704 void SetTabRows(
const SwTabCols &rNew,
bool bCurColOnly );
705 void GetMouseTabRows(
SwTabCols &rToFill,
const Point &rPt )
const;
706 void SetMouseTabRows(
const SwTabCols &rNew,
bool bCurColOnly,
const Point &rPt );
710 void UnProtectCells();
711 void UnProtectTables();
712 bool HasTableAnyProtection(
const OUString* pTableName,
713 bool* pFullTableProtection );
714 bool CanUnProtectCells()
const;
716 sal_uInt16 GetRowsToRepeat()
const;
717 void SetRowsToRepeat( sal_uInt16 nNumOfRows );
718 sal_uInt16 GetVirtPageNum()
const;
722 sal_uInt16 GetRowSelectionFromTop()
const;
727 void AdjustCellWidth(
const bool bBalance,
const bool bNoShrink );
730 bool IsAdjustCellWidthAllowed(
bool bBalance =
false )
const;
733 void SetTableStyle(
const OUString& rStyleName);
740 bool UpdateTableStyleFormatting(
SwTableNode *pTableNode =
nullptr,
bool bResetDirect =
false, OUString
const* pStyleName =
nullptr);
746 void GetAutoSum( OUString& rFormula )
const;
750 sal_uInt16 GetPhyPageNum()
const;
752 void SetNewPageOffset( sal_uInt16 nOffset );
753 void SetPageOffset( sal_uInt16 nOffset );
754 sal_uInt16 GetPageOffset()
const;
756 void InsertLabel(
const SwLabelType eType,
const OUString &rText,
const OUString& rSeparator,
757 const OUString& rNumberSeparator,
758 const bool bBefore,
const sal_uInt16 nId,
759 const OUString& rCharacterStyle,
760 const bool bCpyBrd );
764 sal_uInt16 GetCurMouseColNum(
const Point &rPt )
const;
765 size_t GetCurTabColNum()
const;
766 size_t GetCurMouseTabColNum(
const Point &rPt )
const;
767 sal_uInt16 GetCurOutColNum()
const;
769 bool IsColRightToLeft()
const;
770 bool IsTableRightToLeft()
const;
771 bool IsMouseTableRightToLeft(
const Point &rPt )
const;
772 bool IsTableVertical()
const;
774 bool IsLastCellInRow()
const;
779 void GetConnectableFrameFormats
780 (
SwFrameFormat & rFormat,
const OUString & rReference,
bool bSuccessors,
781 std::vector< OUString > & aPrevPageVec,
782 std::vector< OUString > & aThisPageVec,
783 std::vector< OUString > & aNextPageVec,
784 std::vector< OUString > & aRestVec);
796 Color GetShapeBackground()
const;
807 bool IsShapeDefaultHoriTextDirR2L()
const;
809 void ParkCursorInTab();
812 bool IsNumLabel(
const Point &rPt,
int nMaxOffset = -1 );
814 static bool IsVerticalModeAtNdAndPos(
const SwTextNode& _rTextNode,
815 const Point& _rDocPos );
820 SAL_DLLPRIVATE
void ClearColumnRowCache(
SwTabFrame const*);
virtual void MakeSelVisible()
show the current selected "object"
void Insert(sal_Unicode, bool bOnlyCurrCursor=false)
Edit (all selected ranges).
bool Copy(SwEditShell &rDestShell)
Copy content of all ranges at current position of cursor to given Shell.
std::unique_ptr< SwColCache > m_pColumnCache
SwTable::SearchType m_eTableInsertMode
insert table rows or columns instead of overwriting the existing table cells
bool IsInRepeatedHeadline() const
bool GotoNextFly(GotoObjFlags eType=GotoObjFlags::FlyAny)
Independent selecting of flys.
std::unique_ptr< SwColCache > m_pRowCache
bool m_bTableCopied
table copied to the clipboard by the last private copy
void SetTableInsertMode(SwTable::SearchType eFlag)
void SetCheckForOLEInCaption(bool bFlag)
comphelper::OInterfaceContainerHelper3< css::text::XPasteListener > m_aPasteListeners
bool IsInHeadline() const
void SetTableCopied(bool bCopied)
virtual void ConnectObj(svt::EmbeddedObjectRef &, const SwRect &rPrt, const SwRect &rFrame)=0
Connect objects with ActivateWhenVisible at Paint.
std::unique_ptr< SdrDropMarkerOverlay > m_pChainTo
bool GotoPrevFly(GotoObjFlags eType=GotoObjFlags::FlyAny)
bool IsCheckForOLEInCaption() const
Check resize of OLE-Object.
bool m_bCheckForOLEInCaption
const SdrMarkList * GetMarkList() const
std::unique_ptr< SdrDropMarkerOverlay > m_pChainFrom
SwTable::SearchType GetTableInsertMode() const
bool GetTableCopied() const
virtual void CalcAndSetScale(svt::EmbeddedObjectRef &xObj, const SwRect *pFlyPrtRect=nullptr, const SwRect *pFlyFrameRect=nullptr, const bool bNoTextFramePrtAreaChanged=false)=0
Client for OleObject has to be up-to-date regarding scaling.
general base class for all free-flowing frames
Base class of the Writer layout elements.
Of course Writer needs its own rectangles.
SwTabFrame is one table in the document layout, containing rows (which contain cells).
SwTextNode is a paragraph in the document model.
void ToggleHeaderFooterEdit()
Acts both for headers / footers, depending on the bShow(Header|Footer)Separator flags.
virtual void Insert(SotClipboardFormatId nFormat, const OUString &rFormatName) override
GotoObjFlags
values can be combined via logical or
@ OBJCNT_DONTCARE
Not determinable - different objects are selected.
@ FlyEmbeddedPrt
Rect of PrtArea of FlyFrame.
@ SectionPrt
Rect of current PrtArea of section.
@ PageCalc
... page will be formatted if required.
@ FlyEmbedded
Rect of current FlyFrame.
@ PagesArea
Rect covering the pages area.
@ PagePrt
Rect of current PrtArea of page.
@ SectionOutsideTable
Rect of current section but outside of table.
FrameTypeFlags
values can be combined via logical or
void ClearFEShellTabCols(SwDoc &rDoc, SwTabFrame const *const pFrame)
FlyProtectFlags
values can be combined via logical or
const SwFrameFormat * pFrameFormat
static void DeleteTable(SwDoc &rDoc, SwTable &rTable)