Debian Codegraph @

src/af/xap/xp/xap_FontPreview.h

raw
1 /* AbiSource Application Framework
2 * Copyright (C) 1998 AbiSource, Inc.
3 * Copyright (C) 2009 Hubert Figuiere
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 * 02110-1301 USA.
19 */
20
21 #ifndef XAP_FONTPREVIEW_H
22 #define XAP_FONTPREVIEW_H
23
24 #include <string>
25 #include <map>
26
27 #ifndef UT_TYPES_H
28 #include "ut_types.h"
29 #endif
30 #include "xap_Dlg_FontChooser.h"
31
32 class GR_Graphics;
33
34 // some hardcoded values for the preview window size
35 #define PREVIEW_WIDTH 400
36 #define PREVIEW_HEIGHT 75
37
38 class ABI_EXPORT XAP_FontPreview
39 {
40 public:
41 typedef std::map<std::string,std::string> PropMap;
42
43 XAP_FontPreview();
44 virtual ~XAP_FontPreview(void);
45
46 void addOrReplaceVecProp(const std::string & pszProp,
47 const std::string & pszVal);
48 void setFontFamily(const gchar * pFontFamily);
49 void setText(const gchar * pFontFamily);
50 void draw(void);
51 protected:
52 void _createFontPreviewFromGC(GR_Graphics * gc,
53 UT_uint32 width,
54 UT_uint32 height);
55 UT_sint32 m_width;
56 UT_sint32 m_height;
57 private:
58 XAP_Preview_FontPreview * m_pFontPreview;
59 UT_UCSChar * m_drawString;
60 PropMap m_mapProps;
61 };
62
63 #endif /* XAP_FONTPREVIEW_H */