zjf
2023-03-06 392b76515f40376b6d36f40a114850ef63650384
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
/////////////////////////////////////////////////////////////////////////////// 
// Copyright (C) 2002-2016, Open Design Alliance (the "Alliance"). 
// All rights reserved. 
// 
// This software and its documentation and related materials are owned by 
// the Alliance. The software may only be incorporated into application 
// programs owned by members of the Alliance, subject to a signed 
// Membership Agreement and Supplemental Software License Agreement with the
// Alliance. The structure and organization of this software are the valuable  
// trade secrets of the Alliance and its suppliers. The software is also 
// protected by copyright law and international treaty provisions. Application  
// programs incorporating this software must include the following statement 
// with their copyright notices:
//   
//   This application incorporates Teigha(R) software pursuant to a license 
//   agreement with Open Design Alliance.
//   Teigha(R) Copyright (C) 2002-2016 by Open Design Alliance. 
//   All rights reserved.
//
// By use of this software, its documentation or related materials, you 
// acknowledge and accept the above terms.
///////////////////////////////////////////////////////////////////////////////
 
 
#ifndef OD_DBTABLESTYLE_H
#define OD_DBTABLESTYLE_H
 
#include "TD_PackPush.h"
#include "DbObject.h"
#include "DbColor.h"
#include "OdValue.h"
#include "StringArray.h"
 
/** \details
  
    <group TD_Namespaces>
*/
namespace OdDb
{
  // OdDbTable and OdTbTableStyle specific enum
  //
  
  enum CellType          
  { 
    kUnknownCell    = 0,
    kTextCell       = 1,
    kBlockCell      = 2,
    kMultipleContentCell = 3
  };
 
  enum CellContentType   
  { 
    kCellContentTypeUnknown = 0x0,
    kCellContentTypeValue   = 0x1,
    kCellContentTypeField   = 0x2,
    kCellContentTypeBlock   = 0x4
  };
 
  enum CellEdgeMask      
  { 
    kTopMask        = 0x1,
    kRightMask      = 0x2,
    kBottomMask     = 0x4,
    kLeftMask       = 0x8 
  };
 
  enum SelectType
  { 
    kWindow         = 1,
    kCrossing       = 2 
  };
 
  enum FlowDirection
  { 
    kTtoB           = 0,
    kBtoT           = 1 
  };
 
  enum RotationAngle     
  { 
    kDegreesUnknown = -1,
    kDegrees000     = 0,
    kDegrees090     = 1,
    kDegrees180     = 2,
    kDegrees270     = 3 
  };
 
  enum CellAlignment
  { 
    kTopLeft        = 1,
    kTopCenter      = 2,
    kTopRight       = 3,
    kMiddleLeft     = 4,
    kMiddleCenter   = 5,
    kMiddleRight    = 6,
    kBottomLeft     = 7,
    kBottomCenter   = 8,
    kBottomRight    = 9 
  };
 
  enum GridLineType
  { 
    kInvalidGridLine= 0x00,
    kHorzTop        = 0x01,
    kHorzInside     = 0x02,
    kHorzBottom     = 0x04,
    kVertLeft       = 0x08,
    kVertInside     = 0x10,
    kVertRight      = 0x20,
    kHorzGridLineTypes     = kHorzTop | kHorzBottom | kHorzInside,
    kVertGridLineTypes     = kVertLeft | kVertRight | kVertInside,
    kOuterGridLineTypes    = kHorzTop | kHorzBottom | kVertLeft | kVertRight,
    kInnerGridLineTypes    = kHorzInside | kVertInside,
    kAllGridLineTypes      = kOuterGridLineTypes | kInnerGridLineTypes
  };
 
 
  enum RowType
  { 
    kUnknownRow     = 0x0,
    kDataRow        = 0x1,
    kTitleRow       = 0x2,
    kHeaderRow      = 0x4
  };
 
  enum TableStyleFlags
  { 
    kHorzInsideLineFirst  = 0x1,
    kHorzInsideLineSecond = 0x2,
    kHorzInsideLineThird  = 0x4,
    kTableStyleModified   = 0x8
  };
 
 
  enum RowTypes
  { 
    kAllRows = kDataRow | kTitleRow | kHeaderRow 
  };
    
  enum GridLineTypes 
  {   
    kAllGridLines = kHorzTop | kHorzInside | kHorzBottom | kVertLeft | kVertInside | kVertRight 
  };
 
