bump product version to 5.0.4.1
[LibreOffice.git] / extensions / source / scanner / sanedlg.hxx
blob7e689221f0371e10d1eabfb63e726cfee6e9017a
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/group.hxx>
27 #include <vcl/field.hxx>
28 #include <vcl/edit.hxx>
29 #include <svtools/treelistbox.hxx>
31 #include <sane.hxx>
33 class ScanPreview;
35 class SaneDlg : public ModalDialog
37 private:
38 Sane& mrSane;
39 bool mbScanEnabled;
41 Link<> maOldLink;
43 VclPtr<OKButton> mpOKButton;
44 VclPtr<CancelButton> mpCancelButton;
45 VclPtr<PushButton> mpDeviceInfoButton;
46 VclPtr<PushButton> mpPreviewButton;
47 VclPtr<PushButton> mpScanButton;
48 VclPtr<PushButton> mpButtonOption;
50 VclPtr<FixedText> mpOptionTitle;
51 VclPtr<FixedText> mpOptionDescTxt;
52 VclPtr<FixedText> mpVectorTxt;
54 VclPtr<MetricField> mpLeftField;
55 VclPtr<MetricField> mpTopField;
56 VclPtr<MetricField> mpRightField;
57 VclPtr<MetricField> mpBottomField;
59 VclPtr<ListBox> mpDeviceBox;
60 VclPtr<NumericBox> mpReslBox;
61 VclPtr<CheckBox> mpAdvancedBox;
63 VclPtr<NumericField> mpVectorBox;
64 VclPtr<ListBox> mpQuantumRangeBox;
65 VclPtr<ListBox> mpStringRangeBox;
67 VclPtr<CheckBox> mpBoolCheckBox;
69 VclPtr<Edit> mpStringEdit;
70 VclPtr<Edit> mpNumericEdit;
72 VclPtr<SvTreeListBox> mpOptionBox;
74 VclPtr<ScanPreview> mpPreview;
76 int mnCurrentOption;
77 int mnCurrentElement;
78 double* mpRange;
79 double mfMin, mfMax;
81 bool doScan;
83 DECL_LINK( ClickBtnHdl, Button* );
84 DECL_LINK( SelectHdl, ListBox* );
85 DECL_LINK( ModifyHdl, Edit* );
86 DECL_LINK( ReloadSaneOptionsHdl, Sane* );
87 DECL_LINK( OptionsBoxSelectHdl, SvTreeListBox* );
89 void SaveState();
90 bool LoadState();
92 void InitDevices();
93 void InitFields();
94 void AcquirePreview();
95 void DisableOption();
96 void EstablishBoolOption();
97 void EstablishStringOption();
98 void EstablishStringRange();
99 void EstablishQuantumRange();
100 void EstablishNumericOption();
101 void EstablishButtonOption();
103 // helper
104 bool SetAdjustedNumericalValue( const char* pOption, double fValue, int nElement = 0 );
105 public:
106 SaneDlg( vcl::Window*, Sane&, bool );
107 virtual ~SaneDlg();
108 virtual void dispose() SAL_OVERRIDE;
110 virtual short Execute() SAL_OVERRIDE;
111 void UpdateScanArea( bool );
112 bool getDoScan() { return doScan;}
116 #endif
118 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */