Debian Codegraph @

src/af/xap/win/xap_Win32Dlg_Insert_Symbol.h

raw
1 /* AbiWord
2 * Copyright (C) 2000 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_Win32Dialog_Insert_Symbol_H
21 #define XAP_Win32Dialog_Insert_Symbol_H
22
23 #include "xap_Dlg_Insert_Symbol.h"
24 #include "xap_Draw_Symbol.h"
25 #include "xap_Win32DialogBase.h"
26
27 class XAP_Frame;
28 class XAP_Win32PreviewWidget;
29
30 /*****************************************************************/
31
32 static UT_UCSChar m_CurrentSymbol = UCS_SPACE;
33 static UT_UCSChar m_PreviousSymbol = UCS_SPACE;
34
35 extern char Symbol_font_selected[];
36
37 class ABI_EXPORT XAP_Draw_Symbol_sample : public XAP_Preview
38 {
39 public:
40
41 XAP_Draw_Symbol_sample(XAP_Draw_Symbol *pSymbolDraw, GR_Graphics * gc) : XAP_Preview(gc)
42 {
43 m_pSymbolDraw = pSymbolDraw;
44 }
45 virtual ~XAP_Draw_Symbol_sample(void)
46 {
47 }
48
49 void draw(const UT_Rect *clip=NULL)
50 {
51 UT_UNUSED(clip);
52 m_pSymbolDraw->drawarea(m_CurrentSymbol, m_PreviousSymbol);
53 }
54
55 //protected:
56
57 XAP_Draw_Symbol *m_pSymbolDraw;
58 };
59
60
61
62 class ABI_EXPORT XAP_Win32Dialog_Insert_Symbol: public XAP_Win32DialogBase, public XAP_Dialog_Insert_Symbol
63 {
64 public:
65 XAP_Win32Dialog_Insert_Symbol(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id);
66 virtual ~XAP_Win32Dialog_Insert_Symbol(void);
67
68 virtual void runModal(XAP_Frame * pFrame);
69 virtual void runModeless(XAP_Frame * pFrame);
70 virtual void notifyActiveFrame(XAP_Frame *pFrame);
71 virtual void notifyCloseFrame(XAP_Frame *pFrame);
72 virtual void destroy(void);
73 virtual void activate(void);
74
75 static XAP_Dialog * static_constructor(XAP_DialogFactory *, XAP_Dialog_Id id);
76 static int CALLBACK fontEnumProcedure(const LOGFONTW *pLogFont, const TEXTMETRICW *pTextMetric, DWORD Font_type, LPARAM lParam);
77
78 virtual void * pGetWindowHandle(void) { return (void *) m_hDlg; }
79 void doInsertSymbol( void );
80
81 protected:
82 BOOL _onInitDialog(HWND hWnd, WPARAM wParam, LPARAM lParam);
83 BOOL _onCommand(HWND hWnd, WPARAM wParam, LPARAM lParam);
84 BOOL _onDeltaPos(NM_UPDOWN * pnmud);
85 int _enumFont(const LOGFONTW *pLogFont, const TEXTMETRICW *pTextMetric, DWORD Font_type);
86 void _setFontFromCombo(UT_sint32 Index);
87
88
89 XAP_Win32PreviewWidget * m_pSymbolPreviewWidget;
90 XAP_Win32PreviewWidget * m_pSamplePreviewWidget;
91 XAP_Draw_Symbol_sample * m_DrawSymbolSample;
92
93 HWND m_hDlg;
94 };
95
96 #endif /* XAP_Win32Dialog_Insert_Symbol_H */