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