  enum GridLineStyle  
  { 
    kGridLineStyleSingle = 1,
    kGridLineStyleDouble = 2
  };
 
  enum CellMargin        
  { 
    kCellMarginTop         = 0x01,
    kCellMarginLeft        = 0x02,
    kCellMarginBottom      = 0x04,
    kCellMarginRight       = 0x08,
    kCellMarginHorzSpacing = 0x10,
    kCellMarginVertSpacing = 0x20 
  };
 
  enum CellContentLayout
  { 
    kCellContentLayoutFlow              = 0x1,
    kCellContentLayoutStackedHorizontal = 0x2,
    kCellContentLayoutStackedVertical   = 0x4
  };
 
  enum CellState
  { 
    kCellStateNone                        = 0x00,
    kCellStateContentLocked               = 0x01,
    kCellStateContentReadOnly             = 0x02,
    kCellStateLinked                      = 0x04,
    kCellStateContentModifiedAfterUpdate  = 0x08,
    kCellStateFormatLocked                = 0x10,
    kCellStateFormatReadOnly              = 0x20,
    kCellStateFormatModifiedAfterUpdate   = 0x40,
    kAllCellStates  = (kCellStateContentLocked | kCellStateContentReadOnly |
                       kCellStateLinked | kCellStateContentModifiedAfterUpdate | 
                       kCellStateFormatLocked | kCellStateFormatReadOnly |
                       kCellStateFormatModifiedAfterUpdate)
  };
 
  enum GridProperty      
  { 
    kGridPropInvalid           = 0x00,
    kGridPropLineStyle         = 0x01,
    kGridPropLineWeight        = 0x02,
    kGridPropLinetype          = 0x04,
    kGridPropColor             = 0x08,
    kGridPropVisibility        = 0x10,
    kGridPropDoubleLineSpacing = 0x20,
    kGridPropAll               = (kGridPropLineStyle | kGridPropLineWeight | kGridPropLinetype |
                                  kGridPropColor | kGridPropVisibility | kGridPropDoubleLineSpacing)
  };
 
  enum CellOption        
  {
    kCellOptionNone    = 0x0,
    kInheritCellFormat = 0x1
  };
 
  enum CellProperty      
  { 
    kCellPropInvalid               = 0x00000,
    kCellPropDataType              = 0x00001,
    kCellPropDataFormat            = 0x00002,
    kCellPropRotation              = 0x00004,
    kCellPropScale                 = 0x00008,
    kCellPropAlignment             = 0x00010,
    kCellPropContentColor          = 0x00020,
    kCellPropTextStyle             = 0x00040,
    kCellPropTextHeight            = 0x00080,
    kCellPropAutoScale             = 0x00100,
    kCellPropBackgroundColor       = 0x00200,
    kCellPropMarginLeft            = 0x00400,
    kCellPropMarginTop             = 0x00800,
    kCellPropMarginRight           = 0x01000,
    kCellPropMarginBottom          = 0x02000,
    kCellPropContentLayout         = 0x04000,
    kCellPropMergeAll              = 0x08000,
    kCellPropFlowDirBtoT           = 0x10000,
    kCellPropMarginHorzSpacing     = 0x20000,
    kCellPropMarginVertSpacing     = 0x40000,
    kCellPropDataTypeAndFormat     = (kCellPropDataType | kCellPropDataFormat),
    kCellPropContent               = (kCellPropDataType | kCellPropDataFormat | kCellPropRotation |
                                      kCellPropScale | kCellPropContentColor |  kCellPropTextStyle | 
                                      kCellPropTextHeight | kCellPropAutoScale),
    kCellPropBitProperties         = (kCellPropAutoScale | kCellPropMergeAll | kCellPropFlowDirBtoT),
    kCellPropAll                   = (kCellPropDataType | kCellPropDataFormat | kCellPropRotation |
                                      kCellPropScale | kCellPropAlignment | kCellPropContentColor | kCellPropBackgroundColor | 
                                      kCellPropTextStyle | kCellPropTextHeight | kCellPropMarginLeft | kCellPropMarginTop |
                                      kCellPropMarginRight | kCellPropMarginBottom | kCellPropMarginHorzSpacing | 
                                      kCellPropMarginVertSpacing | kCellPropAutoScale | kCellPropMergeAll | 
                                      kCellPropFlowDirBtoT | kCellPropContentLayout)
  };
}
 
  /** \details
    This class represents the parameters of cells for OdDbTable entities..
    
    <group Other_Classes>
  */
