namespace tools { class PolyPolygon; } class SwDoc; class CommandExtTextInputData;
class SvNumberFormatter; class SfxPoolItem; class SfxItemSet; class SfxWatermarkItem; class SvxAutoCorrect;
class SwDDEFieldType; class SwDBManager;
struct SwDocStat; class SwAutoCompleteWord;
class SwFormatRefMark;
class SwNumRule;
class SwTextFormatColl; class SwGrfNode;
class Graphic; class GraphicObject; class GraphicAttr; class SwFormatINetFormat; class SwTable; class SwTextBlocks; class SwFormatFootnote; class SwSection; class SwSectionData; class SwSectionFormat; class SwTableAutoFormat; class SwPageDesc; class SwTextINetFormat; class SwSeqFieldList; class SwGlblDocContent; class SwGlblDocContents; class SwRangeRedline; class SwRedlineData; class SwFootnoteInfo; class SwEndNoteInfo; class SwLineNumberInfo; class SwAuthEntry; class SwRewriter; class SwView; struct SwConversionArgs; struct SvxSwAutoFormatFlags; struct SwInsertTableOptions; struct SwDBData; enumclass SvtScriptType : sal_uInt8; enumclass SfxClassificationPolicyType; enumclass RedlineFlags; enumclass TransliterationFlags; enumclass GraphicType;
namespace com::sun::star::uno { template < class > class Sequence; } namespace com::sun::star::linguistic2 { class XSpellAlternatives; } namespace com::sun::star::linguistic2 { struct ProofreadingResult; }
namespace svx{ struct SpellPortion; typedef std::vector<SpellPortion> SpellPortions; class ClassificationResult;
}
// Types of forms of content. #define CNT_TXT 0x0001 #define CNT_GRF 0x0002 #define CNT_OLE 0x0010
// Test USHORT for a defined form of content. #define CNT_HasText(USH) ((USH)&CNT_TXT) #define CNT_HasGrf(USH) ((USH)&CNT_GRF) #define CNT_HasOLE(USH) ((USH)&CNT_OLE)
class SAL_DLLPUBLIC_RTTI SwEditShell : public SwCursorShell
{ static SvxSwAutoFormatFlags* s_pAutoFormatFlags;
/// For the private methods DelRange and those of AutoCorrect. friendclass SwAutoFormat; friendvoid InitCore(); friendvoid FinitCore(); /// For the PamCorrAbs/-Rel methods. friendclass SwUndo;
/** Returns pointer to a SwGrfNode
that will be used by GetGraphic() and GetGraphicSize(). */
SwGrfNode *GetGrfNode_() const ;
/** Replace a selected range in a TextNode by given string. MeantforSearch&Replace. bRegExpRplc-replacetabs(\\t)andinsertfoundstring(not\&). E.g.:Fnd:"zzz",Repl:"xx\t\\t..&..\&"
--> "xx\t<Tab>..zzz..&" */
SW_DLLPUBLIC bool Replace( const OUString& rNewStr, bool bRegExpRplc );
/** Replace a selected range in a TextNode by given string.
Possible comments will be kept (moved to the end of the selection). */ bool ReplaceKeepComments( const OUString& rNewStr);
/** Delete content of all ranges.
If whole nodes are selected, these nodes get deleted. */
SW_DLLPUBLIC boolDelete(bool isArtificialSelection = false, bool goLeft = false);
/// Remove a complete paragraph.
SW_DLLPUBLIC bool DelFullPara();
/// Change text to Upper/Lower/Hiragana/Katakana/... void TransliterateText( TransliterationFlags nType );
/// Count words in current selection.
SW_DLLPUBLIC void CountWords( SwDocStat& rStat ) const;
/// Replace fields by text - mailmerge support. bool ConvertFieldsToText();
/// Set all numbering start points to a fixed value - mailmerge support. void SetNumberingRestart();
/// Embeds all local links (ranges/graphics).
SW_DLLPUBLIC sal_uInt16 GetLinkUpdMode() const;
SW_DLLPUBLIC void SetLinkUpdMode( sal_uInt16 nMode );
/// Copy content of all ranges at current position of cursor to given Shell. bool Copy( SwEditShell& rDestShell );
/** For copying via ClipBoard: Iftableiscopiedintotable,moveallcursorsawayfromit. CopyandPastemustbeinFEShellbecauseofFlyFrames!
Copy all selections to the document. */ bool CopySelToDoc( SwDoc& rInsDoc );
/** If cursor is in an INetAttribute it will be deleted completely
including the descriptive text (needed at drag & drop). */ void DelINetAttrWithText();
/** If Cursor is at the end of a character style in which the DontExpand-flag
is not yet set, the latter will be set (==> return TRUE). */ bool DontExpandFormat();
/** Get RES_CHRATR_* items of one type in the current selection. *@paramnWhichWhichIdofthecollecteditems. *Ifpartsoftheselectionhavedifferentscripttypes,theitemswithcorrespondingWhichIdsarealsocollected.
* @return a vector of pairs. The pair contains a SfxPoolItem and a SwPaM, in which the item is valid and can be changed. */
std::vector<std::pair< const SfxPoolItem*, std::unique_ptr<SwPaM>>> GetItemWithPaM( sal_uInt16 nWhich );
/// Sign the paragraph at the cursor. void SignParagraph();
/// Validate the paragraph signatures, if any, of the current text node. void ValidateParagraphSignatures(SwTextNode* pNode, bool updateDontRemove);
/// Validate the current paragraph signatures, if any, at the cursor start. void ValidateCurrentParagraphSignatures(bool updateDontRemove);
/// Validate all paragraph signatures. void ValidateAllParagraphSignatures(bool updateDontRemove);
/// Restore the metadata fields, if missing, from the RDF metadata /// and validate the signatures and update the signature metadata fields. /// Needed since deleting the metadata field doesn't remove the RDF /// and editing docs using software that don't support paragraph signing. void RestoreMetadataFieldsAndValidateParagraphSignatures();
/// Ensure that the classification of the doc is never lower than /// the paragraph with the highest classification. void ClassifyDocPerHighestParagraphClass();
/// Apply the classification to the paragraph at cursor. void ApplyParagraphClassification(std::vector<svx::ClassificationResult> aResult);
std::vector<svx::ClassificationResult> CollectParagraphClassification();
/// Returns true iff the cursor is within a paragraph metadata field. /// Currently there are two variants: signature and classification. bool IsCursorInParagraphMetadataField() const;
/// Removes the paragraph metadata field at the current cursor, if any. /// Returns true iff a paragraph metadata field was removed. /// Currently there are two variants: signature and classification. bool RemoveParagraphMetadataFieldAtCursor();
/// Check whether DB fields point to an available data source and returns it. bool IsFieldDataSourceAvailable(OUString& rUsedDataSource) const;
SW_DLLPUBLIC void UpdateExpFields(bool bCloseDB = false);///< only every expression fields update
SW_DLLPUBLIC void LockExpFields();
SW_DLLPUBLIC void UnlockExpFields(); bool IsExpFieldsLocked() const;
/** Returns the numbering rule found at the paragraphs of the current selection,
if all paragraphs of the current selection have the same or none numbering rule applied. */ const SwNumRule* GetNumRuleAtCurrentSelection() const;
/** Optional parameter <bResetIndentAttrs> (default value false). If<bResetIndentAttrs>equalstrue,theindentattributes"beforetext" and"firstlineindent"areadditionallyresetatthecurrentselection, iftheliststylemakesuseofthenewlistlevelattributes. Parameters<bCreateNewList>and<sContinuedListId> <bCreateNewList>indicates,ifanewlistiscreatedbyapplyingthegivenliststyle. If<bCreateNewList>equalsfalse,<sContinuedListId>maycontainthe
list Id of a list, which has to be continued by applying the given list style */ void SetCurNumRule( const SwNumRule&, constbool bCreateNewList /*= false*/, const OUString& sContinuedListId = OUString(), constbool bResetIndentAttrs = false );
/// Paragraphs without enumeration but with indents. void NoNum();
/** Searches for a text node with a numbering rule. incasealiststyleisfound,<sListId>holdsthelistid,towhichthe
text node belongs, which applies the found list style. */ const SwNumRule * SearchNumRule(constbool bNum,
OUString& sListId );
std::set<OUString> GetUsedBullets();
/// is it forbidden to modify cursors via API calls? bool CursorsLocked() const; /// set selections to those contained in the UndoRedoContext /// should only be called by sw::UndoManager! void HandleUndoRedoContext(::sw::UndoRedoContext & rContext);
/** If there's an automatic, not manipulated polygon at the selected
notxtnode, it has to be deleted, e.g. cause the object has changed. */ void ClearAutomaticContour();
/// @return the size of a graphic in Twips if cursor is in a graphic.
SW_DLLPUBLIC bool GetGrfSize(Size&) const;
/** @return name and filter of a graphic if the cursor is in a graphic, elsegivearapontheknuckles!
If a string-ptr != 0 return the respective name. */ void GetGrfNms( OUString* pGrfName, OUString* pFltName ) const;
/// Re-read if graphic is not ok. Current graphic is replaced by the new one. void ReRead( const OUString& rGrfName, const OUString& rFltName, const Graphic* pGraphic = nullptr );
/// Unique identification of object (for ImageMapDlg). void *GetIMapInventor() const;
// #i73788# /// Remove default parameter, because method always called this default value.
SW_DLLPUBLIC Graphic GetIMapGraphic() const; ///< @return a graphic for all Flys! const SwFlyFrameFormat* FindFlyByName( const UIName& rName ) const;
/** @return a ClientObject, if CurrentCursor->Point() points to a SwOLENode (andmarkisneithersetnotpointinttosameClientObject)
else give rap on the knuckles. */
SW_DLLPUBLIC svt::EmbeddedObjectRef& GetOLEObject() const;
/// Is there an OLEObject with this name (SwFormat)? bool HasOLEObj( const UIName& rName ) const;
/// @return pointer to the data of the chart in which Cursr is. void SetChartName( const UIName &rName );
/// Update content of all charts for table with given name. void UpdateCharts( const UIName& rName );
OUString GetCurWord() const;
/** Glossary from glossary document in current document.
Styles only if not already existent. */ void InsertGlossary( SwTextBlocks& rGlossary, const OUString& );
/** Make current selection glossary and insert into glossary document
including styles. */
sal_uInt16 MakeGlossary( SwTextBlocks& rToFill, const OUString& rName, const OUString& rShortName, bool bSaveRelFile, const OUString* pOnlyText );
/// Save complete content of doc as glossary.
sal_uInt16 SaveGlossaryDoc( SwTextBlocks& rGlossary, const OUString& rName, const OUString& rShortName, bool bSaveRelFile, bool bOnlyText );
/** Spells on a sentence basis - the SpellPortions are needed
@return false if no error could be found. */ bool SpellSentence(svx::SpellPortions& rToFill, bool bIsGrammarCheck );
/// Make SpellIter start with the current sentence when called next time. staticvoid PutSpellingToSentenceStart();
/// Moves the continuation position to the end of the currently checked sentence. staticvoid MoveContinuationPosToEndOfCheckedSentence();
/// @return reference set in document according to given name. const SwFormatRefMark* GetRefMark( const SwMarkName& rName ) const;
/** @return names of all references set in document.
If ArrayPointer == 0 then return only whether a RefMark is set in document. */
sal_uInt16 GetRefMarks( std::vector<OUString>* = nullptr ) const;
// We consider no more than 9 characters before the cursor, and they must not start in the // middle of a word (leading spaces are OK)
std::vector<OUString> GetChunkForAutoText();
/// Set our styles according to the respective rules. void AutoFormat( const SvxSwAutoFormatFlags* pAFlags, bool bCurrentParagraphOnly );
/** May an outline be moved or copied?
Check whether it's in text body, not in table, and not read-only (move). */ bool IsOutlineMovable( SwOutlineNodes::size_type nIdx ) const; bool IsOutlineCopyable( SwOutlineNodes::size_type nIdx ) const;
SW_DLLPUBLIC sal_Int32 GetLineCount();
/// Query and set footnote-text/number. Set... to current SSelection!
SW_DLLPUBLIC bool GetCurFootnote( SwFormatFootnote* pToFillFootnote = nullptr );
SW_DLLPUBLIC bool SetCurFootnote( const SwFormatFootnote& rFillFootnote );
SW_DLLPUBLIC bool HasFootnotes( bool bEndNotes = false ) const;
SW_DLLPUBLIC size_t GetSeqFootnoteList( SwSeqFieldList& rList, bool bEndNotes = false ); /// @return list of all footnotes and their first portions of text.
/** @return current range like Cet CurrSection(). But this function iterates alsooverframesandcatchestherangeevenifthecursorispositionedin afootnotethereferenceofwhichisinacolumnedrange. IfbOutOfTabisset,therangecomprisingthetableissearched
and not an inner one. */
SwSection* GetAnySection( bool bOutOfTab = false, const Point* pPt = nullptr );
/** Search inside the cursor selection for full selected sections. ifanypartofsectionintheselection@return0.
if more than one in the selection return the count. */
SW_DLLPUBLIC sal_uInt16 GetFullSelectedSectionCount() const;
/** Special insert: Insert a new text node just before or after a section or table,ifthecursorispositionedatthestart/endofsaid section/table.Thepurposeofthemethodistoallowuserstoinserttext atcertain'impossible'positions,e.g.beforeatableatthedocument
start or between two sections. */
SW_DLLPUBLIC void DoSpecialInsert(); bool CanSpecialInsert() const;
/** Adjust left margin via object bar (similar to adjustment of numerations). Onecaneitherchangethemargin"by"addingorsubtractingagiven
offset or set it "to" this position @param (bModulus = true). */ bool IsMoveLeftMargin( bool bRight, bool bModulus = true ) const; void MoveLeftMargin( bool bRight, bool bModulus = true );
/** Search Redline for this Data and @return position in array.
If not found, return SwRedlineTable::npos. */
SwRedlineTable::size_type FindRedlineOfData( const SwRedlineData& ) const;
/// Set comment to Redline at position. bool SetRedlineComment( const OUString& rS ); const SwRangeRedline* GetCurrRedline() const;
/// Redline attributes have been changed. Updated views.
SW_DLLPUBLIC void UpdateRedlineAttr();
/// Compare two documents.
tools::Long CompareDoc( const SwDoc& rDoc );
/* TODO: this flag may have to be invalidated / reset to false at various *placesifitwastrueandtheeditcursorpositionchanges.It'ssomehow *overkillthoughbecauseitcanonlybetrueifaNO-BREAKSPACEwas *insertedbythelastDoAutoCorrect()call(inFrenchlanguage),any *subsequentcallwillresetitanywayandjustifthecursoris *positionedbehind"x:"andthenextcharacterinsertedisnotaspace *theexistingnb-spacewillberemoved.Bearthisinmindifthatproblem
* arises. */ bool m_bNbspRunNext; ///< NO-BREAK SPACE state flag passed to and maintained by SvxAutoCorrect::DoAutoCorrect() bool m_bDoParagraphSignatureValidation; ///< Prevent nested calls of ValidateParagraphSignatures.
};
/// Class for automated call of Start- and EndAction(). class SwActContext {
SwEditShell & m_rShell; public:
SwActContext(SwEditShell *pShell);
~SwActContext() COVERITY_NOEXCEPT_FALSE;
};
/// Class for automated call of Start- and EndCursorMove(). class SwMvContext {
SwEditShell & m_rShell; public:
SwMvContext(SwEditShell *pShell);
~SwMvContext() COVERITY_NOEXCEPT_FALSE;
};
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.