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 <vector>
18 
19 class SwTextNode;
20 
21 class ToxLinkProcessorTest;
22 
23 namespace sw {
24 
29 public:
31  virtual ~ToxLinkProcessor() {}
32 
33  void
34  StartNewLink(sal_Int32 startPosition, const OUString& characterStyle);
35 
43  void
44  CloseLink(sal_Int32 endPosition, const OUString& url);
45 
47  void
49 
50 private:
56  virtual sal_uInt16
57  ObtainPoolId(const OUString& characterStyle) const;
58 
60  struct StartedLink {
61  StartedLink(sal_Int32 startPosition, const OUString& characterStyle) :
62  mStartPosition(startPosition), mCharacterStyle(characterStyle) {
63  }
64  sal_Int32 const mStartPosition;
65  OUString const mCharacterStyle;
66  };
67 
71  struct ClosedLink {
72  ClosedLink(const OUString& url, sal_Int32 startPosition, sal_Int32 endPosition)
73  : mINetFormat(url, OUString())
74  , mStartTextPos(startPosition)
75  , mEndTextPos(endPosition)
76  {
77  }
79  sal_Int32 const mStartTextPos;
80  sal_Int32 const mEndTextPos;
81  };
82 
83  std::vector<std::unique_ptr<ClosedLink>> m_ClosedLinks;
84 
85  std::unique_ptr<StartedLink> m_pStartedLink;
86 
87  friend class ::ToxLinkProcessorTest;
88 };
89 
90 }
91 
92 #endif /* SW_TOXLINKPROCESSOR_HXX_ */
93 
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Dialog to specify the properties of date form field.
virtual sal_uInt16 ObtainPoolId(const OUString &characterStyle) const
Obtain the pool id which belongs to a character style.
void CloseLink(sal_Int32 endPosition, const OUString &url)
Close a link which has been found during processing.
std::vector< std::unique_ptr< ClosedLink > > m_ClosedLinks
std::unique_ptr< StartedLink > m_pStartedLink
void InsertLinkAttributes(SwTextNode &node)
Insert the found links as attributes to a text node.
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
void StartNewLink(sal_Int32 startPosition, const OUString &characterStyle)
A helper class for ToxTextGenerator.