LibreOffice Module sw (master) 1
reffld.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_REFFLD_HXX
20#define INCLUDED_SW_INC_REFFLD_HXX
21
22#include <tools/solar.h>
23
24#include "fldbas.hxx"
25
26class SfxPoolItem;
27class SwDoc;
28class SwTextNode;
29class SwTextField;
30class SwRootFrame;
31
32bool IsFrameBehind( const SwTextNode& rMyNd, sal_Int32 nMySttPos,
33 const SwTextNode& rBehindNd, sal_Int32 nSttPos );
34
36{
43};
44
46{
56 // --> #i81002#
61};
62
64
65class SAL_DLLPUBLIC_RTTI SwGetRefFieldType final : public SwFieldType
66{
68
70 virtual void SwClientNotify(const SwModify&, const SfxHint&) override;
71public:
73 virtual std::unique_ptr<SwFieldType> Copy() const override;
74 virtual void UpdateFields() override {};
75
76 SwDoc& GetDoc() const { return m_rDoc; }
77
78 void MergeWithOtherDoc( SwDoc& rDestDoc );
79
80 static SwTextNode* FindAnchor( SwDoc* pDoc, const OUString& rRefMark,
81 sal_uInt16 nSubType, sal_uInt16 nSeqNo,
82 sal_Int32* pStt, sal_Int32* pEnd = nullptr,
83 SwRootFrame const* pLayout = nullptr);
84 void UpdateGetReferences();
85};
86
88{
89private:
90 OUString m_sSetRefName;
92 OUString m_sText;
93 OUString m_sTextRLHidden;
94 sal_uInt16 m_nSubType;
96 sal_uInt16 m_nSeqNo;
97
98 virtual OUString ExpandImpl(SwRootFrame const* pLayout) const override;
99 virtual std::unique_ptr<SwField> Copy() const override;
100
101public:
102 SwGetRefField( SwGetRefFieldType*, OUString aSetRef, OUString aReferenceLanguage,
103 sal_uInt16 nSubType, sal_uInt16 nSeqNo, sal_uLong nFormat );
104
105 virtual ~SwGetRefField() override;
106
107 virtual OUString GetFieldName() const override;
108
109 const OUString& GetSetRefName() const { return m_sSetRefName; }
110
111 // #i81002#
118 void UpdateField( const SwTextField* pFieldTextAttr );
119
120 void SetExpand( const OUString& rStr );
121
123 virtual sal_uInt16 GetSubType() const override;
124 virtual void SetSubType( sal_uInt16 n ) override;
125
126 // --> #i81002#
127 bool IsRefToHeadingCrossRefBookmark() const;
128 bool IsRefToNumItemCrossRefBookmark() const;
129 const SwTextNode* GetReferencedTextNode() const;
130 // #i85090#
131 OUString GetExpandedTextOfReferencedTextNode(SwRootFrame const& rLayout) const;
132
134 sal_uInt16 GetSeqNo() const { return m_nSeqNo; }
135 void SetSeqNo( sal_uInt16 n ) { m_nSeqNo = n; }
136
137 // Name of reference.
138 virtual OUString GetPar1() const override;
139 virtual void SetPar1(const OUString& rStr) override;
140
141 virtual OUString GetPar2() const override;
142 virtual bool QueryValue( css::uno::Any& rVal, sal_uInt16 nWhichId ) const override;
143 virtual bool PutValue( const css::uno::Any& rVal, sal_uInt16 nWhichId ) override;
144
145 void ConvertProgrammaticToUIName();
146
147 virtual OUString GetDescription() const override;
148};
149
150#endif
151
152/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Definition: doc.hxx:197
Instances of SwFields and those derived from it occur 0 to n times.
Definition: fldbas.hxx:247
virtual std::unique_ptr< SwFieldType > Copy() const =0
Base class of all fields.
Definition: fldbas.hxx:296
virtual OUString GetPar1() const
Definition: fldbas.cxx:334
virtual void SetPar1(const OUString &rStr)
Definition: fldbas.cxx:349
virtual OUString ExpandImpl(SwRootFrame const *pLayout) const =0
virtual sal_uInt16 GetSubType() const
Definition: fldbas.cxx:355
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt16 nWhichId) const
Definition: fldbas.cxx:364
virtual OUString GetFieldName() const
get name or content
Definition: fldbas.cxx:318
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt16 nWhichId)
Definition: fldbas.cxx:382
virtual OUString GetDescription() const
Definition: fldbas.cxx:909
virtual std::unique_ptr< SwField > Copy() const =0
virtual OUString GetPar2() const
Definition: fldbas.cxx:339
virtual void SetSubType(sal_uInt16)
Definition: fldbas.cxx:360
Get reference.
Definition: reffld.hxx:66
SwDoc & m_rDoc
Definition: reffld.hxx:67
SwDoc & GetDoc() const
Definition: reffld.hxx:76
virtual void UpdateFields() override
Definition: reffld.hxx:74
OUString m_sSetRefName
Definition: reffld.hxx:90
OUString m_sText
result
Definition: reffld.hxx:92
sal_uInt16 m_nSubType
Definition: reffld.hxx:94
OUString m_sTextRLHidden
result for layout with redlines hidden
Definition: reffld.hxx:93
sal_uInt16 m_nSeqNo
reference to either a SwTextFootnote::m_nSeqNo or a SwSetExpField::mnSeqNo
Definition: reffld.hxx:96
OUString m_sSetReferenceLanguage
Definition: reffld.hxx:91
const OUString & GetSetRefName() const
Definition: reffld.hxx:109
void SetSeqNo(sal_uInt16 n)
Definition: reffld.hxx:135
sal_uInt16 GetSeqNo() const
Get/set SequenceNo (of interest only for REF_SEQUENCEFLD).
Definition: reffld.hxx:134
The root element of a Writer document layout.
Definition: rootfrm.hxx:85
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:112
SwDoc & m_rDoc
Definition: docbm.cxx:1228
const SwContentFrame * FindAnchor(const SwFrame *pOldAnch, const Point &rNew, const bool bBody=false)
search an anchor for paragraph bound frames starting from pOldAnch
Definition: flycnt.cxx:1084
sal_Int64 n
bool IsFrameBehind(const SwTextNode &rMyNd, sal_Int32 nMySttPos, const SwTextNode &rBehindNd, sal_Int32 nSttPos)
Definition: reffld.cxx:100
REFERENCESUBTYPE
Definition: reffld.hxx:36
@ REF_OUTLINE
Definition: reffld.hxx:40
@ REF_SETREFATTR
Definition: reffld.hxx:37
@ REF_SEQUENCEFLD
Definition: reffld.hxx:38
@ REF_FOOTNOTE
Definition: reffld.hxx:41
@ REF_BOOKMARK
Definition: reffld.hxx:39
@ REF_ENDNOTE
Definition: reffld.hxx:42
REFERENCEMARK
Definition: reffld.hxx:46
@ REF_BEGIN
Definition: reffld.hxx:47
@ REF_PAGE_PGDESC
"As Page Style"
Definition: reffld.hxx:52
@ REF_UPDOWN
"Above/Below"
Definition: reffld.hxx:51
@ REF_NUMBER
new reference format types for referencing bookmarks and set references
Definition: reffld.hxx:58
@ REF_PAGE
"Page"
Definition: reffld.hxx:48
@ REF_ONLYSEQNO
"Numbering"
Definition: reffld.hxx:55
@ REF_ONLYNUMBER
"Category and Number"
Definition: reffld.hxx:53
@ REF_ONLYCAPTION
"Caption Text"
Definition: reffld.hxx:54
@ REF_NUMBER_NO_CONTEXT
"Number (no context)"
Definition: reffld.hxx:59
@ REF_CHAPTER
"Chapter"
Definition: reffld.hxx:49
@ REF_CONTENT
"Reference"
Definition: reffld.hxx:50
@ REF_NUMBER_FULL_CONTEXT
"Number (full context)"
Definition: reffld.hxx:60
sal_uIntPtr sal_uLong
#define SW_DLLPUBLIC
Definition: swdllapi.h:28