class OdCellRange
{
public:
  OdInt32  m_topRow;
  OdInt32  m_leftColumn;
  OdInt32  m_bottomRow;
  OdInt32  m_rightColumn;
 
  OdCellRange() : m_topRow(-1)
    , m_leftColumn(-1)
    , m_bottomRow(-1)
    , m_rightColumn(-1) {}
 
  OdCellRange(OdInt32 topRow, OdInt32 leftColumn, OdInt32 bottomRow, OdInt32 rightColumn)
    : m_topRow(topRow)
    , m_leftColumn(leftColumn)
    , m_bottomRow(bottomRow)
    , m_rightColumn(rightColumn)
  {}
 
  bool operator ==(
    const OdCellRange& range) const
  {
    return ( m_topRow == range.m_topRow &&
              m_leftColumn == range.m_leftColumn &&
              m_bottomRow == range.m_bottomRow &&
              m_rightColumn == range.m_rightColumn );
  }
  bool operator !=(
    const OdCellRange& range) const
  {
    return !( *this == range);
  }
};
 
typedef OdArray<OdCellRange> OdCellRangeArray;
 
 /** \details
    This class represents a grid for OdDbTable entities.
    
    <group Other_Classes>
 */
class OdGridProperty
{
public:
 
  OdDb::GridProperty  m_propMask;
  OdDb::GridLineStyle m_lineStyle;
  OdDb::LineWeight    m_lineWeight;
  OdDbHardPointerId   m_linetype;
  OdCmColor           m_color;
  OdDb::Visibility    m_visibility;
  double              m_doubleLineSpacing;
 
  OdGridProperty() : m_propMask(OdDb::kGridPropInvalid)
    , m_lineStyle(OdDb::kGridLineStyleSingle)
    , m_lineWeight(OdDb::kLnWtByBlock)
    , m_visibility(OdDb::kVisible)
    , m_doubleLineSpacing(0.0) {}
 
};
 
/** \details
    This class represents TableStyles for OdDbTable entities in an OdDbDatabase instance.
 
    <group OdDb_Classes>
*/
class TOOLKIT_EXPORT OdDbTableStyle : public OdDbObject
{
public:
  ODDB_DECLARE_MEMBERS(OdDbTableStyle);
 
  OdDbTableStyle();
  // virtual ~OdDbTableStyle();
 
  // General Properties
  //
  
  /** \details
    Returns the name of this TableStyle object.
  */
  virtual OdString getName() const;
 
  /** \details
    Sets the name of this TableStyle object.
 
    \param name [in]  Name.
  */
  virtual void setName(const OdString& name);
 
  /** \details
    Returns the description of this TableStyle object.
  */
  virtual OdString description() const;
 
  /** \details
    Sets the description of this TableStyle object.
    
    \param description [in]  Description.
  */
  virtual void setDescription(
    const OdString& description);
 
  /** \details
    Returns the bit flags for this TableStyle object (DXF 71). 
      
    \remarks
    bitFlags() returns a combination of zero or more of the following:
    
    <table>
    Name                      Value
    kHorzInsideLineFirst      1
    kHorzInsideLineSecond     2
    kHorzInsideLineThird      4
    kTableStyleModified       8 
    </table>
  */
  virtual OdUInt32 bitFlags() const;
 
  /** \details
    Sets the bit flags for this TableStyle object (DXF 71). 
    
    \param bitFlags [in]  Bit flags.
    
    \remarks
    bitFlags must be a combination of one or more of the following:
    
    <table>
    Name                      Value
    kHorzInsideLineFirst      1
    kHorzInsideLineSecond     2
    kHorzInsideLineThird      4
    kTableStyleModified       8 
    </table>
  */
  virtual void setBitFlags(
    OdUInt32 bitFlags);
 
  /** \details
    Returns the direction this TableStyle object flows from its first row to its last (DXF 70).
 
    \remarks
    flowDirection() returns one of the following:
    
    <table>
    Name          Value   Description
    OdDb::kTtoB   0       Top to Bottom
    OdDb::kBtoT   1       Bottom to Top
    </table>
  */
  virtual OdDb::FlowDirection flowDirection() const; 
 
