add more spacing
[personal-kdebase.git] / workspace / plasma / shells / desktop / panelcontroller.h
blob61ef0dd6b1e05d484348ce24efcd2168f9e95533
1 /*
2 * Copyright 2008 Marco Martin <notmart@gmail.com>
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 PANELCONTROLLER_H
21 #define PANELCONTROLLER_H
23 #include <QWidget>
25 #include <Plasma/Plasma>
27 #include "panelview.h"
31 namespace Plasma
33 class Containment;
36 class PanelController : public QWidget
38 Q_OBJECT
39 public:
41 PanelController(QWidget* parent = 0);
42 ~PanelController();
44 QSize sizeHint() const;
46 QPoint positionForPanelGeometry(const QRect &panelGeom) const;
47 void setContainment(Plasma::Containment *containment);
48 void resizePanel(const QSizeF newSize);
50 void setLocation(const Plasma::Location &loc);
51 Plasma::Location location() const;
53 void setOffset(int newOffset);
54 int offset() const;
56 void setAlignment(const Qt::Alignment &newAlignment);
57 Qt::Alignment alignment() const;
59 void setVisibilityMode(PanelView::VisibilityMode);
60 PanelView::VisibilityMode panelVisibilityMode() const;
62 public Q_SLOTS:
63 void themeChanged();
65 protected:
66 void paintEvent(QPaintEvent *event);
67 bool eventFilter(QObject *watched, QEvent *event);
68 void focusOutEvent(QFocusEvent * event);
70 Q_SIGNALS:
71 /**
72 * Emitted when the controller requests an add widgets dialog is shown.
74 void offsetChanged(int offset);
75 void alignmentChanged(Qt::Alignment);
76 void locationChanged(Plasma::Location);
77 void panelVisibilityModeChanged(PanelView::VisibilityMode mode);
79 private:
80 void mouseMoveFilter(QMouseEvent *event);
82 Q_PRIVATE_SLOT(d, void rulersMoved(int offset, int minLength, int minLength))
83 Q_PRIVATE_SLOT(d, void alignToggled(bool toggle))
84 Q_PRIVATE_SLOT(d, void panelVisibilityModeChanged(bool toggle))
85 Q_PRIVATE_SLOT(d, void settingsPopup())
86 Q_PRIVATE_SLOT(d, void maximizePanel())
88 class ButtonGroup;
89 class ResizeHandle;
90 class Private;
91 Private *d;
95 #endif // multiple inclusion guard