]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/richtext/richtextbuffer.h
GetCurrentSelection() was documented but not present in all ports (just MSW and GTK...
[wxWidgets.git] / include / wx / richtext / richtextbuffer.h
index 6d1a07395f2b09df8dd44112fa5cd2836dab65e2..7b49ad732db2f22bbe3b2776071416abcb839365 100644 (file)
@@ -101,6 +101,7 @@ class WXDLLIMPEXP_RICHTEXT wxTextAttrEx;
 class WXDLLIMPEXP_RICHTEXT wxRichTextListStyleDefinition;
 class WXDLLIMPEXP_RICHTEXT wxRichTextEvent;
 class WXDLLIMPEXP_RICHTEXT wxRichTextRenderer;
+class WXDLLIMPEXP_RICHTEXT wxRichTextBuffer;
 
 /*!
  * Flags determining the available space, passed to Layout
@@ -115,6 +116,15 @@ class WXDLLIMPEXP_RICHTEXT wxRichTextRenderer;
 // the rect passed to Layout.
 #define wxRICHTEXT_LAYOUT_SPECIFIED_RECT 0x10
 
+/*!
+ * Flags to pass to Draw
+ */
+
+// Ignore paragraph cache optimization, e.g. for printing purposes
+// where one line may be drawn higher (on the next page) compared
+// with the previous line
+#define wxRICHTEXT_DRAW_IGNORE_CACHE    0x01
+
 /*!
  * Flags returned from hit-testing
  */
@@ -714,6 +724,9 @@ public:
     void SetDescent(int descent) { m_descent = descent; }
     int GetDescent() const { return m_descent; }
 
+    /// Gets the containing buffer
+    wxRichTextBuffer* GetBuffer() const;
+
 // Operations
 
     /// Clone the object
@@ -727,8 +740,9 @@ public:
     void Reference() { m_refCount ++; }
     void Dereference();
 
-    /// Convert units in tends of a millimetre to device units
-    static int ConvertTenthsMMToPixels(wxDC& dc, int units);
+    /// Convert units in tenths of a millimetre to device units
+    int ConvertTenthsMMToPixels(wxDC& dc, int units);
+    static int ConvertTenthsMMToPixels(int ppi, int units);
 
 protected:
     wxSize                  m_size;
@@ -1574,11 +1588,8 @@ public:
     /// Initialisation
     void Init();
 
-    /// Clears the buffer and resets the command processor
-    virtual void Clear();
-
-    /// The same as Clear, and adds an empty paragraph.
-    virtual void Reset();
+    /// Clears the buffer, adds an empty paragraph, and clears the command processor.
+    virtual void ResetAndClearCommands();
 
     /// Load a file
     virtual bool LoadFile(const wxString& filename, int type = wxRICHTEXT_TYPE_ANY);
@@ -1861,6 +1872,11 @@ public:
     /// Factor to multiply by character height to get a reasonable bullet size
     static float GetBulletProportion() { return sm_bulletProportion; }
     static void SetBulletProportion(float prop) { sm_bulletProportion = prop; }
+
+    /// Scale factor for calculating dimensions
+    double GetScale() const { return m_scale; }
+    void SetScale(double scale) { m_scale = scale; }
+
 protected:
 
     /// Command processor
@@ -1904,6 +1920,9 @@ protected:
 
     /// Factor to multiply by character height to get a reasonable bullet size
     static float            sm_bulletProportion;
+
+    /// Scaling factor in use: needed to calculate correct dimensions when printing
+    double                  m_scale;
 };
 
 /*!
@@ -2240,6 +2259,7 @@ WXDLLIMPEXP_RICHTEXT bool wxTextAttrEqPartial(const wxTextAttrEx& attr1, const w
 WXDLLIMPEXP_RICHTEXT bool wxRichTextApplyStyle(wxTextAttrEx& destStyle, const wxTextAttrEx& style);
 WXDLLIMPEXP_RICHTEXT bool wxRichTextApplyStyle(wxRichTextAttr& destStyle, const wxTextAttrEx& style);
 WXDLLIMPEXP_RICHTEXT bool wxRichTextApplyStyle(wxTextAttrEx& destStyle, const wxRichTextAttr& style, wxRichTextAttr* compareWith = NULL);
+WXDLLIMPEXP_RICHTEXT bool wxRichTextApplyStyle(wxRichTextAttr& destStyle, const wxRichTextAttr& style, wxRichTextAttr* compareWith = NULL);
 
 /// Compare tabs
 WXDLLIMPEXP_RICHTEXT bool wxRichTextTabsEq(const wxArrayInt& tabs1, const wxArrayInt& tabs2);