Class WikiDocEditor

Index Home MAE > MAE Architecture > MAE Data Types > Class Index > Class WikiDocEditor

Summary
Public Methods
WikiDocEditor(state)
WikiDocEditor(wikidoc)
void clear()
inline bool valid() const
const HashArray& getEditState() const
const string getSessionName() const
XMLData getCallbackRef() const
bool isSimpleLayout() const
bool isBlockLayout() const
bool isOutlineMode() const
bool isFullMode() const
bool isViewSource() const
bool isViewFormatted() const
const string getTopHeading() const
const bool getEditHeadings() const
const bool getEditSubHeadings() const
const bool getAddSubHeadings() const
const bool getEditHeadingBlock() const
const bool getAddSubSubHeadings() const
const bool getIncludeSubContent() const
const bool getExcludeSubContent() const
const bool getAddTables() const
string getTermHeading() const
string getTermSubHeading() const
string getTermSubSubHeading() const
string getTermTable() const
const string getBlockShowing() const
const string getBlockEditing() const
const string getSubBlockEditing() const
const string getFrameTag() const
const bool isReadOnly() const
const bool isReadWrite() const
const string getEditText() const
int getIndexRefAssistCharDepth() const
const string getIndexRefAssistAllowedNonAlphanumerics() const
WikiDocEditor& setEditState(newEditState)
WikiDocEditor& setSessionName(name)
WikiDocEditor& setCallbackRef(cbref)
WikiDocEditor& setSimpleLayout()
WikiDocEditor& setBlockLayout()
WikiDocEditor& setOutlineMode()
WikiDocEditor& setFullMode()
WikiDocEditor& setViewSource()
WikiDocEditor& setViewFormatted()
WikiDocEditor& setTopHeading(topHeading)
WikiDocEditor& setEditHeadings(allow)
WikiDocEditor& setEditSubHeadings(allow)
WikiDocEditor& setEditHeadingBlock(allow)
WikiDocEditor& setAddSubHeadings(allow)
WikiDocEditor& setAddSubSubHeadings(allow)
WikiDocEditor& setIncludeSubBlocks()
WikiDocEditor& setExcludeSubBlocks(exclude)
WikiDocEditor& setAddTables(allow)
WikiDocEditor& setTermHeading(term)
WikiDocEditor& setTermSubHeading(term)
WikiDocEditor& setTermSubSubHeading(term)
WikiDocEditor& setTermTable(term)
WikiDocEditor& setBlockShowing(heading)
WikiDocEditor& setBlockEditing(heading)
WikiDocEditor& setSubBlockEditing(subheading)
WikiDocEditor& setFrameTag(frametag)
WikiDocEditor& setReadOnly(readOnly)
WikiDocEditor& setReadWrite()
WikiDocEditor& setIndexRefAssistCharDepth(depth)
WikiDocEditor& setIndexRefAssistAllowedNonAlphanumerics(allowed)
string getWikiRefText(starttext)
inline string getWikiRefText()
void drawEditorSimple(device)
void drawEditorBlock(device)
void drawEditor(device)
static bool isWikiDocEditorMessage(request)
static bool isWikiDocEditorResponse(request)
bool handleMessage(device, request, param)
bool handleInputResponse(device, cbtag, cbdata, response)
inline void setAppIndexRefLookup(cbfn, cbdata)
Private Properties
Private Methods
const XMLData& getCBData() const
void drawEditorViewText(device, tag, text)
string getBlockLabel(sectionNo)
int getBlockFirstLine(blockLabel)
void addUserBlock(blockLabel, sub, title, table)
void drawEditorTopLine(device, depth, heading, block_label, veryTop, redraw)
void drawEditorTextBlock(device, text, block_label, redraw)
void drawEditorBottomLine(device, depth, block_label, redraw)

#include <WikiDocEditor.h >

Super class: WikiDocument

Summary

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.

Public Methods

WikiDocEditor(state)

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.

WikiDocEditor(wikidoc)

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.

void clear()

Reset the wiki document editor back to defaults and clear any content.

inline bool valid() const

Determine if the current session is valid.

A session is valid if it has a name.

Return value: true if the session is valid

const HashArray& getEditState() const

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

const string getSessionName() const

Get the session name (string) of this wiki editor instance.

Return value: a string with the session name

XMLData getCallbackRef() const

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

bool isSimpleLayout() const

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

bool isBlockLayout() const

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

bool isOutlineMode() const

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

bool isFullMode() const

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

bool isViewSource() const

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

bool isViewFormatted() const

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

const string getTopHeading() const

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

const bool getEditHeadings() const

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

const bool getEditSubHeadings() const

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

const bool getAddSubHeadings() const

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

const bool getEditHeadingBlock() const

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

