21#ifndef KONTACT_ICONSIDEPANEBASE_H
22#define KONTACT_ICONSIDEPANEBASE_H
26#include <tdelistbox.h>
28#include "sidepanebase.h"
34namespace KParts { class Part; }
44enum IconViewMode { LargeIcons = 48, NormalIcons = 32, SmallIcons = 22, ShowText = 3, ShowIcons = 5 };
59 const TQPixmap *pixmap() const { return &mPixmap; }
63 void setHover( bool );
64 void setPaintActive( bool );
65 bool paintActive() const { return mPaintActive; }
69 virtual int width( const TQListBox * ) const;
73 virtual int height( const TQListBox * ) const;
78 virtual void paint( TQPainter *p );
95 : TQToolTip( parent->viewport() ), mListBox( parent )
98 void maybeTip( const TQPoint& p ) {
100 if ( Prefs::self()->sidePaneShowText() ) return;
101 if ( !mListBox ) return;
102 TQListBoxItem* item = mListBox->itemAt( p );
104 const TQRect itemRect = mListBox->itemRect( item );
105 if ( !itemRect.isValid() ) return;
108 TQString tipStr = entryItem->text();
109 tip( itemRect, tipStr );
123 Navigator( IconSidePane *parent = 0, const char *name = 0 );
125 virtual void setSelected( TQListBoxItem *, bool );
127 void updatePlugins( TQValueList<Kontact::Plugin*> plugins );
129 TQSize sizeHint() const;
133 IconViewMode viewMode() { return mViewMode; }
134 IconViewMode sizeIntToEnum( int size) const;
135 const TQPtrList<TDEAction> & actions() { return mActions; }
136 bool showIcons() const { return mShowIcons; }
137 bool showText() const { return mShowText; }
142 void dragEnterEvent( TQDragEnterEvent * );
143 void dragMoveEvent ( TQDragMoveEvent * );
144 void dropEvent( TQDropEvent * );
145 void resizeEvent( TQResizeEvent * );
146 void enterEvent( TQEvent* );
147 void leaveEvent( TQEvent* );
149 void setHoverItem( TQListBoxItem*, bool );
150 void setPaintActiveItem( TQListBoxItem*, bool );
153 void slotExecuted( TQListBoxItem * );
154 void slotMouseOn( TQListBoxItem *item );
156 void slotShowRMBMenu( TQListBoxItem *, const TQPoint& );
157 void shortCutSelected( int );
158 void slotStopHighlight();
161 IconSidePane *mSidePane;
162 IconViewMode mViewMode;
164 TQListBoxItem* mMouseOn;
168 TQSignalMapper *mMapper;
169 TQPtrList<TDEAction> mActions;
174class IconSidePane : public SidePaneBase
179 IconSidePane( Core *core, TQWidget *parent, const char *name = 0 );
185 virtual void updatePlugins();
187 virtual void selectPlugin( const TQString &name );
188 const TQPtrList<TDEAction> & actions() { return mNavigator->actions(); }
191 Navigator *mNavigator;
This class provides the interface to the Kontact core for the plugins.
Tooltip that changes text depending on the item it is above.
A TQListBoxPixmap Square Box with an optional icon and a text underneath.
virtual int width(const TQListBox *) const returns the width of this item.
virtual int height(const TQListBox *) const returns the height of this item.
Navigation pane showing all parts relevant to the user.
Base class for all Plugins in Kontact.
|