]> git.saurik.com Git - wxWidgets.git/blob - user/wxLayout/wxlparser.h
Added more makefiles; fixed some samples for Cygwin
[wxWidgets.git] / user / wxLayout / wxlparser.h
1 /*-*- c++ -*-********************************************************
2 * wxlparser.h : parsers, import/export for wxLayoutList *
3 * *
4 * (C) 1998 by Karsten Ballüder (Ballueder@usa.net) *
5 * *
6 * $Id$
7 *******************************************************************/
8 #ifndef WXLPARSER_H
9 # define WXLPARSER_H
10
11 #ifdef __GNUG__
12 # pragma interface "wxlparser.h"
13 #endif
14
15 #ifndef NULL
16 # define NULL 0
17 #endif
18
19 enum wxLayoutExportType
20 {
21 WXLO_EXPORT_TEXT,
22 WXLO_EXPORT_HTML,
23 WXLO_EXPORT_OBJECT
24 };
25
26 enum wxLayoutExportMode
27 {
28 WXLO_EXPORT_AS_MASK = 0x0f,
29 WXLO_EXPORT_AS_TEXT = 0x00,
30 WXLO_EXPORT_AS_TEXT_AND_COMMANDS = 0x01,
31 WXLO_EXPORT_AS_HTML = 0x02,
32 WXLO_EXPORT_AS_OBJECTS = 0x03,
33
34 WXLO_EXPORT_WITH_MASK = 0xf0,
35 WXLO_EXPORT_WITH_CRLF = 0x00,
36 WXLO_EXPORT_WITH_LF_ONLY = 0x10
37 };
38
39 struct wxLayoutExportObject
40 {
41 wxLayoutExportType type;
42 union
43 {
44 String *text;
45 wxLayoutObjectBase *object;
46 }content;
47 ~wxLayoutExportObject()
48 {
49 if(type == WXLO_EXPORT_TEXT || type == WXLO_EXPORT_HTML)
50 delete content.text;
51 }
52 };
53
54 #ifdef OS_WIN
55 /// import text into a wxLayoutList (including linefeeds):
56 void wxLayoutImportText(wxLayoutList &list, String const &str,
57 int withflag = WXLO_EXPORT_WITH_CRLF);
58
59 wxLayoutExportObject *wxLayoutExport(wxLayoutList &list,
60 wxLayoutList::iterator &from,
61 int mode = WXLO_EXPORT_AS_TEXT|WXLO_EXPORT_WITH_CRLF);
62 #else
63 /// import text into a wxLayoutList (including linefeeds):
64 void wxLayoutImportText(wxLayoutList &list, String const &str,
65 int withflag = WXLO_EXPORT_WITH_LF_ONLY);
66
67 wxLayoutExportObject *wxLayoutExport(wxLayoutList &list,
68 wxLayoutList::iterator &from,
69 int mode = WXLO_EXPORT_AS_TEXT|WXLO_EXPORT_WITH_LF_ONLY);
70 #endif
71
72 #endif //WXLPARSER_H