LibreOffice Module editeng (master) 1
overflowingtxt.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#ifndef INCLUDED_EDITENG_OVERFLOWINGTXT_HXX
21#define INCLUDED_EDITENG_OVERFLOWINGTXT_HXX
22
24#include <editeng/editdata.hxx>
25
26#include <com/sun/star/uno/Reference.h>
27#include <optional>
28
29namespace com::sun::star {
30 namespace datatransfer { class XTransferable; }
31}
32
34class Outliner;
35
36
37/*
38 * A collection of static methods for attaching text.
39 * Strongly coupled with some of the classes in this file.
40 */
42{
43public:
44 static css::uno::Reference< css::datatransfer::XTransferable> CreateTransferableFromText(Outliner const *);
45
47 css::uno::Reference< css::datatransfer::XTransferable > const & xOverflowingContent,
48 Outliner *,
49 OutlinerParaObject const *);
51 css::uno::Reference< css::datatransfer::XTransferable > const & xOverflowingContent,
52 Outliner *,
53 OutlinerParaObject const *);
54};
55
56/*
57 * The classes OverflowingText and NonOverflowingText handle the
58 * actual preparation of the OutlinerParaObjects to be used in destination
59 * and source box respectively.
60*/
61
63{
64public:
65 OverflowingText(css::uno::Reference< css::datatransfer::XTransferable > xOverflowingContent);
66
69
70private:
71 css::uno::Reference< css::datatransfer::XTransferable > mxOverflowingContent;
72};
73
75{
76public:
77 NonOverflowingText(const ESelection &aSel, bool bLastParaInterrupted);
78
81 bool IsLastParaInterrupted() const;
82
83private:
86};
87
88
89/*
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).
93 *
94 */
96{
97public:
98 OFlowChainedText(Outliner const *, bool );
100
101 std::optional<OutlinerParaObject> InsertOverflowingText(Outliner *, OutlinerParaObject const *);
102 std::optional<OutlinerParaObject> RemoveOverflowingText(Outliner *);
103
104 ESelection GetOverflowPointSel() const;
105
106 bool IsLastParaInterrupted() const;
107
108private:
109 std::optional<NonOverflowingText> mpNonOverflowingTxt;
110 std::optional<OverflowingText> mpOverflowingTxt;
111
113};
114
115// UFlowChainedText is a simpler class than OFlowChainedText: it almost only joins para-objects
117{
118public:
119 UFlowChainedText(Outliner const *, bool);
120 std::optional<OutlinerParaObject> CreateMergedUnderflowParaObject(Outliner *, OutlinerParaObject const *);
121
122private:
123 css::uno::Reference< css::datatransfer::XTransferable > mxUnderflowingTxt;
124
126};
127
128#endif
129
130/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
NonOverflowingText(const ESelection &aSel, bool bLastParaInterrupted)
ESelection GetOverflowPointSel() const
bool IsLastParaInterrupted() const
std::optional< OutlinerParaObject > RemoveOverflowingText(Outliner *) const
std::optional< NonOverflowingText > mpNonOverflowingTxt
std::optional< OverflowingText > mpOverflowingTxt
std::optional< OutlinerParaObject > DeeplyMergeParaObject(Outliner *, OutlinerParaObject const *)
OverflowingText(css::uno::Reference< css::datatransfer::XTransferable > xOverflowingContent)
css::uno::Reference< css::datatransfer::XTransferable > mxOverflowingContent
std::optional< OutlinerParaObject > JuxtaposeParaObject(Outliner *, OutlinerParaObject const *)
static css::uno::Reference< css::datatransfer::XTransferable > CreateTransferableFromText(Outliner const *)
static std::optional< OutlinerParaObject > JuxtaposeParaObject(css::uno::Reference< css::datatransfer::XTransferable > const &xOverflowingContent, Outliner *, OutlinerParaObject const *)
static std::optional< OutlinerParaObject > DeeplyMergeParaObject(css::uno::Reference< css::datatransfer::XTransferable > const &xOverflowingContent, Outliner *, OutlinerParaObject const *)
css::uno::Reference< css::datatransfer::XTransferable > mxUnderflowingTxt
Specialise std::optional template for the case where we are wrapping a o3tl::cow_wrapper type,...
Definition: outlobj.hxx:133
#define EDITENG_DLLPUBLIC
Definition: editengdllapi.h:28