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

Plasma

  • sources
  • kde-4.12
  • kdelibs
  • plasma
abstracttoolbox.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008 by Marco Martin <notmart@gmail.com>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Library General Public License as
6  * published by the Free Software Foundation; either version 2, or
7  * (at your option) any later version.
8 
9  * This program 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
12  * GNU General Public License for more details
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this program; if not, write to the
16  * Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  */
19 
20 #ifndef PLASMA_ABSTRACTTOOLBOX_H
21 #define PLASMA_ABSTRACTTOOLBOX_H
22 
23 #include <QGraphicsWidget>
24 #include <QGraphicsItem>
25 
26 #include <kplugininfo.h>
27 
28 #include "plasma/plasma_export.h"
29 
30 class QAction;
31 
32 class KConfigGroup;
33 
34 namespace Plasma
35 {
36 
37 class AbstractToolBoxPrivate;
38 class Containment;
39 
40 class PLASMA_EXPORT AbstractToolBox : public QGraphicsWidget
41 {
42  Q_OBJECT
43  Q_INTERFACES(QGraphicsItem)
44  Q_PROPERTY(bool showing READ isShowing WRITE setShowing)
45 
46 public:
47  enum ToolType {
48  AddTool = 0,
49  ConfigureTool = 100,
50  ControlTool = 200,
51  MiscTool = 300,
52  DestructiveTool = 400,
53  UserToolType = DestructiveTool + 1000
54  };
55  Q_ENUMS(ToolType)
56 
57  explicit AbstractToolBox(Containment *parent);
58  explicit AbstractToolBox(QObject *parent = 0,
59  const QVariantList &args = QVariantList());
60  ~AbstractToolBox();
61 
69  static AbstractToolBox *load(const QString &name, const QVariantList &args=QVariantList(), Plasma::Containment *containment=0);
70 
82  static KPluginInfo::List listToolBoxInfo(const QString
83  &parentApp = QString());
84 
89  virtual void addTool(QAction *action) = 0;
90 
94  virtual void removeTool(QAction *action) = 0;
95 
99  virtual bool isShowing() const = 0;
100 
104  virtual void setShowing(const bool show) = 0;
105 
106 public Q_SLOTS:
107  //FIXME for KDE5: those should become virtuals
113  void restore(const KConfigGroup &group);
114 
120  void save(const KConfigGroup &group);
121 
127  void reposition();
128 
129 Q_SIGNALS:
133  void toggled();
134 
139  void visibilityChanged(bool open);
140 
141 protected:
142  Containment *containment() const;
143 
144 private:
145  AbstractToolBoxPrivate * const d;
146 
147 };
148 
149 } // Plasma namespace
150 
154 #define K_EXPORT_PLASMA_TOOLBOX(libname, classname) \
155 K_PLUGIN_FACTORY(factory, registerPlugin<classname>();) \
156 K_EXPORT_PLUGIN(factory("plasma_toolbox_" #libname)) \
157 K_EXPORT_PLUGIN_VERSION(PLASMA_VERSION)
158 
159 #endif // multiple inclusion guard
160 
QObject
Plasma::AbstractToolBox
Definition: abstracttoolbox.h:40
Plasma::AbstractToolBox::ToolType
ToolType
Definition: abstracttoolbox.h:47
Plasma::Containment
The base class for plugins that provide backgrounds and applet grouping containers.
Definition: containment.h:72
plasma_export.h
QGraphicsWidget
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:32 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Plasma

Skip menu "Plasma"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

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