File indexing completed on 2024-03-24 17:25:12

0001 /***************************************************************************
0002                        exthistorycombo.h  -  description
0003                              -------------------
0004     begin                : Sun May 20 2007
0005     copyright            : (C) 2007 by Dominik Seichter
0006     email                : domseichter@web.de
0007 ***************************************************************************/
0008 
0009 /***************************************************************************
0010  *                                                                         *
0011  *   This program is free software; you can redistribute it and/or modify  *
0012  *   it under the terms of the GNU General Public License as published by  *
0013  *   the Free Software Foundation; either version 2 of the License, or     *
0014  *   (at your option) any later version.                                   *
0015  *                                                                         *
0016  ***************************************************************************/
0017 
0018 #ifndef EXT_HISTORY_COMBO_H
0019 #define EXT_HISTORY_COMBO_H
0020 
0021 #include <QTimer>
0022 #include <KHistoryComboBox>
0023 
0024 /** A combobox with an item history, additional context
0025  *  menu entries for KRename tokens and a delayed text input
0026  *  signal which is only emitted after the user has typed
0027  *  sevaral characters.
0028  */
0029 class ExtHistoryCombo : public KHistoryComboBox
0030 {
0031     Q_OBJECT
0032 
0033 public:
0034     /**
0035      * Create a new ExtHistoryCombo object with a parent and a name.
0036      *
0037      * @param parent Parent widget
0038      */
0039     explicit ExtHistoryCombo(QWidget *parent);
0040 
0041     /// Fix compilation, designer needs this method
0042     inline void insertItems(int, QStringList &list)
0043     {
0044         KHistoryComboBox::insertItems(list);
0045     }
0046 
0047     void loadConfig();
0048     void saveConfig();
0049 
0050     /**
0051      * select the current contents of the combobox.
0052      */
0053     void selectAll();
0054 
0055 Q_SIGNALS:
0056     void delayedTextChanged();
0057 
0058 private Q_SLOTS:
0059     void slotTextChanged();
0060 
0061 private:
0062     QTimer m_timer;
0063 
0064 };
0065 
0066 #endif /* EXT_HISTORY_COMBO_H */
0067