LibreOffice Module sw (master)
1
sw
source
uibase
sidebar
PageMarginControl.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_SOURCE_UIBASE_SIDEBAR_PAGEMARGINCONTROL_HXX
20
#define INCLUDED_SW_SOURCE_UIBASE_SIDEBAR_PAGEMARGINCONTROL_HXX
21
22
#include <
sal/config.h
>
23
24
#include <
o3tl/unit_conversion.hxx
>
25
#include <
svtools/toolbarmenu.hxx
>
26
27
#define SWPAGE_NARROW_VALUE 720
28
#define SWPAGE_NORMAL_VALUE 1136
29
#define SWPAGE_WIDE_VALUE1 1440
30
#define SWPAGE_WIDE_VALUE2 2880
31
#define SWPAGE_WIDE_VALUE3 1800
32
33
// #i19922# - tdf#126051 see cui/source/tabpages/page.cxx and svx/source/dialog/hdft.cxx
34
constexpr
tools::Long
MINBODY
=
o3tl::toTwips
(1,
o3tl::Length::mm
);
// 1mm in twips rounded
35
36
class
PageMarginPopup
;
37
38
namespace
sw::sidebar
{
39
40
class
PageMarginControl
final :
public
WeldToolbarPopup
41
{
42
public
:
43
explicit
PageMarginControl
(
PageMarginPopup
* pControl,
weld::Widget
* pParent);
44
virtual
void
GrabFocus
()
override
;
45
virtual
~PageMarginControl
()
override
;
46
47
private
:
48
std::unique_ptr<weld::Button>
m_xNarrow
;
49
std::unique_ptr<weld::Button>
m_xNormal
;
50
std::unique_ptr<weld::Button>
m_xWide
;
51
std::unique_ptr<weld::Button>
m_xMirrored
;
52
std::unique_ptr<weld::Button>
m_xLast
;
53
std::unique_ptr<weld::Button>
m_xMoreButton
;
54
55
std::unique_ptr<weld::Label>
m_xLeft
;
56
std::unique_ptr<weld::Label>
m_xRight
;
57
std::unique_ptr<weld::Label>
m_xInner
;
58
std::unique_ptr<weld::Label>
m_xOuter
;
59
60
std::unique_ptr<weld::MetricSpinButton>
m_xLeftMarginEdit
;
61
std::unique_ptr<weld::MetricSpinButton>
m_xRightMarginEdit
;
62
std::unique_ptr<weld::MetricSpinButton>
m_xTopMarginEdit
;
63
std::unique_ptr<weld::MetricSpinButton>
m_xBottomMarginEdit
;
64
65
// hidden metric field
66
std::unique_ptr<weld::MetricSpinButton>
m_xWidthHeightField
;
67
68
rtl::Reference<PageMarginPopup>
m_xControl
;
69
70
tools::Long
m_nPageLeftMargin
;
71
tools::Long
m_nPageRightMargin
;
72
tools::Long
m_nPageTopMargin
;
73
tools::Long
m_nPageBottomMargin
;
74
bool
m_bMirrored
;
75
76
const
MapUnit
m_eUnit
;
77
78
Size
m_aPageSize
;
79
80
bool
m_bUserCustomValuesAvailable
;
81
tools::Long
m_nUserCustomPageLeftMargin
;
82
tools::Long
m_nUserCustomPageRightMargin
;
83
tools::Long
m_nUserCustomPageTopMargin
;
84
tools::Long
m_nUserCustomPageBottomMargin
;
85
bool
m_bUserCustomMirrored
;
86
87
bool
m_bCustomValuesUsed
;
88
89
DECL_LINK
( SelectMarginHdl,
weld::Button
&,
void
);
90
DECL_LINK
( ModifyLRMarginHdl,
weld::MetricSpinButton
&,
void
);
91
DECL_LINK
( ModifyULMarginHdl,
weld::MetricSpinButton
&,
void
);
92
DECL_LINK
(MoreButtonClickHdl_Impl,
weld::Button
&,
void
);
93
94
static
void
ExecuteMarginLRChange
(
95
const
tools::Long
nPageLeftMargin,
96
const
tools::Long
nPageRightMargin );
97
static
void
ExecuteMarginULChange
(
98
const
tools::Long
nPageTopMargin,
99
const
tools::Long
nPageBottomMargin );
100
static
void
ExecutePageLayoutChange
(
const
bool
bMirrored );
101
102
void
SetMetricFieldMaxValues
(
const
Size
& rPageSize);
103
104
bool
GetUserCustomValues
();
105
void
StoreUserCustomValues
();
106
107
void
FillHelpText
(
const
bool
bUserCustomValuesAvailable );
108
};
109
110
}
// end of namespace sw::sidebar
111
112
#endif
113
114
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
MINBODY
constexpr tools::Long MINBODY
Definition:
PageMarginControl.hxx:34
PageMarginPopup
Definition:
PageMarginPopup.hxx:25
Size
WeldToolbarPopup
rtl::Reference< PageMarginPopup >
sw::sidebar::PageMarginControl
Definition:
PageMarginControl.hxx:41
sw::sidebar::PageMarginControl::GrabFocus
virtual void GrabFocus() override
Definition:
PageMarginControl.cxx:227
sw::sidebar::PageMarginControl::m_xLast
std::unique_ptr< weld::Button > m_xLast
Definition:
PageMarginControl.hxx:52
sw::sidebar::PageMarginControl::m_xNormal
std::unique_ptr< weld::Button > m_xNormal
Definition:
PageMarginControl.hxx:49
sw::sidebar::PageMarginControl::m_nUserCustomPageTopMargin
tools::Long m_nUserCustomPageTopMargin
Definition:
PageMarginControl.hxx:83
sw::sidebar::PageMarginControl::m_bUserCustomValuesAvailable
bool m_bUserCustomValuesAvailable
Definition:
PageMarginControl.hxx:80
sw::sidebar::PageMarginControl::m_nPageBottomMargin
tools::Long m_nPageBottomMargin
Definition:
PageMarginControl.hxx:73
sw::sidebar::PageMarginControl::StoreUserCustomValues
void StoreUserCustomValues()
Definition:
PageMarginControl.cxx:551
sw::sidebar::PageMarginControl::m_nPageTopMargin
tools::Long m_nPageTopMargin
Definition:
PageMarginControl.hxx:72
sw::sidebar::PageMarginControl::PageMarginControl
PageMarginControl(PageMarginPopup *pControl, weld::Widget *pParent)
Definition:
PageMarginControl.cxx:92
sw::sidebar::PageMarginControl::m_xBottomMarginEdit
std::unique_ptr< weld::MetricSpinButton > m_xBottomMarginEdit
Definition:
PageMarginControl.hxx:63
sw::sidebar::PageMarginControl::m_xMirrored
std::unique_ptr< weld::Button > m_xMirrored
Definition:
PageMarginControl.hxx:51
sw::sidebar::PageMarginControl::~PageMarginControl
virtual ~PageMarginControl() override
Definition:
PageMarginControl.cxx:232
sw::sidebar::PageMarginControl::m_xWidthHeightField
std::unique_ptr< weld::MetricSpinButton > m_xWidthHeightField
Definition:
PageMarginControl.hxx:66
sw::sidebar::PageMarginControl::m_xControl
rtl::Reference< PageMarginPopup > m_xControl
Definition:
PageMarginControl.hxx:68
sw::sidebar::PageMarginControl::m_xNarrow
std::unique_ptr< weld::Button > m_xNarrow
Definition:
PageMarginControl.hxx:48
sw::sidebar::PageMarginControl::DECL_LINK
DECL_LINK(ModifyLRMarginHdl, weld::MetricSpinButton &, void)
sw::sidebar::PageMarginControl::m_xMoreButton
std::unique_ptr< weld::Button > m_xMoreButton
Definition:
PageMarginControl.hxx:53
sw::sidebar::PageMarginControl::ExecutePageLayoutChange
static void ExecutePageLayoutChange(const bool bMirrored)
Definition:
PageMarginControl.cxx:447
sw::sidebar::PageMarginControl::DECL_LINK
DECL_LINK(SelectMarginHdl, weld::Button &, void)
sw::sidebar::PageMarginControl::m_nPageLeftMargin
tools::Long m_nPageLeftMargin
Definition:
PageMarginControl.hxx:70
sw::sidebar::PageMarginControl::m_xWide
std::unique_ptr< weld::Button > m_xWide
Definition:
PageMarginControl.hxx:50
sw::sidebar::PageMarginControl::SetMetricFieldMaxValues
void SetMetricFieldMaxValues(const Size &rPageSize)
Definition:
PageMarginControl.cxx:237
sw::sidebar::PageMarginControl::m_xOuter
std::unique_ptr< weld::Label > m_xOuter
Definition:
PageMarginControl.hxx:58
sw::sidebar::PageMarginControl::m_eUnit
const MapUnit m_eUnit
Definition:
PageMarginControl.hxx:76
sw::sidebar::PageMarginControl::FillHelpText
void FillHelpText(const bool bUserCustomValuesAvailable)
Definition:
PageMarginControl.cxx:264
sw::sidebar::PageMarginControl::m_xTopMarginEdit
std::unique_ptr< weld::MetricSpinButton > m_xTopMarginEdit
Definition:
PageMarginControl.hxx:62
sw::sidebar::PageMarginControl::m_xRightMarginEdit
std::unique_ptr< weld::MetricSpinButton > m_xRightMarginEdit
Definition:
PageMarginControl.hxx:61
sw::sidebar::PageMarginControl::m_xLeft
std::unique_ptr< weld::Label > m_xLeft
Definition:
PageMarginControl.hxx:55
sw::sidebar::PageMarginControl::m_nUserCustomPageLeftMargin
tools::Long m_nUserCustomPageLeftMargin
Definition:
PageMarginControl.hxx:81
sw::sidebar::PageMarginControl::m_bUserCustomMirrored
bool m_bUserCustomMirrored
Definition:
PageMarginControl.hxx:85
sw::sidebar::PageMarginControl::ExecuteMarginLRChange
static void ExecuteMarginLRChange(const tools::Long nPageLeftMargin, const tools::Long nPageRightMargin)
Definition:
PageMarginControl.cxx:419
sw::sidebar::PageMarginControl::m_xLeftMarginEdit
std::unique_ptr< weld::MetricSpinButton > m_xLeftMarginEdit
Definition:
PageMarginControl.hxx:60
sw::sidebar::PageMarginControl::m_xInner
std::unique_ptr< weld::Label > m_xInner
Definition:
PageMarginControl.hxx:57
sw::sidebar::PageMarginControl::DECL_LINK
DECL_LINK(ModifyULMarginHdl, weld::MetricSpinButton &, void)
sw::sidebar::PageMarginControl::m_bCustomValuesUsed
bool m_bCustomValuesUsed
Definition:
PageMarginControl.hxx:87
sw::sidebar::PageMarginControl::m_aPageSize
Size m_aPageSize
Definition:
PageMarginControl.hxx:78
sw::sidebar::PageMarginControl::m_xRight
std::unique_ptr< weld::Label > m_xRight
Definition:
PageMarginControl.hxx:56
sw::sidebar::PageMarginControl::m_bMirrored
bool m_bMirrored
Definition:
PageMarginControl.hxx:74
sw::sidebar::PageMarginControl::m_nPageRightMargin
tools::Long m_nPageRightMargin
Definition:
PageMarginControl.hxx:71
sw::sidebar::PageMarginControl::DECL_LINK
DECL_LINK(MoreButtonClickHdl_Impl, weld::Button &, void)
sw::sidebar::PageMarginControl::m_nUserCustomPageRightMargin
tools::Long m_nUserCustomPageRightMargin
Definition:
PageMarginControl.hxx:82
sw::sidebar::PageMarginControl::GetUserCustomValues
bool GetUserCustomValues()
Definition:
PageMarginControl.cxx:484
sw::sidebar::PageMarginControl::m_nUserCustomPageBottomMargin
tools::Long m_nUserCustomPageBottomMargin
Definition:
PageMarginControl.hxx:84
sw::sidebar::PageMarginControl::ExecuteMarginULChange
static void ExecuteMarginULChange(const tools::Long nPageTopMargin, const tools::Long nPageBottomMargin)
Definition:
PageMarginControl.cxx:433
weld::Button
weld::MetricSpinButton
weld::Widget
config.h
MapUnit
MapUnit
o3tl::toTwips
constexpr auto toTwips(N number, Length from)
o3tl::Length::mm
@ mm
sw::sidebar
Definition:
A11yCheckIssuesPanel.cxx:30
tools::Long
long Long
toolbarmenu.hxx
unit_conversion.hxx
Generated on Sun Jul 30 2023 04:30:03 for LibreOffice Module sw (master) by
1.9.3