nss: upgrade to release 3.73
[LibreOffice.git] / include / editeng / overflowingtxt.hxx
blobad0a662d12014c5c72426701f3bbeecd5fbae4b6
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 <config_options.h>
24 #include <editeng/editengdllapi.h>
25 #include <editeng/editdata.hxx>
27 #include <com/sun/star/uno/Reference.h>
28 #include <memory>
30 namespace com::sun::star {
31 namespace datatransfer { class XTransferable; }
33 namespace rtl {
34 class OUString;
36 using ::rtl::OUString;
39 class OutlinerParaObject;
40 class Outliner;
44 * A collection of static methods for attaching text.
45 * Strongly coupled with some of the classes in this file.
47 class TextChainingUtils
49 public:
50 static css::uno::Reference< css::datatransfer::XTransferable> CreateTransferableFromText(Outliner const *);
52 static std::unique_ptr<OutlinerParaObject> JuxtaposeParaObject(
53 css::uno::Reference< css::datatransfer::XTransferable > const & xOverflowingContent,
54 Outliner *,
55 OutlinerParaObject const *);
56 static std::unique_ptr<OutlinerParaObject> DeeplyMergeParaObject(
57 css::uno::Reference< css::datatransfer::XTransferable > const & xOverflowingContent,
58 Outliner *,
59 OutlinerParaObject const *);
63 * The classes OverflowingText and NonOverflowingText handle the
64 * actual preparation of the OutlinerParaObjects to be used in destination
65 * and source box respectively.
68 class OverflowingText
70 public:
71 OverflowingText(css::uno::Reference< css::datatransfer::XTransferable > const & xOverflowingContent);
73 std::unique_ptr<OutlinerParaObject> JuxtaposeParaObject(Outliner *, OutlinerParaObject const *);
74 std::unique_ptr<OutlinerParaObject> DeeplyMergeParaObject(Outliner *, OutlinerParaObject const *);
76 private:
77 css::uno::Reference< css::datatransfer::XTransferable > mxOverflowingContent;
80 class NonOverflowingText
82 public:
83 NonOverflowingText(const ESelection &aSel, bool bLastParaInterrupted);
85 std::unique_ptr<OutlinerParaObject> RemoveOverflowingText(Outliner *) const;
86 ESelection GetOverflowPointSel() const;
87 bool IsLastParaInterrupted() const;
89 private:
90 const ESelection maContentSel;
91 const bool mbLastParaInterrupted;
96 * classes OFlowChainedText and UFlowChainedText:
97 * contain and handle the state of a broken up text _after_ a flow event
98 * (respectively after Overflow and Underflow).
101 class UNLESS_MERGELIBS(EDITENG_DLLPUBLIC) OFlowChainedText
103 public:
104 OFlowChainedText(Outliner const *, bool );
105 ~OFlowChainedText();
107 std::unique_ptr<OutlinerParaObject> InsertOverflowingText(Outliner *, OutlinerParaObject const *);
108 std::unique_ptr<OutlinerParaObject> RemoveOverflowingText(Outliner *);
110 ESelection GetOverflowPointSel() const;
112 bool IsLastParaInterrupted() const;
114 private:
115 std::unique_ptr<NonOverflowingText> mpNonOverflowingTxt;
116 std::unique_ptr<OverflowingText> mpOverflowingTxt;
118 bool mbIsDeepMerge;
121 // UFlowChainedText is a simpler class than OFlowChainedText: it almost only joins para-objects
122 class UNLESS_MERGELIBS(EDITENG_DLLPUBLIC) UFlowChainedText
124 public:
125 UFlowChainedText(Outliner const *, bool);
126 std::unique_ptr<OutlinerParaObject> CreateMergedUnderflowParaObject(Outliner *, OutlinerParaObject const *);
128 private:
129 css::uno::Reference< css::datatransfer::XTransferable > mxUnderflowingTxt;
131 bool mbIsDeepMerge;
134 #endif
136 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */