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

xap_Preview_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 
00021 #ifndef XAP_PREVIEW_ZOOM_H
00022 #define XAP_PREVIEW_ZOOM_H
00023 
00024 /* pre-emptive dismissal; ut_types.h is needed by just about everything,
00025  * so even if it's commented out in-file that's still a lot of work for
00026  * the preprocessor to do...
00027  */
00028 #ifndef UT_TYPES_H
00029 #include "ut_types.h"
00030 #endif
00031 #include "ut_misc.h"
00032 
00033 #include "xap_Preview.h"
00034 
00035 class GR_Font;
00036 
00037 class ABI_EXPORT XAP_Preview_Zoom : public XAP_Preview
00038 {
00039 public:
00040 
00041     XAP_Preview_Zoom(GR_Graphics * gc);
00042     virtual ~XAP_Preview_Zoom(void);
00043 
00044     // example placements useful in zoom
00045     typedef enum { pos_TOP, pos_CENTER, pos_BOTTOM } tPos;
00046     // example fonts useful in zoom (add more later)
00047     typedef enum { font_NORMAL } tFont;
00048 
00049     // data twiddlers
00050     void    setDrawAtPosition(XAP_Preview_Zoom::tPos pos);
00051     void    setFont(XAP_Preview_Zoom::tFont f);
00052     void    setZoomPercent(UT_uint32 percent);
00053 
00054     // set the string you'd like to display
00055     bool    setString(const char * string);
00056     bool    setString(UT_UCSChar * string);
00057 
00058     // where all the zoom-specific drawing happens
00059     void    draw(const UT_Rect *clip=NULL);
00060 
00061 protected:
00062 
00063     XAP_Preview_Zoom::tPos  m_pos;
00064     XAP_Preview_Zoom::tFont m_previewFont;
00065     UT_uint32               m_zoomPercent;
00066 
00067     UT_UCSChar *            m_string;
00068 
00069     GR_Font *               m_pFont;    // so we can delete it
00070 };
00071 
00072 #endif /* XAP_PREVIEW_ZOOM_H */

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1