X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d2d0adc7765dfe904f0f7e97d85a2638c934a7d6..d8af1bf97d364e0f499fb509cb9639d040b52186:/include/wx/richtext/richtextbuffer.h diff --git a/include/wx/richtext/richtextbuffer.h b/include/wx/richtext/richtextbuffer.h index a91ea90363..23c9e298e3 100644 --- a/include/wx/richtext/richtextbuffer.h +++ b/include/wx/richtext/richtextbuffer.h @@ -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; }; /*! @@ -2041,7 +2060,7 @@ class WXDLLIMPEXP_RICHTEXT wxRichTextFileHandler: public wxObject DECLARE_CLASS(wxRichTextFileHandler) public: wxRichTextFileHandler(const wxString& name = wxEmptyString, const wxString& ext = wxEmptyString, int type = 0) - : m_name(name), m_extension(ext), m_type(type), m_visible(true), m_flags(0) + : m_name(name), m_extension(ext), m_type(type), m_flags(0), m_visible(true) { } #if wxUSE_STREAMS