LibreOffice Module sw (master) 1
ToxLinkProcessor.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
10#ifndef SW_TOXLINKPROCESSOR_HXX_
11#define SW_TOXLINKPROCESSOR_HXX_
12
13#include "fmtinfmt.hxx"
14#include <rtl/ustring.hxx>
15
16#include <memory>
17#include <optional>
18#include <utility>
19#include <vector>
20
21class SwTextNode;
22
23class ToxLinkProcessorTest;
24
25namespace sw {
26
31public:
33 virtual ~ToxLinkProcessor() {}
34
35 void
36 StartNewLink(sal_Int32 startPosition, const OUString& characterStyle);
37
45 void
46 CloseLink(sal_Int32 endPosition, const OUString& url, bool bRelative);
47
49 void
51
52private:
58 virtual sal_uInt16
59 ObtainPoolId(const OUString& characterStyle) const;
60
62 struct StartedLink {
63 StartedLink(sal_Int32 startPosition, OUString characterStyle) :
64 mStartPosition(startPosition), mCharacterStyle(std::move(characterStyle)) {
65 }
66 sal_Int32 mStartPosition;
68 };
69
73 struct ClosedLink {
74 ClosedLink(const OUString& url, sal_Int32 startPosition, sal_Int32 endPosition)
75 : mINetFormat(url, OUString())
76 , mStartTextPos(startPosition)
77 , mEndTextPos(endPosition)
78 {
79 }
81 sal_Int32 mStartTextPos;
82 sal_Int32 mEndTextPos;
83 };
84
85 std::vector<std::unique_ptr<ClosedLink>> m_ClosedLinks;
86
87 std::optional<StartedLink> m_oStartedLink;
88
89 friend class ::ToxLinkProcessorTest;
90};
91
92}
93
94#endif /* SW_TOXLINKPROCESSOR_HXX_ */
95
96/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:112
A helper class for ToxTextGenerator.
std::optional< StartedLink > m_oStartedLink
void StartNewLink(sal_Int32 startPosition, const OUString &characterStyle)
virtual sal_uInt16 ObtainPoolId(const OUString &characterStyle) const
Obtain the pool id which belongs to a character style.
std::vector< std::unique_ptr< ClosedLink > > m_ClosedLinks
void CloseLink(sal_Int32 endPosition, const OUString &url, bool bRelative)
Close a link which has been found during processing.
void InsertLinkAttributes(SwTextNode &node)
Insert the found links as attributes to a text node.
Dialog to specify the properties of date form field.