Class WikiDocEditor
#include <WikiDocEditor.h >
Super class: WikiDocument
Class to manage a text area user input region that accepts and displays wiki content.
Wiki content uses extra punctuation to make text italic, bold. Using = at the start of a line for headers (one = for H1, two for H2, etc.). Or start a line with * for bulleted list and # for numbered list.
Your app must maintain the state of the wiki document, which is tied to a unique UI callback tag such as 'descr' or 'descr_1_324', etc. - your convention.
The wiki UI may have multiple user controls (Save button, toggle between view/edit), so the app needs to test if an action is for a wiki or not. Each wiki document has a unique session name that the app provides. The session name is used for naming extra UI regions that are needed.
const HashArray& state |
key/value pairs of wiki editor state Default value: HashArray("") |
Create WikiDocEditor instance from state contained in a HashArray.
If no state is provided, all defaults are used.
const WikiDocument& wikidoc |
a wiki document that has already been created. |
Create WikiDocEditor with state defaults for the wiki document provided.
Its content will be initially displayed.
Reset the wiki document editor back to defaults and clear any content.
Determine if the current session is valid.
A session is valid if it has a name.
Return value: true if the session is valid
Get the current state of the editor as key/value paris in a HashArray.
This does NOT include wiki content.
Return value: a HashArray of the wiki state
Get the session name (string) of this wiki editor instance.
Return value: a string with the session name
Get the UI callback data for this editor's instance.
The app uses this to find right WikiDocEditor instance
Return value: XMLData for the callback
Get the current state of the editor - if it's in Simple Layout mode.
Alternatively, the editor is in Block Layout mode.
In Simple Layout mode, the editor does not show awareness of blocks of
text per header.
Return value: true if in Simple Layout mode; false otherwise
Get the current state of the editor - if it's in Block Layout mode.
Alternatively, the editor is in Simple Layout mode.
In Block Layout, a specific block inside the wiki content can be edited.
Return value: true if in Block Layout mode; false otherwise
Get the current state of the editor - if it's in Outline Mode.
In Outline Mode, headings are displayed so they user can click on a heading
to then edit that block.
Alternatively, the editor is in Full Display Mode.
Return value: true if in Outline Mode; false otherwise
Get the current state of the editor - if it's in Full Display Mode.
In Full Display Mode, the full editable/viewable content is displayed.
Alternatively, the editor is in Outline Mode.
Return value: true if in Full Display Mode; false otherwise
Get the current display state of the content - View Source Mode.
In View Source Mode, formatting punctuation is diplayed (quotes, equals, etc.)
Return value: true if in View Source Mode; false otherwise
Get the current display state of the content - View Formatted Mode.
In View Formatted Mode, text is displayed in its attractive, formatted way;
no formatting punctuation is diplayed (quotes, equals, etc.)
Return value: true if in View Source Mode; false otherwise
Get the title of the topmost heading of the editable/viewable wiki text.
Title is returned without the equals sign formatting around it.
Return value: title of the topmost heading
Get the current state of the editor - can the user edit the headings?
Return value: true if the user can edit the headings; false otherwise
Get the current state of the editor - can the user edit the subheadings?
Return value: true if the user can edit the subheadings; false otherwise
Get the current state of the editor - can the user add a subheading?
Return value: true if the user can add a subheading; false otherwise
Get the current state of the editor - can the user edit a heading block?
Return value: true if the user can edit a heading block; false otherwise
Get the current state of the editor - can the user add a sub-subheading?
Return value: true if the user can add a sub-subheading; false otherwise
Get the current state of the editor - display subheading content or just this
header's immediate content?
Return value: true if any subheading content is displayed; false if not displayed
Get the current state of the editor - display subheading content or just this
header's immediate content?
Return value: true if no subheading content is displayed; false if displayed
Get the
Get the
Get the
Get the
Get the
Get the
Get the
Get the
Get the
Get the
Get the
Get the
Get the
Get the
const HashArray& newEditState |
basic SET methods
const string& name |
used for tag names, etc.
const string& cbref |
app uses to find right WikiDocEditor instance
const string& topHeading |
bool allow |
Default value: true |
bool allow |
Default value: true |
bool allow |
Default value: true |
bool allow |
Default value: true |
bool allow |
Default value: true |
bool exclude |
bool allow |
Default value: true |
const string& term |
const string& term |
const string& term |
const string& term |
const string& heading |
const string& heading |
const string& subheading |
const string& frametag |
bool readOnly |
Default value: true |
int depth |
Default value: 30 |
const string& allowed |
Default value: ".- '" |
const string& starttext |
UserDevice& device |
handling interaction from the user
UserDevice& device |
UserDevice& device |
const string& request |
const string& request |
UserDevice& device |
|
const string& request |
|
const XMLData& param |
UserDevice& device |
|
string cbtag |
|
const XMLData& cbdata |
|
string response |
appIndexRefLookupFN cbfn |
|
void* cbdata |
XMLData editState |
|
static string rootTag |
|
static appIndexRefLookupFN appIndexRefLookupCBFN |
|
static void* appIndexRefLookupCBData |
UserDevice& device |
|
const string& tag |
|
const string& text |
const vector <int >& sectionNo |
const string& blockLabel |
const string& blockLabel |
|
bool sub |
|
const string& title |
|
bool table |
Default value: false |
UserDevice& device |
|
int depth |
|
const string& heading |
|
const string& block_label |
|
bool veryTop |
Default value: false |
bool redraw |
Default value: false |
UserDevice& device |
|
const string& text |
|
const string& block_label |
|
bool redraw |
Default value: false |
UserDevice& device |
|
int depth |
|
const string& block_label |
|
bool redraw |
Default value: false |