bump product version to 4.1.6.2
[LibreOffice.git] / extensions / source / scanner / sanedlg.hxx
blob22c1074b2ed33ff70b93db99c69238858837a19f
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 _SVT_SANEDLG_HXX
20 #define _SVT_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 SaneDlg : public ModalDialog
35 private:
36 enum DragDirection { TopLeft, Top, TopRight, Right, BottomRight, Bottom,
37 BottomLeft, Left };
39 Sane& mrSane;
40 Bitmap maPreviewBitmap;
41 Rectangle maPreviewRect;
42 Point maTopLeft, maBottomRight;
43 Point maMinTopLeft, maMaxBottomRight;
44 sal_Bool mbDragEnable;
45 sal_Bool mbIsDragging;
46 bool mbScanEnabled;
47 sal_Bool mbDragDrawn;
48 DragDirection meDragDirection;
50 MapMode maMapMode;
52 Link maOldLink;
54 OKButton maOKButton;
55 CancelButton maCancelButton;
56 PushButton maDeviceInfoButton;
57 PushButton maPreviewButton;
58 PushButton maScanButton;
59 PushButton maButtonOption;
61 FixedText maOptionsTxt;
62 FixedText maOptionTitle;
63 FixedText maOptionDescTxt;
64 FixedText maVectorTxt;
66 FixedText maScanLeftTxt;
67 MetricField maLeftField;
68 FixedText maScanTopTxt;
69 MetricField maTopField;
70 FixedText maRightTxt;
71 MetricField maRightField;
72 FixedText maBottomTxt;
73 MetricField maBottomField;
75 FixedText maDeviceBoxTxt;
76 ListBox maDeviceBox;
77 FixedText maReslTxt;
78 NumericBox maReslBox;
79 FixedText maAdvancedTxt;
80 CheckBox maAdvancedBox;
82 NumericField maVectorBox;
83 ListBox maQuantumRangeBox;
84 ListBox maStringRangeBox;
86 FixedLine maPreviewBox;
87 FixedLine maAreaBox;
89 CheckBox maBoolCheckBox;
91 Edit maStringEdit;
92 Edit maNumericEdit;
94 SvTreeListBox maOptionBox;
96 int mnCurrentOption;
97 int mnCurrentElement;
98 double* mpRange;
99 double mfMin, mfMax;
101 bool doScan;
103 DECL_LINK( ClickBtnHdl, Button* );
104 DECL_LINK( SelectHdl, ListBox* );
105 DECL_LINK( ModifyHdl, Edit* );
106 DECL_LINK( ReloadSaneOptionsHdl, Sane* );
107 DECL_LINK( OptionsBoxSelectHdl, SvTreeListBox* );
109 void SaveState();
110 sal_Bool LoadState();
112 void InitDevices();
113 void InitFields();
114 void AcquirePreview();
115 void DisableOption();
116 void EstablishBoolOption();
117 void EstablishStringOption();
118 void EstablishStringRange();
119 void EstablishQuantumRange();
120 void EstablishNumericOption();
121 void EstablishButtonOption();
123 void DrawRectangles( Point&, Point& );
124 void DrawDrag();
125 Point GetPixelPos( const Point& );
126 Point GetLogicPos( const Point& );
127 void UpdateScanArea( sal_Bool );
129 // helper
130 sal_Bool SetAdjustedNumericalValue( const char* pOption, double fValue, int nElement = 0 );
132 virtual void Paint( const Rectangle& );
133 virtual void MouseMove( const MouseEvent& rMEvt );
134 virtual void MouseButtonDown( const MouseEvent& rMEvt );
135 virtual void MouseButtonUp( const MouseEvent& rMEvt );
136 public:
137 SaneDlg( Window*, Sane&, bool );
138 ~SaneDlg();
140 virtual short Execute();
141 bool getDoScan();
145 #endif
147 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */