LibreOffice Module sw (master) 1
textapi.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_SW_SOURCE_CORE_INC_TEXTAPI_HXX
21#define INCLUDED_SW_SOURCE_CORE_INC_TEXTAPI_HXX
22
23#include <editeng/unoedsrc.hxx>
24#include <editeng/unotext.hxx>
25#include <editeng/outlobj.hxx>
26
27class SwDoc;
28
31{
33
34 void EnsureOutliner();
35 virtual std::unique_ptr<SvxEditSource> Clone() const override;
36 virtual SvxTextForwarder* GetTextForwarder() override;
37 virtual void UpdateData() override;
38 explicit SwTextAPIEditSource( const SwTextAPIEditSource& rSource );
39
40public:
42 virtual ~SwTextAPIEditSource() override;
43
44 void Dispose();
45 void SetText( OutlinerParaObject const & rText );
46 void SetString( const OUString& rText );
48 OUString GetText() const;
49};
50
51class SwTextAPIObject final : public SvxUnoText
52{
53 std::unique_ptr<SwTextAPIEditSource> m_pSource;
54public:
55 SwTextAPIObject( std::unique_ptr<SwTextAPIEditSource> p);
56 virtual ~SwTextAPIObject() noexcept override;
57 void DisposeEditSource() { m_pSource->Dispose(); }
59 void SetString( const OUString& rText ) { m_pSource->SetString( rText ); }
60 void SetText( OutlinerParaObject const & rText ) { m_pSource->SetText( rText ); }
61 OUString GetText() const { return m_pSource->GetText(); }
62};
63
64#endif
65
66/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Definition: doc.hxx:197
std::optional< OutlinerParaObject > CreateText()
Definition: textapi.cxx:199
OUString GetText() const
Definition: textapi.cxx:207
void SetText(OutlinerParaObject const &rText)
Definition: textapi.cxx:175
SwTextAPIEditSource_Impl * m_pImpl
Definition: textapi.hxx:32
void SetString(const OUString &rText)
Definition: textapi.cxx:184
virtual std::unique_ptr< SvxEditSource > Clone() const override
Definition: textapi.cxx:115
virtual ~SwTextAPIEditSource() override
Definition: textapi.cxx:133
virtual void UpdateData() override
Definition: textapi.cxx:120
SwTextAPIEditSource(const SwTextAPIEditSource &rSource)
Definition: textapi.cxx:107
virtual SvxTextForwarder * GetTextForwarder() override
Definition: textapi.cxx:160
std::optional< OutlinerParaObject > CreateText()
Definition: textapi.hxx:58
void DisposeEditSource()
Definition: textapi.hxx:57
OUString GetText() const
Definition: textapi.hxx:61
SwTextAPIObject(std::unique_ptr< SwTextAPIEditSource > p)
Definition: textapi.cxx:66
std::unique_ptr< SwTextAPIEditSource > m_pSource
Definition: textapi.hxx:53
void SetString(const OUString &rText)
Definition: textapi.hxx:59
virtual ~SwTextAPIObject() noexcept override
Definition: textapi.cxx:72
void SetText(OutlinerParaObject const &rText)
Definition: textapi.hxx:60