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 const m_aHDistStr;
37  OUString const m_aVDistStr;
38  OUString const m_aWidthStr;
39  OUString const m_aHeightStr;
40  OUString const m_aLeftStr;
41  OUString const m_aUpperStr;
42  OUString const m_aColsStr;
43  OUString const m_aRowsStr;
44 
51 
52  long m_lXWidth;
53  long m_lXHeight;
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 
62  SwLabPreview();
63 
64  void UpdateItem(const SwLabItem& rItem);
65 };
66 
68 {
71  bool bModified;
72 
74 
75  std::unique_ptr<weld::Label> m_xMakeFI;
76  std::unique_ptr<weld::Label> m_xTypeFI;
77  std::unique_ptr<weld::CustomWeld> m_xPreview;
78  std::unique_ptr<weld::MetricSpinButton> m_xHDistField;
79  std::unique_ptr<weld::MetricSpinButton> m_xVDistField;
80  std::unique_ptr<weld::MetricSpinButton> m_xWidthField;
81  std::unique_ptr<weld::MetricSpinButton> m_xHeightField;
82  std::unique_ptr<weld::MetricSpinButton> m_xLeftField;
83  std::unique_ptr<weld::MetricSpinButton> m_xUpperField;
84  std::unique_ptr<weld::SpinButton> m_xColsField;
85  std::unique_ptr<weld::SpinButton> m_xRowsField;
86  std::unique_ptr<weld::MetricSpinButton> m_xPWidthField;
87  std::unique_ptr<weld::MetricSpinButton> m_xPHeightField;
88  std::unique_ptr<weld::Button> m_xSavePB;
89 
90 
91  DECL_LINK( ModifyHdl, weld::SpinButton&, void );
92  DECL_LINK( MetricModifyHdl, weld::MetricSpinButton&, void );
93  DECL_LINK( PreviewHdl, Timer *, void );
94  DECL_LINK( SaveHdl, weld::Button&, void );
95 
96  void ChangeMinMax();
97 
100 
101 public:
102  SwLabFormatPage(TabPageParent pParent, const SfxItemSet& rSet);
103  virtual ~SwLabFormatPage() override;
104 
105  static VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rSet);
106 
107  virtual void ActivatePage(const SfxItemSet& rSet) override;
108  virtual DeactivateRC DeactivatePage(SfxItemSet* pSet) override;
109  void FillItem(SwLabItem& rItem);
110  virtual bool FillItemSet(SfxItemSet* rSet) override;
111  virtual void Reset(const SfxItemSet* rSet) override;
112 
114 };
115 
117 {
118  bool bSuccess;
121 
122  std::unique_ptr<weld::ComboBox> m_xMakeCB;
123  std::unique_ptr<weld::Entry> m_xTypeED;
124  std::unique_ptr<weld::Button> m_xOKPB;
125 
126  DECL_LINK(OkHdl, weld::Button&, void);
127  DECL_LINK(ModifyEntryHdl, weld::Entry&, void);
128  DECL_LINK(ModifyComboHdl, weld::ComboBox&, void);
129 
130  void Modify();
131 
132 public:
133  SwSaveLabelDlg(SwLabDlg* pParent, SwLabRec& rRec);
134  virtual ~SwSaveLabelDlg() override;
135 
136  void SetLabel(const OUString& rMake, const OUString& rType)
137  {
138  m_xMakeCB->set_entry_text(rMake);
139  m_xTypeED->set_text(rType);
140  }
141  bool GetLabel(SwLabItem& rItem);
142 };
143 #endif
144 
145 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OUString const m_aUpperStr
Definition: labfmt.hxx:41
SwLabFormatPage(TabPageParent pParent, const SfxItemSet &rSet)
Definition: labfmt.cxx:287
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: labfmt.cxx:446
std::unique_ptr< weld::SpinButton > m_xColsField
Definition: labfmt.hxx:84
std::unique_ptr< weld::CustomWeld > m_xPreview
Definition: labfmt.hxx:77
std::unique_ptr< weld::Button > m_xSavePB
Definition: labfmt.hxx:88
DECL_LINK(OkHdl, weld::Button &, void)
long m_lXHeight
Definition: labfmt.hxx:53
const SfxItemSet * pSet
bool bModified
Definition: labfmt.hxx:71
std::unique_ptr< weld::Label > m_xTypeFI
Definition: labfmt.hxx:76
long m_lColsWidth
Definition: labfmt.hxx:50
std::unique_ptr< weld::MetricSpinButton > m_xPHeightField
Definition: labfmt.hxx:87
void Modify()
Definition: labfmt.cxx:575
std::unique_ptr< weld::MetricSpinButton > m_xLeftField
Definition: labfmt.hxx:82
std::unique_ptr< weld::Entry > m_xTypeED
Definition: labfmt.hxx:123
std::unique_ptr< weld::ComboBox > m_xMakeCB
Definition: labfmt.hxx:122
SwLabRec & rLabRec
Definition: labfmt.hxx:120
OUString const m_aVDistStr
Definition: labfmt.hxx:37
std::unique_ptr< weld::SpinButton > m_xRowsField
Definition: labfmt.hxx:85
DECL_LINK(ModifyHdl, weld::SpinButton &, void)
void UpdateItem(const SwLabItem &rItem)
Definition: labfmt.cxx:281
std::unique_ptr< weld::Button > m_xOKPB
Definition: labfmt.hxx:124
OUString const m_aRowsStr
Definition: labfmt.hxx:43
std::unique_ptr< weld::MetricSpinButton > m_xUpperField
Definition: labfmt.hxx:83
virtual void ActivatePage()
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: labfmt.cxx:411
Idle aPreviewIdle
Definition: labfmt.hxx:69
long m_lHDistWidth
Definition: labfmt.hxx:45
Color const m_aGrayColor
Definition: labfmt.hxx:34
SwSaveLabelDlg(SwLabDlg *pParent, SwLabRec &rRec)
Definition: labfmt.cxx:518
bool GetLabel(SwLabItem &rItem)
Definition: labfmt.cxx:590
virtual void Reset(const SfxItemSet *rSet) override
Definition: labfmt.cxx:454
static VclPtr< SfxTabPage > Create(TabPageParent pParent, const SfxItemSet *rSet)
Definition: labfmt.cxx:406
virtual ~SwLabFormatPage() override
Definition: labfmt.cxx:340
OUString const m_aColsStr
Definition: labfmt.hxx:42
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: labfmt.cxx:417
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
Definition: labfmt.cxx:140
void SetLabel(const OUString &rMake, const OUString &rType)
Definition: labfmt.hxx:136
long m_lHeightWidth
Definition: labfmt.hxx:47
SwLabDlg * m_pLabDialog
Definition: labfmt.hxx:119
OUString const m_aLeftStr
Definition: labfmt.hxx:40
std::unique_ptr< weld::MetricSpinButton > m_xHDistField
Definition: labfmt.hxx:78
long m_lUpperWidth
Definition: labfmt.hxx:49
void FillItem(SwLabItem &rItem)
Definition: labfmt.cxx:425
virtual ~SwSaveLabelDlg() override
Definition: labfmt.cxx:539
std::unique_ptr< weld::MetricSpinButton > m_xPWidthField
Definition: labfmt.hxx:86
OUString const m_aHDistStr
Definition: labfmt.hxx:36
void ChangeMinMax()
Definition: labfmt.cxx:366
long m_lXWidth
Definition: labfmt.hxx:52
std::unique_ptr< weld::Label > m_xMakeFI
Definition: labfmt.hxx:75
long m_lVDistWidth
Definition: labfmt.hxx:46
SwLabItem aItem
Definition: labfmt.hxx:70
SfxOkDialogController * GetDialogController() const
OUString const m_aHeightStr
Definition: labfmt.hxx:39
DeactivateRC
SwLabItem m_aItem
Definition: labfmt.hxx:55
SwLabPreview m_aPreview
Definition: labfmt.hxx:73
virtual void DeactivatePage()
std::unique_ptr< weld::MetricSpinButton > m_xWidthField
Definition: labfmt.hxx:80
long m_lLeftWidth
Definition: labfmt.hxx:48
std::unique_ptr< weld::MetricSpinButton > m_xVDistField
Definition: labfmt.hxx:79
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea) override
Definition: labfmt.cxx:123
OUString const m_aWidthStr
Definition: labfmt.hxx:38
SwLabDlg * GetParentSwLabDlg()
Definition: labfmt.hxx:113
std::unique_ptr< weld::MetricSpinButton > m_xHeightField
Definition: labfmt.hxx:81