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.

126 lines
3.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_VIEW_H
  22. #define KBFX_PLASMA_CANVAS_VIEW_H
  23. #include <tqcanvas.h>
  24. #include <tqcursor.h>
  25. #include <tqdragobject.h>
  26. #include <tqpainter.h>
  27. #include <kimageeffect.h>
  28. #include <kbfxconfig.h>
  29. #include <kbfxdatastack.h>
  30. #include <kbfxplasmapixmapprovider.h>
  31. #include <kbfxplasmapluginloader.h>
  32. //#include "kbfxplasmacanvasrtti.h"
  33. #include "kbfxplasmacanvasgroup.h"
  34. #include "kbfxplasmacanvasgroupview.h"
  35. #include "kbfxplasmacanvasitem.h"
  36. #include "kbfxplasmacanvasitemwrapper.h"
  37. #include "kbfxplasmacanvasstack.h"
  38. #include "kbfxplasmacanvasview.h"
  39. #include "kbfxsignal.h"
  40. #include "kbfxspinxscrollbar.h"
  41. class TQCanvasView;
  42. class KbfxPlasmaCanvasView : public TQCanvasView
  43. {
  44. Q_OBJECT
  45. public:
  46. typedef TQMap<TQString,KbfxPlasmaCanvasStack*> stackMap;
  47. typedef TQMap<TQString,KbfxDataStack*> dataStack;
  48. typedef TQMap<int,KbfxPlasmaCanvasItem*> searchMap;
  49. KbfxPlasmaCanvasView ( TQWidget * parent = 0, const char * name = 0, WFlags f = 0 );
  50. virtual ~KbfxPlasmaCanvasView();
  51. void addStack ( KbfxPlasmaCanvasStack*stk,TQString name );
  52. void addStack ( KbfxDataStack*stk,TQString name );
  53. void setKbfxCanvas ( TQCanvas*cnv );
  54. void loadGroup ( KbfxDataGroupList * src,KbfxPlasmaCanvasGroupView * dest );
  55. void contentsDragLeaveEvent ( TQDragEnterEvent *event );
  56. void contentsDragEnterEvent ( TQDragEnterEvent *event );
  57. public slots:
  58. void clearAll();
  59. virtual void contentsMousePressEvent ( TQMouseEvent * me );
  60. virtual void contentsMouseMoveEvent ( TQMouseEvent * e );
  61. virtual void contentsMouseReleaseEvent ( TQMouseEvent * e );
  62. virtual void mouseMoveEvent ( TQMouseEvent * me );
  63. virtual void enterEvent ( TQEvent * e );
  64. virtual void keyPressEvent ( TQKeyEvent * ke );
  65. virtual void emulatedKeyPress ( TQKeyEvent * k ) {keyPressEvent ( k );}
  66. virtual void resizeEvent ( TQResizeEvent * ) ;
  67. virtual void leaveEvent ( TQEvent * e );
  68. // virtual void leaveEvent(TQEvent e );
  69. void handleLoadRequest ( KbfxSignal );
  70. void search ( const TQString & );
  71. void search_R ( const TQString key );
  72. void execFirst();
  73. void execAt ( int i );
  74. void expandAll();
  75. void reload();
  76. signals:
  77. void clicked();
  78. protected:
  79. void clearAllButOne ( KbfxPlasmaCanvasItem * i );
  80. private:
  81. void clearSearch();
  82. void startDrag();
  83. void placeScrollBars();
  84. TQPoint m_clickPos;
  85. KbfxPlasmaCanvasItem * m_currentItem;
  86. KbfxPlasmaCanvasStack * m_currentStack;
  87. KbfxPlasmaCanvasStack * m_stack;
  88. TQString m_lastSignalData;
  89. stackMap m_appletMap;
  90. dataStack m_dataStack;
  91. searchMap m_searchMap;
  92. KbfxPlasmaCanvasStack * gstack ;
  93. KbfxPlasmaCanvasItem * m_exeCandidate;
  94. TQCanvas * m_default;
  95. TQCanvas * m_search;
  96. bool m_findDone;
  97. KbfxSpinxScrollBar * m_scrollbar_top;
  98. KbfxSpinxScrollBar * m_scrollbar_bot;
  99. TQPoint m_dragPos;
  100. KbfxPlasmaCanvasGroupView * m_currentView;
  101. TQString m_currentViewName;
  102. KbfxPlasmaCanvasItem * m_selectedItem;
  103. };
  104. #endif