TDE base libraries and programs
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.

122 lines
3.0 KiB

  1. /* vi: ts=8 sts=4 sw=4
  2. This file is part of the KDE project, module kcmbackground.
  3. Copyright (C) 1999 Geert Jansen <g.t.jansen@stud.tue.nl>
  4. Copyright (C) 2003 Waldo Bastian <bastian@kde.org>
  5. This program is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU General Public License
  7. version 2 as published by the Free Software Foundation.
  8. This library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Library General Public License for more details.
  12. You should have received a copy of the GNU Library General Public License
  13. along with this library; see the file COPYING.LIB. If not, write to
  14. the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  15. Boston, MA 02110-1301, USA.
  16. */
  17. #ifndef BGADVANCED_H
  18. #define BGADVANCED_H
  19. #include <tqdict.h>
  20. #include <tqlistview.h>
  21. #include <tqstringlist.h>
  22. #include <kdialogbase.h>
  23. class TQLineEdit;
  24. class TQSpinBox;
  25. class BGAdvancedBase;
  26. class KBackgroundRenderer;
  27. class KBackgroundProgram;
  28. class BGAdvancedDialog : public KDialogBase
  29. {
  30. Q_OBJECT
  31. public:
  32. BGAdvancedDialog(KBackgroundRenderer *_r, TQWidget *parent, bool m_multidesktop);
  33. void setCacheSize(int s);
  34. int cacheSize();
  35. TQColor textColor();
  36. void setTextColor(const TQColor &color);
  37. TQColor textBackgroundColor();
  38. void setTextBackgroundColor(const TQColor &color);
  39. bool shadowEnabled();
  40. void setShadowEnabled(bool enabled);
  41. void setTextLines(int lines);
  42. int textLines() const;
  43. void setTextWidth(int width);
  44. int textWidth() const;
  45. void updateUI();
  46. void makeReadOnly();
  47. TQString backgroundProgram() const;
  48. int backgroundMode() const;
  49. public slots:
  50. void slotAdd();
  51. void slotRemove();
  52. void slotModify();
  53. protected:
  54. void addProgram(const TQString &name);
  55. void removeProgram(const TQString &name);
  56. void selectProgram(const TQString &name);
  57. protected slots:
  58. void slotProgramItemClicked(TQListViewItem *item);
  59. void slotProgramItemDoubleClicked(TQListViewItem *item);
  60. void slotProgramChanged();
  61. void slotEnableProgram(bool b);
  62. private:
  63. KBackgroundRenderer *r;
  64. BGAdvancedBase *dlg;
  65. TQWidget *m_pMonitor;
  66. TQDict<TQListViewItem> m_programItems;
  67. TQString m_selectedProgram;
  68. int m_oldBackgroundMode;
  69. int m_backgroundMode;
  70. };
  71. /**
  72. * Dialog to edit a background program.
  73. */
  74. class KProgramEditDialog: public KDialogBase
  75. {
  76. Q_OBJECT
  77. public:
  78. KProgramEditDialog(const TQString &program=TQString::null, TQWidget *parent=0L,
  79. char *name=0L);
  80. /** The program name is here in case the user changed it */
  81. TQString program()const;
  82. public slots:
  83. void slotOk();
  84. private:
  85. TQString m_Program;
  86. TQLineEdit *m_NameEdit, *m_CommentEdit;
  87. TQLineEdit *m_ExecEdit, *m_CommandEdit;
  88. TQLineEdit *m_PreviewEdit;
  89. TQSpinBox *m_RefreshEdit;
  90. KBackgroundProgram *m_Prog;
  91. };
  92. #endif