Line data Source code
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 : #ifndef INCLUDED_EXTENSIONS_SOURCE_SCANNER_SANEDLG_HXX
20 : #define INCLUDED_EXTENSIONS_SOURCE_SCANNER_SANEDLG_HXX
21 :
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>
30 :
31 : #include <sane.hxx>
32 :
33 : class ScanPreview;
34 :
35 : class SaneDlg : public ModalDialog
36 : {
37 : private:
38 : Sane& mrSane;
39 : bool mbScanEnabled;
40 :
41 : Link maOldLink;
42 :
43 : OKButton* mpOKButton;
44 : CancelButton* mpCancelButton;
45 : PushButton* mpDeviceInfoButton;
46 : PushButton* mpPreviewButton;
47 : PushButton* mpScanButton;
48 : PushButton* mpButtonOption;
49 :
50 : FixedText* mpOptionTitle;
51 : FixedText* mpOptionDescTxt;
52 : FixedText* mpVectorTxt;
53 :
54 : MetricField* mpLeftField;
55 : MetricField* mpTopField;
56 : MetricField* mpRightField;
57 : MetricField* mpBottomField;
58 :
59 : ListBox* mpDeviceBox;
60 : NumericBox* mpReslBox;
61 : CheckBox* mpAdvancedBox;
62 :
63 : NumericField* mpVectorBox;
64 : ListBox* mpQuantumRangeBox;
65 : ListBox* mpStringRangeBox;
66 :
67 : CheckBox* mpBoolCheckBox;
68 :
69 : Edit* mpStringEdit;
70 : Edit* mpNumericEdit;
71 :
72 : SvTreeListBox* mpOptionBox;
73 :
74 : ScanPreview* mpPreview;
75 :
76 : int mnCurrentOption;
77 : int mnCurrentElement;
78 : double* mpRange;
79 : double mfMin, mfMax;
80 :
81 : bool doScan;
82 :
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* );
88 :
89 : void SaveState();
90 : bool LoadState();
91 :
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();
102 :
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 :
109 : virtual short Execute() SAL_OVERRIDE;
110 : void UpdateScanArea( bool );
111 0 : bool getDoScan() { return doScan;}
112 : };
113 :
114 :
115 : #endif
116 :
117 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|