  /** \details
    Sets the direction this TableStyle objectflows from its first row to its last. (DXF 70).
 
    \param flowDirection [in]  Flow direction.
    
    \remarks
    flowDirection must be one of the following: 
         
    <table>
    Name          Value   Description
    OdDb::kTtoB   0       Top to Bottom
    OdDb::kBtoT   1       Bottom to Top
    </table>
  */
  virtual void setFlowDirection(
    OdDb::FlowDirection flowDirection);
 
  /** \details
    Returns the horizontal cell margin for this TableStyle object (DXF 40). 
    \remarks
    The horizontal cell margin is the horizontal space between the cell text and the cell border.
  */
  virtual double horzCellMargin() const;
 
  /** \details
    Sets the horizontal cell margin for this TableStyle object (DXF 40).
    
    \param cellMargin [in]  Cell margin.
    
    \remarks
    The horizontal cell margin is the horizontal space between the cell text and the cell border.
  */
  virtual void   setHorzCellMargin(
    double cellMargin);
 
 
  /** \details
    Returns the vertical cell margin for this TableStyle object (DXF 41). 
 
    \remarks
    The vertical cell margin is the vertical space between the cell text and the cell border.
  */
  virtual double vertCellMargin() const;
 
  /** \details
    Sets the vertical cell margin for this Table entity (DXF 41).
    
    \param cellMargin [in]  Cell margin.
    
    \remarks
    The vertical cell margin is the vertical space between the cell text and the cell border.
  */
  virtual void setVertCellMargin(
    double cellMargin);
 
  /** \details
      Returns true if and only if the title row is suppressed for this TableStyle object (DXF 280).
  */
  virtual bool isTitleSuppressed() const;
 
  /** \details
    Controls the suppression of the title row (DXF 280).
    \param suppress [in]  Controls suppression.
  */
  virtual void suppressTitleRow(
    bool suppress);
 
  /** \details
    Returns true if and only if the header row is suppressed for this TableStyle object (DXF 281). 
  */
  virtual bool isHeaderSuppressed() const;
 
  /** \details
      Controls the suppression of the header row for this TableStyle object (DXF 280).
      \param enable [in]  Controls suppression.
  */
  virtual void suppressHeaderRow(
    bool suppress);
 
 
  /** \details
    Returns the Object ID of the text style for the specified row type in this TableStyle object (DXF 7).
 
    \param rowType [in]  Row type.
    
    \remarks
    rowType must be one of the following:
    
    <table>
    Name              Value
    kTitleRow         1
    kHeaderRow        2
    kDataRow          4
    </table>
  */
  virtual OdDbObjectId textStyle(
    OdDb::RowType rowType = OdDb::kDataRow) const;
 
  /** \details
    Sets the Object ID of the text style for the specified row types for this TableStyle object (DXF 7).
    
    \param rowTypes [in]  Row types.
    \param textStyleId [in]  Text style Object ID.
 
    \remarks
    rowTypes must be a combination of one or more of the following:
    
    <table>
    Name              Value
    kTitleRow         1
    kHeaderRow        2
    kDataRow          4
    </table>
  */
  virtual void setTextStyle(
    const OdDbObjectId textStyleId, 
    int rowTypes = OdDb::kAllRows);
 
  /** \details
    Returns the text height for the specified row type in this TableStyle object (DXF 140).
 
    \param rowType [in]  Row type
    
    \remarks
    rowType must be one of the following:
    
    <table>
    Name                    Value
    OdDb::kTitleRow         1
    OdDb::kHeaderRow        2
    OdDb::kDataRow          4
    </table>
  */
  virtual double textHeight(
    OdDb::RowType rowType = OdDb::kDataRow) const;
 
  /** \details
    Sets the text height for the specified row types in this TableStyle object (DXF 140).
 
    \param rowTypes [in]  Row types.
    \param height [in]  Text height.
 
    \remarks
    rowTypes must be a combination of one or more of the following:
    
    <table>
    Name              Value
    kTitleRow         1
    kHeaderRow        2
    kDataRow          4
    </table>
  */
  virtual void setTextHeight(
    double height, 
    int rowTypes = OdDb::kAllRows);
 
