add more spacing
[personal-kdebase.git] / workspace / plasma / containments / panel / panel.h
blobec8f400b4b6074f78d3452ed726916aa77e578c4
1 /*
2 * Copyright 2007 by Alex Merry <alex.merry@kdemail.net>
3 * Copyright 2008 by Alexis Ménard <darktears31@gmail.com>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Library General Public License version 2,
8 * or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details
15 * You should have received a copy of the GNU Library General Public
16 * License along with this program; if not, write to the
17 * Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 #ifndef PLASMA_PANEL_H
22 #define PLASMA_PANEL_H
24 #include <Plasma/Containment>
26 class QComboBox;
27 class QAction;
28 class KDialog;
29 class KIntNumInput;
30 class Spacer;
32 namespace Plasma
34 class FrameSvg;
37 class Panel : public Plasma::Containment
39 Q_OBJECT
40 public:
41 Panel(QObject *parent, const QVariantList &args);
42 ~Panel();
43 void init();
44 QList<QAction*> contextualActions();
46 void constraintsEvent(Plasma::Constraints constraints);
48 void paintInterface(QPainter *painter,
49 const QStyleOptionGraphicsItem *option,
50 const QRect &contentsRect);
51 void paintBackground(QPainter *painter, const QRect &contentsRect);
52 void showDropZone(const QPoint pos);
54 protected:
55 void saveState(KConfigGroup &config) const;
57 private slots:
58 void themeUpdated();
59 void backgroundChanged();
60 void layoutApplet(Plasma::Applet* applet, const QPointF &pos);
61 void appletRemoved(Plasma::Applet* applet);
62 void updateSize();
63 void addPanel();
65 private:
66 /**
67 * update the formfactor based on the location
69 void setFormFactorFromLocation(Plasma::Location loc);
71 /**
72 * recalculate which borders to show
74 void updateBorders(const QRect &geom);
76 Plasma::FrameSvg *m_background;
77 QAction* m_configureAction;
78 QAction* m_addPanelAction;
80 //cached values
81 QSize m_currentSize;
82 QRect m_lastViewGeom;
83 bool m_maskDirty;
84 int m_spacerIndex;
85 Spacer *m_spacer;
87 friend class Spacer;
91 #endif // PLASMA_PANEL_H