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.
 
 
 
 
 
 

110 lines
2.6 KiB

  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_SPINX_H
  22. #define KBFX_SPINX_H
  23. #define zap(x) if(x){delete(x); x=0;}
  24. #include <config.h>
  25. #include <tqbitmap.h>
  26. #include <tqlabel.h>
  27. #include <tqlcdnumber.h>
  28. #include <tqpoint.h>
  29. #include <tqpopupmenu.h>
  30. #include <tqstring.h>
  31. #include <tqtimer.h>
  32. #include <dcopclient.h>
  33. #include <dcopobject.h>
  34. #include <dcopref.h>
  35. #include <tdeapplication.h>
  36. #include <tdeconfig.h>
  37. #include <kdebug.h>
  38. #include <kdirwatch.h>
  39. #include <tdeglobal.h>
  40. #include <tdelocale.h>
  41. #include <tdemessagebox.h>
  42. #include <kpanelapplet.h>
  43. #include <tdepopupmenu.h>
  44. #include <krun.h>
  45. #include <kuser.h>
  46. #include <kbfxconfig.h>
  47. #include <kbfxplasmapixmapprovider.h>
  48. #include "kbfxbutton.h"
  49. #include "kbfxspinxmenu.h"
  50. #include "kbfxspinxpopup.h"
  51. #include "kbfxspinxview.h"
  52. #include "kbfxtooltip.h"
  53. class KbfxSpinx : public KPanelApplet,public DCOPObject
  54. {
  55. K_DCOP
  56. Q_OBJECT
  57. //
  58. public:
  59. KbfxSpinx ( const TQString& configFile, Type t = Normal, int actions = 0,
  60. TQWidget *parent = 0, const char *name = 0 );
  61. ~KbfxSpinx();
  62. virtual int widthForHeight ( int height ) const;
  63. virtual int heightForWidth ( int width ) const;
  64. virtual void about();
  65. virtual void help();
  66. virtual void preferences();
  67. TQPoint menuPosition();
  68. void resizeRequest() { emit(updateLayout()); }
  69. k_dcop:
  70. ASYNC showMenu();
  71. ASYNC notifyConfigChange();
  72. public slots:
  73. void showKbfxMenu();
  74. void showKmenu();
  75. void ToolTip();
  76. void dirtyReaload(const TQString&);
  77. protected:
  78. void createRMenu();
  79. void createKbfx();
  80. bool m_tooltip;
  81. private:
  82. TDEConfig *ksConfig;
  83. KbfxButton * kbfxBtn;
  84. KbfxSpinxMenuWidget * m_menuWidget;
  85. KbfxSpinxPopUp * m_menu;
  86. TQWidget * m_parent;
  87. bool m_kicker_auto_adjust;
  88. bool m_KbfxWatcher;
  89. static bool m_horizontal_position;
  90. DCOPClient * m_dcopClient;
  91. TQTimer * kmenu_timer;
  92. KDirWatch * l_watch;
  93. };
  94. #endif