  /** \details
    Returns the cell alignment for the specified row type in this TableStyle object (DXF 170).
 
    \param rowType [in]  Row type
    
    \remarks
    rowType() returns one of the following:
    
    <table>
    Name                    Value
    OdDb::kTitleRow         1
    OdDb::kHeaderRow        2
    OdDb::kDataRow          4
    </table>
    
    alignment() returns one of the following:
    
    <table>
    Name                    Value
    OdDb::kTopLeft          1
    OdDb::kTopCenter        2 
    OdDb::kTopRight         3
    OdDb::kMiddleLeft       4
    OdDb::kMiddleCenter     5
    OdDb::kMiddleRight      6
    OdDb::kBottomLeft       7 
    OdDb::kBottomCenter     8
    OdDb::kBottomRight      9
    </table>
  */
  virtual OdDb::CellAlignment alignment(
    OdDb::RowType rowType = OdDb::kDataRow) const;
 
 
  /** \details
    Sets the cell alignment for the specified row types in this TableStyle object (DXF 170).
    
    \param rowTypes [in]  Row types.
    \param alignment [in]  Alignment.
 
    \remarks
    rowTypes must be a combination of one or more of the following:
    
    <table>
    Name                    Value
    OdDb::kTitleRow         1
    OdDb::kHeaderRow        2
    OdDb::kDataRow          4
    </table>
    
    alignment must be one of the following:
    
    <table>
    Name                    Value
    OdDb::kTopLeft          1
    OdDb::kTopCenter        2 
    OdDb::kTopRight         3
    OdDb::kMiddleLeft       4
    OdDb::kMiddleCenter     5
    OdDb::kMiddleRight      6
    OdDb::kBottomLeft       7 
    OdDb::kBottomCenter     8
    OdDb::kBottomRight      9
    </table>
  */
  virtual void setAlignment(
    OdDb::CellAlignment alignment, 
    int rowTypes = OdDb::kAllRows);
 
  /** \details
    Returns the text color for the specified row type in this TableStyle object (DXF 62).
 
    \param rowTypes [in]  Row types.
 
    \remarks
    rowTypes must be a combination of one or more of the following:
    
    <table>
    Name                    Value
    OdDb::kTitleRow         1
    OdDb::kHeaderRow        2
    OdDb::kDataRow          4
    </table>
  */
  virtual OdCmColor color(
    OdDb::RowType rowType = OdDb::kDataRow) const;
    
 
  /** \details
    Sets the text color for the specified row types in this TableStyle object (DXF 62).
 
    \param rowTypes [in]  Row types.
    \param color [in]  Color.
 
    \remarks
    rowTypes must be a combination of one or more of the following:
    
    <table>
    Name                    Value
    OdDb::kTitleRow         1
    OdDb::kHeaderRow        2
    OdDb::kDataRow          4
    </table>
  */
  virtual void setColor(
    const OdCmColor& color,
    int rowTypes = OdDb::kAllRows);
 
  /** \details
    Returns the background color for the specified row type in this TableStyle object (DXF 63).
 
    \param rowType [in]  Row type.
 
    \remarks
    rowType must be one of the following:
    
    <table>
    Name                    Value
    OdDb::kTitleRow         1
    OdDb::kHeaderRow        2
    OdDb::kDataRow          4
    </table>
  */
  virtual OdCmColor backgroundColor(
    OdDb::RowType rowType = OdDb::kDataRow) const;
 
  /** \details
    Sets the background color for the specified row type in this TableStyle object (DXF 63). 
 
    \param rowTypes [in]  Row types.
    \param color [in]  Background color.
    
    \remarks
    rowTypes must be a combination of one or more of the following:
    
    <table>
    Name                    Value
    OdDb::kTitleRow         1
    OdDb::kHeaderRow        2
    OdDb::kDataRow          4
    </table>
  */
  virtual void setBackgroundColor(
    const OdCmColor& color,
    int rowTypes = OdDb::kAllRows);
 
  /** \details
    Returns true if and only if the background color for the specified row 
    type is disabled for this TableStyle object (DXF 283).
 
    \param rowType [in]  Row type
    \param row [in]  Row index of the cell.
    \param column [in]  Column index of the cell.
 
    \remarks
    rowType must be one of the following:
    
    <table>
    Name                    Value
    OdDb::kTitleRow         1
    OdDb::kHeaderRow        2
    OdDb::kDataRow          4
    </table>
  */
  virtual bool isBackgroundColorNone(
    OdDb::RowType rowType = OdDb::kDataRow) const;
 
