LibreOffice Module sw (master)  1
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 <sfx2/tbxctrl.hxx>
23 #include <vcl/fixed.hxx>
24 #include <vcl/field.hxx>
25 #include <vcl/layout.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 static const long MINBODY = 56; // 1mm in twips rounded
35 
36 namespace sw { namespace sidebar {
37 
39 {
40 public:
41  explicit PageMarginControl( sal_uInt16 nId, vcl::Window* pParent );
42  virtual ~PageMarginControl() override;
43  virtual void dispose() override;
44 
45 private:
51 
56 
58 
63 
64  // hidden metric field
66 
72 
74 
76 
83 
85 
86  DECL_LINK( SelectMarginHdl, Button*, void );
87  DECL_LINK( ModifyLRMarginHdl, Edit&, void );
88  DECL_LINK( ModifyULMarginHdl, Edit&, void );
89 
90  static void ExecuteMarginLRChange(
91  const long nPageLeftMargin,
92  const long nPageRightMargin );
93  static void ExecuteMarginULChange(
94  const long nPageTopMargin,
95  const long nPageBottomMargin );
96  static void ExecutePageLayoutChange( const bool bMirrored );
97 
98  void SetMetricFieldMaxValues(const Size& rPageSize);
99 
100  bool GetUserCustomValues();
101  void StoreUserCustomValues();
102 
103  void FillHelpText( const bool bUserCustomValuesAvailable );
104 };
105 
106 } } // end of namespace sw::sidebar
107 
108 #endif
109 
110 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void FillHelpText(const bool bUserCustomValuesAvailable)
VclPtr< MetricField > m_pBottomMarginEdit
static void ExecutePageLayoutChange(const bool bMirrored)
sal_Int16 nId
Dialog to specify the properties of date form field.
Definition: accfrmobj.cxx:38
PageMarginControl(sal_uInt16 nId, vcl::Window *pParent)
VclPtr< MetricField > m_pRightMarginEdit
DECL_LINK(SelectMarginHdl, Button *, void)
VclPtr< MetricField > m_pTopMarginEdit
VclPtr< MetricField > m_pWidthHeightField
void SetMetricFieldMaxValues(const Size &rPageSize)
static void ExecuteMarginLRChange(const long nPageLeftMargin, const long nPageRightMargin)
static void ExecuteMarginULChange(const long nPageTopMargin, const long nPageBottomMargin)
static const long MINBODY
VclPtr< MetricField > m_pLeftMarginEdit
virtual void dispose() override
MapUnit