class SwFlyFrame; class SwTabCols; class SvxBrushItem; class SvxFrameDirectionItem; class SwTableAutoFormat; class SwFrame; class SwFormatFrameSize; class SwFormatRowSplit; class Outliner; class SwFrameFormat; struct SwSortOptions; class SdrMarkList; enumclass RndStdIds;
namespace svx
{ class ISdrObjectFilter;
} namespace com::sun::star::embed { class XEmbeddedObject; }
//! values can be combined via logical or enumclass FlyProtectFlags
{
NONE = 0,
Content = 1,
Size = 2,
Pos = 4,
Parent = 8, ///< Check only parents.
Fixed = 16, /**< Only protection that cannot be withdrawn
e.g. by OLE-server; also relevant for dialog. */
}; namespace o3tl
{ template<> struct typed_flags<FlyProtectFlags> : is_typed_flags<FlyProtectFlags, 31> {};
}
// For figuring out contents by position (D&D) enum ObjCntType
{
OBJCNT_NONE,
OBJCNT_FLY,
OBJCNT_GRF,
OBJCNT_OLE,
OBJCNT_SIMPLE,
OBJCNT_CONTROL,
OBJCNT_URLBUTTON,
OBJCNT_GROUPOBJ,
OBJCNT_DONTCARE ///< Not determinable - different objects are selected.
};
//For GetAnyCurRect enumclass CurRectType
{
Page, ///< Rect of current page.
PageCalc, ///< ... page will be formatted if required.
PagePrt, ///< Rect of current PrtArea of page.
Frame, ///< Rect of current frame.
FlyEmbedded, ///< Rect of current FlyFrame.
FlyEmbeddedPrt, ///< Rect of PrtArea of FlyFrame
Section, ///< Rect of current section.
SectionOutsideTable, ///< Rect of current section but outside of table.
SectionPrt, ///< Rect of current PrtArea of section.
HeaderFooter, ///< Rect of current header/footer
PagesArea ///< Rect covering the pages area
};
class SAL_DLLPUBLIC_RTTI SwFEShell : public SwEditShell
{ private: mutable std::unique_ptr<SwColCache> m_pColumnCache; mutable std::unique_ptr<SwColCache> m_pRowCache;
std::unique_ptr<SdrDropMarkerOverlay> m_pChainTo;
std::unique_ptr<SdrDropMarkerOverlay> m_pChainFrom; bool m_bCheckForOLEInCaption;
comphelper::OInterfaceContainerHelper3<css::text::XPasteListener> m_aPasteListeners; /// insert table rows or columns instead of overwriting the existing table cells
SwTable::SearchType m_eTableInsertMode; /// table copied to the clipboard by the last private copy bool m_bTableCopied;
/// Terminate actions for all shells and call ChangeLink. void EndAllActionAndCall();
void ScrollTo( const Point &rPt );
void ChangeOpaque( SdrLayerID nLayerId );
/** Used for mouse operations on a table:
@return a cell frame that is 'close' to rPt. */ const SwFrame *GetBox( const Point &rPt, bool* pbRow = nullptr, bool* pbCol = nullptr ) const;
// 0 == not in any column. static sal_uInt16 GetCurColNum_( const SwFrame *pFrame,
SwGetCurColNumPara* pPara );
/// Copy and Paste methods for internal clipboard. /// bDeleteRedlines: if content inside a delete redline should be stripped away in rClpDoc.
SW_DLLPUBLIC void Copy( SwDoc& rClpDoc, const OUString* pNewClpText = nullptr, bool bDeleteRedlines = true );
SW_DLLPUBLIC bool Paste( SwDoc& rClpDoc, bool bNestedTable = false );
/// Paste some pages into another doc - used in mailmerge.
SW_DLLPUBLIC void PastePages( SwFEShell& rToFill, sal_uInt16 nStartPage, sal_uInt16 nEndPage);
/// Is selected frame within another frame?
SW_DLLPUBLIC const SwFrameFormat* IsFlyInFly();
/** If an object has been given, exactly this object is selected
(instead of searching over position). */
SW_DLLPUBLIC bool SelectObj( const Point& rSelPt, sal_uInt8 nFlag = 0, SdrObject *pObj = nullptr );
SW_DLLPUBLIC void DelSelectedObj();
/** Move selection upwards or downwards (Z-Order). TRUE=totoporbottom.
FALSE = run past one other. */ void SelectionToTop ( bool bTop = true ); void SelectionToBottom( bool bBottom = true );
/** The following two methods return enum SdrHdlKind.
Declared as int in order to spare including SVDRAW.HXX. */ bool IsObjSelectable( const Point& rPt ); /// Same as IsObjSelectable(), but return the object as well.
SdrObject* GetObjAt(const Point& rPt); bool IsInsideSelectedObj( const Point& rPt ); ///< returns enum values /** Test if there is a draw object at that position and if it should be selected. The'should'isaimedatWritertextflyframeswhichmaybeinfrontof
the draw object. */ bool ShouldObjectBeSelected(const Point& rPt, bool *pSelectFrameInsteadOfCroppedImage = nullptr);
bool MoveAnchor( SwMove nDir );
/** @return if Upper of frame at current position is section frame Currentlyonlyusedbytherules.Tobereplacedbysomethingmore
sophisticated one day. */
SW_DLLPUBLIC bool IsDirectlyInSection() const;
/** For return values see above FrameType. pPt:CursrorDocPosrespectively;bStopAtFly:Stopatflysorcontinueoveranchor. Although(0,TRUE)iskindofastandard,theparametersarenotdefaultedhere
in order to force more conscious use especially of bStopAtFly. */
SW_DLLPUBLIC FrameTypeFlags GetFrameType( const Point *pPt, bool bStopAtFly ) const;
FrameTypeFlags GetSelFrameType() const; //Selection (Drawing)
/** check whether selected frame contains a control; *companionmethodtoGetSelFrameType,usedforpreventing
* drag&drop of controls into header */ bool IsSelContainsControl() const;
/// Methods for status line.
Point GetAnchorObjDiff() const;
Point GetObjAbsPos() const;
Size GetObjSize() const;
/// SS for envelopes: get all page-bound objects and set them to new page. void GetPageObjs( std::vector<SwFrameFormat*>& rFillArr ); void SetPageObjsNewPage( std::vector<SwFrameFormat*>& rFillArr );
/// Show current selection (frame / draw object as required). virtualvoid MakeSelVisible(ScrollSizeMode eScrollSizeMode = ScrollSizeMode::ScrollSizeDefault) override;
/** @return FrameFormat of object that may be under Point.
Object does not become selected! */ const SwFrameFormat* GetFormatFromObj( const Point& rPt, SwRect** pRectToFill = nullptr ) const;
/// @return a format too, if the point is over the text of any fly. const SwFrameFormat* GetFormatFromAnyObj( const Point& rPt ) const;
/** Which Protection is set at selected object? */
SW_DLLPUBLIC FlyProtectFlags IsSelObjProtected( FlyProtectFlags eType ) const;
/** Deliver graphic in rName besides graphic name. If graphic is
linked give name with path. rbLink is TRUE if graphic is linked. */ const Graphic *GetGrfAtPos( const Point &rDocPos,
OUString &rName, bool &rbLink ) const;
/// If a fly is selected, it draws cursor into the first ContentFrame.
SW_DLLPUBLIC const SwFrameFormat* SelFlyGrabCursor();
/// Get FlyFrameFormat; for UI macro linkage at Flys const SwFrameFormat* GetFlyFrameFormat() const;
SW_DLLPUBLIC SwFrameFormat* GetFlyFrameFormat();
/** OLE. Server requires new size. Desired values are adjusted as frame attributes. Ifthevaluesarenotallowed,theformattingclipsanddeterminesscaling. SeeCalcAndSetScale().
The @return value is the applied size. */
Size RequestObjectResize( const SwRect &rRect, const css::uno::Reference < css::embed::XEmbeddedObject >& );
/// The layout has been changed, so the active object has to be moved after that virtualvoid MoveObjectIfActive( svt::EmbeddedObjectRef& xObj, const Point& rOffset );
/** Client for OleObject has to be up-to-date regarding scaling. ImplementedinWrtShell. Ifapointerispassedonasize,thisistheobject'scurrentcore-size.
Else the size is provided via GetCurFlyRect(). */ virtualvoid CalcAndSetScale( svt::EmbeddedObjectRef& xObj, const SwRect *pFlyPrtRect = nullptr, const SwRect *pFlyFrameRect = nullptr, constbool bNoTextFramePrtAreaChanged = false ) = 0;
/** Connect objects with ActivateWhenVisible at Paint.
Called by notxtfrm::Paint, implemented in wrtsh. */ virtualvoid ConnectObj( svt::EmbeddedObjectRef&, const SwRect &rPrt, const SwRect &rFrame ) = 0;
/// Set name at selected FlyFrame.
SW_DLLPUBLIC void SetFlyName( const UIName& rName );
UIName GetFlyName() const;
/// get reference to OLE object (if there is one) for selected FlyFrame
css::uno::Reference < css::embed::XEmbeddedObject > GetOleRef() const;
/// Created unique name for frame.
SW_DLLPUBLIC UIName GetUniqueGrfName() const;
SW_DLLPUBLIC UIName GetUniqueOLEName() const;
SW_DLLPUBLIC UIName GetUniqueFrameName() const;
/// Jump to named Fly (graphic/OLE). bool GotoFly( const UIName& rName, FlyCntType eType, bool bSelFrame );
/// Position is a graphic with URL? const SwFrameFormat* IsURLGrfAtPos( const Point& rPt, OUString* pURL = nullptr,
OUString *pTargetFrameName = nullptr,
OUString *pURLDescription = nullptr ) const;
/** For Chain always connect Fly specified by format with that hit by point.
rRect contains rect of Fly (for its highlight). */
SwChainRet Chainable( SwRect &rRect, const SwFrameFormat &rSource, const Point &rPt ) const;
SwChainRet Chain( SwFrameFormat &rSource, const Point &rPt ); void Chain( SwFrameFormat &rSource, const SwFrameFormat &rDest ); void Unchain( SwFrameFormat &rFormat ); void HideChainMarker(); void SetChainMarker();
Size GetGraphicDefaultSize() const;
/// Temporary work around for bug. void CheckUnboundObjects();
SW_DLLPUBLIC void EndTextEdit(); ///< Deletes object if required.
/** Anchor type of selected object, RndStdIds::UNKNOWN if ambiguous or in case of frame selection.
Else RndStdIds::FLY_AT_PAGE or RndStdIds::FLY_AT_PARA. */
RndStdIds GetAnchorId() const;
/** Process of creating draw objects. At the beginning object type is passed. AttheendaCmdcanbepassed.Here,SDRCREATE_RESTRAINTENDforend orSdrCreateCmd::NextPointforapolygonmayberelevant. AfterRESTRAINTENDtheobjectiscreatedandselected.
BreakCreate interrupts the process. In this case no object is selected. */
SW_DLLPUBLIC bool BeginCreate( SdrObjKind eSdrObjectKind, const Point &rPos ); bool BeginCreate( SdrObjKind eSdrObjectKind, SdrInventor eObjInventor, const Point &);
SW_DLLPUBLIC void MoveCreate ( const Point &rPos );
SW_DLLPUBLIC bool EndCreate ( SdrCreateCmd eSdrCreateCmd ); void BreakCreate(); bool IsDrawCreate() const; void CreateDefaultShape(SdrObjKind eSdrObjectKind, const tools::Rectangle& rRect, sal_uInt16 nSlotId);
/// Functions for Rubberbox, it selects Draw-Objects bool BeginMark( const Point &rPos ); void MoveMark ( const Point &rPos ); bool EndMark ();
/// Create and destroy group, don't when frame is selected. bool IsGroupSelected(bool bAllowDiagams); ///< Can be a mixed selection! void GroupSelection(); ///< Afterwards the group is selected. void UnGroupSelection(); /**< The individual objects are selected, but
it is possible that there are groups included. */
void MirrorSelection( bool bHorizontal ); ///< Vertical if FALSE.
/** frmatr.hxx. Here no enum because of dependencies. boolvalueonlyforinternaluse!Anchorisnewlysetaccording
to current document position. Anchor is not re-set. */
SW_DLLPUBLIC void ChgAnchor( RndStdIds eAnchorId, bool bSameOnly = false, bool bPosCorr = true );
bool SetDrawingAttr( SfxItemSet &rSet );
/** Get selected DrawObj as graphics (MetaFile/Bitmap).
Return value indicates if it was converted. */ bool GetDrawObjGraphic( SotClipboardFormatId nFormat, Graphic& rGrf ) const;
/// Insertion of a drawing object which have to be already inserted in the DrawModel. void InsertDrawObj( SdrObject& rDrawObj, const Point& rInsertPosition );
/// Page number of the page containing Point, O if no page.
sal_uInt16 GetPageNumber( const Point &rPoint ) const;
SW_DLLPUBLIC bool GetPageNumber( tools::Long nYPos, bool bAtCursorPos, sal_uInt16& rPhyNum, sal_uInt16& rVirtNum, OUString &rDisplay ) const;
SW_DLLPUBLIC void ProtectCells(); /**< If a table selection exists it is destroyed in case
cursor is not allowed in readonly. */
SW_DLLPUBLIC void UnProtectCells(); ///< Refers to table selection. void UnProtectTables(); ///< Unprotect all tables in selection. bool HasTableAnyProtection( const UIName* pTableName, bool* pFullTableProtection ); bool CanUnProtectCells() const;
/// Not allowed if only empty cells are selected. bool IsAdjustCellWidthAllowed( bool bBalance = false ) const;
/// Set table style of the current table. void SetTableStyle(const TableStyleName& rStyleName);
SW_DLLPUBLIC bool SetTableStyle(const SwTableAutoFormat& rNew);
SW_DLLPUBLIC bool ResetTableStyle();
/// Update the direct formatting according to the current table style. /// @param pTableNode Table node to update. When nullptr, current cursor position is used. /// @param bResetDirect Reset direct formatting that might be applied to the cells. /// @param pStyleName new style to apply bool UpdateTableStyleFormatting(SwTableNode *pTableNode = nullptr, bool bResetDirect = false, TableStyleName const* pStyleName = nullptr);
/// The ruler needs some information too.
SW_DLLPUBLIC sal_uInt16 GetCurColNum( SwGetCurColNumPara* pPara = nullptr ) const; //0 == not in any column.
sal_uInt16 GetCurMouseColNum( const Point &rPt ) const;
size_t GetCurTabColNum() const; //0 == not in any table.
size_t GetCurMouseTabColNum( const Point &rPt ) const;
sal_uInt16 GetCurOutColNum() const; ///< Current outer column.
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.