| 1 |
/* AbiSource Application Framework |
| 2 |
* Copyright (C) 1998 AbiSource, Inc. |
| 3 |
* |
| 4 |
* This program is free software; you can redistribute it and/or |
| 5 |
* modify it under the terms of the GNU General Public License |
| 6 |
* as published by the Free Software Foundation; either version 2 |
| 7 |
* of the License, or (at your option) any later version. |
| 8 |
* |
| 9 |
* This program is distributed in the hope that it will be useful, |
| 10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 |
* GNU General Public License for more details. |
| 13 |
* |
| 14 |
* You should have received a copy of the GNU General Public License |
| 15 |
* along with this program; if not, write to the Free Software |
| 16 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
| 17 |
* 02110-1301 USA. |
| 18 |
*/ |
| 19 |
|
| 20 |
#ifndef XAP_DIALOG_ZOOM_H |
| 21 |
#define XAP_DIALOG_ZOOM_H |
| 22 |
|
| 23 |
#include "xap_Frame.h" |
| 24 |
#include "xap_Dialog.h" |
| 25 |
|
| 26 |
/* #include "xav_View.h" */ |
| 27 |
|
| 28 |
class GR_Graphics; |
| 29 |
|
| 30 |
class XAP_Preview_Zoom; |
| 31 |
|
| 32 |
#define XAP_DLG_ZOOM_MAXIMUM_ZOOM 500 // arbitrary value (percentage) |
| 33 |
#define XAP_DLG_ZOOM_MINIMUM_ZOOM 20 // arbitrary value (percentage) |
| 34 |
|
| 35 |
class ABI_EXPORT XAP_Dialog_Zoom : public XAP_Dialog_NonPersistent |
| 36 |
{ |
| 37 |
public: |
| 38 |
XAP_Dialog_Zoom(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); |
| 39 |
virtual ~XAP_Dialog_Zoom(void); |
| 40 |
|
| 41 |
virtual void runModal(XAP_Frame * pFrame) = 0; |
| 42 |
|
| 43 |
typedef enum { a_OK, a_CANCEL } tAnswer; |
| 44 |
// typedef enum { z_200, z_100, z_75, z_PAGEWIDTH, z_WHOLEPAGE, z_PERCENT } zoomType; |
| 45 |
|
| 46 |
XAP_Dialog_Zoom::tAnswer getAnswer(void) const; |
| 47 |
|
| 48 |
// supply this on run |
| 49 |
void setZoomPercent(UT_uint32 zoom); |
| 50 |
void setZoomType(XAP_Frame::tZoomType zoomType) { m_zoomType = zoomType; } |
| 51 |
|
| 52 |
// read these back |
| 53 |
XAP_Frame::tZoomType getZoomType(void); |
| 54 |
UT_uint32 getZoomPercent(void); |
| 55 |
|
| 56 |
protected: |
| 57 |
|
| 58 |
// handle the XP-job of telling m_zoomPreview what to draw |
| 59 |
void _updatePreviewZoomPercent(UT_uint32 percent); |
| 60 |
|
| 61 |
// handle the XP-job of attaching something to our m_zoomPreview |
| 62 |
void _createPreviewFromGC(GR_Graphics * gc, |
| 63 |
UT_uint32 width, |
| 64 |
UT_uint32 height); |
| 65 |
|
| 66 |
XAP_Preview_Zoom * m_zoomPreview; |
| 67 |
|
| 68 |
XAP_Frame::tZoomType m_zoomType; |
| 69 |
UT_uint32 m_zoomPercent; |
| 70 |
|
| 71 |
XAP_Dialog_Zoom::tAnswer m_answer; |
| 72 |
XAP_Frame * m_pFrame; |
| 73 |
}; |
| 74 |
|
| 75 |
#endif /* XAP_DIALOG_ZOOM_H */ |