1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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>
33 class SaneDlg
: public ModalDialog
36 enum DragDirection
{ TopLeft
, Top
, TopRight
, Right
, BottomRight
, Bottom
,
40 Bitmap maPreviewBitmap
;
41 Rectangle maPreviewRect
;
42 Point maTopLeft
, maBottomRight
;
43 Point maMinTopLeft
, maMaxBottomRight
;
44 sal_Bool mbDragEnable
;
45 sal_Bool mbIsDragging
;
48 DragDirection meDragDirection
;
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
;
71 MetricField maRightField
;
72 FixedText maBottomTxt
;
73 MetricField maBottomField
;
75 FixedText maDeviceBoxTxt
;
79 FixedText maAdvancedTxt
;
80 CheckBox maAdvancedBox
;
82 NumericField maVectorBox
;
83 ListBox maQuantumRangeBox
;
84 ListBox maStringRangeBox
;
86 FixedLine maPreviewBox
;
89 CheckBox maBoolCheckBox
;
94 SvTreeListBox maOptionBox
;
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
* );
110 sal_Bool
LoadState();
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
& );
125 Point
GetPixelPos( const Point
& );
126 Point
GetLogicPos( const Point
& );
127 void UpdateScanArea( sal_Bool
);
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
);
137 SaneDlg( Window
*, Sane
&, bool );
140 virtual short Execute();
147 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */