KDevelop API Documentation

qcomboview.h

Go to the documentation of this file.
00001 /**********************************************************************
00002 **
00003 **
00004 ** Definition of QComboView class
00005 **
00006 ** Copyright (C) 1992-2000 Trolltech AS.  All rights reserved.
00007 ** Copyright (C) 2003 Alexander Dymo <cloudtemple@mksat.net>
00008 **
00009 ** This file may be distributed and/or modified under the terms of the
00010 ** GNU General Public License version 2 as published by the Free Software
00011 ** Foundation and appearing in the file LICENSE.GPL included in the
00012 ** packaging of this file.
00013 **
00014 **********************************************************************/
00015 
00016 #ifndef QCOMBOVIEW_H
00017 #define QCOMBOVIEW_H
00018 
00019 #ifndef QT_H
00020 #include "qwidget.h"
00021 #endif // QT_H
00022 
00023 #ifndef QT_NO_COMBOBOX
00024 
00025 
00026 class QStrList;
00027 class QStringList;
00028 class QLineEdit;
00029 class QValidator;
00030 class QListView;
00031 class QListViewItem;
00032 class QComboViewData;
00033 
00034 class Q_EXPORT QComboView : public QWidget
00035 {
00036     Q_OBJECT
00037     Q_ENUMS( Policy )
00038     Q_PROPERTY( bool editable READ editable WRITE setEditable )
00039 //    Q_PROPERTY( int count READ count )
00040     Q_PROPERTY( QString currentText READ currentText WRITE setCurrentText DESIGNABLE false )
00041 //    Q_PROPERTY( QListView *currentItem READ currentItem WRITE setCurrentItem )
00042     Q_PROPERTY( bool autoResize READ autoResize WRITE setAutoResize DESIGNABLE false )
00043     Q_PROPERTY( int sizeLimit READ sizeLimit WRITE setSizeLimit )
00044 //    Q_PROPERTY( int maxCount READ maxCount WRITE setMaxCount )
00045     Q_PROPERTY( Policy insertionPolicy READ insertionPolicy WRITE setInsertionPolicy )
00046     Q_PROPERTY( bool autoCompletion READ autoCompletion WRITE setAutoCompletion )
00047     Q_PROPERTY( bool duplicatesEnabled READ duplicatesEnabled WRITE setDuplicatesEnabled )
00048     Q_OVERRIDE( bool autoMask DESIGNABLE true SCRIPTABLE true )
00049 
00050 public:
00051 //    QComboView( QWidget* parent=0, const char* name=0 );
00052     QComboView( bool rw, QWidget* parent=0, const char* name=0 );
00053     ~QComboView();
00054 
00055     int childCount() const;
00056 
00057     QListViewItem *currentItem() const;
00058     virtual void setCurrentItem( QListViewItem * );
00059     virtual void setCurrentActiveItem( QListViewItem * );
00060 
00061     bool    autoResize()    const;
00062     virtual void setAutoResize( bool );
00063     QSize   sizeHint() const;
00064 
00065     void    setPalette( const QPalette & );
00066     void    setFont( const QFont & );
00067     void    setEnabled( bool );
00068 
00069     virtual void setSizeLimit( int );
00070     int     sizeLimit() const;
00071 
00072 /*    virtual void setMaxCount( int );
00073     int     maxCount() const;*/
00074 
00075     enum Policy { NoInsertion, AtTop, AtCurrent, AtBottom,
00076           AfterCurrent, BeforeCurrent };
00077 
00078     virtual void setInsertionPolicy( Policy policy );
00079     Policy  insertionPolicy() const;
00080 
00081     virtual void setValidator( const QValidator * );
00082     const QValidator * validator() const;
00083 
00084     virtual void setListView( QListView * );
00085     QListView * listView() const;
00086 
00087     virtual void setLineEdit( QLineEdit *edit );
00088     QLineEdit*  lineEdit() const;
00089 
00090     virtual void setAutoCompletion( bool );
00091     bool    autoCompletion() const;
00092 
00093     bool    eventFilter( QObject *object, QEvent *event );
00094 
00095     void    setDuplicatesEnabled( bool enable );
00096     bool    duplicatesEnabled() const;
00097 
00098     bool    editable() const;
00099     void    setEditable( bool );
00100 
00101     virtual void popup();
00102 
00103     QString currentText() const;
00104     void setCurrentText( const QString& );
00105 
00106 public slots:
00107     virtual void clear();
00108     void    clearValidator();
00109     void    clearEdit();
00110     virtual void setEditText( const QString &);
00111 
00112 signals:
00113     void    activated( QListViewItem * item );
00114     void    highlighted( QListViewItem * item );
00115     void    activated( const QString &);
00116     void    highlighted( const QString &);
00117     void    textChanged( const QString &);
00118     void    focusGranted();
00119     void    focusLost();
00120 
00121 private slots:
00122     void    internalActivate( QListViewItem * );
00123     void    internalHighlight( QListViewItem * );
00124     void    internalClickTimeout();
00125     void    returnPressed();
00126     void checkState(QListViewItem*);
00127 
00128 protected:
00129     void    paintEvent( QPaintEvent * );
00130     void    resizeEvent( QResizeEvent * );
00131     void    mousePressEvent( QMouseEvent * );
00132     void    mouseMoveEvent( QMouseEvent * );
00133     void    mouseReleaseEvent( QMouseEvent * );
00134     void    mouseDoubleClickEvent( QMouseEvent * );
00135     void    keyPressEvent( QKeyEvent *e );
00136     void    focusInEvent( QFocusEvent *e );
00137     void    focusOutEvent( QFocusEvent *e );
00138     void    wheelEvent( QWheelEvent *e );
00139     void    styleChange( QStyle& );
00140 
00141     void    updateMask();
00142 
00143 private:
00144     void    setUpListView();
00145     void    setUpLineEdit();
00146     void    popDownListView();
00147     void    reIndex();
00148     void    currentChanged();
00149     QListViewItem *completionIndex( const QString &, QListViewItem * ) const;
00150 
00151     QComboViewData  *d;
00152 
00153 private:    // Disabled copy constructor and operator=
00154 #if defined(Q_DISABLE_COPY)
00155     QComboView( const QComboView & );
00156     QComboView &operator=( const QComboView & );
00157 #endif
00158 };
00159 
00160 
00161 #endif // QT_NO_COMBOBOX
00162 
00163 #endif // QCOMBOVIEW_H
KDE Logo
This file is part of the documentation for KDevelop Version 3.1.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Feb 22 09:22:37 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003