/Users/ericb/Desktop/NATIVEPRINTDLG01/extensions/source/scanner/sanedlg.hxx

Go to the documentation of this file.
00001 /*************************************************************************
00002  *
00003  *  OpenOffice.org - a multi-platform office productivity suite
00004  *
00005  *  $RCSfile: sanedlg.hxx,v $
00006  *
00007  *  $Revision: 1.5 $
00008  *
00009  *  last change: $Author: rt $ $Date: 2005/09/08 20:37:59 $
00010  *
00011  *  The Contents of this file are made available subject to
00012  *  the terms of GNU Lesser General Public License Version 2.1.
00013  *
00014  *
00015  *    GNU Lesser General Public License Version 2.1
00016  *    =============================================
00017  *    Copyright 2005 by Sun Microsystems, Inc.
00018  *    901 San Antonio Road, Palo Alto, CA 94303, USA
00019  *
00020  *    This library is free software; you can redistribute it and/or
00021  *    modify it under the terms of the GNU Lesser General Public
00022  *    License version 2.1, as published by the Free Software Foundation.
00023  *
00024  *    This library is distributed in the hope that it will be useful,
00025  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
00026  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00027  *    Lesser General Public License for more details.
00028  *
00029  *    You should have received a copy of the GNU Lesser General Public
00030  *    License along with this library; if not, write to the Free Software
00031  *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
00032  *    MA  02111-1307  USA
00033  *
00034  ************************************************************************/
00035 #ifndef _SVT_SANEDLG_HXX
00036 #define _SVT_SANEDLG_HXX
00037 
00038 #ifndef _SV_DIALOG_HXX
00039 #include <vcl/dialog.hxx>
00040 #endif
00041 #ifndef _CONFIG_HXX
00042 #include <tools/config.hxx>
00043 #endif
00044 #ifndef _SV_LSTBOX_HXX
00045 #include <vcl/lstbox.hxx>
00046 #endif
00047 #ifndef _SV_BUTTON_HXX
00048 #include <vcl/button.hxx>
00049 #endif
00050 #ifndef _SV_FIXED_HXX
00051 #include <vcl/fixed.hxx>
00052 #endif
00053 #ifndef _SV_GROUP_HXX
00054 #include <vcl/group.hxx>
00055 #endif
00056 #ifndef _SV_FIELD_HXX
00057 #include <vcl/field.hxx>
00058 #endif
00059 #ifndef _SV_EDIT_HXX
00060 #include <vcl/edit.hxx>
00061 #endif
00062 #include <svtools/svtreebx.hxx>
00063 
00064 #include <sane.hxx>
00065 
00066 class SaneDlg : public ModalDialog
00067 {
00068 private:
00069         enum DragDirection { TopLeft, Top, TopRight, Right, BottomRight, Bottom,
00070                                                  BottomLeft, Left };
00071 
00072         Sane&                   mrSane;
00073         Bitmap                  maPreviewBitmap;
00074         Rectangle               maPreviewRect;
00075         Point                   maTopLeft, maBottomRight;
00076         Point                   maMinTopLeft, maMaxBottomRight;
00077     BOOL                        mbDragEnable;
00078         BOOL                    mbIsDragging;
00079         int                             mnDragMode;
00080         BOOL                    mbDragDrawn;
00081         DragDirection   meDragDirection;
00082 
00083         MapMode                 maMapMode;
00084 
00085         Link                    maOldLink;
00086         
00087         OKButton                maOKButton;
00088         CancelButton    maCancelButton;
00089         PushButton              maDeviceInfoButton;
00090         PushButton              maPreviewButton;
00091         PushButton              maButtonOption;
00092 
00093         FixedText               maOptionsTxt;
00094         FixedText               maOptionTitle;
00095         FixedText               maOptionDescTxt;
00096         FixedText               maVectorTxt;
00097 
00098         FixedText               maScanLeftTxt;
00099         MetricField             maLeftField;
00100         FixedText               maScanTopTxt;
00101         MetricField             maTopField;
00102         FixedText               maRightTxt;
00103         MetricField             maRightField;
00104         FixedText               maBottomTxt;
00105         MetricField             maBottomField;
00106 
00107         FixedText               maDeviceBoxTxt;
00108         ListBox                 maDeviceBox;
00109         FixedText               maReslTxt;
00110         NumericBox              maReslBox;
00111         FixedText               maAdvancedTxt;
00112         CheckBox                maAdvancedBox;
00113 
00114         NumericField    maVectorBox;
00115         ListBox                 maQuantumRangeBox;
00116         ListBox                 maStringRangeBox;
00117 
00118         FixedLine               maPreviewBox;
00119         FixedLine               maAreaBox;
00120 
00121         CheckBox                maBoolCheckBox;
00122 
00123         Edit                    maStringEdit;
00124         Edit                    maNumericEdit;
00125 
00126         SvTreeListBox   maOptionBox;
00127 
00128         int                             mnCurrentOption;
00129         int                             mnCurrentElement;
00130         double*                 mpRange;
00131         double                  mfMin, mfMax;
00132 
00133         DECL_LINK( ClickBtnHdl, Button* );
00134         DECL_LINK( SelectHdl, ListBox* );
00135         DECL_LINK( ModifyHdl, Edit* );
00136         DECL_LINK( ReloadSaneOptionsHdl, Sane* );
00137         DECL_LINK( OptionsBoxSelectHdl, SvTreeListBox* );
00138 
00139         void SaveState();
00140         BOOL LoadState();
00141 
00142         void InitDevices();
00143         void InitFields();
00144         void AcquirePreview();
00145         void DisableOption();
00146         void EstablishBoolOption();
00147         void EstablishStringOption();
00148         void EstablishStringRange();
00149         void EstablishQuantumRange();
00150         void EstablishNumericOption();
00151         void EstablishButtonOption();
00152 
00153         void DrawRectangles( Point&, Point& );
00154         void DrawDrag();
00155         Point GetPixelPos( const Point& );
00156         Point GetLogicPos( const Point& );
00157         void UpdateScanArea( BOOL );
00158 
00159         // helper
00160         BOOL SetAdjustedNumericalValue( const char* pOption, double fValue, int nElement = 0 );
00161         
00162         virtual void Paint( const Rectangle& );
00163         virtual void MouseMove( const MouseEvent& rMEvt );
00164         virtual void MouseButtonDown( const MouseEvent& rMEvt );
00165         virtual void MouseButtonUp( const MouseEvent& rMEvt );
00166 public:
00167         SaneDlg( Window*, Sane& );
00168         ~SaneDlg();
00169 
00170         virtual short Execute();
00171 };
00172 
00173 
00174 #endif

Generated on Thu Feb 28 17:53:26 2008 for AquaScanner by  doxygen 1.5.1