delay a few things on startup, such as setting the visibility mode, which ensures...
[personal-kdebase.git] / workspace / plasma / scriptengines / google_gadgets / ggl_applet_script.h
blobb5d9c17b12fc56e46efe4cb20363b8baa858f84a
1 /*
2 Copyright 2008 Google Inc.
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
8 http://www.apache.org/licenses/LICENSE-2.0
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
17 #ifndef GGADGET_GGL_APPLET_SCRIPT_H__
18 #define GGADGET_GGL_APPLET_SCRIPT_H__
20 #include <Plasma/AppletScript>
22 namespace ggadget {
23 class PlasmaHost;
24 class DecoratedViewHost;
25 class ViewHostInterface;
28 namespace Plasma {
29 class Applet;
32 class GadgetInfo {
33 public:
34 GadgetInfo()
35 : host(NULL),
36 gadget(NULL),
37 applet(NULL),
38 script(NULL),
39 widget(NULL),
40 main_view_host(NULL),
41 expanded_main_view_host(NULL),
42 details_view_host(NULL),
43 options_view_host(NULL),
44 view_debug_mode(0),
45 location(Plasma::Floating)
47 ggadget::PlasmaHost *host;
48 ggadget::Gadget *gadget;
49 Plasma::Applet *applet;
50 Plasma::AppletScript *script;
51 ggadget::qt::QtViewWidget *widget;
52 ggadget::DecoratedViewHost *main_view_host;
53 ggadget::ViewHostInterface *expanded_main_view_host;
54 ggadget::ViewHostInterface *details_view_host;
55 ggadget::ViewHostInterface *options_view_host;
56 int view_debug_mode;
57 Plasma::Location location;
60 class GglAppletScript : public Plasma::AppletScript {
61 Q_OBJECT
62 public:
63 GglAppletScript(QObject *parent, const QVariantList &args);
64 virtual ~GglAppletScript();
66 virtual bool init();
67 virtual void constraintsEvent(Plasma::Constraints constraints);
68 virtual void paintInterface(QPainter *painter,
69 const QStyleOptionGraphicsItem *option,
70 const QRect &contentsRect);
71 virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
72 virtual QList<QAction*> contextualActions();
74 public Q_SLOTS:
75 virtual void showConfigurationInterface();
77 private Q_SLOTS:
78 void loadGadget();
80 private:
81 class Private;
82 Private *const d;
85 #endif