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.

kmyhistorycombo.h 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. public:
  26. /** Create a new KMyHistoryCombo which has automatic KRename default history
  27. * handling and a custom popup menu to insert tokens if customPopup is true
  28. *
  29. * \param customPopup insert custom menu items into context menu.
  30. */
  31. KMyHistoryCombo(bool customPopup, TQWidget* parent=0, const char* name=0);
  32. ~KMyHistoryCombo();
  33. /**
  34. * Saves the settings of the HistoryCombo in the applications
  35. * config file in a group named name()
  36. * Saved settings include:
  37. * - history items
  38. * - completion items
  39. * - completion mode
  40. */
  41. void saveSettings();
  42. inline TQString text() const;
  43. TQString text( int index ) const;
  44. void setText( const TQString & text );
  45. void add( const TQString & text );
  46. bool isEmpty() const;
  47. signals:
  48. void delayedTextChanged();
  49. private slots:
  50. void textChangedGovernor();
  51. void slotCustomContextMenu( TQPopupMenu* p );
  52. void slotInsertKRenameCommand( int id );
  53. private:
  54. TQTimer* m_timer;
  55. };
  56. inline TQString KMyHistoryCombo::text() const
  57. {
  58. return currentText();
  59. }
  60. #endif