1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: sanedlg.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _SVT_SANEDLG_HXX
31 #define _SVT_SANEDLG_HXX
33 #include <vcl/dialog.hxx>
34 #include <tools/config.hxx>
35 #include <vcl/lstbox.hxx>
36 #ifndef _SV_BUTTON_HXX
37 #include <vcl/button.hxx>
39 #include <vcl/fixed.hxx>
40 #include <vcl/group.hxx>
41 #include <vcl/field.hxx>
42 #include <vcl/edit.hxx>
43 #include <svtools/svtreebx.hxx>
47 class SaneDlg
: public ModalDialog
50 enum DragDirection
{ TopLeft
, Top
, TopRight
, Right
, BottomRight
, Bottom
,
54 Bitmap maPreviewBitmap
;
55 Rectangle maPreviewRect
;
56 Point maTopLeft
, maBottomRight
;
57 Point maMinTopLeft
, maMaxBottomRight
;
62 DragDirection meDragDirection
;
69 CancelButton maCancelButton
;
70 PushButton maDeviceInfoButton
;
71 PushButton maPreviewButton
;
72 PushButton maButtonOption
;
74 FixedText maOptionsTxt
;
75 FixedText maOptionTitle
;
76 FixedText maOptionDescTxt
;
77 FixedText maVectorTxt
;
79 FixedText maScanLeftTxt
;
80 MetricField maLeftField
;
81 FixedText maScanTopTxt
;
82 MetricField maTopField
;
84 MetricField maRightField
;
85 FixedText maBottomTxt
;
86 MetricField maBottomField
;
88 FixedText maDeviceBoxTxt
;
92 FixedText maAdvancedTxt
;
93 CheckBox maAdvancedBox
;
95 NumericField maVectorBox
;
96 ListBox maQuantumRangeBox
;
97 ListBox maStringRangeBox
;
99 FixedLine maPreviewBox
;
102 CheckBox maBoolCheckBox
;
107 SvTreeListBox maOptionBox
;
110 int mnCurrentElement
;
114 DECL_LINK( ClickBtnHdl
, Button
* );
115 DECL_LINK( SelectHdl
, ListBox
* );
116 DECL_LINK( ModifyHdl
, Edit
* );
117 DECL_LINK( ReloadSaneOptionsHdl
, Sane
* );
118 DECL_LINK( OptionsBoxSelectHdl
, SvTreeListBox
* );
125 void AcquirePreview();
126 void DisableOption();
127 void EstablishBoolOption();
128 void EstablishStringOption();
129 void EstablishStringRange();
130 void EstablishQuantumRange();
131 void EstablishNumericOption();
132 void EstablishButtonOption();
134 void DrawRectangles( Point
&, Point
& );
136 Point
GetPixelPos( const Point
& );
137 Point
GetLogicPos( const Point
& );
138 void UpdateScanArea( BOOL
);
141 BOOL
SetAdjustedNumericalValue( const char* pOption
, double fValue
, int nElement
= 0 );
143 virtual void Paint( const Rectangle
& );
144 virtual void MouseMove( const MouseEvent
& rMEvt
);
145 virtual void MouseButtonDown( const MouseEvent
& rMEvt
);
146 virtual void MouseButtonUp( const MouseEvent
& rMEvt
);
148 SaneDlg( Window
*, Sane
& );
151 virtual short Execute();