BALL  1.5.0
helpViewer.h
Go to the documentation of this file.
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4 // $Id: helpViewer.h,v 1.2.18.1 2007/03/25 21:26:21 oliver Exp $
5 //
6 
7 #ifndef BALL_VIEW_WIDGETS_HELPVIEWER_H
8 #define BALL_VIEW_WIDGETS_HELPVIEWER_H
9 
10 #ifndef BALL_VIEW_WIDGETS_DOCKWIDGET_H
12 #endif
13 
14 #include <QtWidgets/QTextBrowser>
15 
16 namespace BALL
17 {
18  namespace VIEW
19  {
20 
25  : public QTextBrowser
26  {
27  Q_OBJECT
28 
29  public:
30 
31  MyTextBrowser(QWidget* parent, const char* name = 0);
32 
33  protected:
34 
35  bool forward_, backward_;
36  };
37 
63  : public DockWidget
64  {
65  Q_OBJECT
66 
67  public:
68 
70 
71 
72  HelpViewer(QWidget* parent, const char* name = 0);
73 
75  virtual ~HelpViewer();
76 
79  virtual void initializeWidget(MainControl& main_control);
80 
87  virtual void onNotify(Message *message);
88 
90  virtual void showHelp(const String& URL);
91 
93  virtual void showHelp(const String& URL, String entry);
94 
96  void setDefaultPage(const String& url);
97 
99  const String& getDefaultPage() const;
100 
102  void setProject(const String& project) { project_ = project;}
103 
105  String getProject() const { return project_;}
106 
108  void setBaseDirectory(const String& dir);
109 
111  const String& getBaseDirectory() const;
112 
114  virtual void registerForHelpSystem(const QObject* object, const String& docu_entry);
115 
117  void unregisterForHelpSystem(const QObject* object);
118 
120  bool showHelpFor(const QObject* object);
121 
124 
126  bool hasHelpFor(const QObject* object) const;
127 
129  String getHelpEntryFor(const QObject* object) const;
130 
132  void setWhatsThisEnabled(bool state) { whats_this_ = state;}
133 
135  bool isWhatsThisEnabled() const {return whats_this_;}
136 
138  void showDocumentationFor(const String& classname, const String& member);
139 
140  public Q_SLOTS:
141 
143  virtual void showHelp();
144 
147 
150 
152  bool eventFilter(QObject* obj, QEvent* e);
153 
154  protected:
155 
157 
165  QAction* whats_action_;
166 
169  };
170 
171 } } // namespaces
172 
173 #endif // BALL_VIEW_WIDGETS_HELPVIEWER_H
BALL::VIEW::HelpViewer::whats_this_mode_
bool whats_this_mode_
Definition: helpViewer.h:162
BALL::VIEW::MyTextBrowser::forward_
bool forward_
Definition: helpViewer.h:35
BALL::VIEW::MyTextBrowser
Definition: helpViewer.h:26
BALL::VIEW::HelpViewer::getHelpEntryFor
String getHelpEntryFor(const QObject *object) const
Get help entry for widget.
BALL::VIEW::HelpViewer::showHelp
virtual void showHelp()
Show default page.
BALL::HashMap< const QObject *, String >
QEvent
BALL::VIEW::HelpViewer::base_dir_
String base_dir_
Definition: helpViewer.h:160
BALL::VIEW::Message
Definition: message.h:53
BALL::VIEW::HelpViewer::ignore_event_
bool ignore_event_
Definition: helpViewer.h:163
BALL::VIEW::HelpViewer::default_page_
String default_page_
Definition: helpViewer.h:159
BALL::VIEW::HelpViewer::showHelpFor
bool showHelpFor(const QObject *object)
Show the documentation entry for a given widget.
dockWidget.h
BALL::VIEW::HelpViewer::setWhatsThisEnabled
void setWhatsThisEnabled(bool state)
Definition: helpViewer.h:132
BALL::VIEW::HelpViewer::whats_action_
QAction * whats_action_
Definition: helpViewer.h:165
BALL::VIEW::HelpViewer::getProject
String getProject() const
Definition: helpViewer.h:105
BALL::String
Definition: string.h:57
BALL_EMBEDDABLE
#define BALL_EMBEDDABLE(TYPE, BASE)
Definition: embeddable.h:31
BALL::VIEW::MainControl
Definition: mainControl.h:118
BALL::VIEW::HelpViewer::whats_this_
bool whats_this_
Definition: helpViewer.h:164
BALL
Definition: constants.h:13
QWidget
BALL::VIEW::HelpViewer::enterWhatsThisMode
void enterWhatsThisMode()
BALL::VIEW::HelpViewer
Definition: helpViewer.h:64
BALL::VIEW::HelpViewer::eventFilter
bool eventFilter(QObject *obj, QEvent *e)
Event filter for the whats this mode.
BALL::VIEW::HelpViewer::browser_
MyTextBrowser * browser_
Definition: helpViewer.h:161
BALL::VIEW::HelpViewer::showDocumentationForObject
bool showDocumentationForObject()
Show documentation for object under cursor.
BALL::StringHashMap< String >
BALL::VIEW::HelpViewer::classes_to_files_
StringHashMap< String > classes_to_files_
Definition: helpViewer.h:168
BALL::VIEW::HelpViewer::unregisterForHelpSystem
void unregisterForHelpSystem(const QObject *object)
Unregister a widget for showing its documentation.
BALL_VIEW_EXPORT
#define BALL_VIEW_EXPORT
Definition: COMMON/global.h:52
BALL::VIEW::HelpViewer::project_
String project_
Definition: helpViewer.h:158
BALL::VIEW::HelpViewer::collectClasses_
void collectClasses_()
BALL::VIEW::HelpViewer::setBaseDirectory
void setBaseDirectory(const String &dir)
BALL::VIEW::HelpViewer::getBaseDirectory
const String & getBaseDirectory() const
BALL::VIEW::HelpViewer::docu_entries_
HashMap< const QObject *, String > docu_entries_
Definition: helpViewer.h:167
BALL::VIEW::HelpViewer::isWhatsThisEnabled
bool isWhatsThisEnabled() const
Definition: helpViewer.h:135
QTextBrowser
BALL::VIEW::DockWidget
Definition: dockWidget.h:28
BALL::VIEW::HelpViewer::exitWhatsThisMode
void exitWhatsThisMode()
BALL::VIEW::HelpViewer::registerForHelpSystem
virtual void registerForHelpSystem(const QObject *object, const String &docu_entry)
Register a widget for showing its documentation.
BALL::VIEW::HelpViewer::hasHelpFor
bool hasHelpFor(const QObject *object) const
Check wheter we have a documentation entry for a given object.
QObject
BALL::VIEW::HelpViewer::showDocumentationFor
void showDocumentationFor(const String &classname, const String &member)
BALL::VIEW::MyTextBrowser::MyTextBrowser
MyTextBrowser(QWidget *parent, const char *name=0)
BALL_DEPRECATED
#define BALL_DEPRECATED
Definition: COMMON/global.h:64