LibreOffice Module sw (master)  1
formatlinebreak.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 #ifndef INCLUDED_SW_INC_FORMATLINEBREAK_HXX
20 #define INCLUDED_SW_INC_FORMATLINEBREAK_HXX
21 
22 #include "swdllapi.h"
23 #include <svl/eitem.hxx>
24 #include "calbck.hxx"
25 
26 #include <cppuhelper/weakref.hxx>
27 #include <com/sun/star/text/XTextContent.hpp>
28 
29 class SwDoc;
30 class SwTextLineBreak;
31 
33 enum class SwLineBreakClear
34 {
35  NONE,
36  LEFT,
37  RIGHT,
38  ALL,
39  LAST = ALL
40 };
41 
43 class SW_DLLPUBLIC SwFormatLineBreak final : public SfxEnumItem<SwLineBreakClear>,
45 {
48 
49  css::uno::WeakReference<css::text::XTextContent> m_wXLineBreak;
50 
51  SwFormatLineBreak& operator=(const SwFormatLineBreak& rLineBreak) = delete;
52 
53  SwFormatLineBreak(const SwFormatLineBreak&) = delete;
54 
55 public:
57  virtual ~SwFormatLineBreak() override;
58 
60  bool operator==(const SfxPoolItem&) const override;
61 
63  SwFormatLineBreak* Clone(SfxItemPool* pPool = nullptr) const override;
64 
66  void SwClientNotify(const SwModify&, const SfxHint&) override;
67 
68  sal_uInt16 GetValueCount() const override;
69 
70  css::uno::Reference<css::text::XTextRange> GetAnchor() const;
71 
72  void SetTextLineBreak(SwTextLineBreak* pTextAttr) { m_pTextAttr = pTextAttr; }
73 
74  css::uno::WeakReference<css::text::XTextContent> const& GetXTextContent() const
75  {
76  return m_wXLineBreak;
77  }
78 
79  void SetXLineBreak(css::uno::Reference<css::text::XTextContent> const& xLineBreak)
80  {
81  m_wXLineBreak = xLineBreak;
82  }
83 
84  void dumpAsXml(xmlTextWriterPtr pWriter) const override;
85 };
86 
87 #endif
88 
89 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetTextLineBreak(SwTextLineBreak *pTextAttr)
SwTextLineBreak * m_pTextAttr
The SwTextAttr that knows the position of the line break in the doc model.
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const =0
SwLineBreakClear
Defines the location of a line break text wrapping restart.
Definition: doc.hxx:187
css::uno::WeakReference< css::text::XTextContent > const & GetXTextContent() const
SfxPoolItem & operator=(const SfxPoolItem &)=delete
virtual bool operator==(SfxPoolItem const &other) const override
SfxPoolItem subclass that wraps an SwLineBreakClear.
css::uno::WeakReference< css::text::XTextContent > m_wXLineBreak
SwTextAttr subclass that tracks the location of the wrapped SwFormatLineBreak.
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
void SetXLineBreak(css::uno::Reference< css::text::XTextContent > const &xLineBreak)
virtual sal_uInt16 GetValueCount() const =0
struct _xmlTextWriter * xmlTextWriterPtr
virtual void SwClientNotify(const SwModify &, const SfxHint &rHint) override
Definition: calbck.cxx:303
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const