LibreOffice Module extensions (master) 1
sanedlg.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 <vcl/customweld.hxx>
22#include <vcl/weld.hxx>
23
24#include "sane.hxx"
25
26class ScanPreview;
27
29{
30private:
34
36
39 std::unique_ptr<double[]> mpRange;
40 double mfMin, mfMax;
41
42 bool doScan;
43
44 std::unique_ptr<weld::Button> mxCancelButton;
45 std::unique_ptr<weld::Button> mxDeviceInfoButton;
46 std::unique_ptr<weld::Button> mxPreviewButton;
47 std::unique_ptr<weld::Button> mxScanButton;
48 std::unique_ptr<weld::Button> mxButtonOption;
49
50 std::unique_ptr<weld::Label> mxOptionTitle;
51 std::unique_ptr<weld::Label> mxOptionDescTxt;
52 std::unique_ptr<weld::Label> mxVectorTxt;
53
54 std::unique_ptr<weld::MetricSpinButton> mxLeftField;
55 std::unique_ptr<weld::MetricSpinButton> mxTopField;
56 std::unique_ptr<weld::MetricSpinButton> mxRightField;
57 std::unique_ptr<weld::MetricSpinButton> mxBottomField;
58
59 std::unique_ptr<weld::ComboBox> mxDeviceBox;
60 std::unique_ptr<weld::ComboBox> mxReslBox;
61 std::unique_ptr<weld::CheckButton> mxAdvancedBox;
62
63 std::unique_ptr<weld::SpinButton> mxVectorBox;
64 std::unique_ptr<weld::ComboBox> mxQuantumRangeBox;
65 std::unique_ptr<weld::ComboBox> mxStringRangeBox;
66
67 std::unique_ptr<weld::CheckButton> mxBoolCheckBox;
68
69 std::unique_ptr<weld::Entry> mxStringEdit;
70 std::unique_ptr<weld::Entry> mxNumericEdit;
71
72 std::unique_ptr<weld::TreeView> mxOptionBox;
73
74 std::unique_ptr<ScanPreview> mxPreview;
75 std::unique_ptr<weld::CustomWeld> mxPreviewWnd;
76
77 DECL_LINK( ClickBtnHdl, weld::Button&, void );
78 DECL_LINK( ToggleBtnHdl, weld::Toggleable&, void );
79 DECL_LINK( SelectHdl, weld::ComboBox&, void );
80 DECL_LINK( ModifyHdl, weld::Entry&, void );
81 DECL_LINK( MetricValueModifyHdl, weld::MetricSpinButton&, void );
82 DECL_LINK( ValueModifyHdl, weld::ComboBox&, void );
83 DECL_LINK( ReloadSaneOptionsHdl, Sane&, void );
84 DECL_LINK( OptionsBoxSelectHdl, weld::TreeView&, void );
85
86 void SaveState();
87 bool LoadState();
88
89 void InitDevices();
90 void InitFields();
91 void AcquirePreview();
92 void DisableOption();
99
100 // helper
101 bool SetAdjustedNumericalValue( const char* pOption, double fValue, int nElement = 0 );
102public:
103 SaneDlg(weld::Window*, Sane&, bool);
104 virtual ~SaneDlg() override;
105
106 virtual short run() override;
107 void UpdateScanArea( bool );
108 bool getDoScan() const { return doScan;}
109};
110
111/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::CustomWeld > mxPreviewWnd
Definition: sanedlg.hxx:75
std::unique_ptr< weld::CheckButton > mxBoolCheckBox
Definition: sanedlg.hxx:67
Link< Sane &, void > maOldLink
Definition: sanedlg.hxx:35
std::unique_ptr< weld::ComboBox > mxQuantumRangeBox
Definition: sanedlg.hxx:64
void EstablishBoolOption()
Definition: sanedlg.cxx:965
std::unique_ptr< weld::MetricSpinButton > mxBottomField
Definition: sanedlg.hxx:57
void UpdateScanArea(bool)
Definition: sanedlg.cxx:1248
DECL_LINK(ClickBtnHdl, weld::Button &, void)
std::unique_ptr< weld::MetricSpinButton > mxTopField
Definition: sanedlg.hxx:55
std::unique_ptr< weld::Button > mxPreviewButton
Definition: sanedlg.hxx:46
DECL_LINK(OptionsBoxSelectHdl, weld::TreeView &, void)
std::unique_ptr< weld::SpinButton > mxVectorBox
Definition: sanedlg.hxx:63
DECL_LINK(ModifyHdl, weld::Entry &, void)
bool doScan
Definition: sanedlg.hxx:42
std::unique_ptr< weld::CheckButton > mxAdvancedBox
Definition: sanedlg.hxx:61
void AcquirePreview()
Definition: sanedlg.cxx:862
int mnCurrentElement
Definition: sanedlg.hxx:38
std::unique_ptr< weld::MetricSpinButton > mxRightField
Definition: sanedlg.hxx:56
virtual ~SaneDlg() override
Definition: sanedlg.cxx:291
std::unique_ptr< weld::ComboBox > mxDeviceBox
Definition: sanedlg.hxx:59
bool getDoScan() const
Definition: sanedlg.hxx:108
std::unique_ptr< weld::TreeView > mxOptionBox
Definition: sanedlg.hxx:72
bool SetAdjustedNumericalValue(const char *pOption, double fValue, int nElement=0)
Definition: sanedlg.cxx:1427
void SaveState()
Definition: sanedlg.cxx:1344
std::unique_ptr< weld::Label > mxOptionTitle
Definition: sanedlg.hxx:50
std::unique_ptr< ScanPreview > mxPreview
Definition: sanedlg.hxx:74
SaneDlg(weld::Window *, Sane &, bool)
Definition: sanedlg.cxx:222
void EstablishButtonOption()
Definition: sanedlg.cxx:1067
DECL_LINK(ValueModifyHdl, weld::ComboBox &, void)
std::unique_ptr< double[]> mpRange
Definition: sanedlg.hxx:39
void InitFields()
Definition: sanedlg.cxx:337
std::unique_ptr< weld::ComboBox > mxStringRangeBox
Definition: sanedlg.hxx:65
void EstablishStringRange()
Definition: sanedlg.cxx:993
void EstablishQuantumRange()
Definition: sanedlg.cxx:1007
std::unique_ptr< weld::Button > mxButtonOption
Definition: sanedlg.hxx:48
int mnCurrentOption
Definition: sanedlg.hxx:37
void DisableOption()
Definition: sanedlg.cxx:952
DECL_LINK(MetricValueModifyHdl, weld::MetricSpinButton &, void)
virtual short run() override
Definition: sanedlg.cxx:305
void EstablishStringOption()
Definition: sanedlg.cxx:978
Sane & mrSane
Definition: sanedlg.hxx:32
DECL_LINK(ToggleBtnHdl, weld::Toggleable &, void)
DECL_LINK(SelectHdl, weld::ComboBox &, void)
std::unique_ptr< weld::ComboBox > mxReslBox
Definition: sanedlg.hxx:60
std::unique_ptr< weld::Label > mxOptionDescTxt
Definition: sanedlg.hxx:51
std::unique_ptr< weld::Label > mxVectorTxt
Definition: sanedlg.hxx:52
std::unique_ptr< weld::MetricSpinButton > mxLeftField
Definition: sanedlg.hxx:54
std::unique_ptr< weld::Entry > mxStringEdit
Definition: sanedlg.hxx:69
bool LoadState()
Definition: sanedlg.cxx:1273
std::unique_ptr< weld::Entry > mxNumericEdit
Definition: sanedlg.hxx:70
DECL_LINK(ReloadSaneOptionsHdl, Sane &, void)
void InitDevices()
Definition: sanedlg.cxx:319
std::unique_ptr< weld::Button > mxScanButton
Definition: sanedlg.hxx:47
weld::Window * mpParent
Definition: sanedlg.hxx:31
std::unique_ptr< weld::Button > mxCancelButton
Definition: sanedlg.hxx:44
std::unique_ptr< weld::Button > mxDeviceInfoButton
Definition: sanedlg.hxx:45
bool mbScanEnabled
Definition: sanedlg.hxx:33
double mfMin
Definition: sanedlg.hxx:40
void EstablishNumericOption()
Definition: sanedlg.cxx:1043
double mfMax
Definition: sanedlg.hxx:40
Definition: sane.hxx:60