tdelistbox.h
00001 /* This file is part of the KDE libraries 00002 Copyright (C) 2000 Reginald Stadlbauer <reggie@kde.org> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License version 2 as published by the Free Software Foundation. 00007 00008 This library is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 Library General Public License for more details. 00012 00013 You should have received a copy of the GNU Library General Public License 00014 along with this library; see the file COPYING.LIB. If not, write to 00015 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00016 Boston, MA 02110-1301, USA. 00017 */ 00018 #ifndef TDELISTBOX_H 00019 #define TDELISTBOX_H 00020 00021 #include <tqlistbox.h> 00022 00023 #include <tdelibs_export.h> 00024 00040 class TDEUI_EXPORT TDEListBox : public TQListBox 00041 { 00042 Q_OBJECT 00043 00044 public: 00045 TDEListBox( TQWidget *parent = 0, const char *name = 0, WFlags f = 0 ); 00046 00047 signals: 00048 00059 void executed( TQListBoxItem *item ); 00060 00072 void executed( TQListBoxItem *item, const TQPoint &pos ); 00073 00088 void doubleClicked( TQListBoxItem *item, const TQPoint &pos ); 00089 00090 protected slots: 00091 void slotOnItem( TQListBoxItem *item ); 00092 void slotOnViewport(); 00093 00094 void slotSettingsChanged(int); 00095 00099 void slotAutoSelect(); 00100 00101 protected: 00102 void emitExecute( TQListBoxItem *item, const TQPoint &pos ); 00103 00104 virtual void keyPressEvent(TQKeyEvent *e); 00105 virtual void focusOutEvent( TQFocusEvent *fe ); 00106 virtual void leaveEvent( TQEvent *e ); 00107 virtual void contentsMousePressEvent( TQMouseEvent *e ); 00108 virtual void contentsMouseDoubleClickEvent ( TQMouseEvent *e ); 00109 00110 bool m_bUseSingle; 00111 bool m_bChangeCursorOverItem; 00112 00113 TQListBoxItem* m_pCurrentItem; 00114 00115 TQTimer* m_pAutoSelect; 00116 int m_autoSelectDelay; 00117 00118 private slots: 00119 void slotMouseButtonClicked( int btn, TQListBoxItem *item, const TQPoint &pos ); 00120 00121 protected: 00122 virtual void virtual_hook( int id, void* data ); 00123 private: 00124 class TDEListBoxPrivate; 00125 TDEListBoxPrivate* const d; 00126 }; 00127 00128 #endif