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

kdevelop/kdevplatform/interfaces

  • extragear
  • kdevelop
  • kdevelop
  • kdevplatform
  • interfaces
iassistant.h
Go to the documentation of this file.
1 /*
2  Copyright 2009 David Nolden <[email protected]>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License version 2 as published by the Free Software Foundation.
7 
8  This library is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  Library General Public License for more details.
12 
13  You should have received a copy of the GNU Library General Public License
14  along with this library; see the file COPYING.LIB. If not, write to
15  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  Boston, MA 02110-1301, USA.
17 */
18 
19 #ifndef KDEVPLATFORM_IASSISTANT_H
20 #define KDEVPLATFORM_IASSISTANT_H
21 
22 #include <QIcon>
23 #include <QExplicitlySharedDataPointer>
24 #include "interfacesexport.h"
25 #include <util/ksharedobject.h>
26 
27 class QAction;
28 
29 namespace KDevelop {
30 
33 class KDEVPLATFORMINTERFACES_EXPORT IAssistantAction : public QObject, public KSharedObject
34 {
35  Q_OBJECT
36 public:
37  IAssistantAction();
38 
39  using Ptr = QExplicitlySharedDataPointer<IAssistantAction>;
40 
41  ~IAssistantAction() override;
42 
45  virtual QAction* toQAction(QObject* parent = nullptr) const;
46 
50  virtual QString description() const = 0;
53  virtual QString toolTip() const;
56  virtual QIcon icon() const;
57 
58 public Q_SLOTS:
64  virtual void execute() = 0;
65 
66 Q_SIGNALS:
70  void executed(IAssistantAction* action);
71 };
72 
76 class KDEVPLATFORMINTERFACES_EXPORT AssistantLabelAction : public IAssistantAction
77 {
78  Q_OBJECT
79 public:
83  explicit AssistantLabelAction(const QString& description);
87  QString description() const override;
91  void execute() override;
95  QAction* toQAction(QObject* parent = nullptr) const override;
96 
97 private:
98  QString m_description;
99 };
100 
103 class KDEVPLATFORMINTERFACES_EXPORT IAssistant : public QObject, public KSharedObject
104 {
105  Q_OBJECT
106 public:
107  IAssistant();
108  ~IAssistant() override;
109 
110  using Ptr = QExplicitlySharedDataPointer<IAssistant>;
111 
113  QList<IAssistantAction::Ptr> actions() const;
114 
119  virtual void createActions();
120 
123  virtual void addAction(const IAssistantAction::Ptr& action);
124 
127  virtual void clearActions();
128 
130  virtual QIcon icon() const;
131 
135  virtual QString title() const;
136 public Q_SLOTS:
138  virtual void doHide();
139 Q_SIGNALS:
141  void hide();
143  void actionsChanged();
144 private:
145  QList<IAssistantAction::Ptr> m_actions;
146 };
147 
148 }
149 
150 #endif // KDEVPLATFORM_IASSISTANT_H
KDevelop::AssistantLabelAction
A fake action that only shows a label.
Definition: iassistant.h:76
KDevelop::IAssistant
Represents a single assistant popup.
Definition: iassistant.h:103
QObject
KSharedObject
QString
QList
Definition: context.h:40
QAction
KDevelop::IAssistantAction
Represents a single assistant action.
Definition: iassistant.h:33
QExplicitlySharedDataPointer
QIcon
This file is part of the KDE documentation.
Documentation copyright © 1996-2019 The KDE developers.
Generated on Sat Dec 7 2019 04:27:27 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kdevelop/kdevplatform/interfaces

Skip menu "kdevelop/kdevplatform/interfaces"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • 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