KBFX – an alternative to T-Menu
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.

115 lines
2.7KB

  1. /*
  2. * Copyright (C) 2006
  3. * Siraj Razick <siraj@kdemail.net>
  4. * PhobosK <phobosk@mail.kbfx.net>
  5. * see Also AUTHORS
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU Library General Public License version 2 as
  9. * published by the Free Software Foundation
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details
  15. *
  16. * You should have received a copy of the GNU Library General Public
  17. * License along with this program; if not, write to the
  18. * Free Software Foundation, Inc.,
  19. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  20. */
  21. #ifndef KBFX_BUTTON_H
  22. #define KBFX_BUTTON_H
  23. #include <tqdragobject.h>
  24. #include <tqimage.h>
  25. #include <tqlabel.h>
  26. #include <tqpainter.h>
  27. #include <tqpixmap.h>
  28. #include <tqtimer.h>
  29. #include <dcopclient.h>
  30. #include <dcopref.h>
  31. #include <kdebug.h>
  32. #include <kimageeffect.h>
  33. #include <tdelocale.h>
  34. #include <tdemessagebox.h>
  35. #include <tdepopupmenu.h>
  36. #include <krun.h>
  37. #include <kbfxconfig.h>
  38. #include <kbfxplasmapixmapprovider.h>
  39. class TQPixmap;
  40. class TQLabel;
  41. class KbfxButton:public TQLabel
  42. {
  43. Q_OBJECT
  44. public:
  45. KbfxButton ( TQWidget * parent, const char * name = 0 );
  46. ~KbfxButton();
  47. void kbfx_vista_button_setFx ( bool choice );
  48. virtual void paintEvent ( TQPaintEvent *pe );
  49. virtual void enterEvent ( TQEvent * e ) ;
  50. virtual void leaveEvent ( TQEvent * e );
  51. virtual void mousePressEvent ( TQMouseEvent * e );
  52. virtual void dropEvent ( TQDropEvent *e );
  53. virtual void dragEnterEvent ( TQDragEnterEvent *e );
  54. static bool m_sizeHeight;
  55. static int m_size;
  56. TQCString findPanel();
  57. void readjust( bool );
  58. public slots:
  59. void loadSkins();
  60. void toggle();
  61. void toggleKMenu();
  62. void fade();
  63. void reloadConfig();
  64. void openKmenuEdit();
  65. void selfDeleter();
  66. void openConfigDialog();
  67. signals:
  68. void pressed();
  69. void hideMenu();
  70. void leave ();
  71. void clicked ();
  72. void showToolTip ();
  73. protected:
  74. TQPixmap m_over_skin;
  75. TQPixmap m_pressed_skin;
  76. TQPixmap m_release_skin;
  77. TQPixmap m_normal_skin;
  78. TQPixmap m_current_skin;
  79. // mng support ???
  80. TQPixmap * m_buffer;
  81. TQTimer * m_anime_timer;
  82. TQMovie * m_normal_anime;
  83. TQMovie * m_pressed_anime;
  84. TQMovie * m_hover_anime;
  85. TQMovie * m_current_anime;
  86. TQString m_normal_path;
  87. TQString m_over_path;
  88. TQString m_pressed_path;
  89. bool m_anime_on;
  90. bool m_kicker_auto_adjust;
  91. DCOPClient * m_dcopClient;
  92. /* state of the button */
  93. bool m_toggle;
  94. TQTimer * fade_timer;
  95. float m_opacity;
  96. TQPixmap m_fadePix;
  97. int m_fadeTime;
  98. };
  99. #endif