TDE core libraries
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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /*
  2. Copyright (c) 2004 Aaron J. Seigo <aseigo@kde.org>
  3. This library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Library General Public
  5. License as published by the Free Software Foundation; either
  6. version 2 of the License, or (at your option) any later version.
  7. This library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Library General Public License for more details.
  11. You should have received a copy of the GNU Library General Public License
  12. along with this library; see the file COPYING.LIB. If not, write to
  13. the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  14. Boston, MA 02110-1301, USA.
  15. */
  16. #ifndef _khotnewbutton_h
  17. #define _khotnewbutton_h
  18. #include <kpushbutton.h>
  19. namespace KNS
  20. {
  21. class DownloadDialog;
  22. /**
  23. * TDEHotNewStuff push button that makes using KHNS in an application
  24. * more convenient by encapsulating most of the details involved in
  25. * using TDEHotNewStuff in the button itself.
  26. *
  27. * @since 3.4
  28. */
  29. class Button : public KPushButton
  30. {
  31. Q_OBJECT
  32. public:
  33. /**
  34. * Constructor used when the details of the TDEHotNewStuff
  35. * download is known when the button is created.
  36. *
  37. * @param what text describing what is being downloaded. will be
  38. * shown on the button as "Download New <what>"
  39. * @param providerList the URL to the list of providers; if empty
  40. * we first try the ProvidersUrl from TDEGlobal::config, then we
  41. * fall back to a hardcoded value
  42. * @param resourceType the Hotstuff data type for this downlaod such
  43. * as "korganizer/calendar"
  44. * @param parent the parent widget
  45. * @param name the name to be used for this widget
  46. */
  47. Button(const TQString& what,
  48. const TQString& providerList,
  49. const TQString& resourceType,
  50. TQWidget* parent, const char* name);
  51. /**
  52. * Constructor used when the details of the TDEHotNewStuff
  53. * download is not known in advance of the button being created.
  54. *
  55. * @param parent the parent widget
  56. * @param name the name to be used for this widget
  57. */
  58. Button(TQWidget* parent, const char* name);
  59. /**
  60. * set the URL to the list of providers for this button to use
  61. */
  62. void setProviderList(const TQString& providerList);
  63. /**
  64. * the Hotstuff data type for this downlaod such as
  65. * "korganizer/calendar"
  66. */
  67. void setResourceType(const TQString& resourceType);
  68. /**
  69. * set the text that should appear on the button. will be prefaced
  70. * with i18n("Download New")
  71. */
  72. void setButtonText(const TQString& what);
  73. signals:
  74. /**
  75. * emitted when the Hot New Stuff dialog is about to be shown, usually
  76. * as a result of the user having click on the button
  77. */
  78. void aboutToShowDialog();
  79. /**
  80. * emitted when the Hot New Stuff dialog has been closed
  81. */
  82. void dialogFinished();
  83. protected slots:
  84. void showDialog();
  85. private:
  86. void init();
  87. class ButtonPrivate;
  88. ButtonPrivate* d;
  89. TQString m_providerList;
  90. TQString m_type;
  91. DownloadDialog* m_downloadDialog;
  92. };
  93. }
  94. #endif