22#ifndef KOFFICE_ICONSIDEPANEBASE_H
23#define KOFFICE_ICONSIDEPANEBASE_H
25#include <tdeactioncollection.h>
26#include <tdelistbox.h>
28#include <tqbuttongroup.h>
32#include <tqwidgetstack.h>
34#include "koshellsettings.h"
40enum IconViewMode { LargeIcons = 48, NormalIcons = 32, SmallIcons = 22, ShowText = 3, ShowIcons = 5 };
53 const TQPixmap *pixmap() const { return &mPixmap; }
55 int id() { return mId; }
57 void setNewText( const TQString &_text );
59 void setHover( bool );
60 void setPaintActive( bool );
61 bool paintActive() const { return mPaintActive; }
66 virtual int width( const TQListBox * ) const;
70 virtual int height( const TQListBox * ) const;
75 virtual void paint( TQPainter *p );
94 : TQToolTip( parent->viewport() ), mListBox( parent )
97 void maybeTip( const TQPoint& p ) {
99 if ( KoShellSettings::sidePaneShowText() ) return;
100 if ( !mListBox ) return;
101 TQListBoxItem* item = mListBox->itemAt( p );
103 const TQRect itemRect = mListBox->itemRect( item );
104 if ( !itemRect.isValid() ) return;
107 TQString tipStr = entryItem->text();
108 tip( itemRect, tipStr );
122 Navigator( bool _selectable, TDEPopupMenu*, IconSidePane *, TQWidget *parent = 0, const char *name = 0 );
124 int insertItem( const TQString &_text, const TQString &_pix);
126 TQSize sizeHint() const;
127 IconViewMode viewMode();
130 void calculateMinWidth();
131 bool leftMouseButtonPressed(){ return mLeftMouseButtonPressed;}
132 int minWidth() { return mMinWidth; }
133 void resetWidth() { mMinWidth = 0; }
136 void itemSelected( int );
137 void updateAllWidgets();
140 void resizeEvent( TQResizeEvent * );
141 void enterEvent( TQEvent* );
142 void mouseReleaseEvent(TQMouseEvent *e);
143 void mousePressEvent(TQMouseEvent *e);
145 void setHoverItem( TQListBoxItem*, bool );
146 void setPaintActiveItem( TQListBoxItem*, bool );
149 void slotExecuted( TQListBoxItem * );
150 void slotMouseOn( TQListBoxItem *item );
152 void slotShowRMBMenu( TQListBoxItem *, const TQPoint& );
155 IconSidePane *mSidePane;
157 TQListBoxItem *executedItem;
158 bool mLeftMouseButtonPressed;
159 TDEPopupMenu *mPopupMenu;
161 TQListBoxItem* mMouseOn;
164class IconSidePane : public TQVBox
169 IconSidePane( TQWidget *parent, const char *name = 0 );
172 void setActionCollection( TDEActionCollection *actionCollection );
173 TDEActionCollection *actionCollection() const;
175 int insertItem( const TQString & _pix, const TQString &_text);
176 int insertItem( int _grp, const TQString & _pix, const TQString &_text);
177 int insertGroup( const TQString &_text, bool _selectable, TQObject *_obj = 0L, const char *_slot = 0L);
178 void renameItem( int _grp, int _id, const TQString & _text );
179 void removeItem( int _grp, int _id );
180 void selectGroup( int);
183 IconViewMode sizeIntToEnum( int size) const;
184 IconViewMode viewMode() { return mViewMode; }
185 void setViewMode( int choice){mViewMode = sizeIntToEnum(choice);}
186 bool showText() { return mShowText; }
187 void toogleText(){mShowText=!mShowText;}
188 bool showIcons() { return mShowIcons; }
189 void toogleIcons(){mShowIcons=!mShowIcons;}
190 TQButtonGroup *buttonGroup() { return m_buttongroup; }
195 void itemSelected( int);
196 void updateAllWidgets();
199 void buttonClicked();
202 TQWidgetStack *mWidgetstack;
203 TQValueList<int> mWidgetStackIds;
205 TQButtonGroup *m_buttongroup;
206 TDEActionCollection *mActionCollection;
207 TDEPopupMenu *mPopupMenu;
209 IconViewMode mViewMode;
Tooltip that changes text depending on the item it is above.
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.
|