TDE personal information management applications
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.

boxcontainer.h 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /*
  2. * Copyright (C) 2004, Mart Kelder (mart.kde@hccnet.nl)
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  17. */
  18. #ifndef MK_BOXCONTAINER_H
  19. #define MK_BOXCONTAINER_H
  20. #include <tqobject.h>
  21. class BoxContainerItem;
  22. template< class T > class TQPtrList;
  23. class TDEConfig;
  24. /**
  25. * This class is the base for all BoxContainers. A BoxContainer is a place
  26. * where BoxContainerItems can be placed. BoxContainerItems are the boxes you see.
  27. */
  28. class BoxContainer : public TQObject
  29. { Q_OBJECT
  30. public:
  31. /**
  32. * Constructor: everything is passed to TQObject.
  33. *
  34. * @param parent The parent of this object
  35. * @param name The name of this object
  36. */
  37. BoxContainer( TQObject *parent = 0, const char * name = 0 );
  38. /**
  39. * Destructor
  40. */
  41. ~BoxContainer();
  42. /**
  43. * This method reads the config from a certain TDEConfig instance.
  44. *
  45. * @param config The TDEConfig-instance to read the config from.
  46. */
  47. void readConfig( TDEConfig* config );
  48. /**
  49. * This method writes the config to a certain TDEConfig instance.
  50. *
  51. * @param config The TDEConfig-instance to write the config to.
  52. */
  53. void writeConfig( TDEConfig *config );
  54. /**
  55. * Shows all childs and itself
  56. */
  57. virtual void showBox();
  58. public slots:
  59. /**
  60. * This slot is triggered if the configuration window has to be shown.
  61. * This call is passed through.
  62. */
  63. void slotShowConfiguration();
  64. protected:
  65. /**
  66. * This methos adds a child to the list.
  67. *
  68. * @param item The item to be added.
  69. */
  70. virtual void addItem( BoxContainerItem* item );
  71. /**
  72. * This method creates a new BoxContainerItem instance of the same
  73. * type as the BoxContainer.
  74. *
  75. * @return A new instance to a BoxContainerItem of the same type.
  76. */
  77. virtual BoxContainerItem* newBoxInstance() const = 0;
  78. /**
  79. * The list of BoxContainerItems.
  80. */
  81. TQPtrList< BoxContainerItem > *_items;
  82. signals:
  83. /**
  84. * This signal is used to pass the slotShowConfiguration call through
  85. */
  86. void showConfiguration();
  87. };
  88. #endif //MK_BOXCONTAINER_H