bump product version to 6.3.0.0.beta1
[LibreOffice.git] / extensions / source / scanner / sanedlg.hxx
blob48060a099ca703742efa95f30ce3ea8ac7e3caf8
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
19 #ifndef INCLUDED_EXTENSIONS_SOURCE_SCANNER_SANEDLG_HXX
20 #define INCLUDED_EXTENSIONS_SOURCE_SCANNER_SANEDLG_HXX
22 #include <vcl/dialog.hxx>
23 #include <vcl/lstbox.hxx>
24 #include <vcl/button.hxx>
25 #include <vcl/fixed.hxx>
26 #include <vcl/field.hxx>
27 #include <vcl/edit.hxx>
28 #include <vcl/treelistbox.hxx>
30 #include "sane.hxx"
32 class ScanPreview;
34 class SaneDlg : public ModalDialog
36 private:
37 Sane& mrSane;
38 bool mbScanEnabled;
40 Link<Sane&,void> maOldLink;
42 VclPtr<OKButton> mpOKButton;
43 VclPtr<CancelButton> mpCancelButton;
44 VclPtr<PushButton> mpDeviceInfoButton;
45 VclPtr<PushButton> mpPreviewButton;
46 VclPtr<PushButton> mpScanButton;
47 VclPtr<PushButton> mpButtonOption;
49 VclPtr<FixedText> mpOptionTitle;
50 VclPtr<FixedText> mpOptionDescTxt;
51 VclPtr<FixedText> mpVectorTxt;
53 VclPtr<MetricField> mpLeftField;
54 VclPtr<MetricField> mpTopField;
55 VclPtr<MetricField> mpRightField;
56 VclPtr<MetricField> mpBottomField;
58 VclPtr<ListBox> mpDeviceBox;
59 VclPtr<NumericBox> mpReslBox;
60 VclPtr<CheckBox> mpAdvancedBox;
62 VclPtr<NumericField> mpVectorBox;
63 VclPtr<ListBox> mpQuantumRangeBox;
64 VclPtr<ListBox> mpStringRangeBox;
66 VclPtr<CheckBox> mpBoolCheckBox;
68 VclPtr<Edit> mpStringEdit;
69 VclPtr<Edit> mpNumericEdit;
71 VclPtr<SvTreeListBox> mpOptionBox;
73 VclPtr<ScanPreview> mpPreview;
75 int mnCurrentOption;
76 int mnCurrentElement;
77 std::unique_ptr<double[]> mpRange;
78 double mfMin, mfMax;
80 bool doScan;
82 DECL_LINK( ClickBtnHdl, Button*, void );
83 DECL_LINK( SelectHdl, ListBox&, void );
84 DECL_LINK( ModifyHdl, Edit&, void );
85 DECL_LINK( ReloadSaneOptionsHdl, Sane&, void );
86 DECL_LINK( OptionsBoxSelectHdl, SvTreeListBox*, void );
88 void SaveState();
89 bool LoadState();
91 void InitDevices();
92 void InitFields();
93 void AcquirePreview();
94 void DisableOption();
95 void EstablishBoolOption();
96 void EstablishStringOption();
97 void EstablishStringRange();
98 void EstablishQuantumRange();
99 void EstablishNumericOption();
100 void EstablishButtonOption();
102 // helper
103 bool SetAdjustedNumericalValue( const char* pOption, double fValue, int nElement = 0 );
104 public:
105 SaneDlg( vcl::Window*, Sane&, bool );
106 virtual ~SaneDlg() override;
107 virtual void dispose() override;
109 virtual short Execute() override;
110 void UpdateScanArea( bool );
111 bool getDoScan() { return doScan;}
115 #endif
117 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */