KRename – powerful batch renamer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

76 lines
2.4KB

  1. /***************************************************************************
  2. kmyhistorycombo.h - description
  3. -------------------
  4. begin : Tue Oct 16 2001
  5. copyright : (C) 2001 by Dominik Seichter
  6. email : domseichter@web.de
  7. ***************************************************************************/
  8. /***************************************************************************
  9. * *
  10. * This program is free software; you can redistribute it and/or modify *
  11. * it under the terms of the GNU General Public License as published by *
  12. * the Free Software Foundation; either version 2 of the License, or *
  13. * (at your option) any later version. *
  14. * *
  15. ***************************************************************************/
  16. #ifndef KMYHISTORYCOMBO_H
  17. #define KMYHISTORYCOMBO_H
  18. // KDE includes
  19. #include <kcombobox.h>
  20. #include <kcompletion.h>
  21. class TQPopupMenu;
  22. class TQTimer;
  23. class KMyHistoryCombo : public KHistoryCombo {
  24. Q_OBJECT
  25. TQ_OBJECT
  26. public:
  27. /** Create a new KMyHistoryCombo which has automatic KRename default history
  28. * handling and a custom popup menu to insert tokens if customPopup is true
  29. *
  30. * \param customPopup insert custom menu items into context menu.
  31. */
  32. KMyHistoryCombo(bool customPopup, TQWidget* parent=0, const char* name=0);
  33. ~KMyHistoryCombo();
  34. /**
  35. * Saves the settings of the HistoryCombo in the applications
  36. * config file in a group named name()
  37. * Saved settings include:
  38. * - history items
  39. * - completion items
  40. * - completion mode
  41. */
  42. void saveSettings();
  43. inline TQString text() const;
  44. TQString text( int index ) const;
  45. void setText( const TQString & text );
  46. void add( const TQString & text );
  47. bool isEmpty() const;
  48. signals:
  49. void delayedTextChanged();
  50. private slots:
  51. void textChangedGovernor();
  52. void slotCustomContextMenu( TQPopupMenu* p );
  53. void slotInsertKRenameCommand( int id );
  54. private:
  55. TQTimer* m_timer;
  56. };
  57. inline TQString KMyHistoryCombo::text() const
  58. {
  59. return currentText();
  60. }
  61. #endif