• Skip to content
  • Skip to link menu
KDE 4.3 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KDEUI

kcombobox.h

Go to the documentation of this file.
00001 /* This file is part of the KDE libraries
00002 
00003    Copyright (c) 2000,2001 Dawit Alemayehu <adawit@kde.org>
00004    Copyright (c) 2000,2001 Carsten Pfeiffer <pfeiffer@kde.org>
00005 
00006    This library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Lesser General Public
00008    License (LGPL) as published by the Free Software Foundation; either
00009    version 2 of the License, or (at your option) any later version.
00010 
00011    This library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Lesser General Public License for more details.
00015 
00016    You should have received a copy of the GNU Lesser General Public License
00017    along with this library; see the file COPYING.LIB.  If not, write to
00018    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019    Boston, MA 02110-1301, USA.
00020 */
00021 
00022 #ifndef KCOMBOBOX_H
00023 #define KCOMBOBOX_H
00024 
00025 #include <QtGui/QComboBox>
00026 
00027 #include <kcompletion.h>
00028 
00029 class QLineEdit;
00030 class QMenu;
00031 
00032 class KCompletionBox;
00033 class KUrl;
00034 
00035 /*
00036  * ### KDE 5: On all methods that it is said that a prettyUrl will be used, it
00037  *            would be nice to add a flag to the method for forcing the pretty
00038  *            url or not. (ereslibre)
00039  */
00040 
00146 class KDEUI_EXPORT KComboBox : public QComboBox, public KCompletionBase //krazy:exclude=qclasses
00147 {
00148   Q_OBJECT
00149   Q_PROPERTY( bool autoCompletion READ autoCompletion WRITE setAutoCompletion )
00150   Q_PROPERTY( bool urlDropsEnabled READ urlDropsEnabled WRITE setUrlDropsEnabled )
00151   Q_PROPERTY( bool trapReturnKey READ trapReturnKey WRITE setTrapReturnKey )
00152 
00153 public:
00154 
00161     explicit KComboBox( QWidget *parent=0 );
00162 
00171     explicit KComboBox( bool rw, QWidget *parent=0 );
00172 
00176     virtual ~KComboBox();
00177 
00182     KDE_DEPRECATED void insertURL( const KUrl& url, int index = -1 )
00183     { insertUrl( index < 0 ? count() : index, url ); }
00184     KDE_DEPRECATED void insertURL( const QPixmap& pixmap, const KUrl& url, int index = -1 )
00185     { insertUrl( index < 0 ? count() : index, QIcon(pixmap), url ); }
00186     KDE_DEPRECATED void changeURL( const KUrl& url, int index )
00187     { changeUrl( index, url ); }
00188     KDE_DEPRECATED void changeURL( const QPixmap& pixmap, const KUrl& url, int index )
00189     { changeUrl( index, QIcon(pixmap), url ); }
00190 
00196     void setEditUrl( const KUrl& url );
00197 
00203     void addUrl( const KUrl& url );
00204 
00210     void addUrl( const QIcon& icon,  const KUrl& url );
00211 
00217     void insertUrl( int index, const KUrl& url );
00218 
00224     void insertUrl( int index, const QIcon& icon, const KUrl& url );
00225 
00231     void changeUrl( int index, const KUrl& url );
00232 
00238     void changeUrl( int index , const QIcon& icon, const KUrl& url);
00239 
00248     int cursorPosition() const;
00249 
00260     virtual void setAutoCompletion( bool autocomplete );
00261 
00271     bool autoCompletion() const;
00272 
00289     virtual KDE_DEPRECATED void setContextMenuEnabled( bool showMenu );
00290 
00298     void setUrlDropsEnabled( bool enable );
00299 
00303     bool urlDropsEnabled() const;
00304 
00314     bool contains( const QString& text ) const;
00315 
00329     void setTrapReturnKey( bool trap );
00330 
00337     bool trapReturnKey() const;
00338 
00342     virtual bool eventFilter( QObject *, QEvent * );
00343 
00353     KCompletionBox * completionBox( bool create = true );
00354 
00364     virtual void setLineEdit( QLineEdit * );
00365 
00373     void setEditable(bool editable);
00374 
00375 Q_SIGNALS:
00381     void returnPressed();
00382 
00392     void returnPressed( const QString& );
00393 
00402     void completion( const QString& );
00403 
00407     void substringCompletion( const QString& );
00408 
00420     void textRotation( KCompletionBase::KeyBindingType );
00421 
00426     void completionModeChanged( KGlobalSettings::Completion );
00427 
00437     void aboutToShowContextMenu( QMenu * p );
00438 
00439 public Q_SLOTS:
00440 
00458     void rotateText( KCompletionBase::KeyBindingType type );
00459 
00466     virtual void setCompletedText( const QString& );
00467 
00472     void setCompletedItems( const QStringList& items, bool autosubject = true );
00473 
00479     void setCurrentItem( const QString& item, bool insert = false, int index = -1 );
00480 
00481 protected Q_SLOTS:
00482 
00494     virtual void makeCompletion( const QString& );
00495 
00496 protected:
00497     /*
00498     * This function simply sets the lineedit text and
00499     * highlights the text appropriately if the boolean
00500     * value is set to true.
00501     *
00502     * @param
00503     * @param
00504     */
00505     virtual void setCompletedText( const QString& /* */, bool /*marked*/ );
00506 
00510     virtual void create( WId = 0, bool initializeWindow = true,
00511                          bool destroyOldWindow = true );
00512 
00513     virtual void wheelEvent( QWheelEvent *ev );
00514     
00515     virtual QSize minimumSizeHint() const;
00516 
00517 private Q_SLOTS:
00518     void lineEditDeleted();
00519 
00520 private:
00524     void init();
00525 
00526 private:
00527     class KComboBoxPrivate;
00528     KComboBoxPrivate* const d;
00529 };
00530 
00531 
00532 
00533 #endif
00534 

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal