Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / include / editeng / overflowingtxt.hxx
blob5b95f2d1296cb9eb7e8d944bdf091cf2cc1fc57d
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_OVERFLOWINGTXT_HXX
21 #define INCLUDED_EDITENG_OVERFLOWINGTXT_HXX
23 #include <editeng/editengdllapi.h>
24 #include <editeng/editdata.hxx>
26 #include <com/sun/star/uno/Reference.h>
27 #include <optional>
29 namespace com::sun::star {
30 namespace datatransfer { class XTransferable; }
33 class OutlinerParaObject;
34 class Outliner;
38 * A collection of static methods for attaching text.
39 * Strongly coupled with some of the classes in this file.
41 class TextChainingUtils
43 public:
44 static css::uno::Reference< css::datatransfer::XTransferable> CreateTransferableFromText(Outliner const *);
46 static std::optional<OutlinerParaObject> JuxtaposeParaObject(
47 css::uno::Reference< css::datatransfer::XTransferable > const & xOverflowingContent,
48 Outliner *,
49 OutlinerParaObject const *);
50 static std::optional<OutlinerParaObject> DeeplyMergeParaObject(
51 css::uno::Reference< css::datatransfer::XTransferable > const & xOverflowingContent,
52 Outliner *,
53 OutlinerParaObject const *);
57 * The classes OverflowingText and NonOverflowingText handle the
58 * actual preparation of the OutlinerParaObjects to be used in destination
59 * and source box respectively.
62 class OverflowingText
64 public:
65 OverflowingText(css::uno::Reference< css::datatransfer::XTransferable > xOverflowingContent);
67 std::optional<OutlinerParaObject> JuxtaposeParaObject(Outliner *, OutlinerParaObject const *);
68 std::optional<OutlinerParaObject> DeeplyMergeParaObject(Outliner *, OutlinerParaObject const *);
70 private:
71 css::uno::Reference< css::datatransfer::XTransferable > mxOverflowingContent;
74 class NonOverflowingText
76 public:
77 NonOverflowingText(const ESelection &aSel, bool bLastParaInterrupted);
79 std::optional<OutlinerParaObject> RemoveOverflowingText(Outliner *) const;
80 ESelection GetOverflowPointSel() const;
81 bool IsLastParaInterrupted() const;
83 private:
84 ESelection maContentSel;
85 bool mbLastParaInterrupted;
90 * classes OFlowChainedText and UFlowChainedText:
91 * contain and handle the state of a broken up text _after_ a flow event
92 * (respectively after Overflow and Underflow).
95 class EDITENG_DLLPUBLIC OFlowChainedText
97 public:
98 OFlowChainedText(Outliner const *, bool );
99 ~OFlowChainedText();
101 std::optional<OutlinerParaObject> InsertOverflowingText(Outliner *, OutlinerParaObject const *);
102 std::optional<OutlinerParaObject> RemoveOverflowingText(Outliner *);
104 ESelection GetOverflowPointSel() const;
106 bool IsLastParaInterrupted() const;
108 private:
109 std::optional<NonOverflowingText> mpNonOverflowingTxt;
110 std::optional<OverflowingText> mpOverflowingTxt;
112 bool mbIsDeepMerge;
115 // UFlowChainedText is a simpler class than OFlowChainedText: it almost only joins para-objects
116 class EDITENG_DLLPUBLIC UFlowChainedText
118 public:
119 UFlowChainedText(Outliner const *, bool);
120 std::optional<OutlinerParaObject> CreateMergedUnderflowParaObject(Outliner *, OutlinerParaObject const *);
122 private:
123 css::uno::Reference< css::datatransfer::XTransferable > mxUnderflowingTxt;
125 bool mbIsDeepMerge;
128 #endif
130 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */