]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/richtext/richtextbuffer.h
avoid hidden GetImageList
[wxWidgets.git] / include / wx / richtext / richtextbuffer.h
index 2e6f9f3752e6d0718f1681322a319887bdec6479..3a5e25f8e1600e1680da9149830d879dcaa0602d 100644 (file)
@@ -134,6 +134,10 @@ class WXDLLIMPEXP_ADV wxTextAttrEx;
 #define wxRICHTEXT_VARIABLE_WIDTH   0x04
 #define wxRICHTEXT_VARIABLE_HEIGHT  0x08
 
+// Only lay out the part of the buffer that lies within
+// the rect passed to Layout.
+#define wxRICHTEXT_LAYOUT_SPECIFIED_RECT 0x10
+
 /*!
  * Flags returned from hit-testing
  */
@@ -244,6 +248,9 @@ protected:
     long m_end;
 };
 
+#define wxRICHTEXT_ALL  wxRichTextRange(-2, -2)
+#define wxRICHTEXT_NONE  wxRichTextRange(-1, -1)
+
 /*!
  * wxTextAttrEx is an extended version of wxTextAttr with more paragraph attributes.
  */
@@ -641,7 +648,7 @@ protected:
     wxTextAttrEx            m_attributes;
 };
 
-WX_DECLARE_EXPORTED_LIST( wxRichTextObject, wxRichTextObjectList );
+WX_DECLARE_LIST_WITH_DECL( wxRichTextObject, wxRichTextObjectList, class WXDLLIMPEXP_ADV );
 
 /*!
  * wxRichTextCompositeObject class declaration
@@ -931,7 +938,7 @@ public:
     virtual const wxTextAttrEx& GetBasicStyle() const { return m_attributes; }
 
     /// Invalidate the buffer. With no argument, invalidates whole buffer.
-    void Invalidate(const wxRichTextRange& invalidRange = wxRichTextRange(-1, -1));
+    void Invalidate(const wxRichTextRange& invalidRange = wxRICHTEXT_ALL);
 
     /// Get invalid range, rounding to entire paragraphs if argument is true.
     wxRichTextRange GetInvalidRange(bool wholeParagraphs = false) const;
@@ -997,7 +1004,7 @@ public:
 // Constructors
 
     wxRichTextLine(wxRichTextParagraph* parent);
-    wxRichTextLine(const wxRichTextLine& obj) { Init(); Copy(obj); }
+    wxRichTextLine(const wxRichTextLine& obj) { Init( NULL); Copy(obj); }
     virtual ~wxRichTextLine() {}
 
 // Overrideables
@@ -1015,6 +1022,9 @@ public:
     const wxRichTextRange& GetRange() const { return m_range; }
     wxRichTextRange& GetRange() { return m_range; }
 
+    /// Get the absolute range
+    wxRichTextRange GetAbsoluteRange() const;
+
     /// Get/set the line size as calculated by Layout.
     virtual wxSize GetSize() const { return m_size; }
     virtual void SetSize(const wxSize& sz) { m_size = sz; }
@@ -1036,7 +1046,7 @@ public:
 // Operations
 
     /// Initialisation
-    void Init();
+    void Init(wxRichTextParagraph* parent);
 
     /// Copy
     void Copy(const wxRichTextLine& obj);
@@ -1047,6 +1057,7 @@ public:
 protected:
 
     /// The range of the line (start position to end position)
+    /// This is relative to the parent paragraph.
     wxRichTextRange     m_range;
 
     /// Size and position measured relative to top of paragraph
@@ -1060,7 +1071,7 @@ protected:
     wxRichTextParagraph* m_parent;
 };
 
-WX_DECLARE_EXPORTED_LIST( wxRichTextLine, wxRichTextLineList );
+WX_DECLARE_LIST_WITH_DECL( wxRichTextLine, wxRichTextLineList , class WXDLLIMPEXP_ADV );
 
 /*!
  * wxRichTextParagraph class declaration
@@ -1148,6 +1159,12 @@ public:
     /// Get the bullet text for this paragraph.
     wxString GetBulletText();
 
+    /// Allocate or reuse a line object
+    wxRichTextLine* AllocateLine(int pos);
+
+    /// Clear remaining unused line objects, if any
+    bool ClearUnusedLines(int lineCount);
+
 protected:
     /// The lines that make up the wrapped paragraph
     wxRichTextLineList m_cachedLines;
@@ -1616,8 +1633,10 @@ public:
     /// Finds a handler by type
     static wxRichTextFileHandler *FindHandler(int imageType);
 
-    /// Gets a wildcard incorporating all visible handlers
-    static wxString GetExtWildcard(bool combine = false, bool save = false);
+    /// Gets a wildcard incorporating all visible handlers. If 'types' is present,
+    /// will be filled with the file type corresponding to each filter. This can be
+    /// used to determine the type to pass to LoadFile given a selected filter.
+    static wxString GetExtWildcard(bool combine = false, bool save = false, wxArrayInt* types = NULL);
 
     /// Clean up handlers
     static void CleanUpHandlers();