  /** \details
    Controls the background color setting for the specified row types or cell in this TableStyle object (DXF 283). 
 
    \param disable [in]  Disables the background color if true, enables if false.
    \param rowTypes [in]  Row types.
 
    \remarks
    rowTypes must be a combination of one or more of the following:
    
    <table>
    Name                    Value
    OdDb::kTitleRow         1
    OdDb::kHeaderRow        2
    OdDb::kDataRow          4
    </table>
  */
  virtual void setBackgroundColorNone(
    bool disable,
    int rowTypes = OdDb::kAllRows);
 
  //Gridline properties
  //
  
  /** \details
    Returns the grid lineweight for the specified gridline type and row type in this TableStyle object (DXF 274-279).
      
    \param gridlineType [in]  Gridline type.
    \param rowType [in]  Row type.
 
    \remarks
    gridlineType must be one of the following:
    
    <table>
    Name                    Value
    OdDb::kHorzTop          1
    OdDb::kHorzInside       2
    OdDb::kHorzBottom       4
    OdDb::kVertLeft         8
    OdDb::kVertInside       0x10
    OdDb::kVertRight        0x20
    </table>
    
    rowType must be one of the following:
    
    <table>
    Name                    Value
    OdDb::kTitleRow         1
    OdDb::kHeaderRow        2
    OdDb::kDataRow          4
    </table>
    
  */
  virtual OdDb::LineWeight gridLineWeight(
    OdDb::GridLineType gridlineType,
    OdDb::RowType rowType = OdDb::kDataRow) const; 
  
  /** \details
    Sets the grid lineweight for the specified gridline types and row types,
    or the specified cell and edges in this Table entity (DXF 274-279).
      
    \param lineWeight [in]  Lineweight.      
    \param gridlineTypes [in]  Gridline types.
    \param rowTypes [in]  Row types.
 
    \remarks
    gridlineTypes must be a combination of one or more of the following:
    
    <table>
    Name                    Value
    OdDb::kHorzTop          1
    OdDb::kHorzInside       2
    OdDb::kHorzBottom       4
    OdDb::kVertLeft         8
    OdDb::kVertInside       0x10
    OdDb::kVertRight        0x20
    </table>
    
    rowTypes must be a combination of one or more of the following:
    
    <table>
    Name                    Value
    OdDb::kTitleRow         1
    OdDb::kHeaderRow        2
    OdDb::kDataRow          4
    </table>
  */
  virtual void setGridLineWeight(
    OdDb::LineWeight lineWeight, 
    int gridlineTypes = OdDb::kAllGridLines, 
    int rowTypes = OdDb::kAllRows);
 
 
  /** \details
    Returns the grid color for the specified gridline type and row type
    in this TableStyle object (DXF 63,64,65,66,68,69).
      
    \param gridlineType [in]  Gridline type.
    \param rowType [in]  Row type.
 
    \remarks
    gridlineType must be one of the following:
    
    <table>
    Name                    Value
    OdDb::kHorzTop          1
    OdDb::kHorzInside       2
    OdDb::kHorzBottom       4
    </table>
    
    rowType must be one of the following:
    
    <table>
    Name                    Value
    OdDb::kTitleRow         1
    OdDb::kHeaderRow        2
    OdDb::kDataRow          4
    </table>
  */
  virtual OdCmColor gridColor(
    OdDb::GridLineType gridlineType,
    OdDb::RowType rowType = OdDb::kDataRow) const; 
 
