Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / include / editeng / overflowingtxt.hxx
blob27141dfda504e6196f3d8525a9955875bb9d6cf4
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/macros.hxx>
24 #include <editeng/editengdllapi.h>
25 #include <editeng/editdata.hxx>
27 #include <com/sun/star/uno/Reference.h>
29 namespace com { namespace sun { namespace star {
30 namespace datatransfer {
31 class XTransferable;
32 } } } }
33 namespace rtl {
34 class OUString;
36 using ::rtl::OUString;
39 class OutlinerParaObject;
40 class EditTextObject;
41 class Outliner;
45 * A collection of static methods for attaching text.
46 * Strongly coupled with some of the classes in this file.
48 class TextChainingUtils
50 public:
51 static css::uno::Reference< css::datatransfer::XTransferable> CreateTransferableFromText(Outliner *);
53 static OutlinerParaObject *JuxtaposeParaObject(
54 css::uno::Reference< css::datatransfer::XTransferable > xOverflowingContent,
55 Outliner *,
56 OutlinerParaObject *);
57 static OutlinerParaObject *DeeplyMergeParaObject(
58 css::uno::Reference< css::datatransfer::XTransferable > xOverflowingContent,
59 Outliner *,
60 OutlinerParaObject *);
64 * The classes OverflowingText and NonOverflowingText handle the
65 * actual preparation of the OutlinerParaObjects to be used in destination
66 * and source box respectively.
69 class OverflowingText
71 public:
72 OutlinerParaObject *JuxtaposeParaObject(Outliner *, OutlinerParaObject *);
73 OutlinerParaObject *DeeplyMergeParaObject(Outliner *, OutlinerParaObject *);
75 private:
76 friend class Outliner;
77 OverflowingText(css::uno::Reference< css::datatransfer::XTransferable > xOverflowingContent);
79 css::uno::Reference< css::datatransfer::XTransferable > mxOverflowingContent;
82 class NonOverflowingText
84 public:
85 OutlinerParaObject *RemoveOverflowingText(Outliner *) const;
86 ESelection GetOverflowPointSel() const;
87 bool IsLastParaInterrupted() const;
89 private:
90 NonOverflowingText(const ESelection &aSel, bool bLastParaInterrupted);
92 friend class Outliner;
93 const ESelection maContentSel;
94 const bool mbLastParaInterrupted;
99 * classes OFlowChainedText and UFlowChainedText:
100 * contain and handle the state of a broken up text _after_ a flow event
101 * (respectively after Overflow and Underflow).
104 class EDITENG_DLLPUBLIC OFlowChainedText
106 public:
107 OFlowChainedText(Outliner *, bool );
108 ~OFlowChainedText();
110 OutlinerParaObject *InsertOverflowingText(Outliner *, OutlinerParaObject *);
111 OutlinerParaObject *RemoveOverflowingText(Outliner *);
113 ESelection GetOverflowPointSel() const;
115 bool IsLastParaInterrupted() const;
117 private:
118 NonOverflowingText *mpNonOverflowingTxt;
119 OverflowingText *mpOverflowingTxt;
121 bool mbIsDeepMerge;
124 // UFlowChainedText is a simpler class than OFlowChainedText: it almost only joins para-objects
125 class EDITENG_DLLPUBLIC UFlowChainedText
127 public:
128 UFlowChainedText(Outliner *, bool);
129 OutlinerParaObject *CreateMergedUnderflowParaObject(Outliner *, OutlinerParaObject *);
131 private:
132 css::uno::Reference< css::datatransfer::XTransferable > mxUnderflowingTxt;
134 bool mbIsDeepMerge;
137 #endif
139 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */