Debian Codegraph @

tw/tw.go

raw
1 package tw
2
3 // Operation Status Constants
4 // Used to indicate the success or failure of operations
5 const (
6 Pending = 0 // Operation failed
7 Fail = -1 // Operation failed
8 Success = 1 // Operation succeeded
9
10 MinimumColumnWidth = 8
11
12 DefaultCacheStringCapacity = 10 * 1024 // 10 KB
13 )
14
15 const (
16 Empty = ""
17 Skip = ""
18 Space = " "
19 NewLine = "\n"
20 Column = ":"
21 Dash = "-"
22 )
23
24 // Feature State Constants
25 // Represents enabled/disabled states for features
26 const (
27 Unknown State = Pending // Feature is enabled
28 On State = Success // Feature is enabled
29 Off State = Fail // Feature is disabled
30 )
31
32 // Table Alignment Constants
33 // Defines text alignment options for table content
34 const (
35 AlignNone Align = "none" // Center-aligned text
36 AlignCenter Align = "center" // Center-aligned text
37 AlignRight Align = "right" // Right-aligned text
38 AlignLeft Align = "left" // Left-aligned text
39 AlignDefault = AlignLeft // Left-aligned text
40 )
41
42 const (
43 Header Position = "header" // Table header section
44 Row Position = "row" // Table row section
45 Footer Position = "footer" // Table footer section
46 )
47
48 const (
49 LevelHeader Level = iota // Topmost line position
50 LevelBody // LevelBody line position
51 LevelFooter // LevelFooter line position
52 )
53
54 const (
55 LocationFirst Location = "first" // Topmost line position
56 LocationMiddle Location = "middle" // LevelBody line position
57 LocationEnd Location = "end" // LevelFooter line position
58 )
59
60 const (
61 SectionHeader = "header"
62 SectionRow = "row"
63 SectionFooter = "footer"
64 )
65
66 // Text Wrapping Constants
67 // Defines text wrapping behavior in table cells
68 const (
69 WrapNone = iota // No wrapping
70 WrapNormal // Standard word wrapping
71 WrapTruncate // Truncate text with ellipsis
72 WrapBreak // Break words to fit
73 )
74
75 // Cell Merge Constants
76 // Specifies cell merging behavior in tables
77
78 const (
79 MergeNone = iota // No merging
80 MergeVertical // Merge cells vertically
81 MergeHorizontal // Merge cells horizontally
82 MergeBoth // Merge both vertically and horizontally
83 MergeHierarchical // Hierarchical merging
84 )
85
86 // Special Character Constants
87 // Defines special characters used in formatting
88 const (
89 CharEllipsis = "…" // Ellipsis character for truncation
90 CharBreak = "↩" // Break character for wrapping
91 )
92
93 type Spot int
94
95 const (
96 SpotNone Spot = iota
97 SpotTopLeft
98 SpotTopCenter
99 SpotTopRight
100 SpotBottomLeft
101 SpotBottomCenter // Default for legacy SetCaption
102 SpotBottomRight
103 SpotLeftTop
104 SpotLeftCenter
105 SpotLeftBottom
106 SpotRightTop
107 SpotRightCenter
108 SpotRIghtBottom
109 )