1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
27 #ifndef _SVT_SANEDLG_HXX
28 #define _SVT_SANEDLG_HXX
30 #include <vcl/dialog.hxx>
31 #include <tools/config.hxx>
32 #include <vcl/lstbox.hxx>
33 #ifndef _SV_BUTTON_HXX
34 #include <vcl/button.hxx>
36 #include <vcl/fixed.hxx>
37 #include <vcl/group.hxx>
38 #include <vcl/field.hxx>
39 #include <vcl/edit.hxx>
40 #include <svtools/svtreebx.hxx>
44 class SaneDlg
: public ModalDialog
47 enum DragDirection
{ TopLeft
, Top
, TopRight
, Right
, BottomRight
, Bottom
,
51 Bitmap maPreviewBitmap
;
52 Rectangle maPreviewRect
;
53 Point maTopLeft
, maBottomRight
;
54 Point maMinTopLeft
, maMaxBottomRight
;
59 DragDirection meDragDirection
;
66 CancelButton maCancelButton
;
67 PushButton maDeviceInfoButton
;
68 PushButton maPreviewButton
;
69 PushButton maButtonOption
;
71 FixedText maOptionsTxt
;
72 FixedText maOptionTitle
;
73 FixedText maOptionDescTxt
;
74 FixedText maVectorTxt
;
76 FixedText maScanLeftTxt
;
77 MetricField maLeftField
;
78 FixedText maScanTopTxt
;
79 MetricField maTopField
;
81 MetricField maRightField
;
82 FixedText maBottomTxt
;
83 MetricField maBottomField
;
85 FixedText maDeviceBoxTxt
;
89 FixedText maAdvancedTxt
;
90 CheckBox maAdvancedBox
;
92 NumericField maVectorBox
;
93 ListBox maQuantumRangeBox
;
94 ListBox maStringRangeBox
;
96 FixedLine maPreviewBox
;
99 CheckBox maBoolCheckBox
;
104 SvTreeListBox maOptionBox
;
107 int mnCurrentElement
;
111 DECL_LINK( ClickBtnHdl
, Button
* );
112 DECL_LINK( SelectHdl
, ListBox
* );
113 DECL_LINK( ModifyHdl
, Edit
* );
114 DECL_LINK( ReloadSaneOptionsHdl
, Sane
* );
115 DECL_LINK( OptionsBoxSelectHdl
, SvTreeListBox
* );
122 void AcquirePreview();
123 void DisableOption();
124 void EstablishBoolOption();
125 void EstablishStringOption();
126 void EstablishStringRange();
127 void EstablishQuantumRange();
128 void EstablishNumericOption();
129 void EstablishButtonOption();
131 void DrawRectangles( Point
&, Point
& );
133 Point
GetPixelPos( const Point
& );
134 Point
GetLogicPos( const Point
& );
135 void UpdateScanArea( BOOL
);
138 BOOL
SetAdjustedNumericalValue( const char* pOption
, double fValue
, int nElement
= 0 );
140 virtual void Paint( const Rectangle
& );
141 virtual void MouseMove( const MouseEvent
& rMEvt
);
142 virtual void MouseButtonDown( const MouseEvent
& rMEvt
);
143 virtual void MouseButtonUp( const MouseEvent
& rMEvt
);
145 SaneDlg( Window
*, Sane
& );
148 virtual short Execute();