2008-04-30 23:50:43 +02:00
|
|
|
/*
|
|
|
|
* Copyright 2005 by Aaron Seigo <aseigo@kde.org>
|
|
|
|
* Copyright 2007 by Riccardo Iaconelli <riccardo@kde.org>
|
|
|
|
* Copyright 2008 by Ménard Alexis <darktears31@gmail.com>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Library General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this program; if not, write to the
|
|
|
|
* Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef PLASMA_APPLET_P_H
|
|
|
|
#define PLASMA_APPLET_P_H
|
|
|
|
|
2008-05-17 05:39:24 +02:00
|
|
|
#include <KActionCollection>
|
|
|
|
|
2008-04-30 23:50:43 +02:00
|
|
|
namespace Plasma
|
|
|
|
{
|
|
|
|
|
|
|
|
class PanelSvg;
|
|
|
|
class AppletScript;
|
|
|
|
class ShadowItem;
|
|
|
|
|
|
|
|
class AppletOverlayWidget : public QGraphicsWidget
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
AppletOverlayWidget(QGraphicsWidget *parent);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
|
|
|
|
};
|
|
|
|
|
|
|
|
class Applet::Private
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Private(KService::Ptr service, int uniqueID, Applet *applet);
|
|
|
|
~Private();
|
|
|
|
|
|
|
|
void init();
|
|
|
|
|
|
|
|
// put all setup routines for script here. at this point we can assume that
|
|
|
|
// package exists and that we have a script engin
|
|
|
|
void setupScriptSupport();
|
|
|
|
|
|
|
|
QString globalName() const;
|
|
|
|
QString instanceName();
|
|
|
|
void scheduleConstraintsUpdate(Plasma::Constraints c);
|
|
|
|
KConfigGroup* mainConfigGroup();
|
|
|
|
void copyEntries(KConfigGroup *source, KConfigGroup *destination);
|
|
|
|
QString visibleFailureText(const QString& reason);
|
|
|
|
void checkImmutability();
|
|
|
|
void themeChanged();
|
2008-05-01 05:24:20 +02:00
|
|
|
void resetConfigurationObject();
|
2008-05-09 06:43:21 +02:00
|
|
|
void appletAnimationComplete(QGraphicsItem *item, Plasma::Animator::Animation anim);
|
2008-06-01 04:13:53 +02:00
|
|
|
void setFocus();
|
2008-06-04 21:04:34 +02:00
|
|
|
void cleanUpAndDelete();
|
2008-04-30 23:50:43 +02:00
|
|
|
|
|
|
|
static uint s_maxAppletId;
|
|
|
|
static uint s_maxZValue;
|
|
|
|
static uint s_minZValue;
|
|
|
|
static PackageStructure::Ptr packageStructure;
|
|
|
|
|
|
|
|
//TODO: examine the usage of memory here; there's a pretty large
|
|
|
|
// number of members at this point.
|
|
|
|
uint appletId;
|
|
|
|
Applet *q;
|
|
|
|
BackgroundHints backgroundHints;
|
|
|
|
KPluginInfo appletDescription;
|
|
|
|
Package* package;
|
|
|
|
AppletOverlayWidget *needsConfigOverlay;
|
|
|
|
QList<QGraphicsItem*> registeredAsDragHandle;
|
|
|
|
QStringList loadedEngines;
|
|
|
|
Plasma::PanelSvg *background;
|
|
|
|
//Plasma::LineEdit *failureText;
|
|
|
|
AppletScript *script;
|
|
|
|
ConfigXml* configXml;
|
|
|
|
ShadowItem* shadow;
|
|
|
|
KConfigGroup *mainConfig;
|
|
|
|
Plasma::Constraints pendingConstraints;
|
2008-05-01 00:10:22 +02:00
|
|
|
Plasma::AspectRatioMode aspectRatioMode;
|
2008-05-11 15:56:35 +02:00
|
|
|
QGraphicsView* ghostView;
|
2008-04-30 23:50:43 +02:00
|
|
|
ImmutabilityType immutability;
|
2008-05-17 05:39:24 +02:00
|
|
|
KActionCollection actions;
|
2008-06-01 04:13:53 +02:00
|
|
|
KAction *activationAction;
|
2008-05-09 01:30:56 +02:00
|
|
|
int constraintsTimerId;
|
2008-04-30 23:50:43 +02:00
|
|
|
bool hasConfigurationInterface : 1;
|
|
|
|
bool failed : 1;
|
|
|
|
bool isContainment : 1;
|
|
|
|
bool square : 1;
|
|
|
|
bool transient : 1;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // Plasma namespace
|
|
|
|
|
|
|
|
#endif
|