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>
39 namespace editeng {
class SvxBorderLine; }
57 class ISdrObjectFilter;
166 #define SW_ADD_SELECT 1
167 #define SW_ENTER_GROUP 2
168 #define SW_LEAVE_FRAME 4
169 #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);
266 bool Copy(
SwFEShell&,
const Point& rSttPt,
const Point& rInsPt,
267 bool bIsMove =
false,
bool bSelectInsert =
true );
276 bool SelectObj(
const Point& rSelPt,
sal_uInt8 nFlag = 0,
SdrObject *pObj =
nullptr );
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;
311 FrameTypeFlags GetFrameType(
const Point *pPt,
bool bStopAtFly )
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,
336 const SwPosition* _pToCharContentPos =
nullptr,
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 );
365 const SwFrameFormat* GetFormatFromObj(
const Point& rPt,
SwRect** pRectToFill =
nullptr )
const;
368 const SwFrameFormat* GetFormatFromAnyObj(
const Point& rPt )
const;
375 const Graphic *GetGrfAtPos(
const Point &rDocPos,
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 );
383 bool IsFrameSelected()
const;
384 bool GetFlyFrameAttr(
SfxItemSet &rSet )
const;
387 void ResetFlyFrameAttr(
const SfxItemSet* pSet );
390 void SetFlyPos(
const Point &rAbsPos);
391 Point FindAnchorPos(
const Point &rAbsPos,
bool bMoveIt =
false );
396 bool IsFrameVertical(
const bool bEnvironment,
bool& bRightToLeft,
bool& bVertL2R)
const;
399 void SetFrameFormat(
SwFrameFormat *pFormat,
bool bKeepOrient =
false, Point
const * pDocPos =
nullptr );
405 SwFlyFrame* GetCurrFlyFrame(
const bool bCalcFrame =
true)
const;
408 SwFlyFrame* GetSelectedOrCurrFlyFrame()
const;
415 {
return GotoObj(
true,
eType ); }
417 {
return GotoObj(
false,
eType); }
420 size_t GetFlyCount(
FlyCntType eType,
bool bIgnoreTextBoxes =
false )
const;
423 std::vector<SwFrameFormat const*> GetFlyFrameFormats(
437 Size RequestObjectResize(
const SwRect &rRect,
const css::uno::Reference < css::embed::XEmbeddedObject >& );
447 const SwRect *pFlyPrtRect =
nullptr,
448 const SwRect *pFlyFrameRect =
nullptr,
449 const bool bNoTextFramePrtAreaChanged =
false ) = 0;
455 const SwRect &rFrame ) = 0;
462 void SetFlyName(
const OUString& rName );
463 OUString GetFlyName()
const;
466 css::uno::Reference < css::embed::XEmbeddedObject > GetOleRef()
const;
469 OUString GetUniqueGrfName()
const;
470 OUString GetUniqueOLEName()
const;
471 OUString GetUniqueFrameName()
const;
474 bool GotoFly(
const OUString& rName,
FlyCntType eType,
478 const SwFrameFormat* IsURLGrfAtPos(
const Point& rPt, OUString* pURL =
nullptr,
479 OUString *pTargetFrameName =
nullptr,
480 OUString *pURLDescription =
nullptr )
const;
488 void HideChainMarker();
489 void SetChainMarker();
491 Size GetGraphicDefaultSize()
const;
494 void CheckUnboundObjects();
502 bool* pbWrapped =
nullptr);
512 void StartCropImage();
515 bool IsRotationOfSwGrfNodePossible()
const;
517 size_t IsObjSelected()
const;
518 bool IsObjSelected(
const SdrObject& rObj )
const;
519 bool IsObjSameLevelWithMarked(
const SdrObject* pObj)
const;
533 bool BeginCreate(
SdrObjKind eSdrObjectKind,
const Point &rPos );
535 void MoveCreate (
const Point &rPos );
538 bool IsDrawCreate()
const;
543 void MoveMark (
const Point &rPos );
547 bool IsGroupSelected(
bool bAllowDiagams);
548 void GroupSelection();
549 void UnGroupSelection();
552 bool IsGroupAllowed()
const;
553 bool IsUnGroupAllowed()
const;
555 void MirrorSelection(
bool bHorizontal );
560 void ChgAnchor(
RndStdIds eAnchorId,
bool bSameOnly =
false,
561 bool bPosCorr =
true );
570 bool Paste(
const Graphic &rGrf,
const OUString& rURL );
574 bool IsAlignPossible()
const;
575 void SetCalcFieldValueHdl(
Outliner* pOutliner);
577 void Insert(
const OUString& rGrfName,
578 const OUString& rFltName,
584 const Point& rInsertPosition );
586 void ReplaceSdrObj(
const OUString& rGrfName,
const Graphic* pGrf );
591 void AlignFormulaToBaseline(
const css::uno::Reference < css::embed::XEmbeddedObject >& xObj );
594 void AlignAllFormulasToBaseline();
597 Point GetContentPos(
const Point& rPoint,
bool bNext )
const;
600 Point GetRelativePagePosition(
const Point& rDocPos);
608 size_t GetCurPageDesc(
const bool bCalcFrame =
true )
const;
609 size_t GetMousePageDesc(
const Point &rPt )
const;
610 size_t GetPageDescCnt()
const;
611 SwPageDesc* FindPageDescByName(
const OUString& rName,
612 bool bGetFromPool =
false,
613 size_t* pPos =
nullptr );
615 const SwPageDesc& GetPageDesc(
size_t i )
const;
616 void ChgPageDesc(
size_t i,
const SwPageDesc& );
619 const SwPageDesc* GetSelectedPageDescs()
const;
622 const Point* pPt =
nullptr,
623 const css::uno::Reference < css::embed::XEmbeddedObject >& =
624 css::uno::Reference < css::embed::XEmbeddedObject >() )
const;
627 sal_uInt16 GetPageNumber(
const Point &rPoint )
const;
628 bool GetPageNumber(
tools::Long nYPos,
bool bAtCursorPos, sal_uInt16& rPhyNum, sal_uInt16& rVirtNum, OUString &rDisplay )
const;
637 bool HasWholeTabSelection()
const;
640 bool HasBoxSelection()
const;
642 void InsertRow( sal_uInt16 nCnt,
bool bBehind );
643 void InsertCol( sal_uInt16 nCnt,
bool bBehind );
646 bool DeleteRow(
bool bCompleteTable =
false);
654 bool DeleteTableSel();
658 void SplitTab(
bool bVert, sal_uInt16 nCnt,
bool bSameHeight );
665 std::unique_ptr<SwFormatFrameSize> GetRowHeight()
const;
668 std::unique_ptr<SwFormatRowSplit> GetRowSplit()
const;
670 void SetBoxAlign( sal_uInt16 nOrient );
671 sal_uInt16 GetBoxAlign()
const;
673 bool BalanceRowHeight(
bool bTstOnly,
const bool bOptimize =
false );
680 void GetTabBackground( std::unique_ptr<SvxBrushItem>& rToFill )
const;
683 bool GetBoxBackground( std::unique_ptr<SvxBrushItem>& rToFill )
const;
686 bool GetBoxDirection( std::unique_ptr<SvxFrameDirectionItem>& rToFill )
const;
689 bool GetRowBackground( std::unique_ptr<SvxBrushItem>& rToFill )
const;
691 SwTab WhichMouseTabCol(
const Point &rPt )
const;
692 void GetTabCols(
SwTabCols &rToFill )
const;
693 void SetTabCols(
const SwTabCols &rNew,
bool bCurRowOnly );
694 void GetMouseTabCols(
SwTabCols &rToFill,
const Point &rPt )
const;
695 void SetMouseTabCols(
const SwTabCols &rNew,
bool bCurRowOnly,
699 bool SelTableRowCol(
const Point& rPt,
const Point* pEnd,
bool bRowDrag );
701 void GetTabRows(
SwTabCols &rToFill )
const;
702 void SetTabRows(
const SwTabCols &rNew,
bool bCurColOnly );
703 void GetMouseTabRows(
SwTabCols &rToFill,
const Point &rPt )
const;
704 void SetMouseTabRows(
const SwTabCols &rNew,
bool bCurColOnly,
const Point &rPt );
708 void UnProtectCells();
709 void UnProtectTables();
710 bool HasTableAnyProtection(
const OUString* pTableName,
711 bool* pFullTableProtection );
712 bool CanUnProtectCells()
const;
714 sal_uInt16 GetRowsToRepeat()
const;
715 void SetRowsToRepeat( sal_uInt16 nNumOfRows );
716 sal_uInt16 GetVirtPageNum()
const;
720 sal_uInt16 GetRowSelectionFromTop()
const;
725 void AdjustCellWidth(
const bool bBalance,
const bool bNoShrink );
728 bool IsAdjustCellWidthAllowed(
bool bBalance =
false )
const;
731 void SetTableStyle(
const OUString& rStyleName);
738 bool UpdateTableStyleFormatting(
SwTableNode *pTableNode =
nullptr,
bool bResetDirect =
false, OUString
const* pStyleName =
nullptr);
744 void GetAutoSum( OUString& rFormula )
const;
748 sal_uInt16 GetPhyPageNum()
const;
750 void SetNewPageOffset( sal_uInt16 nOffset );
751 void SetPageOffset( sal_uInt16 nOffset );
752 sal_uInt16 GetPageOffset()
const;
754 void InsertLabel(
const SwLabelType eType,
const OUString &rText,
const OUString& rSeparator,
755 const OUString& rNumberSeparator,
756 const bool bBefore,
const sal_uInt16 nId,
757 const OUString& rCharacterStyle,
758 const bool bCpyBrd );
762 sal_uInt16 GetCurMouseColNum(
const Point &rPt )
const;
763 size_t GetCurTabColNum()
const;
764 size_t GetCurMouseTabColNum(
const Point &rPt )
const;
765 sal_uInt16 GetCurOutColNum()
const;
767 bool IsColRightToLeft()
const;
768 bool IsTableRightToLeft()
const;
769 bool IsMouseTableRightToLeft(
const Point &rPt )
const;
770 bool IsTableVertical()
const;
772 bool IsLastCellInRow()
const;
777 void GetConnectableFrameFormats
778 (
SwFrameFormat & rFormat,
const OUString & rReference,
bool bSuccessors,
779 std::vector< OUString > & aPrevPageVec,
780 std::vector< OUString > & aThisPageVec,
781 std::vector< OUString > & aNextPageVec,
782 std::vector< OUString > & aRestVec);
794 Color GetShapeBackground()
const;
805 bool IsShapeDefaultHoriTextDirR2L()
const;
807 void ParkCursorInTab();
809 SwTextNode * GetNumRuleNodeAtPos(
const Point &rPot);
810 bool IsNumLabel(
const Point &rPt,
int nMaxOffset = -1 );
812 static bool IsVerticalModeAtNdAndPos(
const SwTextNode& _rTextNode,
813 const Point& _rDocPos );
818 SAL_DLLPRIVATE
void ClearColumnRowCache(
SwTabFrame const*);
Base class of the Writer layout elements.
static void DeleteTable(SwDoc &rDoc, SwTable &rTable)
Rect of current FlyFrame.
Marks a position in the document model.
std::unique_ptr< SdrDropMarkerOverlay > m_pChainFrom
SwTable::SearchType GetTableInsertMode() const
std::unique_ptr< SwColCache > m_pColumnCache
SwTabFrame is one table in the document layout, containing rows (which contain cells).
virtual void MakeSelVisible()
show the current selected "object"
const SdrMarkList * GetMarkList() const
Of course Writer needs its own rectangles.
bool GotoNextFly(GotoObjFlags eType=GotoObjFlags::FlyAny)
Independent selecting of flys.
bool IsInRepeatedHeadline() const
Rect of current PrtArea of section.
SwTable::SearchType m_eTableInsertMode
insert table rows or columns instead of overwriting the existing table cells
std::unique_ptr< SdrDropMarkerOverlay > m_pChainTo
GotoObjFlags
values can be combined via logical or
bool IsCheckForOLEInCaption() const
Check resize of OLE-Object.
comphelper::OInterfaceContainerHelper3< css::text::XPasteListener > m_aPasteListeners
Rect of current PrtArea of page.
Rect of current section but outside of table.
void SetCheckForOLEInCaption(bool bFlag)
FrameTypeFlags
values can be combined via logical or
Not determinable - different objects are selected.
FlyProtectFlags
values can be combined via logical or
bool m_bCheckForOLEInCaption
SwTextNode is a paragraph in the document model.
void SetTableCopied(bool bCopied)
bool GotoPrevFly(GotoObjFlags eType=GotoObjFlags::FlyAny)
general base class for all free-flowing frames
Rect covering the pages area.
void ToggleHeaderFooterEdit()
Acts both for headers / footers, depending on the bShow(Header|Footer)Separator flags.
void ClearFEShellTabCols(SwDoc &rDoc, SwTabFrame const *const pFrame)
... page will be formatted if required.
std::unique_ptr< SwColCache > m_pRowCache
Rect of current header/footer.
bool Copy(SwEditShell &rDestShell)
Copy content of all ranges at current position of cursor to given Shell.
const SwFrameFormat * pFrameFormat
void Insert(sal_Unicode, bool bOnlyCurrCursor=false)
Edit (all selected ranges).
bool IsInHeadline() const
bool GetTableCopied() const
void SetTableInsertMode(SwTable::SearchType eFlag)
bool m_bTableCopied
table copied to the clipboard by the last private copy
Rect of PrtArea of FlyFrame.