X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5bddd46dde044ccb04952e027b4ec27bb1251bba..7b8c3373a350c42491007d23aea70eaea1ff3a41:/interface/wx/html/htmlwin.h?ds=inline
diff --git a/interface/wx/html/htmlwin.h b/interface/wx/html/htmlwin.h
index 50efdf2166..ef7dde2599 100644
--- a/interface/wx/html/htmlwin.h
+++ b/interface/wx/html/htmlwin.h
@@ -3,7 +3,7 @@
// Purpose: interface of wxHtmlWindow
// Author: wxWidgets team
// RCS-ID: $Id$
-// Licence: wxWindows license
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
/**
@@ -16,13 +16,13 @@
downloaded via HTTP protocol) in a window.
The width of the window is constant - given in the constructor - and virtual height
is changed dynamically depending on page size.
- Once the window is created you can set its content by calling SetPage(text),
- LoadPage(filename) or wxHtmlWindow::LoadFile.
+ Once the window is created you can set its content by calling SetPage() with raw HTML,
+ LoadPage() with a wxFileSystem location or LoadFile() with a filename.
@note
- wxHtmlWindow uses the wxImage class for displaying images.
- Don't forget to initialize all image formats you need before loading any page!
- (See ::wxInitAllImageHandlers and wxImage::AddHandler.)
+ wxHtmlWindow uses the wxImage class for displaying images, as such you need to
+ initialize the handlers for any image formats you use before loading a page.
+ See ::wxInitAllImageHandlers and wxImage::AddHandler.
@beginStyleTable
@style{wxHW_SCROLLBAR_NEVER}
@@ -35,7 +35,7 @@
@endStyleTable
- @beginEventTable{wxHtmlCellEvent, wxHtmlLinkEvent}
+ @beginEventEmissionTable{wxHtmlCellEvent, wxHtmlLinkEvent}
@event{EVT_HTML_CELL_CLICKED(id, func)}
A wxHtmlCell was clicked.
@event{EVT_HTML_CELL_HOVER(id, func)}
@@ -61,12 +61,11 @@ public:
Constructor.
The parameters are the same as wxScrolled::wxScrolled() constructor.
*/
- wxHtmlWindow(wxWindow parent, wxWindowID id = -1,
+ wxHtmlWindow(wxWindow *parent, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxHW_DEFAULT_STYLE,
const wxString& name = "htmlWindow");
- //@}
/**
Adds @ref overview_html_filters "input filter" to the static list of available
@@ -75,7 +74,7 @@ public:
- @c image/* MIME types
- Plain Text filter (this filter is used if no other filter matches)
*/
- static void AddFilter(wxHtmlFilter filter);
+ static void AddFilter(wxHtmlFilter* filter);
/**
Appends HTML fragment to currently displayed text and refreshes the window.
@@ -109,7 +108,7 @@ public:
wxString GetOpenedPage() const;
/**
- Returns title of the opened page or wxEmptyString if current page does not
+ Returns title of the opened page or wxEmptyString if the current page does not
contain \
tag.
*/
wxString GetOpenedPageTitle() const;
@@ -120,20 +119,20 @@ public:
wxFrame* GetRelatedFrame() const;
/**
- Moves back to the previous page.
- (each page displayed using LoadPage() is stored in history list.)
+ Moves back to the previous page. Only pages displayed using LoadPage()
+ are stored in history list.
*/
bool HistoryBack();
/**
Returns @true if it is possible to go back in the history
- (i.e. HistoryBack() won't fail).
+ i.e. HistoryBack() won't fail.
*/
bool HistoryCanBack();
/**
Returns @true if it is possible to go forward in the history
- (i.e. HistoryBack() won't fail).
+ i.e. HistoryForward() won't fail.
*/
bool HistoryCanForward();
@@ -143,12 +142,13 @@ public:
void HistoryClear();
/**
- Moves to next page in history.
+ Moves to next page in history. Only pages displayed using LoadPage()
+ are stored in history list.
*/
bool HistoryForward();
/**
- Loads HTML page from file and displays it.
+ Loads an HTML page from a file and displays it.
@return @false if an error occurred, @true otherwise
@@ -157,12 +157,13 @@ public:
bool LoadFile(const wxFileName& filename);
/**
- Unlike SetPage() this function first loads HTML page from @a location
- and then displays it. See example:
+ Unlike SetPage() this function first loads the HTML page from @a location
+ and then displays it.
@param location
- The address of document.
- See wxFileSystem for details on address format and behaviour of "opener".
+ The address of the document.
+ See the @ref overview_fs for details on the address format
+ and wxFileSystem for a description of how the file is opened.
@return @false if an error occurred, @true otherwise
@@ -229,7 +230,7 @@ public:
@param path
Optional path in config tree. If not given current path is used.
*/
- virtual void ReadCustomization(wxConfigBase cfg,
+ virtual void ReadCustomization(wxConfigBase* cfg,
wxString path = wxEmptyString);
/**
@@ -259,15 +260,15 @@ public:
void SelectWord(const wxPoint& pos);
/**
- Returns current selection as plain text.
- Returns empty string if no text is currently selected.
+ Returns the current selection as plain text.
+ Returns an empty string if no text is currently selected.
*/
wxString SelectionToText();
/**
This function sets the space between border of window and HTML contents.
See image:
- @image html border.png
+ @image html htmlwin_border.png
@param b
indentation from borders in pixels
@@ -275,32 +276,25 @@ public:
void SetBorders(int b);
/**
- This function sets font sizes and faces.
+ This function sets font sizes and faces. See wxHtmlDCRenderer::SetFonts
+ for detailed description.
- @param normal_face
- This is face name for normal (i.e. non-fixed) font.
- It can be either empty string (then the default face is chosen) or
- platform-specific face name. Examples are "helvetica" under Unix or
- "Times New Roman" under Windows.
- @param fixed_face
- The same thing for fixed face ( \..\ )
- @param sizes
- This is an array of 7 items of int type.
- The values represent size of font with HTML size from -2 to +4
- ( \ to \ ).
- Default sizes are used if sizes is @NULL.
+ @see SetSize()
+ */
+ void SetFonts(const wxString& normal_face, const wxString& fixed_face,
+ const int* sizes = NULL);
- Default font sizes are defined by constants wxHTML_FONT_SIZE_1,
- wxHTML_FONT_SIZE_2, ..., wxHTML_FONT_SIZE_7.
- Note that they differ among platforms. Default face names are empty strings.
+ /**
+ Sets default font sizes and/or default font size.
+ See wxHtmlDCRenderer::SetStandardFonts for detailed description.
+ @see SetFonts()
*/
- void SetFonts(const wxString& normal_face,
- const wxString& fixed_face,
- const int sizes = NULL);
+ void SetStandardFonts(int size = -1,
+ const wxString& normal_face = wxEmptyString,
+ const wxString& fixed_face = wxEmptyString);
/**
- Sets HTML page and display it. This won't @b load the page!!
- It will display the @e source. See example:
+ Sets the source of a page and displays it, for example:
@code
htmlwin -> SetPage("Hello, world!");
@endcode
@@ -308,7 +302,7 @@ public:
If you want to load a document from some location use LoadPage() instead.
@param source
- The HTML document source to be displayed.
+ The HTML to be displayed.
@return @false if an error occurred, @true otherwise.
*/
@@ -364,7 +358,7 @@ public:
@param path
Optional path in config tree. If not given, the current path is used.
*/
- virtual void WriteCustomization(wxConfigBase cfg,
+ virtual void WriteCustomization(wxConfigBase* cfg,
wxString path = wxEmptyString);
protected:
@@ -389,7 +383,7 @@ protected:
@return @true if a link was clicked, @false otherwise.
*/
- virtual bool OnCellClicked(wxHtmlCell cell, wxCoord x, wxCoord y,
+ virtual bool OnCellClicked(wxHtmlCell* cell, wxCoord x, wxCoord y,
const wxMouseEvent& event);
/**
@@ -406,7 +400,7 @@ protected:
@param y
The logical y coordinate of the click point
*/
- virtual void OnCellMouseHover(wxHtmlCell cell, wxCoord x, wxCoord y);
+ virtual void OnCellMouseHover(wxHtmlCell* cell, wxCoord x, wxCoord y);
};
@@ -430,7 +424,7 @@ public:
/**
The constructor is not normally used by the user code.
*/
- wxHyperlinkEvent(int id, const wxHtmlLinkInfo& linkinfo);
+ wxHtmlLinkEvent(int id, const wxHtmlLinkInfo& linkinfo);
/**
Returns the wxHtmlLinkInfo which contains info about the cell clicked
@@ -465,7 +459,8 @@ public:
*/
wxHtmlCellEvent(wxEventType commandType, int id,
wxHtmlCell* cell,
- const wxPoint& point);
+ const wxPoint& point,
+ const wxMouseEvent& ev);
/**
Returns the wxHtmlCellEvent associated with the event.
@@ -490,6 +485,6 @@ public:
With this function the event handler can return info to the wxHtmlWindow
which sent the event.
*/
- bool SetLinkClicked(bool linkclicked);
+ void SetLinkClicked(bool linkclicked);
};