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.

97 lines
2.4KB

  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_GROUP_H
  22. #define KBFX_PLASMA_CANVAS_GROUP_H
  23. #include <tqmap.h>
  24. #include <tqptrlist.h>
  25. #include "kbfxplasmacanvasabstractitem.h"
  26. #include <tqobject.h>
  27. class TQCanvasItem;
  28. class TQRect;
  29. class KbfxPlasmaCanvasGroup:public TQObject
  30. {
  31. Q_OBJECT
  32. public:
  33. typedef TQPtrList<KbfxPlasmaCanvasAbstractItem> ItemList;
  34. typedef TQPtrListIterator<KbfxPlasmaCanvasAbstractItem> ItemListIter;
  35. //a Global mapof Groups
  36. typedef TQMap<KbfxPlasmaCanvasAbstractItem*,KbfxPlasmaCanvasGroup*> ItemListMap;
  37. KbfxPlasmaCanvasGroup();
  38. virtual ~KbfxPlasmaCanvasGroup();
  39. bool addItem ( KbfxPlasmaCanvasAbstractItem * );
  40. bool deleteItem ( KbfxPlasmaCanvasAbstractItem * );
  41. void move ( int x,int y );
  42. void moveBy ( int x,int y );
  43. TQString name();
  44. TQRect boundingRect();
  45. int count();
  46. int height();
  47. int width();
  48. static KbfxPlasmaCanvasGroup * groupContaining ( KbfxPlasmaCanvasAbstractItem * );
  49. TQString groupName();
  50. uint groupID();
  51. void setGroupName ( TQString name );
  52. void setGroupID ( uint );
  53. bool isShaded() {return m_shaded;};
  54. virtual int rtti() { return 1005;}
  55. void showAll();
  56. public slots:
  57. void moveUp ( int );
  58. void moveDown ( int );
  59. void shade();//folding action
  60. void hide();
  61. void show();
  62. signals:
  63. void groupShade ( uint id );
  64. void groupUnShade ( uint id );
  65. private :
  66. ItemList m_itemList;
  67. static ItemListMap& itemListMap();
  68. int m_x;
  69. int m_y;
  70. int m_height;
  71. int m_width;
  72. //state variables
  73. bool m_shaded;
  74. bool m_visible;
  75. TQString m_name;
  76. uint m_id;
  77. int m_sepheight;
  78. int m_count;
  79. };
  80. #endif