• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdevelop API Reference
  • KDE Home
  • Contact Us
 

kdevplatform/documentation

  • sources
  • kfour-appscomplete
  • kdevelop
  • kdevplatform
  • documentation
documentationview.h
Go to the documentation of this file.
1 /*
2  Copyright 2009 Aleix Pol Gonzalez <[email protected]>
3  Copyright 2010 Benjamin Port <[email protected]>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License version 2 as published by the Free Software Foundation.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 #ifndef KDEVPLATFORM_DOCUMENTATIONVIEW_H
21 #define KDEVPLATFORM_DOCUMENTATIONVIEW_H
22 
23 #include <QWidget>
24 #include <QAbstractListModel>
25 #include <interfaces/idocumentation.h>
26 #include "documentationexport.h"
27 
28 namespace KDevelop {
29  class IPlugin;
30  class DocumentationFindWidget;
31 }
32 
33 class QModelIndex;
34 class QLineEdit;
35 class ProvidersModel;
36 class QComboBox;
37 
38 class KDEVPLATFORMDOCUMENTATION_EXPORT DocumentationView : public QWidget
39 {
40  Q_OBJECT
41 public:
42  DocumentationView(QWidget* parent, ProvidersModel* m);
43 
44 public:
45  QList<QAction*> contextMenuActions() const;
46 
47 public Q_SLOTS:
48  void initialize();
49 
50  void showDocumentation(const KDevelop::IDocumentation::Ptr& doc);
51  void emptyHistory();
52 
53  void tryBrowseForward();
54  void tryBrowseBack();
55  void browseForward();
56  void browseBack();
57  void changedSelection(const QModelIndex& idx);
58  void changedProvider(int);
59  void showHome();
60 
61 private:
62  void mousePressEvent(QMouseEvent* event) override;
63  void setupActions();
64  void updateView();
65  void returnPressed();
66 
67  QAction* mForward;
68  QAction* mBack;
69  QAction* mHomeAction;
70  QAction* mSeparatorBeforeFind;
71  QAction* mFind;
72  QLineEdit* mIdentifiers;
73  QList< KDevelop::IDocumentation::Ptr > mHistory;
74  QList< KDevelop::IDocumentation::Ptr >::iterator mCurrent;
75  QComboBox* mProviders;
76  ProvidersModel* mProvidersModel;
77  KDevelop::DocumentationFindWidget* mFindDoc;
78 };
79 
80 class KDEVPLATFORMDOCUMENTATION_EXPORT ProvidersModel : public QAbstractListModel
81 {
82  Q_OBJECT
83 public:
84  explicit ProvidersModel(QObject* parent = nullptr);
85 
86  QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
87  int rowCount(const QModelIndex& idx = QModelIndex()) const override;
88  QList<KDevelop::IDocumentationProvider*> providers();
89  KDevelop::IDocumentationProvider* provider(int pos) const;
90  int rowForProvider(KDevelop::IDocumentationProvider* provider);
91 
92 public Q_SLOTS:
93  void unloaded(KDevelop::IPlugin* p);
94  void loaded(KDevelop::IPlugin* p);
95  void reloadProviders();
96 
97 private:
98  void addProvider(KDevelop::IDocumentationProvider* provider);
99  void removeProvider(KDevelop::IDocumentationProvider* provider);
100 
101  QList<KDevelop::IDocumentationProvider*> mProviders;
102 Q_SIGNALS:
103  void providersChanged();
104 };
105 
106 #endif // KDEVPLATFORM_DOCUMENTATIONVIEW_H
QAbstractItemModel::rowCount
virtual int rowCount(const QModelIndex &parent) const=0
QLineEdit
QAbstractItemModel::data
virtual QVariant data(const QModelIndex &index, int role) const=0
QWidget
QAbstractListModel
QList
QMouseEvent
QComboBox
QObject
ProvidersModel
Definition: documentationview.h:80
QAction
KDevelop
Definition: documentationfindwidget.h:28
QModelIndex
KDevelop::DocumentationFindWidget
Definition: documentationfindwidget.h:31
QVariant
DocumentationView
Definition: documentationview.h:38
QWidget::mousePressEvent
virtual void mousePressEvent(QMouseEvent *event)
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Jan 23 2021 09:40:24 by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kdevplatform/documentation

Skip menu "kdevplatform/documentation"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Related Pages

kdevelop API Reference

Skip menu "kdevelop API Reference"
  • kdevplatform
  •   debugger
  •   documentation
  •   interfaces
  •   language
  •     assistant
  •     backgroundparser
  •     checks
  •     classmodel
  •     codecompletion
  •     codegen
  •     duchain
  •     editor
  •     highlighting
  •     interfaces
  •     util
  •   outputview
  •   project
  •   serialization
  •   shell
  •   sublime
  •   tests
  •   util
  •   vcs

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal