summaryrefslogtreecommitdiff
path: root/extensions/source/scanner/sanedlg.hxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-06-11 13:42:45 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-06-11 14:27:54 +0100
commitd6eeb8a48903488a8d09948173af5845e2f3b729 (patch)
tree568994f0769bf70c1cd76ce90eaf7d7d153c91fa /extensions/source/scanner/sanedlg.hxx
parentf188c982d5b8456fadb27ca5b88ece1c6ac1e719 (diff)
extract Scan Preview code into a preview widget
instead of scribbling over the parent dialog directly. Doing is this way allows the .ui-ification to work right. Change-Id: Ia0c33eae4cd5a4c94896436fe5a5afad8d60a577
Diffstat (limited to 'extensions/source/scanner/sanedlg.hxx')
-rw-r--r--extensions/source/scanner/sanedlg.hxx29
1 files changed, 4 insertions, 25 deletions
diff --git a/extensions/source/scanner/sanedlg.hxx b/extensions/source/scanner/sanedlg.hxx
index d45642ba05d1..45750e5a452b 100644
--- a/extensions/source/scanner/sanedlg.hxx
+++ b/extensions/source/scanner/sanedlg.hxx
@@ -30,24 +30,13 @@
#include <sane.hxx>
+class ScanPreview;
+
class SaneDlg : public ModalDialog
{
private:
- enum DragDirection { TopLeft, Top, TopRight, Right, BottomRight, Bottom,
- BottomLeft, Left };
-
Sane& mrSane;
- Bitmap maPreviewBitmap;
- Rectangle maPreviewRect;
- Point maTopLeft, maBottomRight;
- Point maMinTopLeft, maMaxBottomRight;
- bool mbDragEnable;
- bool mbIsDragging;
bool mbScanEnabled;
- bool mbDragDrawn;
- DragDirection meDragDirection;
-
- MapMode maMapMode;
Link maOldLink;
@@ -82,7 +71,7 @@ private:
SvTreeListBox* mpOptionBox;
- Window* mpPreview;
+ ScanPreview* mpPreview;
int mnCurrentOption;
int mnCurrentElement;
@@ -111,24 +100,14 @@ private:
void EstablishNumericOption();
void EstablishButtonOption();
- void DrawRectangles( Point&, Point& );
- void DrawDrag();
- Point GetPixelPos( const Point& );
- Point GetLogicPos( const Point& );
- void UpdateScanArea( bool );
-
// helper
bool SetAdjustedNumericalValue( const char* pOption, double fValue, int nElement = 0 );
-
- virtual void Paint( const Rectangle& ) SAL_OVERRIDE;
- virtual void MouseMove( const MouseEvent& rMEvt ) SAL_OVERRIDE;
- virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
- virtual void MouseButtonUp( const MouseEvent& rMEvt ) SAL_OVERRIDE;
public:
SaneDlg( Window*, Sane&, bool );
virtual ~SaneDlg();
virtual short Execute() SAL_OVERRIDE;
+ void UpdateScanArea( bool );
bool getDoScan() { return doScan;}
};