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 
123  bool showDocumentationForObject();
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 
146  void enterWhatsThisMode();
147 
149  void exitWhatsThisMode();
150 
152  bool eventFilter(QObject* obj, QEvent* e);
153 
154  protected:
155 
156  void collectClasses_();
157 
165  QAction* whats_action_;
166 
169  };
170 
171 } } // namespaces
172 
173 #endif // BALL_VIEW_WIDGETS_HELPVIEWER_H
BALL::VIEW::HelpViewer::getProject
String getProject() const
Definition: helpViewer.h:105
BALL_VIEW_EXPORT
#define BALL_VIEW_EXPORT
Definition: COMMON/global.h:52
BALL::VIEW::MyTextBrowser
Definition: helpViewer.h:24
BALL::VIEW::HelpViewer::ignore_event_
bool ignore_event_
Definition: helpViewer.h:163
BALL::VIEW::HelpViewer::default_page_
String default_page_
Definition: helpViewer.h:159
QWidget
BALL::HashMap< const QObject *, String >
BALL::StringHashMap< String >
dockWidget.h
BALL::VIEW::MyTextBrowser::forward_
bool forward_
Definition: helpViewer.h:35
BALL_EMBEDDABLE
#define BALL_EMBEDDABLE(TYPE, BASE)
Definition: embeddable.h:31
BALL::VIEW::HelpViewer::whats_this_mode_
bool whats_this_mode_
Definition: helpViewer.h:162
QObject
BALL::VIEW::DockWidget
Definition: dockWidget.h:25
BALL
Definition: constants.h:12
BALL::VIEW::HelpViewer::base_dir_
String base_dir_
Definition: helpViewer.h:160
BALL::String
Definition: string.h:56
BALL_DEPRECATED
#define BALL_DEPRECATED
Definition: COMMON/global.h:64
BALL::VIEW::HelpViewer::setProject
void setProject(const String &project)
Definition: helpViewer.h:102
BALL::VIEW::MainControl
Definition: mainControl.h:114
BALL::VIEW::HelpViewer::classes_to_files_
StringHashMap< String > classes_to_files_
Definition: helpViewer.h:168
BALL::VIEW::HelpViewer::project_
String project_
Definition: helpViewer.h:158
BALL::VIEW::HelpViewer::whats_action_
QAction * whats_action_
Definition: helpViewer.h:165
BALL::VIEW::HelpViewer::isWhatsThisEnabled
bool isWhatsThisEnabled() const
Definition: helpViewer.h:135
BALL::VIEW::HelpViewer::docu_entries_
HashMap< const QObject *, String > docu_entries_
Definition: helpViewer.h:167
BALL::VIEW::HelpViewer
Definition: helpViewer.h:62
BALL::VIEW::HelpViewer::whats_this_
bool whats_this_
Definition: helpViewer.h:164
QTextBrowser
BALL::VIEW::Message
Definition: message.h:52
BALL::VIEW::HelpViewer::setWhatsThisEnabled
void setWhatsThisEnabled(bool state)
Definition: helpViewer.h:132
BALL::VIEW::HelpViewer::browser_
MyTextBrowser * browser_
Definition: helpViewer.h:161
QEvent