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

Plasma

  • 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
30class QAction;
31
32class KConfigGroup;
33
34namespace Plasma
35{
36
37class AbstractToolBoxPrivate;
38class Containment;
39
40class PLASMA_EXPORT AbstractToolBox : public QGraphicsWidget
41{
42 Q_OBJECT
43 Q_INTERFACES(QGraphicsItem)
44 Q_PROPERTY(bool showing READ isShowing WRITE setShowing)
45
46public:
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
106public 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
129Q_SIGNALS:
133 void toggled();
134
139 void visibilityChanged(bool open);
140
141protected:
142 Containment *containment() const;
143
144private:
145 AbstractToolBoxPrivate * const d;
146
147};
148
149} // Plasma namespace
150
154#define K_EXPORT_PLASMA_TOOLBOX(libname, classname) \
155K_PLUGIN_FACTORY(factory, registerPlugin<classname>();) \
156K_EXPORT_PLUGIN(factory("plasma_toolbox_" #libname)) \
157K_EXPORT_PLUGIN_VERSION(PLASMA_VERSION)
158
159#endif // multiple inclusion guard
160
Plasma::AbstractToolBox
Definition: abstracttoolbox.h:41
Plasma::AbstractToolBox::visibilityChanged
void visibilityChanged(bool open)
Toolbox opened or closed.
Plasma::AbstractToolBox::removeTool
virtual void removeTool(QAction *action)=0
remove the tool associated with this action
Plasma::AbstractToolBox::ToolType
ToolType
Definition: abstracttoolbox.h:47
Plasma::AbstractToolBox::setShowing
virtual void setShowing(const bool show)=0
Opens or closes the ToolBox.
Plasma::AbstractToolBox::addTool
virtual void addTool(QAction *action)=0
create a toolbox tool from the given action action the action to associate the tool with
Plasma::AbstractToolBox::isShowing
virtual bool isShowing() const =0
Plasma::AbstractToolBox::toggled
void toggled()
Toolbox opened or closed.
Plasma::Containment
The base class for plugins that provide backgrounds and applet grouping containers.
Definition: containment.h:73
QGraphicsWidget
QObject
Plasma
Namespace for everything in libplasma.
Definition: abstractdialogmanager.cpp:25
plasma_export.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 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-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 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
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
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