]> git.saurik.com Git - wxWidgets.git/blobdiff - user/wxLayout/wxlparser.h
minor bug fix
[wxWidgets.git] / user / wxLayout / wxlparser.h
index b1a0f68409764e801697ffb31c6232e2e6207061..571a8749d972ed943abeead99e52affbb7ab0bd4 100644 (file)
@@ -20,15 +20,21 @@ enum wxLayoutExportType
 {
    WXLO_EXPORT_TEXT,        
    WXLO_EXPORT_HTML,        
-   WXLO_EXPORT_OBJECT
+   WXLO_EXPORT_OBJECT,
+   // this can be caused by empty lines:
+   WXLO_EXPORT_EMPTYLINE
 };
 
 enum wxLayoutExportMode
 {
-   WXLO_EXPORT_AS_TEXT,
-   WXLO_EXPORT_AS_TEXT_AND_COMMANDS,
-   WXLO_EXPORT_AS_HTML,
-   WXLO_EXPORT_AS_OBJECTS
+   WXLO_EXPORT_AS_TEXT = 0x00,
+   WXLO_EXPORT_AS_TEXT_AND_COMMANDS = 0x01,
+   WXLO_EXPORT_AS_HTML = 0x02,
+   WXLO_EXPORT_AS_OBJECTS = 0x03,
+
+   // non 0:
+   WXLO_EXPORT_WITH_CRLF = 0x10,
+   WXLO_EXPORT_WITH_LF_ONLY = 0x20
 };
 
 struct wxLayoutExportObject
@@ -36,8 +42,8 @@ struct wxLayoutExportObject
    wxLayoutExportType type;
    union
    {
-      String           *text;
-      wxLayoutObjectBase *object;
+      wxString           *text;
+      wxLayoutObject *object;
    }content;
    ~wxLayoutExportObject()
       {
@@ -46,12 +52,34 @@ struct wxLayoutExportObject
       }
 };
 
+
+struct wxLayoutExportStatus
+{
+   wxLayoutExportStatus(wxLayoutList *list);
+   wxLayoutLine      * m_line;
+   wxLOiterator        m_iterator;
+   wxLayoutStyleInfo   m_si;
+};
+
+#ifdef OS_WIN
 /// import text into a wxLayoutList (including linefeeds):
-void wxLayoutImportText(wxLayoutList &list, String const &str);
+void wxLayoutImportText(wxLayoutList *list, wxString const &str,
+                        int withflag = WXLO_EXPORT_WITH_CRLF);
 
+wxLayoutExportObject *wxLayoutExport(wxLayoutExportStatus *status,
+                                     int mode = WXLO_EXPORT_AS_TEXT,
+                                     int flags =
+                                     WXLO_EXPORT_WITH_CRLF); 
+#else
+/// import text into a wxLayoutList (including linefeeds):
+void wxLayoutImportText(wxLayoutList *list, wxString const &str,
+                        int withflag = WXLO_EXPORT_WITH_LF_ONLY);
 
-wxLayoutExportObject *wxLayoutExport(wxLayoutList &list,
-                               wxLayoutList::iterator &from,
-                               wxLayoutExportMode WXLO_EXPORT_AS_TEXT);
+/// export text in a given format
+wxLayoutExportObject *wxLayoutExport(wxLayoutExportStatus *status,
+                                     int mode = WXLO_EXPORT_AS_TEXT,
+                                     int flags =
+                                     WXLO_EXPORT_WITH_LF_ONLY);
+#endif
 
 #endif //WXLPARSER_H