Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / workspace / libs / plasma / view.h
blobc65a573f72662b3b91b99d76611b668d10be7a3d
1 /*
2 * Copyright 2007 Aaron Seigo <aseigo@kde.org>
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.
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
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.
20 #ifndef VIEW_H
21 #define VIEW_H
23 #include <QtGui/QGraphicsView>
25 #include <plasma/plasma_export.h>
27 namespace Plasma
30 class Containment;
31 class Corona;
33 /**
34 * @short A QGraphicsView for Plasma::Applets
36 class PLASMA_EXPORT View : public QGraphicsView
38 Q_OBJECT
40 public:
41 View(int screen, Corona *corona, QWidget *parent = 0);
42 explicit View(Containment *containment, QWidget *parent = 0);
43 ~View();
45 /**
46 * Sets whether or not to draw the containment wallpaper when painting
47 * on this item
49 void setDrawWallpaper(bool draw);
51 /**
52 * @return whether or not containments should draw wallpaper
54 bool drawWallpaper() const;
56 /**
57 * Sets which screen this view is associated with, if any.
58 * This will also set the containment if a valid screen is specified
60 * @arg screen the xinerama screen number; -1 for no screen
62 void setScreen(int screen);
64 /**
65 * Returns the screen this view is associated with
67 * @return the xinerama screen number, or -1 for none
69 int screen() const;
71 /**
72 * Sets which virtual desktop this view is asociated with, if any.
74 * @arg desktop a valid desktop number, -1 for all desktops, less than -1 for none
76 void setDesktop(int desktop);
78 /**
79 * The virtual desktop this view is associated with
81 * @return the desktop number, -1 for all desktops and less than -1 for none
83 int desktop() const;
85 /**
86 * The virtual desktop this view is actually being viewed on
88 * @return the desktop number (always valid, never < 0)
90 int effectiveDesktop() const;
92 /**
93 * Sets the containment for this view, which will also cause the view
94 * to track the geometry of the containment.
96 * @arg containment the containment to center the view on
98 void setContainment(Containment *containment);
101 * @return the containment associated with this view, or 0 if none is
103 Containment* containment() const;
105 protected Q_SLOTS:
106 void updateSceneRect();
108 private:
109 void initGraphicsView();
111 class Private;
112 Private * const d;
115 } // namespace Plasma
117 #endif