Plasma
panelcontroller.h
Go to the documentation of this file.00001 /* 00002 * Copyright 2008 Marco Martin <notmart@gmail.com> 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU Library General Public License as 00006 * published by the Free Software Foundation; either version 2, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details 00013 * 00014 * You should have received a copy of the GNU Library General Public 00015 * License along with this program; if not, write to the 00016 * Free Software Foundation, Inc., 00017 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #ifndef PANELCONTROLLER_H 00021 #define PANELCONTROLLER_H 00022 00023 #include <QWidget> 00024 00025 #include <plasma/plasma.h> 00026 00027 00028 00029 namespace Plasma 00030 { 00031 class Containment; 00032 } 00033 00034 class PanelController : public QWidget 00035 { 00036 Q_OBJECT 00037 public: 00038 PanelController(QWidget* parent = 0); 00039 ~PanelController(); 00040 00041 QSize sizeHint() const; 00042 00043 QPoint positionForPanelGeometry(const QRect &panelGeom) const; 00044 void setContainment(Plasma::Containment *containment); 00045 void resizePanel(const QSizeF newSize); 00046 00047 void setLocation(const Plasma::Location &loc); 00048 Plasma::Location location() const; 00049 00050 void setOffset(int newOffset); 00051 int offset(); 00052 00053 void setAlignment(const Qt::Alignment &newAlignment); 00054 int alignment(); 00055 00056 public Q_SLOTS: 00057 void hideController(); 00058 00059 protected: 00060 void paintEvent(QPaintEvent *event); 00061 void mousePressEvent(QMouseEvent *event); 00062 void mouseReleaseEvent(QMouseEvent *event); 00063 void mouseMoveEvent(QMouseEvent *event); 00064 void focusOutEvent(QFocusEvent * event); 00065 00066 Q_SIGNALS: 00070 void offsetChanged(int offset); 00071 void alignmentChanged(Qt::Alignment); 00072 void locationChanged(Plasma::Location); 00073 00074 private: 00075 Q_PRIVATE_SLOT(d, void rulersMoved(int offset, int minLength, int minLength)) 00076 Q_PRIVATE_SLOT(d, void alignToggled(bool toggle)) 00077 00078 class ButtonGroup; 00079 class ResizeHandle; 00080 class Private; 00081 Private *d; 00082 }; 00083 00084 00085 #endif // multiple inclusion guard 00086