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.

105 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_PLASMA_CANVAS_ABSTRACT_ITEM_H
  22. #define KBFX_PLASMA_CANVAS_ABSTRACT_ITEM_H
  23. #include <tqcanvas.h>
  24. #include <tqpainter.h>
  25. #include "kbfxplasmacanvasrtti.h"
  26. #include <tqtimer.h>
  27. #include <kdesktopfile.h>
  28. #include <kstandarddirs.h>
  29. #include <kiconloader.h>
  30. #include "kbfxdatasource.h"
  31. #include <krun.h>
  32. class KbfxPlasmaCanvasAbstractItem:public TQObject,public TQCanvasSprite
  33. {
  34. Q_OBJECT
  35. public:
  36. typedef enum {EXECUTABLE=0,SEPARATOR,INDEX,OTHER} Type;
  37. // typedef enum {RASTER=0,VECTOR,NATIVE} SkinMode;
  38. KbfxPlasmaCanvasAbstractItem ( TQCanvasPixmapArray * a, TQCanvas * canvas );
  39. virtual ~KbfxPlasmaCanvasAbstractItem ();
  40. void setCurrent ( bool );
  41. virtual Type type() { return m_type; }
  42. virtual void setType ( Type t ) { m_type = t;}
  43. TQString name() { if ( m_source != 0 ) return m_source->name(); else return TQString ( "Not Set" );};
  44. void setSource ( KbfxDataSource src );
  45. bool isCurrent();
  46. virtual int height() { return m_height;}
  47. virtual int width() { return m_width;}
  48. virtual bool lookup ( TQString str ) {str = str ; return false;}
  49. virtual int rtti() const { return CANVASITEM;}
  50. virtual void draw ( TQPainter & pe );
  51. virtual void drawContent ( TQPainter * pe );
  52. virtual TQPixmap dragPixmap();
  53. //Event Handling
  54. virtual void mousePressEvent ( TQMouseEvent * e );
  55. virtual void mouseMoveEvent ( TQMouseEvent * e );
  56. virtual void enterEvent ( TQEvent * e );
  57. virtual void mouseReleaseEvent ( TQMouseEvent * e );
  58. virtual void setLabelText ( TQString s );
  59. public slots:
  60. virtual void hideit();
  61. virtual void exec();
  62. signals:
  63. void clicked();
  64. void leave();
  65. void selected ( KbfxPlasmaCanvasAbstractItem* );
  66. private:
  67. // KbfxPlasmaCanvasAbstractItem (const KbfxPlasmaCanvasItem &t);
  68. KbfxDataSource * m_source;
  69. Type m_type;
  70. int m_height;
  71. int m_width;
  72. bool m_current;
  73. }
  74. ;//C.G
  75. #endif //M.I.G