make ValueTransfer easier to understand
[LibreOffice.git] / include / editeng / editobj.hxx
blob5badaf8e8a2a2817567787af8070496f0cf7d7f5
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_EDITENG_EDITOBJ_HXX
21 #define INCLUDED_EDITENG_EDITOBJ_HXX
23 #include <svl/style.hxx>
24 #include <editeng/editengdllapi.h>
25 #include <editeng/macros.hxx>
26 #include <svl/languageoptions.hxx>
28 #include <com/sun/star/text/textfield/Type.hpp>
30 #include <vector>
31 #include <memory>
33 class SfxItemPool;
34 class SfxItemSet;
35 class SvxFieldItem;
36 class SvxFieldData;
37 enum class OutlinerMode;
38 struct EECharAttrib;
39 typedef struct _xmlTextWriter* xmlTextWriterPtr;
41 namespace editeng {
43 class FieldUpdater;
44 struct Section;
48 namespace svl {
50 class SharedString;
51 class SharedStringPool;
55 enum class TextRotation { NONE, TOPTOBOTTOM, BOTTOMTOTOP };
57 class EDITENG_DLLPUBLIC EditTextObject
59 public:
60 virtual ~EditTextObject();
62 /**
63 * Set paragraph strings to the shared string pool.
65 * @param rPool shared string pool.
67 virtual void NormalizeString( svl::SharedStringPool& rPool ) = 0;
69 virtual std::vector<svl::SharedString> GetSharedStrings() const = 0;
71 virtual const SfxItemPool* GetPool() const = 0;
72 virtual OutlinerMode GetUserType() const = 0; // For OutlinerMode, it can however not save in compatible format
73 virtual void SetUserType( OutlinerMode n ) = 0;
75 virtual bool IsEffectivelyVertical() const = 0;
76 virtual bool GetVertical() const = 0;
77 virtual bool IsTopToBottom() const = 0;
78 virtual void SetVertical( bool bVertical ) = 0;
79 virtual void SetRotation( TextRotation nRotation ) = 0;
80 virtual TextRotation GetRotation() const = 0;
82 virtual SvtScriptType GetScriptType() const = 0;
84 virtual std::unique_ptr<EditTextObject> Clone() const = 0;
86 virtual sal_Int32 GetParagraphCount() const = 0;
88 virtual OUString GetText(sal_Int32 nPara) const = 0;
90 virtual void ClearPortionInfo() = 0;
92 virtual bool HasOnlineSpellErrors() const = 0;
94 virtual void GetCharAttribs( sal_Int32 nPara, std::vector<EECharAttrib>& rLst ) const = 0;
96 virtual bool RemoveCharAttribs( sal_uInt16 nWhich ) = 0;
98 /**
99 * Get all text sections in this content. Sections are non-overlapping
100 * segments of text split either by paragraph boundaries or format
101 * boundaries. Each section object contains all applied formats and/or a
102 * field item.
104 virtual void GetAllSections( std::vector<editeng::Section>& rAttrs ) const = 0;
106 virtual bool IsFieldObject() const = 0;
107 virtual const SvxFieldItem* GetField() const = 0;
108 virtual const SvxFieldData* GetFieldData(sal_Int32 nPara, size_t nPos, sal_Int32 nType) const = 0;
109 virtual bool HasField( sal_Int32 nType = css::text::textfield::Type::UNSPECIFIED ) const = 0;
111 virtual const SfxItemSet& GetParaAttribs(sal_Int32 nPara) const = 0;
113 virtual void GetStyleSheet(sal_Int32 nPara, OUString& rName, SfxStyleFamily& eFamily) const = 0;
114 virtual void SetStyleSheet(sal_Int32 nPara, const OUString& rName, const SfxStyleFamily& eFamily) = 0;
115 virtual bool ChangeStyleSheets(
116 std::u16string_view rOldName, SfxStyleFamily eOldFamily, const OUString& rNewName, SfxStyleFamily eNewFamily) = 0;
117 virtual void ChangeStyleSheetName(SfxStyleFamily eFamily, std::u16string_view rOldName, const OUString& rNewName) = 0;
119 virtual editeng::FieldUpdater GetFieldUpdater() = 0;
121 virtual bool operator==( const EditTextObject& rCompare ) const = 0;
123 /** Compare, ignoring SfxItemPool pointer.
125 bool Equals( const EditTextObject& rCompare ) const;
127 // #i102062#
128 virtual bool isWrongListEqual(const EditTextObject& rCompare) const = 0;
130 #if DEBUG_EDIT_ENGINE
131 virtual void Dump() const = 0;
132 #endif
133 virtual void dumpAsXml(xmlTextWriterPtr pWriter) const = 0;
136 #endif // INCLUDED_EDITENG_EDITOBJ_HXX
138 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */