Table_def.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /* Table_def.h
  2. *
  3. * Copyright (C) 2002-2012,2015,2016,2017 Paul Boersma
  4. *
  5. * This code is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or (at
  8. * your option) any later version.
  9. *
  10. * This code is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. * See the GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this work. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #define ooSTRUCT TableCell
  19. oo_DEFINE_STRUCT (TableCell)
  20. oo_STRING (string)
  21. #if oo_DECLARING || oo_COPYING
  22. oo_DOUBLE (number)
  23. #endif
  24. oo_END_STRUCT (TableCell)
  25. #undef ooSTRUCT
  26. #define ooSTRUCT TableRow
  27. oo_DEFINE_CLASS (TableRow, Daata)
  28. oo_INTEGER (numberOfColumns)
  29. oo_STRUCT_VECTOR (TableCell, cells, numberOfColumns)
  30. #if oo_DECLARING || oo_COPYING
  31. oo_INTEGER (sortingIndex)
  32. #endif
  33. oo_END_CLASS (TableRow)
  34. #undef ooSTRUCT
  35. #define ooSTRUCT TableColumnHeader
  36. oo_DEFINE_STRUCT (TableColumnHeader)
  37. oo_STRING (label)
  38. #if oo_DECLARING || oo_COPYING
  39. oo_INT16 (numericized)
  40. #endif
  41. oo_END_STRUCT (TableColumnHeader)
  42. #undef ooSTRUCT
  43. #define ooSTRUCT Table
  44. oo_DEFINE_CLASS (Table, Daata)
  45. oo_INTEGER (numberOfColumns)
  46. oo_STRUCT_VECTOR (TableColumnHeader, columnHeaders, numberOfColumns)
  47. oo_COLLECTION_OF (OrderedOf, rows, TableRow, 0)
  48. #if oo_DECLARING
  49. void v_info ()
  50. override;
  51. bool v_hasGetNrow ()
  52. override { return true; }
  53. double v_getNrow ()
  54. override { return rows.size; }
  55. bool v_hasGetNcol ()
  56. override { return true; }
  57. double v_getNcol ()
  58. override { return numberOfColumns; }
  59. bool v_hasGetColStr ()
  60. override { return true; }
  61. conststring32 v_getColStr (integer columnNumber)
  62. override;
  63. bool v_hasGetMatrix ()
  64. override { return true; }
  65. double v_getMatrix (integer rowNumber, integer columnNumber)
  66. override;
  67. bool v_hasGetMatrixStr ()
  68. override { return true; }
  69. conststring32 v_getMatrixStr (integer rowNumber, integer columnNumber)
  70. override;
  71. bool v_hasGetColIndex ()
  72. override { return true; }
  73. double v_getColIndex (conststring32 columnLabel)
  74. override;
  75. #endif
  76. oo_END_CLASS (Table)
  77. #undef ooSTRUCT
  78. /* End of file Table_def.h */