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 <tools/fldunit.hxx>
23 #include <svl/poolitem.hxx>
24 #include <svx/rulritem.hxx>
25 #include <unotools/viewoptions.hxx>
26 #include <vcl/fixed.hxx>
27 #include <vcl/field.hxx>
28 #include <svtools/unitconv.hxx>
29 #include <vector>
30 #include <vcl/layout.hxx>
31 
32 #include <svx/tbxctl.hxx>
33 
34 #define SWPAGE_NARROW_VALUE 720
35 #define SWPAGE_NORMAL_VALUE 1136
36 #define SWPAGE_WIDE_VALUE1 1440
37 #define SWPAGE_WIDE_VALUE2 2880
38 #define SWPAGE_WIDE_VALUE3 1800
39 
40 static const long MINBODY = 284; //0.5 cm in twips
41 
42 namespace sw { namespace sidebar {
43 
45 {
46 public:
47  explicit PageMarginControl( sal_uInt16 nId, vcl::Window* pParent );
48  virtual ~PageMarginControl() override;
49  virtual void dispose() override;
50 
51 private:
57 
62 
64 
69 
70  // hidden metric field
72 
78 
80 
82 
89 
91 
92  DECL_LINK( SelectMarginHdl, Button*, void );
93  DECL_LINK( ModifyLRMarginHdl, Edit&, void );
94  DECL_LINK( ModifyULMarginHdl, Edit&, void );
95 
96  static void ExecuteMarginLRChange(
97  const long nPageLeftMargin,
98  const long nPageRightMargin );
99  static void ExecuteMarginULChange(
100  const long nPageTopMargin,
101  const long nPageBottomMargin );
102  static void ExecutePageLayoutChange( const bool bMirrored );
103 
104  void SetMetricFieldMaxValues(const Size& rPageSize);
105 
106  bool GetUserCustomValues();
107  void StoreUserCustomValues();
108 
109  void FillHelpText( const bool bUserCustomValuesAvailable );
110 };
111 
112 } } // end of namespace sw::sidebar
113 
114 #endif
115 
116 /* 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 drop-down form field.
Definition: accframe.hxx:34
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