~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to plasma/generic/scriptengines/google_gadgets/ggl_applet_script.h

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
  Copyright 2008 Google Inc.
 
3
 
 
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
 
7
 
 
8
       http://www.apache.org/licenses/LICENSE-2.0
 
9
 
 
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.
 
15
*/
 
16
 
 
17
#ifndef GGADGET_GGL_APPLET_SCRIPT_H__
 
18
#define GGADGET_GGL_APPLET_SCRIPT_H__
 
19
 
 
20
#include <Plasma/AppletScript>
 
21
 
 
22
namespace ggadget {
 
23
  class Gadget;
 
24
  class PlasmaHost;
 
25
  class DecoratedViewHost;
 
26
  class ViewHostInterface;
 
27
  namespace qt {
 
28
    class QtViewWidget;
 
29
  }
 
30
}
 
31
 
 
32
namespace Plasma {
 
33
  class Applet;
 
34
}
 
35
class QGraphicsProxyWidget;
 
36
 
 
37
class GadgetInfo {
 
38
 public:
 
39
  GadgetInfo()
 
40
      : host(NULL),
 
41
        gadget(NULL),
 
42
        applet(NULL),
 
43
        script(NULL),
 
44
        proxy(NULL),
 
45
        main_view_widget(NULL),
 
46
        main_view_host(NULL),
 
47
        expanded_main_view_host(NULL),
 
48
        details_view_host(NULL),
 
49
        options_view_host(NULL),
 
50
        view_debug_mode(0),
 
51
        location(Plasma::Floating)
 
52
  {}
 
53
  ggadget::PlasmaHost *host;
 
54
  ggadget::Gadget *gadget;
 
55
  Plasma::Applet *applet;
 
56
  Plasma::AppletScript *script;
 
57
  QGraphicsProxyWidget *proxy;
 
58
  ggadget::qt::QtViewWidget *main_view_widget;
 
59
  ggadget::DecoratedViewHost *main_view_host;
 
60
  ggadget::ViewHostInterface *expanded_main_view_host;
 
61
  ggadget::ViewHostInterface *details_view_host;
 
62
  ggadget::ViewHostInterface *options_view_host;
 
63
  int view_debug_mode;
 
64
  Plasma::Location location;
 
65
};
 
66
 
 
67
class GglAppletScript : public Plasma::AppletScript {
 
68
  Q_OBJECT
 
69
 public:
 
70
  GglAppletScript(QObject *parent, const QVariantList &args);
 
71
  virtual ~GglAppletScript();
 
72
 
 
73
  virtual bool init();
 
74
  virtual void constraintsEvent(Plasma::Constraints constraints);
 
75
  virtual void paintInterface(QPainter *painter,
 
76
                              const QStyleOptionGraphicsItem *option,
 
77
                              const QRect &contentsRect);
 
78
  virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
 
79
  virtual QList<QAction*> contextualActions();
 
80
 
 
81
 public Q_SLOTS:
 
82
  virtual void showConfigurationInterface();
 
83
 
 
84
 private Q_SLOTS:
 
85
  void loadGadget();
 
86
 
 
87
 private:
 
88
  class Private;
 
89
  Private *const d;
 
90
};
 
91
 
 
92
#endif