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.

114 lines
3.1KB

  1. /***************************************************************************
  2. helpdialog.h - description
  3. -------------------
  4. begin : Fr Nov 15 13:44:19 CEST 2001
  5. copyright : (C) 2002 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 HELPDIALOG_H
  17. #define HELPDIALOG_H
  18. #include <tqdialog.h>
  19. #include <tqstringlist.h>
  20. #include <tqpixmap.h>
  21. #include <tqmap.h>
  22. class TQVBoxLayout;
  23. class TQHBoxLayout;
  24. class TQGridLayout;
  25. class TQComboBox;
  26. class TQLineEdit;
  27. class TQPixmap;
  28. class KListView;
  29. class KPushButton;
  30. class HelpDialogData : public TQObject {
  31. Q_OBJECT
  32. TQ_OBJECT
  33. public:
  34. HelpDialogData() {}
  35. ~HelpDialogData() {}
  36. void add( const TQString & headline, TQStringList* commands, const TQPixmap & icon, bool first = false );
  37. void remove( const TQString & headline );
  38. /** returns all available and supported tokens
  39. */
  40. TQStringList tokens() const;
  41. inline const TQMap<TQString,TQStringList> & map() const
  42. {
  43. return m_map;
  44. }
  45. inline const TQMap<TQString,TQPixmap> & icons() const
  46. {
  47. return m_icons;
  48. }
  49. inline const TQString & first() const
  50. {
  51. return m_first;
  52. }
  53. signals:
  54. void updateHeadline();
  55. void updateItems();
  56. private:
  57. TQMap<TQString,TQStringList> m_map;
  58. TQMap<TQString,TQPixmap> m_icons;
  59. TQString m_first;
  60. };
  61. class HelpDialog : public TQDialog
  62. {
  63. Q_OBJECT
  64. TQ_OBJECT
  65. public:
  66. HelpDialog( HelpDialogData* data, TQWidget* parent = 0,
  67. const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
  68. ~HelpDialog();
  69. inline void setLineEdit( TQLineEdit* lineedit );
  70. public slots:
  71. void updateItems();
  72. void updateHeadline();
  73. private slots:
  74. void execute();
  75. private:
  76. TQComboBox* comboHeadline;
  77. KListView* list;
  78. KPushButton* buttonAdd;
  79. KPushButton* buttonClose;
  80. protected:
  81. HelpDialogData* m_data;
  82. TQLineEdit* text;
  83. TQVBoxLayout* HelpDialogLayout;
  84. TQHBoxLayout* Layout1;
  85. };
  86. void HelpDialog::setLineEdit( TQLineEdit* lineedit )
  87. {
  88. text = lineedit;
  89. }
  90. #endif // HELPDIALOG_H