  /** \details
    Returns the grid color for the specified gridline types and row type
    in this TableStyle object (DXF 63,64,65,66,68,69).
      
    \param gridlineTypes [in]  Gridline types.
    \param rowTypes [in]  Row types.
 
    \remarks
    gridlineTypes must be a combination of one or more of the following:
    
    <table>
    Name                    Value
    OdDb::kHorzTop          1
    OdDb::kHorzInside       2
    OdDb::kHorzBottom       4
    </table>
    
    rowTypes must be a combination of one or more of the following:
    
    <table>
    Name                    Value
    OdDb::kTitleRow         1
    OdDb::kHeaderRow        2
    OdDb::kDataRow          4
    </table>
  */
  virtual void setGridColor(
    const OdCmColor color, 
    int gridlineTypes = OdDb::kAllGridLines, 
    int rowTypes = OdDb::kAllRows);
 
 
  /** \details
    Returns the grid visibility for the specified gridline type and row type,
    in this TableStyle object (DXF 284-289).
      
    \param gridlineType [in]  Gridline type.
    \param rowType [in]  Row type.
 
    \remarks
    gridVisibility() returns one of the following:
    
    <table>
    Name                    Value
    OdDb::kInvisible        1
    OdDb::kVisible          0 
    </table>
        
    gridlineType must be one of the following:
    
    <table>
    Name                    Value
    OdDb::kHorzTop          1
    OdDb::kHorzInside       2
    OdDb::kHorzBottom       4
    OdDb::kVertLeft         8
    OdDb::kVertInside       0x10
    OdDb::kVertRight        0x20
    </table>
    
    rowType must be one of the following:
    
    <table>
    Name                    Value
    OdDb::kTitleRow         1
    OdDb::kHeaderRow        2
    OdDb::kDataRow          4
    </table>
    
  */
  virtual OdDb::Visibility gridVisibility(
    OdDb::GridLineType gridlineType,
    OdDb::RowType rowType = OdDb::kDataRow) const; 
 
 
/** \details
    Sets the grid visibility for the specified gridline types and row types,
    in this TableStyle object (DXF 284-289).
      
    \param gridVisibility [in]  Grid visibility.      
    \param gridlineTypes [in]  Gridline types.
    \param rowTypes [in]  Row types.
 
    \remarks
    gridVisibility must be one of the following:
    
    <table>
    Name                    Value
    OdDb::kInvisible        1
    OdDb::kVisible          0 
    </table>
        
    gridlineTypes must be a combination of one or more of the following:
    
    <table>
    Name                    Value
    OdDb::kHorzTop          1
    OdDb::kHorzInside       2
    OdDb::kHorzBottom       4
    OdDb::kVertLeft         8
    OdDb::kVertInside       0x10
    OdDb::kVertRight        0x20
    </table>
    
    rowTypes must be a combination of one or more of the following:
    
    <table>
    Name                    Value
    OdDb::kTitleRow         1
    OdDb::kHeaderRow        2
    OdDb::kDataRow          4
    </table>
    
*/
  virtual void setGridVisibility(
    OdDb::Visibility gridVisiblity, 
    int gridlineTypes = OdDb::kAllGridLines, 
    int rowTypes = OdDb::kAllRows);
 
 
  // NEW 2007
 
  virtual void getDataType(
    OdValue::DataType& nDataType,
    OdValue::UnitType& nUnitType,
    OdDb::RowType rowType = OdDb::kDataRow ) const;
 
  virtual void setDataType(
    OdValue::DataType nDataType, 
    OdValue::UnitType nUnitType,
    int rowTypes = OdDb::kAllRows);
 
  virtual OdString format (
    OdDb::RowType rowType = OdDb::kDataRow) const;
 
  virtual void setFormat(
    const OdString& pszFormat,
    int rowTypes = OdDb::kAllRows);
 
 
  virtual OdResult dwgInFields(
    OdDbDwgFiler* pFiler);
 
  virtual void dwgOutFields(
    OdDbDwgFiler* pFiler) const;
 
  virtual OdResult dxfInFields(
    OdDbDxfFiler* pFiler);
 
  virtual void dxfOutFields(
    OdDbDxfFiler* pFiler) const;
 
  // virtual OdResult audit(OdDbAuditInfo* pAuditInfo);
 
  // Utility functions
  //
 
  /** \details
    Applies the default properties of the specified database to this TableStyle object.
    
    \param pDb [in]  Pointer to the database whose default values are to be used.
     
    \remarks
    If pDb is null, the database containing this object is used
  */
  void setDatabaseDefaults(OdDbDatabase* pDb = 0);
 
  /** \details
    Adds this TableStyle object to the specified database.
  
    \param pDb [in]  Pointer to the database in which to post.
    \param styleName [in]  Name for the table style. 
    \param tableStyleId [out]  Receives 
 
    \remarks
    Returns the Object ID of the posted table style.
  */
  virtual OdDbObjectId postTableStyleToDb(OdDbDatabase* pDb, const OdString& styleName);
 
 
  const OdString  createCellStyle(void);
 
  void createCellStyle(const OdString& cellStyle);
 
  void createCellStyle(const OdString& cellStyle, const OdString& fromCellStyle);
 
  void renameCellStyle(const OdString& oldName, const OdString& newName);
 
  void deleteCellStyle(const OdString& cellStyle);
 
  void copyCellStyle(const OdString& srcCellStyle, const OdString& targetCellStyle);
 
  void copyCellStyle(const OdDbTableStyle* pSrc, const OdString& srcCellStyle, const OdString& targetCellStyle);
  
