• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

xap_Dlg_Zoom.h

Go to the documentation of this file.
00001 /* AbiSource Application Framework
00002  * Copyright (C) 1998 AbiSource, Inc.
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00017  * 02110-1301 USA.
00018  */
00019 
00020 #ifndef XAP_DIALOG_ZOOM_H
00021 #define XAP_DIALOG_ZOOM_H
00022 
00023 #include "xap_Frame.h"
00024 #include "xap_Dialog.h"
00025 
00026 /* #include "xav_View.h" */
00027 
00028 class GR_Graphics;
00029 
00030 class XAP_Preview_Zoom;
00031 
00032 #define XAP_DLG_ZOOM_MAXIMUM_ZOOM       500         // arbitrary value (percentage)
00033 #define XAP_DLG_ZOOM_MINIMUM_ZOOM       20          // arbitrary value (percentage)
00034 
00035 class ABI_EXPORT XAP_Dialog_Zoom : public XAP_Dialog_NonPersistent
00036 {
00037 public:
00038     XAP_Dialog_Zoom(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id);
00039     virtual ~XAP_Dialog_Zoom(void);
00040 
00041     virtual void                    runModal(XAP_Frame * pFrame) = 0;
00042 
00043     typedef enum { a_OK, a_CANCEL } tAnswer;
00044 //  typedef enum { z_200, z_100, z_75, z_PAGEWIDTH, z_WHOLEPAGE, z_PERCENT } zoomType;
00045 
00046     XAP_Dialog_Zoom::tAnswer        getAnswer(void) const;
00047 
00048     // supply this on run
00049     void                            setZoomPercent(UT_uint32 zoom);
00050     void                            setZoomType(XAP_Frame::tZoomType zoomType) { m_zoomType = zoomType; }
00051 
00052     // read these back
00053     XAP_Frame::tZoomType            getZoomType(void);
00054     UT_uint32                       getZoomPercent(void);
00055 
00056 protected:
00057 
00058     // handle the XP-job of telling m_zoomPreview what to draw
00059     void                            _updatePreviewZoomPercent(UT_uint32 percent);
00060 
00061     // handle the XP-job of attaching something to our m_zoomPreview
00062     void                            _createPreviewFromGC(GR_Graphics * gc,
00063                                                          UT_uint32 width,
00064                                                          UT_uint32 height);
00065 
00066     XAP_Preview_Zoom *              m_zoomPreview;
00067 
00068     XAP_Frame::tZoomType            m_zoomType;
00069     UT_uint32                       m_zoomPercent;
00070 
00071     XAP_Dialog_Zoom::tAnswer        m_answer;
00072     XAP_Frame * m_pFrame;
00073 };
00074 
00075 #endif /* XAP_DIALOG_ZOOM_H */

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1