add more spacing
[personal-kdebase.git] / workspace / plasma / shells / desktop / desktopview.h
blob1340c090b9d5c7bc7e28d55d8f793ef64587d89a
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 General Public License as
6 * published by the Free Software Foundation; either version 2,
7 * or (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 DESKTOPVIEW_H
21 #define DESKTOPVIEW_H
23 #include <Plasma/Plasma>
24 #include <Plasma/View>
26 namespace Plasma
28 class Containment;
29 } // namespace Plasma
31 namespace Kephal
33 class Screen;
34 } // namespace Kephal
36 class DashboardView;
38 class DesktopView : public Plasma::View
40 Q_OBJECT
42 public:
43 DesktopView(Plasma::Containment *containment, int id, QWidget *parent);
44 ~DesktopView();
46 /**
47 * Returns whether or not the dashboard view is visible
49 bool isDashboardVisible() const;
51 public slots:
52 /**
53 * zoom in towards the given containment.
54 * if toContainment is null, the current containment is used instead.
55 * zooming in also sets toContainment as current.
57 void zoomIn(Plasma::ZoomLevel zoomLevel);
58 void zoomOut(Plasma::ZoomLevel zoomLevel);
59 void toggleDashboard();
60 void screenResized(Kephal::Screen *);
61 void screenMoved(Kephal::Screen *);
62 void adjustSize();
64 void screenOwnerChanged(int wasScreen, int isScreen, Plasma::Containment* containment);
66 /**
67 * switch to the "next" available containment on the corona.
69 void nextContainment();
71 /**
72 * switch to the "previous" available containment on the corona.
74 void previousContainment();
76 /**
77 * Sets the containment for this view, which will also cause the view
78 * to track the geometry of the containment.
80 * @arg containment the containment to center the view on
82 void setContainment(Plasma::Containment *containment);
84 protected:
85 void wheelEvent(QWheelEvent *event);
86 void drawBackground(QPainter *painter, const QRectF &rect);
88 private:
89 DashboardView *m_dashboard;
90 bool m_dashboardFollowsDesktop;
92 //FIXME: duplicated from containment_p.h
93 //(but with a bigger margin to make room even for very big panels)
94 static const int TOOLBOX_MARGIN = 400;
97 #endif // multiple inclusion guard