  void getUniqueCellStyleName(const OdString& baseName, OdString& sUniqueName) const;
 
  bool isCellStyleInUse(const OdString& cellStyle) const;
 
  OdInt32 numCellStyles(void) const;
 
  OdInt32 getCellStyles(OdStringArray& cellstyles) const;
 
  OdInt32 cellStyleId(const OdString& cellStyle) const;
  OdString cellStyleName(OdInt32 cellStyle) const;
 
  OdDbObjectId textStyle(const OdString& cellStyle) const;
  void setTextStyle (const OdDbObjectId& id, const OdString& cellStyle);
 
  double textHeight(const OdString& cellStyle) const;
  void setTextHeight(double dHeight, const OdString& cellStyle);
 
  OdDb::CellAlignment alignment(const OdString& cellStyle) const;
  void setAlignment(OdDb::CellAlignment alignment, const OdString& cellStyle);
 
  OdCmColor color(const OdString& cellStyle) const;
  void setColor(const OdCmColor& color, const OdString& cellStyle);
 
  OdCmColor backgroundColor(const OdString& cellStyle) const;
  void setBackgroundColor(const OdCmColor& color, const OdString& cellStyle);
 
  void getDataType(OdValue::DataType& nDataType, OdValue::UnitType& nUnitType, const OdString& cellStyle) const;
  void setDataType(OdValue::DataType nDataType, OdValue::UnitType nUnitType, const OdString& cellStyle);
 
  const OdString format(const OdString& cellStyle) const;
  void setFormat(const OdString& format, const OdString& cellStyle);
 
  OdInt32 cellClass(const OdString& cellStyle) const;
  void setCellClass(OdInt32 nClass, const OdString& cellStyle);
 
  double rotation(const OdString& cellStyle) const;
  void setRotation(double rotation, const OdString& cellStyle);
 
  bool isMergeAllEnabled (const OdString& cellStyle) const;
  void enableMergeAll(bool bEnable, const OdString& cellStyle);
 
  double margin(OdDb::CellMargin nMargin, const OdString& cellStyle) const;
  void setMargin(OdDb::CellMargin nMargins, double fMargin, const OdString& cellStyle);
 
  //Gridline properties
  //
  OdDb::LineWeight gridLineWeight(OdDb::GridLineType gridLineType, const OdString& cellStyle) const;
  void setGridLineWeight(OdDb::LineWeight lineWeight, OdDb::GridLineType gridLineTypes, const OdString& cellStyle);
 
  OdCmColor gridColor(OdDb::GridLineType gridLineType, const OdString& cellStyle) const;
  void setGridColor(const OdCmColor color, OdDb::GridLineType gridLineTypes, const OdString& cellStyle);
 
  OdDb::Visibility gridVisibility(OdDb::GridLineType gridLineType, const OdString& cellStyle) const;
  void setGridVisibility(OdDb::Visibility visible, OdDb::GridLineType gridLineTypes, const OdString& cellStyle);
 
  double gridDoubleLineSpacing(OdDb::GridLineType gridLineType, const OdString& cellStyle) const;
  void setGridDoubleLineSpacing(double fSpacing, OdDb::GridLineType gridLineTypes, const OdString& cellStyle);
 
  OdDb::GridLineStyle gridLineStyle(OdDb::GridLineType gridLineType, const OdString& cellStyle) const;
  void setGridLineStyle(OdDb::GridLineStyle nLineStyle, OdDb::GridLineType gridLineTypes, const OdString& cellStyle);
 
  OdDbObjectId gridLinetype(OdDb::GridLineType gridLineType, const OdString& cellStyle) const;
  void setGridLinetype(const OdDbObjectId& id, OdDb::GridLineType gridLineTypes, const OdString& cellStyle);
 
  void getGridProperty(OdGridProperty& gridProp, OdDb::GridLineType nGridLineTypes, const OdString& cellStyle) const;
  void setGridProperty (const OdGridProperty& gridProp, OdDb::GridLineType nGridLineTypes, const OdString& cellStyle);
 
  virtual OdResult subGetClassID(void* pClsid) const;
 
};
 
/** \details
  This template class is a specialization of the OdSmartPtr class for OdDbTableStyle object pointers.
*/
typedef OdSmartPtr<OdDbTableStyle> OdDbTableStylePtr;
 
#include "TD_PackPop.h"
 
#endif // OD_DBTABLESTYLE_H