1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
21 #include <vcl/customweld.hxx>
22 #include <vcl/weld.hxx>
28 class SaneDlg
: public weld::GenericDialogController
31 weld::Window
* mpParent
;
35 Link
<Sane
&,void> maOldLink
;
39 std::unique_ptr
<double[]> mpRange
;
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
;
50 std::unique_ptr
<weld::Label
> mxOptionTitle
;
51 std::unique_ptr
<weld::Label
> mxOptionDescTxt
;
52 std::unique_ptr
<weld::Label
> mxVectorTxt
;
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
;
59 std::unique_ptr
<weld::ComboBox
> mxDeviceBox
;
60 std::unique_ptr
<weld::ComboBox
> mxReslBox
;
61 std::unique_ptr
<weld::CheckButton
> mxAdvancedBox
;
63 std::unique_ptr
<weld::SpinButton
> mxVectorBox
;
64 std::unique_ptr
<weld::ComboBox
> mxQuantumRangeBox
;
65 std::unique_ptr
<weld::ComboBox
> mxStringRangeBox
;
67 std::unique_ptr
<weld::CheckButton
> mxBoolCheckBox
;
69 std::unique_ptr
<weld::Entry
> mxStringEdit
;
70 std::unique_ptr
<weld::Entry
> mxNumericEdit
;
72 std::unique_ptr
<weld::TreeView
> mxOptionBox
;
74 std::unique_ptr
<ScanPreview
> mxPreview
;
75 std::unique_ptr
<weld::CustomWeld
> mxPreviewWnd
;
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 );
91 void AcquirePreview();
93 void EstablishBoolOption();
94 void EstablishStringOption();
95 void EstablishStringRange();
96 void EstablishQuantumRange();
97 void EstablishNumericOption();
98 void EstablishButtonOption();
101 bool SetAdjustedNumericalValue( const char* pOption
, double fValue
, int nElement
= 0 );
103 SaneDlg(weld::Window
*, Sane
&, bool);
104 virtual ~SaneDlg() override
;
106 virtual short run() override
;
107 void UpdateScanArea( bool );
108 bool getDoScan() const { return doScan
;}
111 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */