LibreOffice Module sw (master)
1
sw
inc
txtfld.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
#ifndef INCLUDED_SW_INC_TXTFLD_HXX
20
#define INCLUDED_SW_INC_TXTFLD_HXX
21
22
#include "
txatbase.hxx
"
23
#include <rtl/ustring.hxx>
24
25
#include <memory>
26
#include <cassert>
27
28
class
SwPaM
;
29
class
SwTextNode
;
30
31
class
SAL_DLLPUBLIC_RTTI
SwTextField
:
public
virtual
SwTextAttr
32
{
33
mutable
OUString
m_aExpand
;
// only used to determine, if field content is changing in <ExpandTextField()>
34
SwTextNode
*
m_pTextNode
;
35
36
public
:
37
SwTextField
(
38
SwFormatField
& rAttr,
39
sal_Int32
const
nStart,
40
bool
const
bInClipboard );
41
42
virtual
~SwTextField
()
override
;
43
44
void
CopyTextField(
SwTextField
*pDest )
const
;
45
46
void
ExpandTextField(
const
bool
bForceNotify =
false
)
const
;
47
48
// get and set TextNode pointer
49
SwTextNode
*
GetpTextNode
()
const
50
{
51
return
m_pTextNode;
52
}
53
SwTextNode
&
GetTextNode
()
const
54
{
55
assert(m_pTextNode);
56
return
*m_pTextNode;
57
}
58
void
ChgTextNode
(
SwTextNode
* pNew )
59
{
60
m_pTextNode = pNew;
61
}
62
63
bool
IsFieldInDoc()
const
;
64
65
// enable notification that field content has changed and needs reformatting
66
virtual
void
NotifyContentChange(
SwFormatField
& rFormatField );
67
68
// deletes the given field via removing the corresponding text selection from the document's content
69
static
void
DeleteTextField(
const
SwTextField
& rTextField );
70
71
// return text selection for the given field
72
static
void
GetPamForTextField(
const
SwTextField
& rTextField,
73
std::shared_ptr< SwPaM >& rPamForTextField );
74
75
};
76
77
class
SwTextInputField
final
78
:
public
SwTextAttrNesting
79
,
public
SwTextField
80
{
81
public
:
82
SwTextInputField
(
83
SwFormatField
& rAttr,
84
sal_Int32
const
nStart,
85
sal_Int32
const
nEnd,
86
bool
const
bInClipboard );
87
88
virtual
~SwTextInputField
()
override
;
89
90
bool
LockNotifyContentChange
();
91
void
UnlockNotifyContentChange
();
92
virtual
void
NotifyContentChange
(
SwFormatField
& rFormatField )
override
;
93
94
void
UpdateTextNodeContent
(
const
OUString& rNewContent );
95
96
OUString
GetFieldContent
()
const
;
97
void
UpdateFieldContent
();
98
99
private
:
100
101
bool
m_bLockNotifyContentChange
;
102
};
103
104
#endif
105
106
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SwFormatField
Definition:
fmtfld.hxx:103
SwPaM
PaM is Point and Mark: a selection of the document model.
Definition:
pam.hxx:188
SwTextAttrNesting
Definition:
txatbase.hxx:149
SwTextAttr
A wrapper around SfxPoolItem to store the start position of (usually) a text portion,...
Definition:
txatbase.hxx:44
SwTextField
Definition:
txtfld.hxx:32
SwTextField::GetTextNode
SwTextNode & GetTextNode() const
Definition:
txtfld.hxx:53
SwTextField::ChgTextNode
void ChgTextNode(SwTextNode *pNew)
Definition:
txtfld.hxx:58
SwTextField::m_pTextNode
SwTextNode * m_pTextNode
Definition:
txtfld.hxx:34
SwTextField::m_aExpand
OUString m_aExpand
Definition:
txtfld.hxx:33
SwTextField::GetpTextNode
SwTextNode * GetpTextNode() const
Definition:
txtfld.hxx:49
SwTextInputField
Definition:
txtfld.hxx:80
SwTextInputField::m_bLockNotifyContentChange
bool m_bLockNotifyContentChange
Definition:
txtfld.hxx:101
SwTextInputField::UpdateTextNodeContent
void UpdateTextNodeContent(const OUString &rNewContent)
Definition:
atrfld.cxx:753
SwTextInputField::GetFieldContent
OUString GetFieldContent() const
Definition:
atrfld.cxx:717
SwTextInputField::UnlockNotifyContentChange
void UnlockNotifyContentChange()
Definition:
atrfld.cxx:699
SwTextInputField::SwTextInputField
SwTextInputField(SwFormatField &rAttr, sal_Int32 const nStart, sal_Int32 const nEnd, bool const bInClipboard)
Definition:
atrfld.cxx:670
SwTextInputField::UpdateFieldContent
void UpdateFieldContent()
Definition:
atrfld.cxx:722
SwTextInputField::~SwTextInputField
virtual ~SwTextInputField() override
Definition:
atrfld.cxx:685
SwTextInputField::NotifyContentChange
virtual void NotifyContentChange(SwFormatField &rFormatField) override
Definition:
atrfld.cxx:704
SwTextInputField::LockNotifyContentChange
bool LockNotifyContentChange()
Definition:
atrfld.cxx:689
SwTextNode
SwTextNode is a paragraph in the document model.
Definition:
ndtxt.hxx:112
txatbase.hxx
Generated on Sun Jul 30 2023 04:28:05 for LibreOffice Module sw (master) by
1.9.3