1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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>
29 namespace com
{ namespace sun
{ namespace star
{
30 namespace datatransfer
{
36 using ::rtl::OUString
;
39 class OutlinerParaObject
;
44 * A collection of static methods for attaching text.
45 * Strongly coupled with some of the classes in this file.
47 class TextChainingUtils
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
,
55 OutlinerParaObject
const *);
56 static std::unique_ptr
<OutlinerParaObject
> DeeplyMergeParaObject(
57 css::uno::Reference
< css::datatransfer::XTransferable
> const & xOverflowingContent
,
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.
71 std::unique_ptr
<OutlinerParaObject
> JuxtaposeParaObject(Outliner
*, OutlinerParaObject
const *);
72 std::unique_ptr
<OutlinerParaObject
> DeeplyMergeParaObject(Outliner
*, OutlinerParaObject
const *);
75 friend class Outliner
;
76 OverflowingText(css::uno::Reference
< css::datatransfer::XTransferable
> const & xOverflowingContent
);
78 css::uno::Reference
< css::datatransfer::XTransferable
> mxOverflowingContent
;
81 class NonOverflowingText
84 std::unique_ptr
<OutlinerParaObject
> RemoveOverflowingText(Outliner
*) const;
85 ESelection
GetOverflowPointSel() const;
86 bool IsLastParaInterrupted() const;
89 NonOverflowingText(const ESelection
&aSel
, bool bLastParaInterrupted
);
91 friend class Outliner
;
92 const ESelection maContentSel
;
93 const bool mbLastParaInterrupted
;
98 * classes OFlowChainedText and UFlowChainedText:
99 * contain and handle the state of a broken up text _after_ a flow event
100 * (respectively after Overflow and Underflow).
103 class EDITENG_DLLPUBLIC OFlowChainedText
106 OFlowChainedText(Outliner
const *, bool );
109 std::unique_ptr
<OutlinerParaObject
> InsertOverflowingText(Outliner
*, OutlinerParaObject
const *);
110 std::unique_ptr
<OutlinerParaObject
> RemoveOverflowingText(Outliner
*);
112 ESelection
GetOverflowPointSel() const;
114 bool IsLastParaInterrupted() const;
117 std::unique_ptr
<NonOverflowingText
> mpNonOverflowingTxt
;
118 std::unique_ptr
<OverflowingText
> mpOverflowingTxt
;
123 // UFlowChainedText is a simpler class than OFlowChainedText: it almost only joins para-objects
124 class EDITENG_DLLPUBLIC UFlowChainedText
127 UFlowChainedText(Outliner
const *, bool);
128 std::unique_ptr
<OutlinerParaObject
> CreateMergedUnderflowParaObject(Outliner
*, OutlinerParaObject
const *);
131 css::uno::Reference
< css::datatransfer::XTransferable
> mxUnderflowingTxt
;
138 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */