19 #ifndef INCLUDED_SW_INC_FESH_HXX
20 #define INCLUDED_SW_INC_FESH_HXX
22 #include <com/sun/star/text/RelOrientation.hpp>
31 #include <rtl/ustring.hxx>
38 namespace editeng {
class SvxBorderLine; }
56 class ISdrObjectFilter;
165 #define SW_ADD_SELECT 1
166 #define SW_ENTER_GROUP 2
167 #define SW_LEAVE_FRAME 4
168 #define SW_ALLOW_TEXTBOX 8
214 SAL_DLLPRIVATE
SwFlyFrame *FindFlyFrame(
const css::uno::Reference < css::embed::XEmbeddedObject >& )
const;
217 SAL_DLLPRIVATE
void EndAllActionAndCall();
219 SAL_DLLPRIVATE
void ScrollTo(
const Point &rPt );
221 SAL_DLLPRIVATE
void ChangeOpaque(
SdrLayerID nLayerId );
225 SAL_DLLPRIVATE
const SwFrame *GetBox(
const Point &rPt,
bool* pbRow =
nullptr,
bool* pbCol =
nullptr )
const;
228 SAL_DLLPRIVATE
static sal_uInt16 GetCurColNum_(
const SwFrame *pFrame,
231 SAL_DLLPRIVATE
void GetTabCols_(
SwTabCols &rToFill,
const SwFrame *pBox)
const;
232 SAL_DLLPRIVATE
void GetTabRows_(
SwTabCols &rToFill,
const SwFrame *pBox)
const;
234 SAL_DLLPRIVATE
bool ImpEndCreate();
237 SAL_DLLPRIVATE
bool CopyDrawSel(
SwFEShell& rDestShell,
const Point& rSttPt,
238 const Point& rInsPt,
bool bIsMove,
239 bool bSelectInsert );
243 SAL_DLLPRIVATE
const SdrMarkList* GetMarkList_()
const;
245 SAL_DLLPRIVATE
bool CheckHeadline(
bool bRepeat )
const;
258 void Copy(
SwDoc& rClpDoc,
const OUString* pNewClpText =
nullptr );
259 bool Paste(
SwDoc& rClpDoc,
bool bNestedTable =
false );
262 void PastePages(
SwFEShell& rToFill, sal_uInt16 nStartPage, sal_uInt16 nEndPage);
265 bool Copy(
SwFEShell&,
const Point& rSttPt,
const Point& rInsPt,
266 bool bIsMove =
false,
bool bSelectInsert =
true );
275 bool SelectObj(
const Point& rSelPt,
sal_uInt8 nFlag = 0,
SdrObject *pObj =
nullptr );
276 void DelSelectedObj();
281 void SelectionToTop (
bool bTop =
true );
282 void SelectionToBottom(
bool bBottom =
true );
285 void SelectionToHeaven();
286 void SelectionToHell();
290 bool IsObjSelectable(
const Point& rPt );
293 bool IsInsideSelectedObj(
const Point& rPt );
297 bool ShouldObjectBeSelected(
const Point& rPt);
299 bool MoveAnchor(
SwMove nDir );
304 bool IsDirectlyInSection()
const;
310 FrameTypeFlags GetFrameType(
const Point *pPt,
bool bStopAtFly )
const;
316 bool IsSelContainsControl()
const;
323 SwRect GetObjRect()
const;
326 SwRect GetFlyRect()
const;
331 void CalcBoundRect(
SwRect& _orRect,
333 const sal_Int16 _eHoriRelOrient = css::text::RelOrientation::FRAME,
334 const sal_Int16 _eVertRelOrient = css::text::RelOrientation::FRAME,
335 const SwPosition* _pToCharContentPos =
nullptr,
336 const bool _bFollowTextFlow =
false,
337 bool _bMirror =
false,
338 Point* _opRef =
nullptr,
339 Size* _opPercent =
nullptr,
343 void SetObjRect(
const SwRect& rRect );
345 void BeginDrag(
const Point *pPt,
bool bProp );
346 void Drag (
const Point *pPt,
bool bProp );
351 Point GetAnchorObjDiff()
const;
352 Point GetObjAbsPos()
const;
353 Size GetObjSize()
const;
356 void GetPageObjs( std::vector<SwFrameFormat*>& rFillArr );
357 void SetPageObjsNewPage( std::vector<SwFrameFormat*>& rFillArr );
364 const SwFrameFormat* GetFormatFromObj(
const Point& rPt,
SwRect** pRectToFill =
nullptr )
const;
367 const SwFrameFormat* GetFormatFromAnyObj(
const Point& rPt )
const;
374 const Graphic *GetGrfAtPos(
const Point &rDocPos,
375 OUString &rName,
bool &rbLink )
const;
377 OUString GetObjTitle()
const;
378 void SetObjTitle(
const OUString& rTitle );
379 OUString GetObjDescription()
const;
380 void SetObjDescription(
const OUString& rDescription );
382 bool IsFrameSelected()
const;
383 bool GetFlyFrameAttr(
SfxItemSet &rSet )
const;
386 void ResetFlyFrameAttr(
const SfxItemSet* pSet );
389 void SetFlyPos(
const Point &rAbsPos);
390 Point FindAnchorPos(
const Point &rAbsPos,
bool bMoveIt =
false );
395 bool IsFrameVertical(
const bool bEnvironment,
bool& bRightToLeft,
bool& bVertL2R)
const;
398 void SetFrameFormat(
SwFrameFormat *pFormat,
bool bKeepOrient =
false, Point
const * pDocPos =
nullptr );
404 SwFlyFrame* GetCurrFlyFrame(
const bool bCalcFrame =
true)
const;
407 SwFlyFrame* GetSelectedOrCurrFlyFrame()
const;
414 {
return GotoObj(
true,
eType ); }
416 {
return GotoObj(
false,
eType); }
419 size_t GetFlyCount(
FlyCntType eType,
bool bIgnoreTextBoxes =
false )
const;
422 std::vector<SwFrameFormat const*> GetFlyFrameFormats(
436 Size RequestObjectResize(
const SwRect &rRect,
const css::uno::Reference < css::embed::XEmbeddedObject >& );
446 const SwRect *pFlyPrtRect =
nullptr,
447 const SwRect *pFlyFrameRect =
nullptr,
448 const bool bNoTextFramePrtAreaChanged =
false ) = 0;
454 const SwRect &rFrame ) = 0;
461 void SetFlyName(
const OUString& rName );
462 OUString GetFlyName()
const;
465 css::uno::Reference < css::embed::XEmbeddedObject > GetOleRef()
const;
468 OUString GetUniqueGrfName()
const;
469 OUString GetUniqueOLEName()
const;
470 OUString GetUniqueFrameName()
const;
473 bool GotoFly(
const OUString& rName,
FlyCntType eType,
477 const SwFrameFormat* IsURLGrfAtPos(
const Point& rPt, OUString* pURL =
nullptr,
478 OUString *pTargetFrameName =
nullptr,
479 OUString *pURLDescription =
nullptr )
const;
487 void HideChainMarker();
488 void SetChainMarker();
490 Size GetGraphicDefaultSize()
const;
493 void CheckUnboundObjects();
509 void StartCropImage();
512 bool IsRotationOfSwGrfNodePossible()
const;
514 size_t IsObjSelected()
const;
515 bool IsObjSelected(
const SdrObject& rObj )
const;
516 bool IsObjSameLevelWithMarked(
const SdrObject* pObj)
const;
530 bool BeginCreate(
SdrObjKind eSdrObjectKind,
const Point &rPos );
532 void MoveCreate (
const Point &rPos );
535 bool IsDrawCreate()
const;
540 void MoveMark (
const Point &rPos );
544 bool IsGroupSelected();
545 void GroupSelection();
546 void UnGroupSelection();
549 bool IsGroupAllowed()
const;
550 bool IsUnGroupAllowed()
const;
552 void MirrorSelection(
bool bHorizontal );
557 void ChgAnchor(
RndStdIds eAnchorId,
bool bSameOnly =
false,
558 bool bPosCorr =
true );
567 bool Paste(
const Graphic &rGrf,
const OUString& rURL );
571 bool IsAlignPossible()
const;
572 void SetCalcFieldValueHdl(
Outliner* pOutliner);
574 void Insert(
const OUString& rGrfName,
575 const OUString& rFltName,
581 const Point& rInsertPosition );
583 void ReplaceSdrObj(
const OUString& rGrfName,
const Graphic* pGrf );
588 void AlignFormulaToBaseline(
const css::uno::Reference < css::embed::XEmbeddedObject >& xObj );
591 void AlignAllFormulasToBaseline();
594 Point GetContentPos(
const Point& rPoint,
bool bNext )
const;
597 Point GetRelativePagePosition(
const Point& rDocPos);
605 size_t GetCurPageDesc(
const bool bCalcFrame =
true )
const;
606 size_t GetMousePageDesc(
const Point &rPt )
const;
607 size_t GetPageDescCnt()
const;
608 SwPageDesc* FindPageDescByName(
const OUString& rName,
609 bool bGetFromPool =
false,
610 size_t* pPos =
nullptr );
612 const SwPageDesc& GetPageDesc(
size_t i )
const;
613 void ChgPageDesc(
size_t i,
const SwPageDesc& );
616 const SwPageDesc* GetSelectedPageDescs()
const;
619 const Point* pPt =
nullptr,
620 const css::uno::Reference < css::embed::XEmbeddedObject >& =
621 css::uno::Reference < css::embed::XEmbeddedObject >() )
const;
624 sal_uInt16 GetPageNumber(
const Point &rPoint )
const;
625 bool GetPageNumber(
tools::Long nYPos,
bool bAtCursorPos, sal_uInt16& rPhyNum, sal_uInt16& rVirtNum, OUString &rDisplay )
const;
634 bool HasWholeTabSelection()
const;
637 bool HasBoxSelection()
const;
639 void InsertRow( sal_uInt16 nCnt,
bool bBehind );
640 void InsertCol( sal_uInt16 nCnt,
bool bBehind );
643 bool DeleteRow(
bool bCompleteTable =
false);
651 bool DeleteTableSel();
655 void SplitTab(
bool bVert, sal_uInt16 nCnt,
bool bSameHeight );
662 std::unique_ptr<SwFormatFrameSize> GetRowHeight()
const;
665 std::unique_ptr<SwFormatRowSplit> GetRowSplit()
const;
667 void SetBoxAlign( sal_uInt16 nOrient );
668 sal_uInt16 GetBoxAlign()
const;
670 bool BalanceRowHeight(
bool bTstOnly,
const bool bOptimize =
false );
677 void GetTabBackground( std::unique_ptr<SvxBrushItem>& rToFill )
const;
680 bool GetBoxBackground( std::unique_ptr<SvxBrushItem>& rToFill )
const;
683 bool GetBoxDirection( std::unique_ptr<SvxFrameDirectionItem>& rToFill )
const;
686 bool GetRowBackground( std::unique_ptr<SvxBrushItem>& rToFill )
const;
688 SwTab WhichMouseTabCol(
const Point &rPt )
const;
689 void GetTabCols(
SwTabCols &rToFill )
const;
690 void SetTabCols(
const SwTabCols &rNew,
bool bCurRowOnly );
691 void GetMouseTabCols(
SwTabCols &rToFill,
const Point &rPt )
const;
692 void SetMouseTabCols(
const SwTabCols &rNew,
bool bCurRowOnly,
696 bool SelTableRowCol(
const Point& rPt,
const Point* pEnd,
bool bRowDrag );
698 void GetTabRows(
SwTabCols &rToFill )
const;
699 void SetTabRows(
const SwTabCols &rNew,
bool bCurColOnly );
700 void GetMouseTabRows(
SwTabCols &rToFill,
const Point &rPt )
const;
701 void SetMouseTabRows(
const SwTabCols &rNew,
bool bCurColOnly,
const Point &rPt );
705 void UnProtectCells();
706 void UnProtectTables();
707 bool HasTableAnyProtection(
const OUString* pTableName,
708 bool* pFullTableProtection );
709 bool CanUnProtectCells()
const;
711 sal_uInt16 GetRowsToRepeat()
const;
712 void SetRowsToRepeat( sal_uInt16 nNumOfRows );
713 sal_uInt16 GetVirtPageNum()
const;
717 sal_uInt16 GetRowSelectionFromTop()
const;
722 void AdjustCellWidth(
const bool bBalance,
const bool bNoShrink );
725 bool IsAdjustCellWidthAllowed(
bool bBalance =
false )
const;
728 bool SetTableStyle(
const OUString& rStyleName);
735 bool UpdateTableStyleFormatting(
SwTableNode *pTableNode =
nullptr,
bool bResetDirect =
false, OUString
const* pStyleName =
nullptr);
741 void GetAutoSum( OUString& rFormula )
const;
745 sal_uInt16 GetPhyPageNum()
const;
747 void SetNewPageOffset( sal_uInt16 nOffset );
748 void SetPageOffset( sal_uInt16 nOffset );
749 sal_uInt16 GetPageOffset()
const;
751 void InsertLabel(
const SwLabelType eType,
const OUString &rText,
const OUString& rSeparator,
752 const OUString& rNumberSeparator,
753 const bool bBefore,
const sal_uInt16 nId,
754 const OUString& rCharacterStyle,
755 const bool bCpyBrd );
759 sal_uInt16 GetCurMouseColNum(
const Point &rPt )
const;
760 size_t GetCurTabColNum()
const;
761 size_t GetCurMouseTabColNum(
const Point &rPt )
const;
762 sal_uInt16 GetCurOutColNum()
const;
764 bool IsColRightToLeft()
const;
765 bool IsTableRightToLeft()
const;
766 bool IsMouseTableRightToLeft(
const Point &rPt )
const;
767 bool IsTableVertical()
const;
769 bool IsLastCellInRow()
const;
774 void GetConnectableFrameFormats
775 (
SwFrameFormat & rFormat,
const OUString & rReference,
bool bSuccessors,
776 std::vector< OUString > & aPrevPageVec,
777 std::vector< OUString > & aThisPageVec,
778 std::vector< OUString > & aNextPageVec,
779 std::vector< OUString > & aRestVec);
791 Color GetShapeBackgrd()
const;
802 bool IsShapeDefaultHoriTextDirR2L()
const;
804 void ParkCursorInTab();
806 SwTextNode * GetNumRuleNodeAtPos(
const Point &rPot);
807 bool IsNumLabel(
const Point &rPt,
int nMaxOffset = -1 );
809 static bool IsVerticalModeAtNdAndPos(
const SwTextNode& _rTextNode,
810 const Point& _rDocPos );
815 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
comphelper::OInterfaceContainerHelper2 m_aPasteListeners
std::unique_ptr< SdrDropMarkerOverlay > m_pChainTo
GotoObjFlags
values can be combined via logical or
bool IsCheckForOLEInCaption() const
Check resize of OLE-Object.
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.