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.
23 #include <QtGui/QGraphicsView>
25 #include <plasma/plasma_export.h>
34 * @short A QGraphicsView for Plasma::Applets
36 class PLASMA_EXPORT View
: public QGraphicsView
41 View(int screen
, Corona
*corona
, QWidget
*parent
= 0);
42 explicit View(Containment
*containment
, QWidget
*parent
= 0);
46 * Sets whether or not to draw the containment wallpaper when painting
49 void setDrawWallpaper(bool draw
);
52 * @return whether or not containments should draw wallpaper
54 bool drawWallpaper() const;
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
);
65 * Returns the screen this view is associated with
67 * @return the xinerama screen number, or -1 for none
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
);
79 * The virtual desktop this view is associated with
81 * @return the desktop number, -1 for all desktops and less than -1 for none
86 * The virtual desktop this view is actually being viewed on
88 * @return the desktop number (always valid, never < 0)
90 int effectiveDesktop() const;
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;
106 void updateSceneRect();
109 void initGraphicsView();
115 } // namespace Plasma