kontact
iconsidepane.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef KONTACT_ICONSIDEPANEBASE_H
00024 #define KONTACT_ICONSIDEPANEBASE_H
00025
00026 #include "sidepanebase.h"
00027 #include "prefs.h"
00028
00029 #include <QtGui/QListView>
00030
00031 namespace KParts {
00032 class Part;
00033 }
00034
00035 class KAction;
00036
00037 namespace Kontact
00038 {
00039
00040 class Core;
00041 class Plugin;
00042 class Navigator;
00043 class Model;
00044
00045 class Navigator : public QListView
00046 {
00047 Q_OBJECT
00048
00049 public:
00050 explicit Navigator( SidePaneBase *parent = 0 );
00051
00052 void updatePlugins( QList<Plugin*> plugins );
00053 void setCurrentPlugin( const QString &plugin );
00054
00055 int iconSize() const
00056 {
00057 return mIconSize;
00058 }
00059
00060 bool showIcons() const
00061 {
00062 return mShowIcons;
00063 }
00064
00065 bool showText() const
00066 {
00067 return mShowText;
00068 }
00069
00070 virtual QSize sizeHint() const;
00071
00072 signals:
00073 void pluginActivated( Kontact::Plugin *plugin );
00074
00075 protected:
00076 virtual void dragEnterEvent( QDragEnterEvent *event );
00077 virtual void dragMoveEvent( QDragMoveEvent *event );
00078 virtual void dropEvent( QDropEvent *event );
00079 virtual void showEvent( QShowEvent * event );
00080
00081 private slots:
00082 void slotCurrentChanged( const QModelIndex ¤t );
00083 void slotActionTriggered( bool checked );
00084 void updateNavigatorSize();
00085
00086 private:
00087 SidePaneBase *mSidePane;
00088 Model *mModel;
00089
00090 int mIconSize;
00091 bool mShowIcons;
00092 bool mShowText;
00093
00094 KAction *mShowIconsAction;
00095 KAction *mShowTextAction;
00096 KAction *mShowBothAction;
00097 KAction *mBigIconsAction;
00098 KAction *mNormalIconsAction;
00099 KAction *mSmallIconsAction;
00100 };
00101
00102 class IconSidePane : public SidePaneBase
00103 {
00104 Q_OBJECT
00105
00106 public:
00107 IconSidePane( Core *core, QWidget *parent );
00108 ~IconSidePane();
00109
00110 void setCurrentPlugin( const QString &plugin );
00111
00112 public slots:
00113 virtual void updatePlugins();
00114
00115 protected:
00116 virtual void resizeEvent( QResizeEvent *event );
00117
00118 private:
00119 Navigator *mNavigator;
00120 };
00121
00122 }
00123
00124 #endif