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 virtual std::unique_ptr<SvxEditSource> Clone() const override;
35 virtual SvxTextForwarder* GetTextForwarder() override;
36 virtual void UpdateData() override;
37 explicit SwTextAPIEditSource( const SwTextAPIEditSource& rSource );
38
39public:
41 virtual ~SwTextAPIEditSource() override;
42
43 void Dispose();
44 void SetText( OutlinerParaObject const & rText );
45 void SetString( const OUString& rText );
47 OUString GetText() const;
48};
49
50class SwTextAPIObject final : public SvxUnoText
51{
52 std::unique_ptr<SwTextAPIEditSource> m_pSource;
53public:
54 SwTextAPIObject( std::unique_ptr<SwTextAPIEditSource> p);
55 virtual ~SwTextAPIObject() noexcept override;
56 void DisposeEditSource() { m_pSource->Dispose(); }
58 void SetString( const OUString& rText ) { m_pSource->SetString( rText ); }
59 void SetText( OutlinerParaObject const & rText ) { m_pSource->SetText( rText ); }
60 OUString GetText() const { return m_pSource->GetText(); }
61};
62
63#endif
64
65/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Definition: doc.hxx:188
std::optional< OutlinerParaObject > CreateText()
Definition: textapi.cxx:177
OUString GetText() const
Definition: textapi.cxx:185
void SetText(OutlinerParaObject const &rText)
Definition: textapi.cxx:144
SwTextAPIEditSource_Impl * m_pImpl
Definition: textapi.hxx:32
void SetString(const OUString &rText)
Definition: textapi.cxx:160
virtual std::unique_ptr< SvxEditSource > Clone() const override
Definition: textapi.cxx:91
virtual ~SwTextAPIEditSource() override
Definition: textapi.cxx:109
virtual void UpdateData() override
Definition: textapi.cxx:96
SwTextAPIEditSource(const SwTextAPIEditSource &rSource)
Definition: textapi.cxx:83
virtual SvxTextForwarder * GetTextForwarder() override
Definition: textapi.cxx:123
std::optional< OutlinerParaObject > CreateText()
Definition: textapi.hxx:57
void DisposeEditSource()
Definition: textapi.hxx:56
OUString GetText() const
Definition: textapi.hxx:60
SwTextAPIObject(std::unique_ptr< SwTextAPIEditSource > p)
Definition: textapi.cxx:61
std::unique_ptr< SwTextAPIEditSource > m_pSource
Definition: textapi.hxx:52
void SetString(const OUString &rText)
Definition: textapi.hxx:58
virtual ~SwTextAPIObject() noexcept override
Definition: textapi.cxx:67
void SetText(OutlinerParaObject const &rText)
Definition: textapi.hxx:59