1 /*-*- c++ -*-********************************************************
2 * wxlparser.h : parsers, import/export for wxLayoutList *
4 * (C) 1998 by Karsten Ballüder (Ballueder@usa.net) *
7 *******************************************************************/
12 # pragma interface "wxlparser.h"
19 enum wxLayoutExportType
26 enum wxLayoutExportMode
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,
34 WXLO_EXPORT_WITH_MASK
= 0xf0,
35 WXLO_EXPORT_WITH_CRLF
= 0x00,
36 WXLO_EXPORT_WITH_LF_ONLY
= 0x10
39 struct wxLayoutExportObject
41 wxLayoutExportType type
;
45 wxLayoutObject
*object
;
47 ~wxLayoutExportObject()
49 if(type
== WXLO_EXPORT_TEXT
|| type
== WXLO_EXPORT_HTML
)
54 struct wxLayoutExportStatus
56 wxLayoutExportStatus(wxLayoutList
*list
)
58 list
->GetDefaults()->GetStyle(&m_si
);
59 m_line
= list
->GetFirstLine();
60 m_iterator
= m_line
->GetFirstObject();
63 wxLayoutLine
* m_line
;
64 wxLOiterator m_iterator
;
65 wxLayoutStyleInfo m_si
;
70 /// import text into a wxLayoutList (including linefeeds):
71 void wxLayoutImportText(wxLayoutList
&list
, wxString
const &str
,
72 int withflag
= WXLO_EXPORT_WITH_CRLF
);
74 wxLayoutExportObject
*wxLayoutExport(wxLayoutList
&list
,
75 int mode
= WXLO_EXPORT_AS_TEXT
|WXLO_EXPORT_WITH_CRLF
);
77 /// import text into a wxLayoutList (including linefeeds):
78 void wxLayoutImportText(wxLayoutList
&list
, wxString
const &str
,
79 int withflag
= WXLO_EXPORT_WITH_LF_ONLY
);
81 /// export text in a given format FIXME-MT: not thread safe, uses static variable
82 wxLayoutExportObject
*wxLayoutExport(wxLayoutExportStatus
*status
,
83 int mode
= WXLO_EXPORT_AS_TEXT
|WXLO_EXPORT_WITH_LF_ONLY