Teach symstore more duplicated DLLs
[LibreOffice.git] / sw / inc / reffld.hxx
blobf59ea0d55b43b0781c1c2d035a074e7ac83130a9
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_SW_INC_REFFLD_HXX
20 #define INCLUDED_SW_INC_REFFLD_HXX
22 #include <tools/solar.h>
24 #include "fldbas.hxx"
26 class SfxPoolItem;
27 class SwDoc;
28 class SwTextNode;
29 class SwTextField;
30 class SwRootFrame;
32 bool IsFrameBehind( const SwTextNode& rMyNd, sal_Int32 nMySttPos,
33 const SwTextNode& rBehindNd, sal_Int32 nSttPos );
35 enum REFERENCESUBTYPE
37 REF_SETREFATTR = 0,
38 REF_SEQUENCEFLD,
39 REF_BOOKMARK,
40 REF_OUTLINE,
41 REF_FOOTNOTE,
42 REF_ENDNOTE
45 enum REFERENCEMARK
47 REF_BEGIN,
48 REF_PAGE = REF_BEGIN, ///< "Page"
49 REF_CHAPTER, ///< "Chapter"
50 REF_CONTENT, ///< "Reference"
51 REF_UPDOWN, ///< "Above/Below"
52 REF_PAGE_PGDESC, ///< "As Page Style"
53 REF_ONLYNUMBER, ///< "Category and Number"
54 REF_ONLYCAPTION, ///< "Caption Text"
55 REF_ONLYSEQNO, ///< "Numbering"
56 // --> #i81002#
57 /// new reference format types for referencing bookmarks and set references
58 REF_NUMBER, ///< "Number"
59 REF_NUMBER_NO_CONTEXT, ///< "Number (no context)"
60 REF_NUMBER_FULL_CONTEXT, ///< "Number (full context)"
63 /// Get reference.
65 class SAL_DLLPUBLIC_RTTI SwGetRefFieldType final : public SwFieldType
67 SwDoc* m_pDoc;
69 /// Overlay in order to update all ref-fields.
70 virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ) override;
71 public:
72 SwGetRefFieldType(SwDoc* pDoc );
73 virtual std::unique_ptr<SwFieldType> Copy() const override;
75 SwDoc* GetDoc() const { return m_pDoc; }
77 void MergeWithOtherDoc( SwDoc& rDestDoc );
79 static SwTextNode* FindAnchor( SwDoc* pDoc, const OUString& rRefMark,
80 sal_uInt16 nSubType, sal_uInt16 nSeqNo,
81 sal_Int32* pStt, sal_Int32* pEnd = nullptr,
82 SwRootFrame const* pLayout = nullptr);
85 class SW_DLLPUBLIC SwGetRefField final : public SwField
87 private:
88 OUString m_sSetRefName;
89 OUString m_sSetReferenceLanguage;
90 OUString m_sText; ///< result
91 OUString m_sTextRLHidden; ///< result for layout with redlines hidden
92 sal_uInt16 m_nSubType;
93 /// reference to either a SwTextFootnote::m_nSeqNo or a SwSetExpField::mnSeqNo
94 sal_uInt16 m_nSeqNo;
96 virtual OUString ExpandImpl(SwRootFrame const* pLayout) const override;
97 virtual std::unique_ptr<SwField> Copy() const override;
99 public:
100 SwGetRefField( SwGetRefFieldType*, const OUString& rSetRef, const OUString& rReferenceLanguage,
101 sal_uInt16 nSubType, sal_uInt16 nSeqNo, sal_uLong nFormat );
103 virtual ~SwGetRefField() override;
105 virtual OUString GetFieldName() const override;
107 const OUString& GetSetRefName() const { return m_sSetRefName; }
109 // #i81002#
110 /** The <SwTextField> instance, which represents the text attribute for the
111 <SwGetRefField> instance, has to be passed to the method.
112 This <SwTextField> instance is needed for the reference format type REF_UPDOWN
113 and REF_NUMBER.
114 Note: This instance may be NULL (field in Undo/Redo). This will cause
115 no update for these reference format types. */
116 void UpdateField( const SwTextField* pFieldTextAttr );
118 void SetExpand( const OUString& rStr );
120 /// Get/set sub type.
121 virtual sal_uInt16 GetSubType() const override;
122 virtual void SetSubType( sal_uInt16 n ) override;
124 // --> #i81002#
125 bool IsRefToHeadingCrossRefBookmark() const;
126 bool IsRefToNumItemCrossRefBookmark() const;
127 const SwTextNode* GetReferencedTextNode() const;
128 // #i85090#
129 OUString GetExpandedTextOfReferencedTextNode(SwRootFrame const& rLayout) const;
131 /// Get/set SequenceNo (of interest only for REF_SEQUENCEFLD).
132 sal_uInt16 GetSeqNo() const { return m_nSeqNo; }
133 void SetSeqNo( sal_uInt16 n ) { m_nSeqNo = n; }
135 // Name of reference.
136 virtual OUString GetPar1() const override;
137 virtual void SetPar1(const OUString& rStr) override;
139 virtual OUString GetPar2() const override;
140 virtual bool QueryValue( css::uno::Any& rVal, sal_uInt16 nWhichId ) const override;
141 virtual bool PutValue( const css::uno::Any& rVal, sal_uInt16 nWhichId ) override;
143 void ConvertProgrammaticToUIName();
145 virtual OUString GetDescription() const override;
148 #endif /// INCLUDED_SW_INC_REFFLD_HXX
150 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */