Developer Documentation

Public Slots | Signals | Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
HelpBrowser Class Reference

`#include <OpenFlipper/widgets/helpWidget/helpBrowser.hh>`

Inheritance diagram for HelpBrowser:

## Public Slots
void | open (const QString &_url)
void | open (const QUrl &_url, bool _skipSave=false)
| Opens a new url from the help system in the browser. More...
void | backward ()
| Show last page stored in the history. More...
void | forward ()
| Show next page stored in the history. More...

## Signals
void | historyChanged (const QUrl &)

## Public Member Functions
| HelpBrowser (QHelpEngine *_helpEngine, QWidget *parent=0)
| Constructor. More...
virtual | ~HelpBrowser ()
| Destructor.
QVariant | loadResource (int _type, const QUrl &_name)
| re implementation of the load resource function of the text browser More...
bool | isBackwardAvailable ()
| Checks if we visited other pages before. More...
bool | isForwardAvailable ()
| Checks if the back button was pressed and we can go forward to the next page. More...
QUrl | resolveUrl (const QUrl &_url)
| resolves relative urls to absolute More...

## Private Slots
void | rememberHistory (const QUrl &_url)
| Adds a new page to the history. More...

## Private Member Functions
QUrl | getCurrentDir (const QUrl &_url)
| Extract path from URL. More...
void | updateNameSpaceAndFolder (const QUrl &_url)
| updateNameSpaceAndFolder More...

## Private Attributes
QHelpEngine * | helpEngine_
| The help engine the widget is working on.
QList< QUrl > | visitedPages_
| History of the visited pages.
int | currentPage_
| Current position in the history.
QString | currentVirtualFolder_
| The currently active virtual folder. More...
QString | currentNameSpace_
| The currently active namespace. More...

## Detailed Description

This class implements OpenFlippers help browser. The QtHelp files are loaded at startup into the help engine which is passed to this widget.

Definition at line 56 of file helpBrowser.hh.

## Constructor & Destructor Documentation

## ◆ HelpBrowser()

HelpBrowser::HelpBrowser | ( | QHelpEngine * | _helpEngine,
|  | QWidget * | parent = `0`
| ) |  |

Constructor.

Sets up a new help widget which works on the given help engine

Parameters

  _helpEngine | QHelpEngine
  parent | Parent widget

Definition at line 46 of file helpBrowser.cc.

## Member Function Documentation

## ◆ backward

void HelpBrowser::backward | ( |  | ) |
| slot

Show last page stored in the history.

Definition at line 198 of file helpBrowser.cc.

## ◆ forward

void HelpBrowser::forward | ( |  | ) |
| slot

Show next page stored in the history.

Definition at line 207 of file helpBrowser.cc.

## ◆ getCurrentDir()

QUrl HelpBrowser::getCurrentDir | ( | const QUrl & | _url | ) |
| private

Extract path from URL.

Removes the filename part from the url and returns only the directory component

Parameters

  _url | Input url

Returns
  Path

Definition at line 174 of file helpBrowser.cc.

## ◆ isBackwardAvailable()

bool HelpBrowser::isBackwardAvailable | ( |  | ) |

Checks if we visited other pages before.

Returns
  Did we visit pages before to which we can jump back? (History)

Definition at line 193 of file helpBrowser.cc.

## ◆ isForwardAvailable()

bool HelpBrowser::isForwardAvailable | ( |  | ) |

Checks if the back button was pressed and we can go forward to the next page.

Returns
  is a page stored in the forward list?

Definition at line 188 of file helpBrowser.cc.

## ◆ loadResource()

QVariant HelpBrowser::loadResource | ( | int | _type,
|  | const QUrl & | _name
| ) |  |

re implementation of the load resource function of the text browser

This function loads a resource from the help system. It also handles jumping to another namespace via relative links in the url

Parameters

  _type | Ignored
  _name | A filename in the help system that should be loaded (image, html document)

Returns
  The loaded resource

Definition at line 128 of file helpBrowser.cc.

## ◆ open

void HelpBrowser::open | ( | const QUrl & | _url,
|  | bool | _skipSave = `false`
| ) |  |
| slot

Opens a new url from the help system in the browser.

Parameters

  _url | URL that should be opened
  _skipSave | Flag if the URL should be saved in the history

Definition at line 147 of file helpBrowser.cc.

## ◆ rememberHistory

void HelpBrowser::rememberHistory | ( | const QUrl & | _url | ) |
| private slot

Adds a new page to the history.

Parameters

  _url | URL of the new page

Definition at line 78 of file helpBrowser.cc.

## ◆ resolveUrl()

QUrl HelpBrowser::resolveUrl | ( | const QUrl & | _url | ) |

resolves relative urls to absolute

Parameters

  _url | relative URL which will be resolved

Returns
  absolute url

Definition at line 97 of file helpBrowser.cc.

## ◆ updateNameSpaceAndFolder()

void HelpBrowser::updateNameSpaceAndFolder | ( | const QUrl & | _url | ) |
| private

updateNameSpaceAndFolder

This function takes the url and extracts the virtual namespace and folder information which are stored in the variables. These variables are used to find the corresponding images.

Parameters

  _url | The url that should be analyzed

Definition at line 62 of file helpBrowser.cc.

## Member Data Documentation

## ◆ currentNameSpace_

QString HelpBrowser::currentNameSpace_
| private

The currently active namespace.

QT manages the different help files for the plugins with different name spaces. This variable will always hold the currently active one.

Definition at line 182 of file helpBrowser.hh.

## ◆ currentVirtualFolder_

QString HelpBrowser::currentVirtualFolder_
| private

The currently active virtual folder.

QT manages the different help files for the plugins in different virtual folders. This variable will always hold the currently active one.

Definition at line 175 of file helpBrowser.hh.

The documentation for this class was generated from the following files:

- OpenFlipper/widgets/helpWidget/helpBrowser.hh
- OpenFlipper/widgets/helpWidget/helpBrowser.cc