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

« back to all changes in this revision

Viewing changes to plasma/desktop/shell/desktopview.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 2007 Aaron Seigo <aseigo@kde.org>
 
3
 *
 
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.
 
8
 *
 
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
 
13
 *
 
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.
 
18
 */
 
19
 
 
20
#ifndef DESKTOPVIEW_H
 
21
#define DESKTOPVIEW_H
 
22
 
 
23
#include <Plasma/Plasma>
 
24
#include <Plasma/View>
 
25
 
 
26
namespace Plasma
 
27
{
 
28
    class Containment;
 
29
} // namespace Plasma
 
30
 
 
31
namespace Kephal
 
32
{
 
33
    class Screen;
 
34
} // namespace Kephal
 
35
 
 
36
class DashboardView;
 
37
 
 
38
class DesktopView : public Plasma::View
 
39
{
 
40
    Q_OBJECT
 
41
 
 
42
public:
 
43
    DesktopView(Plasma::Containment *containment, int id, QWidget *parent);
 
44
    ~DesktopView();
 
45
 
 
46
    /**
 
47
     * Sets things up for per-desktop views (or not)
 
48
     */
 
49
    void checkDesktopAffiliation();
 
50
 
 
51
    /**
 
52
     * Returns whether or not the dashboard view is visible
 
53
     */
 
54
    bool isDashboardVisible() const;
 
55
 
 
56
    /**
 
57
     * Returns whether the dashboard containment will always be the desktop's one
 
58
     */
 
59
    bool dashboardFollowsDesktop() const;
 
60
 
 
61
    Plasma::Containment *dashboardContainment() const;
 
62
    void setDashboardContainment(Plasma::Containment *containment);
 
63
 
 
64
public slots:
 
65
    void toggleDashboard();
 
66
    void showDashboard(bool show);
 
67
 
 
68
    void screenResized(Kephal::Screen *);
 
69
    void screenMoved(Kephal::Screen *);
 
70
    void adjustSize();
 
71
    void toolBoxOpened(bool);
 
72
    void showDesktopUntoggled(WId id);
 
73
    void showWidgetExplorer();
 
74
 
 
75
    void screenOwnerChanged(int wasScreen, int isScreen, Plasma::Containment* containment);
 
76
 
 
77
    /**
 
78
     * Sets the containment for this view, which will also cause the view
 
79
     * to track the geometry of the containment.
 
80
     *
 
81
     * @arg containment the containment to center the view on
 
82
     */
 
83
    void setContainment(Plasma::Containment *containment);
 
84
 
 
85
Q_SIGNALS:
 
86
    void dashboardClosed();
 
87
 
 
88
protected:
 
89
    void prepDashboard();
 
90
 
 
91
private:
 
92
    DashboardView *m_dashboard;
 
93
    bool m_dashboardFollowsDesktop : 1;
 
94
    bool m_init : 1;
 
95
    int m_desktop;
 
96
 
 
97
    //FIXME: duplicated from containment_p.h 
 
98
    //(but with a bigger margin to make room even for very big panels)
 
99
    static const int TOOLBOX_MARGIN = 400;
 
100
};
 
101
 
 
102
#endif // multiple inclusion guard