LibreOffice Module sw (master)  1
ToxTabStopTokenHandler.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 
11 #ifndef TOXTABSTOPTOKENHANDLER_HXX_
12 #define TOXTABSTOPTOKENHANDLER_HXX_
13 
14 #include <rtl/ustring.hxx>
15 
16 #include <editeng/tstpitem.hxx>
17 
18 struct SwFormToken;
19 class SwPageDesc;
20 class SwRootFrame;
21 class SwTextNode;
22 
23 namespace sw {
24 
31 {
32 public:
34 
37  OUString text;
39  };
40 
46  virtual HandledTabStopToken
47  HandleTabStopToken(const SwFormToken& aToken, const SwTextNode& targetNode,
48  const SwRootFrame *currentLayout) const = 0;
49 };
50 
53 {
54 public:
55 
57 
73  DefaultToxTabStopTokenHandler(sal_uInt32 indexOfSectionNode, const SwPageDesc& defaultPageDescription,
74  bool tabPositionIsRelativeToParagraphIndent,
75  TabStopReferencePolicy referencePolicy);
76 
85  HandleTabStopToken(const SwFormToken& aToken, const SwTextNode& targetNode,
86  const SwRootFrame *currentLayout) const override;
87 
88 private:
93  static bool
94  CanUseLayoutRectangle(const SwTextNode& targetNode, const SwRootFrame *currentLayout);
95 
100  long
101  CalculatePageMarginFromPageDescription(const SwTextNode& targetNode) const;
102 
103  sal_uInt32 const mIndexOfSectionNode;
107 };
108 
109 }
110 
111 #endif /* TOXTABSTOPTOKENHANDLER_HXX_ */
112 
113 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ToxTabStopTokenHandler::HandledTabStopToken HandleTabStopToken(const SwFormToken &aToken, const SwTextNode &targetNode, const SwRootFrame *currentLayout) const override
Handle a tab stop token.
Dialog to specify the properties of date form field.
Definition: accfrmobj.cxx:38
The root element of a Writer document layout.
Definition: rootfrm.hxx:79
DefaultToxTabStopTokenHandler(sal_uInt32 indexOfSectionNode, const SwPageDesc &defaultPageDescription, bool tabPositionIsRelativeToParagraphIndent, TabStopReferencePolicy referencePolicy)
static bool CanUseLayoutRectangle(const SwTextNode &targetNode, const SwRootFrame *currentLayout)
Test whether the page layout can be obtained by a layout rectangle.
This class handles tab stop tokens in the pattern for tox entries.
TabStopReferencePolicy const mTabStopReferencePolicy
The default implementation of ToxTabStopTokenHandler.
long CalculatePageMarginFromPageDescription(const SwTextNode &targetNode) const
Calculate the page margin from the page description.
virtual HandledTabStopToken HandleTabStopToken(const SwFormToken &aToken, const SwTextNode &targetNode, const SwRootFrame *currentLayout) const =0
Handle a tab stop token.
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79