Debian Codegraph @

src/af/xap/xp/xap_Preview_Zoom.h

raw
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
21 #ifndef XAP_PREVIEW_ZOOM_H
22 #define XAP_PREVIEW_ZOOM_H
23
24 /* pre-emptive dismissal; ut_types.h is needed by just about everything,
25 * so even if it's commented out in-file that's still a lot of work for
26 * the preprocessor to do...
27 */
28 #ifndef UT_TYPES_H
29 #include "ut_types.h"
30 #endif
31 #include "ut_misc.h"
32
33 #include "xap_Preview.h"
34
35 class GR_Font;
36
37 class ABI_EXPORT XAP_Preview_Zoom : public XAP_Preview
38 {
39 public:
40
41 XAP_Preview_Zoom(GR_Graphics * gc);
42 virtual ~XAP_Preview_Zoom(void);
43
44 // example placements useful in zoom
45 typedef enum { pos_TOP, pos_CENTER, pos_BOTTOM } tPos;
46 // example fonts useful in zoom (add more later)
47 typedef enum { font_NORMAL } tFont;
48
49 // data twiddlers
50 void setDrawAtPosition(XAP_Preview_Zoom::tPos pos);
51 void setFont(XAP_Preview_Zoom::tFont f);
52 void setZoomPercent(UT_uint32 percent);
53
54 // set the string you'd like to display
55 bool setString(const char * string);
56 bool setString(UT_UCSChar * string);
57
58 // where all the zoom-specific drawing happens
59 void draw(const UT_Rect *clip=NULL);
60
61 protected:
62
63 XAP_Preview_Zoom::tPos m_pos;
64 XAP_Preview_Zoom::tFont m_previewFont;
65 UT_uint32 m_zoomPercent;
66
67 UT_UCSChar * m_string;
68
69 GR_Font * m_pFont; // so we can delete it
70 };
71
72 #endif /* XAP_PREVIEW_ZOOM_H */