LibreOffice Module sw (master)
1
sw
inc
chpfld.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_CHPFLD_HXX
20
#define INCLUDED_SW_INC_CHPFLD_HXX
21
22
#include "
fldbas.hxx
"
23
24
class
SwFrame
;
25
class
SwContentNode
;
26
class
SwTextNode
;
27
class
SwRootFrame
;
28
29
enum
SwChapterFormat
30
{
31
CF_BEGIN
,
32
CF_NUMBER
=
CF_BEGIN
,
33
CF_TITLE
,
34
CF_NUM_TITLE
,
35
CF_NUMBER_NOPREPST
,
36
CF_NUM_NOPREPST_TITLE
,
37
};
38
39
class
SAL_DLLPUBLIC_RTTI
SwChapterFieldType
final :
public
SwFieldType
40
{
41
public
:
42
SwChapterFieldType
();
43
44
virtual
std::unique_ptr<SwFieldType>
Copy
()
const override
;
45
46
};
47
48
class
SW_DLLPUBLIC
SwChapterField
final :
public
SwField
49
{
50
friend
class
SwChapterFieldType
;
51
friend
class
ToxTextGeneratorTest;
// the unittest needs to mock the chapter fields.
52
53
struct
State
54
{
55
sal_uInt8
nLevel
;
56
OUString
sTitle
;
57
OUString
sNumber
;
58
OUString
sLabelFollowedBy
;
59
OUString
sPre
;
60
OUString
sPost
;
61
State
() : nLevel(0) {}
62
};
63
State
m_State
;
64
State
m_StateRLHidden
;
65
66
virtual
OUString
ExpandImpl
(
SwRootFrame
const
* pLayout)
const override
;
67
virtual
std::unique_ptr<SwField>
Copy
()
const override
;
68
69
public
:
70
SwChapterField
(
SwChapterFieldType
*, sal_uInt32 nFormat = 0);
71
72
// #i53420#
73
void
ChangeExpansion(
const
SwFrame
&,
74
const
SwContentNode
*,
75
bool
bSrchNum =
false
);
76
void
ChangeExpansion(
const
SwTextNode
&rNd,
bool
bSrchNum,
SwRootFrame
const
* pLayout =
nullptr
);
77
78
sal_uInt8
GetLevel(
SwRootFrame
const
* pLayout =
nullptr
)
const
;
79
void
SetLevel(
sal_uInt8
);
80
81
const
OUString& GetNumber(
SwRootFrame
const
* pLayout =
nullptr
)
const
;
82
const
OUString&
GetTitle
(
SwRootFrame
const
* pLayout =
nullptr
)
const
;
83
84
virtual
bool
QueryValue
( css::uno::Any& rVal, sal_uInt16 nWhich )
const override
;
85
virtual
bool
PutValue
(
const
css::uno::Any& rVal, sal_uInt16 nWhich )
override
;
86
};
87
88
#endif
// INCLUDED_SW_INC_CHPFLD_HXX
89
90
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SwChapterFormat
SwChapterFormat
Definition:
chpfld.hxx:30
CF_TITLE
@ CF_TITLE
only the title
Definition:
chpfld.hxx:33
CF_NUM_TITLE
@ CF_NUM_TITLE
number and title
Definition:
chpfld.hxx:34
CF_BEGIN
@ CF_BEGIN
Definition:
chpfld.hxx:31
CF_NUMBER
@ CF_NUMBER
only the chapter number
Definition:
chpfld.hxx:32
CF_NUMBER_NOPREPST
@ CF_NUMBER_NOPREPST
only chapter number without post-/prefix
Definition:
chpfld.hxx:35
CF_NUM_NOPREPST_TITLE
@ CF_NUM_NOPREPST_TITLE
chapter number without post-/prefix and title
Definition:
chpfld.hxx:36
SwChapterFieldType
Definition:
chpfld.hxx:40
SwChapterField
Definition:
chpfld.hxx:49
SwChapterField::m_State
State m_State
Definition:
chpfld.hxx:63
SwChapterField::m_StateRLHidden
State m_StateRLHidden
Definition:
chpfld.hxx:64
SwContentNode
Definition:
node.hxx:395
SwFieldType
Instances of SwFields and those derived from it occur 0 to n times.
Definition:
fldbas.hxx:247
SwFieldType::Copy
virtual std::unique_ptr< SwFieldType > Copy() const =0
SwField
Base class of all fields.
Definition:
fldbas.hxx:296
SwField::ExpandImpl
virtual OUString ExpandImpl(SwRootFrame const *pLayout) const =0
SwField::QueryValue
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt16 nWhichId) const
Definition:
fldbas.cxx:364
SwField::PutValue
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt16 nWhichId)
Definition:
fldbas.cxx:382
SwField::Copy
virtual std::unique_ptr< SwField > Copy() const =0
SwField::GetTitle
const OUString & GetTitle() const
Definition:
fldbas.hxx:398
SwFrame
Base class of the Writer layout elements.
Definition:
frame.hxx:315
SwRootFrame
The root element of a Writer document layout.
Definition:
rootfrm.hxx:85
SwTextNode
SwTextNode is a paragraph in the document model.
Definition:
ndtxt.hxx:112
fldbas.hxx
SwChapterField::State
Definition:
chpfld.hxx:54
SwChapterField::State::sNumber
OUString sNumber
Definition:
chpfld.hxx:57
SwChapterField::State::State
State()
Definition:
chpfld.hxx:61
SwChapterField::State::nLevel
sal_uInt8 nLevel
Definition:
chpfld.hxx:55
SwChapterField::State::sTitle
OUString sTitle
Definition:
chpfld.hxx:56
SwChapterField::State::sPost
OUString sPost
Definition:
chpfld.hxx:60
SwChapterField::State::sPre
OUString sPre
Definition:
chpfld.hxx:59
SwChapterField::State::sLabelFollowedBy
OUString sLabelFollowedBy
Definition:
chpfld.hxx:58
SW_DLLPUBLIC
#define SW_DLLPUBLIC
Definition:
swdllapi.h:28
sal_uInt8
unsigned char sal_uInt8
Generated on Sun Jul 30 2023 04:27:57 for LibreOffice Module sw (master) by
1.9.3