/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
namespace vcl { class Window; } class SbxArray; class SwFlyFrameAttrMgr; class SwField; class SwTOXBase; class SwView; class SvGlobalName; class SwInputFieldList; class SwSectionData; class SvxMacro; class SwFormatINetFormat; class SvxAutoCorrect; class NaviContentBookmark; struct SwCallMouseEvent; class SfxStringListItem; enumclass SvMacroItemId : sal_uInt16; class SwFieldMgr; class SfxRequest; enumclass SwLineBreakClear; enumclass SwContentControlType;
namespace i18nutil { struct SearchOptions2;
}
enumclass SelectionType : sal_Int32
{
NONE = 0x000000,
Text = CNT_TXT, // text, never frames too 0x0001
Graphic = CNT_GRF, // graphic 0x0002
Ole = CNT_OLE, // OLE 0x0010
Frame = 0x000020, // frame, no content type
NumberList = 0x000040, // NumList
Table = 0x000080, // cursor is in table
TableCell = 0x000100, // table cells are selected
DrawObject = 0x000200, // drawing objects (rectangle, circle...)
DrawObjectEditMode = 0x000400, // draw-textobjects in edit mode
Ornament = 0x000800, // edit ornament objects
DbForm = 0x001000, // drawing objects: DB-Forms
FormControl = 0x002000, // a form control is focused. Neither set nor evaluated by the SwWrtShell itself, only by its clients.
Media = 0x004000, // Media object
ExtrudedCustomShape = 0x008000, // extruded custom shape
FontWork = 0x010000, // fontwork
PostIt = 0x020000, // annotation
TableRow = 0x040000, // table rows are selected
TableCol = 0x080000, // table columns are selected
All = 0x0ffff3,
}; namespace o3tl { template<> struct typed_flags<SelectionType> : is_typed_flags<SelectionType, 0x0ffff3> {};
}
/** Used by the UI to modify the document model.
Eg. the Insert() method will take the current cursor position, insert the string, and take care of undo etc.
*/ class SAL_DLLPUBLIC_RTTI SwWrtShell final : public SwFEShell
{ private: using SwCursorShell::Left; using SwCursorShell::Right; using SwCursorShell::Up; using SwCursorShell::Down; using SwCursorShell::LeftMargin; using SwCursorShell::RightMargin; using SwCursorShell::SelectTextAttr; using SwCursorShell::GotoPage; using SwFEShell::InsertObject; using SwEditShell::AutoCorrect; using SwCursorShell::GotoMark;
typedef tools::Long (SwWrtShell::*SELECTFUNC)(const Point *, bool bProp, ScrollSizeMode eScrollSizeMode ); typedefvoid (SwWrtShell::*SELECTFUNC2)(const Point *, bool bProp );
// reset all selections
SW_DLLPUBLIC tools::Long ResetSelect( const Point *, bool, ScrollSizeMode );
// resets the cursorstack after movement with PageUp/-Down if a stack is built up inlinevoid ResetCursorStack();
SW_DLLPUBLIC SelectionType GetSelectionType() const;
// checks if the section is editable in read-only mode bool IsSectionEditableInReadonly() const;
// select table cells for editing of formulas in the ribbonbar inlinevoid SelTableCells( const Link<SwWrtShell&,void> &rLink ); inlinevoid EndSelTableCells();
// leave per word or per line selection mode. Is usually called in MB-Up. bool IsExtSel() const { return m_bSelWrd || m_bSelLn; }
// query whether the active m_fnDrag pointer is set to BeginDrag // is needed for MouseMove to work around bugs 55592/55931 inlinebool Is_FnDragEQBeginDrag() const;
// set the cursor to page "nPage" at the beginning // additionally to an identically named implementation in crsrsh.hxx // here all existing selections are being reset before setting the // cursor
SW_DLLPUBLIC bool GotoPage( sal_uInt16 nPage, bool bRecord );
// setting the cursor; remember the old position for turning back
DECL_LINK( ExecFlyMac, const SwFlyFrameFormat*, void );
// also deletes the frame or sets the cursor in the frame when bDelFrame == false
SW_DLLPUBLIC bool DelRight(bool isReplaceHeuristic = false);
SW_DLLPUBLIC void DelToEndOfPara(); void DelToStartOfPara();
SW_DLLPUBLIC bool DelToEndOfSentence(); void DelToStartOfSentence(); void DelNxtWord(); void DelPrvWord();
// checks whether a word selection exists. // According to the rules for intelligent Cut / Paste // surrounding spaces are cut out. // returns type of word selection (see enum) enum word {
NO_WORD = 0,
WORD_SPACE_BEFORE = 1,
WORD_SPACE_AFTER = 2,
WORD_NO_SPACE = 3
}; int IntelligentCut(SelectionType nSelectionType, bool bCut = true);
// enum tells when should happen when the style was not found enum GetStyle { GETSTYLE_NOCREATE, // create none
GETSTYLE_CREATESOME, // if on PoolId create mapt
GETSTYLE_CREATEANY }; // return standard if applicable
//"Handler" for changes at DrawView - for controls. virtualvoid DrawSelChanged( ) override;
// jump to bookmark and set the "selections-flags" correctly again
SW_DLLPUBLIC void GotoMark( const ::sw::mark::MarkBase* const pMark ); bool GotoMark( const ::sw::mark::MarkBase* const pMark, bool bSelect );
SW_DLLPUBLIC void GotoMark( const SwMarkName& rName ); bool GoNextBookmark(); // true when there still was one bool GoPrevBookmark();
/** @param bOnlyRefresh: * false: run default actions (e.g. toggle checkbox, remove placeholder content) * true: do not alter the content control, just refresh the doc model
*/
SW_DLLPUBLIC bool GotoContentControl(const SwFormatContentControl& rContentControl, bool bOnlyRefresh = false);
// jump to the next / previous hyperlink - inside text and also // on graphics void SelectNextPrevHyperlink( bool bNext );
// Because nobody else is doing it, here is an ExecMacro() void ExecMacro( const SvxMacro& rMacro, OUString* pRet = nullptr, SbxArray* pArgs = nullptr ); // call into the dark Basic/JavaScript
sal_uInt16 CallEvent( SvMacroItemId nEvent, const SwCallMouseEvent& rCallEvent, bool bCheckPtr = false );
// a click at the given field. the cursor is on it. // execute the predefined actions. void ClickToField( const SwField& rField, bool bExecHyperlinks ); void ClickToINetAttr( const SwFormatINetFormat& rItem, LoadUrlFlags nFilter = LoadUrlFlags::NONE ); bool ClickToINetGrf( const Point& rDocPt, LoadUrlFlags nFilter ); inlinebool IsInClickToEdit() const ;
// if a URL-Button is selected, return its URL; otherwise an empty string bool GetURLFromButton( OUString& rURL, OUString& rDescr ) const;
// starts dialog for inserting ranges via Drag&Drop/Clipboard void StartInsertRegionDialog(const SwSectionData&);
// ctor, the first one is a kind of a controlled copy ctor for more views of a document
SwWrtShell( SwWrtShell&, vcl::Window *pWin, SwView &rShell);
SwWrtShell( SwDoc& rDoc, vcl::Window *pWin, SwView &rShell, const SwViewOption *pViewOpt); virtual ~SwWrtShell() override;
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.