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
#define BALL_EMBEDDABLE(TYPE, BASE)
Definition: embeddable.h:31
StringHashMap< String > classes_to_files_
Definition: helpViewer.h:168
HashMap< const QObject *, String > docu_entries_
Definition: helpViewer.h:167
#define BALL_VIEW_EXPORT
Definition: COMMON/global.h:52
void setProject(const String &project)
Definition: helpViewer.h:102
void setWhatsThisEnabled(bool state)
Definition: helpViewer.h:132
Definition: constants.h:12
#define BALL_DEPRECATED
Definition: COMMON/global.h:64
bool isWhatsThisEnabled() const
Definition: helpViewer.h:135
String getProject() const
Definition: helpViewer.h:105
MyTextBrowser * browser_
Definition: helpViewer.h:161