LibreOffice Module sw (master)  1
labfmt.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_UI_ENVELP_LABFMT_HXX
20 #define INCLUDED_SW_SOURCE_UI_ENVELP_LABFMT_HXX
21 
22 #include <labimg.hxx>
23 #include <label.hxx>
24 
25 #include <sfx2/tabdlg.hxx>
26 #include <vcl/idle.hxx>
27 #include <vcl/customweld.hxx>
28 #include <vcl/weld.hxx>
29 
30 class SwLabFormatPage;
31 
33 {
35 
36  OUString m_aHDistStr;
37  OUString m_aVDistStr;
38  OUString m_aWidthStr;
39  OUString m_aHeightStr;
40  OUString m_aLeftStr;
41  OUString m_aUpperStr;
42  OUString m_aColsStr;
43  OUString m_aRowsStr;
44 
51 
54 
56 
57  virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
58  virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
59 
60 public:
61  SwLabPreview();
62 
63  void UpdateItem(const SwLabItem& rItem);
64 };
65 
67 {
70  bool bModified;
71 
73 
74  std::unique_ptr<weld::Label> m_xMakeFI;
75  std::unique_ptr<weld::Label> m_xTypeFI;
76  std::unique_ptr<weld::CustomWeld> m_xPreview;
77  std::unique_ptr<weld::MetricSpinButton> m_xHDistField;
78  std::unique_ptr<weld::MetricSpinButton> m_xVDistField;
79  std::unique_ptr<weld::MetricSpinButton> m_xWidthField;
80  std::unique_ptr<weld::MetricSpinButton> m_xHeightField;
81  std::unique_ptr<weld::MetricSpinButton> m_xLeftField;
82  std::unique_ptr<weld::MetricSpinButton> m_xUpperField;
83  std::unique_ptr<weld::SpinButton> m_xColsField;
84  std::unique_ptr<weld::SpinButton> m_xRowsField;
85  std::unique_ptr<weld::MetricSpinButton> m_xPWidthField;
86  std::unique_ptr<weld::MetricSpinButton> m_xPHeightField;
87  std::unique_ptr<weld::Button> m_xSavePB;
88 
89  DECL_LINK(ModifyHdl, weld::SpinButton&, void);
90  DECL_LINK(MetricModifyHdl, weld::MetricSpinButton&, void);
91  DECL_LINK(PreviewHdl, Timer*, void);
92  DECL_LINK(SaveHdl, weld::Button&, void);
93 
94  void ChangeMinMax();
95 
96 public:
98  const SfxItemSet& rSet);
99  virtual ~SwLabFormatPage() override;
100 
101  static std::unique_ptr<SfxTabPage>
102  Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet);
103 
104  virtual void ActivatePage(const SfxItemSet& rSet) override;
105  virtual DeactivateRC DeactivatePage(SfxItemSet* pSet) override;
106  void FillItem(SwLabItem& rItem);
107  virtual bool FillItemSet(SfxItemSet* rSet) override;
108  virtual void Reset(const SfxItemSet* rSet) override;
109 
110  SwLabDlg* GetParentSwLabDlg() { return static_cast<SwLabDlg*>(GetDialogController()); }
111 };
112 
114 {
115  bool bSuccess;
118 
119  std::unique_ptr<weld::ComboBox> m_xMakeCB;
120  std::unique_ptr<weld::Entry> m_xTypeED;
121  std::unique_ptr<weld::Button> m_xOKPB;
122 
123  DECL_LINK(OkHdl, weld::Button&, void);
124  DECL_LINK(ModifyEntryHdl, weld::Entry&, void);
125  DECL_LINK(ModifyComboHdl, weld::ComboBox&, void);
126 
127  void Modify();
128 
129 public:
130  SwSaveLabelDlg(SwLabDlg* pParent, SwLabRec& rRec);
131  virtual ~SwSaveLabelDlg() override;
132 
133  void SetLabel(const OUString& rMake, const OUString& rType)
134  {
135  m_xMakeCB->set_entry_text(rMake);
136  m_xTypeED->set_text(rType);
137  }
138  bool GetLabel(SwLabItem& rItem);
139 };
140 #endif
141 
142 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: labfmt.cxx:445
std::unique_ptr< weld::SpinButton > m_xColsField
Definition: labfmt.hxx:83
std::unique_ptr< weld::CustomWeld > m_xPreview
Definition: labfmt.hxx:76
std::unique_ptr< weld::Button > m_xSavePB
Definition: labfmt.hxx:87
DECL_LINK(OkHdl, weld::Button &, void)
const SfxItemSet * pSet
Color m_aGrayColor
Definition: labfmt.hxx:34
bool bModified
Definition: labfmt.hxx:70
std::unique_ptr< weld::Label > m_xTypeFI
Definition: labfmt.hxx:75
OUString m_aColsStr
Definition: labfmt.hxx:42
long Long
std::unique_ptr< weld::MetricSpinButton > m_xPHeightField
Definition: labfmt.hxx:86
void Modify()
Definition: labfmt.cxx:574
std::unique_ptr< weld::MetricSpinButton > m_xLeftField
Definition: labfmt.hxx:81
std::unique_ptr< weld::Entry > m_xTypeED
Definition: labfmt.hxx:120
SwLabFormatPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: labfmt.cxx:286
std::unique_ptr< weld::ComboBox > m_xMakeCB
Definition: labfmt.hxx:119
SwLabRec & rLabRec
Definition: labfmt.hxx:117
OUString m_aVDistStr
Definition: labfmt.hxx:37
std::unique_ptr< weld::SpinButton > m_xRowsField
Definition: labfmt.hxx:84
DECL_LINK(ModifyHdl, weld::SpinButton &, void)
OUString m_aHeightStr
Definition: labfmt.hxx:39
void UpdateItem(const SwLabItem &rItem)
Definition: labfmt.cxx:280
tools::Long m_lHeightWidth
Definition: labfmt.hxx:47
std::unique_ptr< weld::Button > m_xOKPB
Definition: labfmt.hxx:121
std::unique_ptr< weld::MetricSpinButton > m_xUpperField
Definition: labfmt.hxx:82
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: labfmt.cxx:410
tools::Long m_lUpperWidth
Definition: labfmt.hxx:49
Idle aPreviewIdle
Definition: labfmt.hxx:68
SwSaveLabelDlg(SwLabDlg *pParent, SwLabRec &rRec)
Definition: labfmt.cxx:517
bool GetLabel(SwLabItem &rItem)
Definition: labfmt.cxx:589
tools::Long m_lXWidth
Definition: labfmt.hxx:52
OUString m_aLeftStr
Definition: labfmt.hxx:40
virtual void Reset(const SfxItemSet *rSet) override
Definition: labfmt.cxx:453
virtual ~SwLabFormatPage() override
Definition: labfmt.cxx:339
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: labfmt.cxx:416
tools::Long m_lColsWidth
Definition: labfmt.hxx:50
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
Definition: labfmt.cxx:139
OUString m_aUpperStr
Definition: labfmt.hxx:41
void SetLabel(const OUString &rMake, const OUString &rType)
Definition: labfmt.hxx:133
SwLabDlg * m_pLabDialog
Definition: labfmt.hxx:116
OUString m_aHDistStr
Definition: labfmt.hxx:36
std::unique_ptr< weld::MetricSpinButton > m_xHDistField
Definition: labfmt.hxx:77
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
Definition: labfmt.cxx:405
tools::Long m_lVDistWidth
Definition: labfmt.hxx:46
tools::Long m_lHDistWidth
Definition: labfmt.hxx:45
OUString m_aWidthStr
Definition: labfmt.hxx:38
void FillItem(SwLabItem &rItem)
Definition: labfmt.cxx:424
virtual ~SwSaveLabelDlg() override
Definition: labfmt.cxx:538
std::unique_ptr< weld::MetricSpinButton > m_xPWidthField
Definition: labfmt.hxx:85
void ChangeMinMax()
Definition: labfmt.cxx:365
std::unique_ptr< weld::Label > m_xMakeFI
Definition: labfmt.hxx:74
SwLabItem aItem
Definition: labfmt.hxx:69
SfxOkDialogController * GetDialogController() const
tools::Long m_lXHeight
Definition: labfmt.hxx:53
OUString m_aRowsStr
Definition: labfmt.hxx:43
DeactivateRC
SwLabItem m_aItem
Definition: labfmt.hxx:55
tools::Long m_lLeftWidth
Definition: labfmt.hxx:48
SwLabPreview m_aPreview
Definition: labfmt.hxx:72
std::unique_ptr< weld::MetricSpinButton > m_xWidthField
Definition: labfmt.hxx:79
std::unique_ptr< weld::MetricSpinButton > m_xVDistField
Definition: labfmt.hxx:78
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea) override
Definition: labfmt.cxx:122
SwLabDlg * GetParentSwLabDlg()
Definition: labfmt.hxx:110
std::unique_ptr< weld::MetricSpinButton > m_xHeightField
Definition: labfmt.hxx:80