const bool getAddSubSubHeadings() const

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

const bool getIncludeSubContent() const

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

const bool getExcludeSubContent() const

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

const bool getAddTables() const

Get the

string getTermHeading() const

Get the

string getTermSubHeading() const

Get the

string getTermSubSubHeading() const

Get the

string getTermTable() const

Get the

const string getBlockShowing() const

Get the

const string getBlockEditing() const

Get the

const string getSubBlockEditing() const

Get the

const string getFrameTag() const

Get the

const bool isReadOnly() const

Get the

const bool isReadWrite() const

Get the

const string getEditText() const

Get the

int getIndexRefAssistCharDepth() const

Get the

const string getIndexRefAssistAllowedNonAlphanumerics() const

Get the

WikiDocEditor& setEditState(newEditState)

const HashArray& newEditState


basic SET methods

WikiDocEditor& setSessionName(name)

const string& name


used for tag names, etc.

WikiDocEditor& setCallbackRef(cbref)

const string& cbref


app uses to find right WikiDocEditor instance

WikiDocEditor& setSimpleLayout()

WikiDocEditor& setBlockLayout()

WikiDocEditor& setOutlineMode()

WikiDocEditor& setFullMode()

WikiDocEditor& setViewSource()

WikiDocEditor& setViewFormatted()

WikiDocEditor& setTopHeading(topHeading)

const string& topHeading


WikiDocEditor& setEditHeadings(allow)

bool allow

Default value: true


WikiDocEditor& setEditSubHeadings(allow)

bool allow

Default value: true


WikiDocEditor& setEditHeadingBlock(allow)

bool allow

Default value: true


WikiDocEditor& setAddSubHeadings(allow)

bool allow

Default value: true


WikiDocEditor& setAddSubSubHeadings(allow)

bool allow

Default value: true


WikiDocEditor& setIncludeSubBlocks()

WikiDocEditor& setExcludeSubBlocks(exclude)

bool exclude


WikiDocEditor& setAddTables(allow)

bool allow

Default value: true


WikiDocEditor& setTermHeading(term)

const string& term


WikiDocEditor& setTermSubHeading(term)

const string& term


WikiDocEditor& setTermSubSubHeading(term)

const string& term


WikiDocEditor& setTermTable(term)

const string& term


WikiDocEditor& setBlockShowing(heading)

const string& heading


WikiDocEditor& setBlockEditing(heading)

const string& heading


WikiDocEditor& setSubBlockEditing(subheading)

const string& subheading


WikiDocEditor& setFrameTag(frametag)

const string& frametag


WikiDocEditor& setReadOnly(readOnly)

bool readOnly

Default value: true


WikiDocEditor& setReadWrite()

WikiDocEditor& setIndexRefAssistCharDepth(depth)

int depth

Default value: 30


WikiDocEditor& setIndexRefAssistAllowedNonAlphanumerics(allowed)

const string& allowed

Default value: ".- '"


string getWikiRefText(starttext)

const string& starttext


inline string getWikiRefText()

void drawEditorSimple(device)

UserDevice& device


handling interaction from the user

void drawEditorBlock(device)

UserDevice& device


void drawEditor(device)

UserDevice& device


static bool isWikiDocEditorMessage(request)

const string& request


static bool isWikiDocEditorResponse(request)

const string& request


bool handleMessage(device, request, param)

UserDevice& device

const string& request

const XMLData& param


bool handleInputResponse(device, cbtag, cbdata, response)

UserDevice& device

string cbtag

const XMLData& cbdata

string response


inline void setAppIndexRefLookup(cbfn, cbdata)

appIndexRefLookupFN cbfn

void* cbdata


Private Properties

XMLData editState

static string rootTag

static appIndexRefLookupFN appIndexRefLookupCBFN

static void* appIndexRefLookupCBData


Private Methods

const XMLData& getCBData() const

void drawEditorViewText(device, tag, text)

UserDevice& device

const string& tag

const string& text


string getBlockLabel(sectionNo)

const vector <int >& sectionNo


int getBlockFirstLine(blockLabel)

const string& blockLabel


void addUserBlock(blockLabel, sub, title, table)

const string& blockLabel

bool sub

const string& title

bool table

Default value: false


void drawEditorTopLine(device, depth, heading, block_label, veryTop, redraw)

UserDevice& device

int depth

const string& heading

const string& block_label

bool veryTop

Default value: false

bool redraw

Default value: false


void drawEditorTextBlock(device, text, block_label, redraw)

UserDevice& device

const string& text

const string& block_label

bool redraw

Default value: false


void drawEditorBottomLine(device, depth, block_label, redraw)

UserDevice& device

int depth

const string& block_label

bool redraw

Default value: false