/inc/grid_view/spacercolumn.h

https://code.google.com/p/dwarftherapist/ · C Header · 47 lines · 18 code · 6 blank · 23 comment · 0 complexity · 4b5734166a18ee7488ba01414cd2a0cf MD5 · raw file

  1. /*
  2. Dwarf Therapist
  3. Copyright (c) 2009 Trey Stout (chmod)
  4. Permission is hereby granted, free of charge, to any person obtaining a copy
  5. of this software and associated documentation files (the "Software"), to deal
  6. in the Software without restriction, including without limitation the rights
  7. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. copies of the Software, and to permit persons to whom the Software is
  9. furnished to do so, subject to the following conditions:
  10. The above copyright notice and this permission notice shall be included in
  11. all copies or substantial portions of the Software.
  12. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  15. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  16. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  17. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18. THE SOFTWARE.
  19. */
  20. #ifndef SPACER_COLUMN_H
  21. #define SPACER_COLUMN_H
  22. #include "viewcolumn.h"
  23. class SpacerColumn : public ViewColumn {
  24. public:
  25. SpacerColumn(QString title, ViewColumnSet *set = 0, QObject *parent = 0);
  26. SpacerColumn(QSettings &s, ViewColumnSet *set = 0, QObject *parent = 0);
  27. SpacerColumn(const SpacerColumn &to_copy); //! copy ctor
  28. SpacerColumn* clone() {return new SpacerColumn(*this);}
  29. QStandardItem *build_cell(Dwarf *d);
  30. QStandardItem *build_aggregate(const QString &group_name, const QVector<Dwarf*> &dwarves);
  31. void set_width(int w) {m_width = w;}
  32. int width() {return m_width;}
  33. // override
  34. void write_to_ini(QSettings &s);
  35. private:
  36. int m_width; // in pixels
  37. };
  38. #endif