kontact Library API Documentation

sidepane.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2003 Daniel Molkentin <molkentin@kde.org>
00003 
00004    This program is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (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 GNU
00012    General Public License for more details.
00013 
00014    You should have received a copy of the GNU General Public License
00015    along with this program; see the file COPYING.  If not, write to
00016    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00017    Boston, MA 02111-1307, USA.
00018  */
00019 #ifndef KONTACT_SIDEPANE_H
00020 #define KONTACT_SIDEPANE_H
00021 
00022 #include "sidepanebase.h"
00023 
00024 #include <qguardedptr.h>
00025 #include <qptrlist.h>
00026 #include <qpushbutton.h>
00027 #include <qvaluelist.h>
00028 #include <qvbox.h>
00029 
00030 class QWidgetStack;
00031 class QLabel;
00032 
00033 namespace Kontact
00034 {
00035 
00036   class Core;
00037   class Plugin;
00038 
00040   // Helper classes
00042 
00043 
00044   class PanelButton : public QPushButton
00045   {
00046     Q_OBJECT
00047     public:
00048       PanelButton(Kontact::Plugin *plugin, int id, QWidget *parent, const char* name = 0);
00049 
00050       ~PanelButton() {}
00051 
00052       bool isActive() const { return mActive; }
00053 
00054       void setActive();
00055       void setInactive();
00056 
00057       int id() const { return mId; }
00058 
00059       Kontact::Plugin *plugin() const { return mPlugin; }
00060 
00061     signals:
00062       void clicked( PanelButton *pb );
00063       void showPart( Kontact::Plugin* plugin );
00064 
00065     public slots:
00066       void slotClicked();
00067 
00068     protected:
00069       virtual void setPixmap(const QPixmap&);
00070       virtual void setText(const QString&);
00071       virtual void drawButtonLabel(QPainter *p);
00072       void composeLabel(QPainter *p);
00073 
00074     private:
00075       Kontact::Plugin *mPlugin;
00076       QPixmap mPix;
00077       QString mText;
00078       bool mActive;
00079       bool mId;
00080   };
00081 
00083 
00084   class SidePane : public SidePaneBase
00085   {
00086     Q_OBJECT
00087     public:
00088       SidePane( Core* core, QWidget *parent, const char* name = 0 );
00089       ~SidePane();
00090 
00091     public slots:
00092       void switchItems(PanelButton* pb);
00093 
00094       void updatePlugins();
00095       void selectPlugin( Kontact::Plugin* );
00096       void selectPlugin( const QString &pluginName );
00097 
00098     protected slots:
00099       void switchSidePaneWidget( Kontact::Plugin * );
00100 
00101     private:
00102       QWidgetStack* mContentStack;
00103       QLabel* mHeaderWidget;
00104       QPtrList<PanelButton> mButtonList;
00105       QValueList<QGuardedPtr<QWidget> > mContentList;
00106   };
00107 
00108 }
00109 
00110 #endif
KDE Logo
This file is part of the documentation for kontact Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat May 1 11:39:00 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003