kitchensync Library API Documentation

partbar.h

00001 /*
00002     This file is part of KitchenSync.
00003 
00004     Copyright (c) 2002 Holger Freyther <zecke@handhelds.org>
00005     Copyright (c) 2002 Maximilian Reiß <harlekin@handhelds.org>
00006 
00007     This library is free software; you can redistribute it and/or
00008     modify it under the terms of the GNU Library General Public
00009     License as published by the Free Software Foundation; either
00010     version 2 of the License, or (at your option) any later version.
00011 
00012     This library is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015     Library General Public License for more details.
00016 
00017     You should have received a copy of the GNU Library General Public License
00018     along with this library; see the file COPYING.LIB.  If not, write to
00019     the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00020     Boston, MA 02111-1307, USA.
00021 */
00022 #ifndef PARTBAR_H
00023 #define PARTBAR_H
00024 
00025 #include <klistbox.h>
00026 #include <kicontheme.h>
00027 
00028 #include <qlistbox.h>
00029 #include <qevent.h>
00030 
00031 namespace KSync {
00032 
00033 class PartBar;
00034 class ActionPart;
00035 
00039 class PartBarItem : public QListBoxPixmap
00040 {
00041   public:
00042     PartBarItem( PartBar *, ActionPart * );
00043     ~PartBarItem();
00044 
00048     ActionPart *part();
00049 
00055     void setIcon( const QString& icon, KIcon::Group group = KIcon::Panel );
00056 
00057 
00061     virtual int width( const QListBox * ) const;
00062 
00066     virtual int height( const QListBox * ) const;
00067 
00071     virtual const QPixmap * pixmap() const {
00072       return m_Pixmap;
00073     }
00074 
00075   protected:
00076     virtual void paint( QPainter *p);
00077 
00078   private:
00079     QPixmap *m_Pixmap;
00080     ActionPart *m_Part;
00081     PartBar *m_Parents;
00082 };
00083 
00084 
00089 class PartBar  : public QFrame
00090 {
00091     Q_OBJECT
00092   public:
00093     PartBar( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
00094     ~PartBar() {};
00095 
00096     virtual PartBarItem *insertItem( ActionPart *part, int pos = -1 );
00097 
00102     virtual void setListBox(  KListBox * );
00103 
00107     KListBox *listBox() const { return m_listBox; }
00108 
00112     virtual void clear();
00113 
00117     virtual QSize sizeHint() const;
00118 
00119     virtual QSize minimumSizeHint() const;
00120 
00124     PartBarItem *currentItem() const;
00125 
00126     void selectPart( const QString & );
00127 
00128   signals:
00129     void activated( ActionPart *part );
00130 
00131   protected slots:
00132     virtual void slotSelected( QListBoxItem * );
00133 
00134   protected:
00135     virtual void resizeEvent( QResizeEvent * );
00136 
00137   private:
00138     KListBox *m_listBox;
00139     PartBarItem *m_activeItem;
00140 };
00141 
00142 }
00143 
00144 #endif
KDE Logo
This file is part of the documentation for kitchensync Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Mon Apr 4 04:47:07 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003