-
Notifications
You must be signed in to change notification settings - Fork 33
/
JXLSExtendedFormat.mm
188 lines (162 loc) · 3.49 KB
/
JXLSExtendedFormat.mm
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
//
// JXLSExtendedFormat.m
// JXLS
//
// Created by David Hoerl on 10/7/08.
// Copyright (c) 2008-2013 David Hoerl. Some rights reserved: <http://opensource.org/licenses/BSD-3-Clause>
// Copyright (c) 2013 Jan Weiß. Some rights reserved: <http://opensource.org/licenses/BSD-3-Clause>
//
#include <stdint.h>
#include <string>
#include "xlslib.h"
#if 0
#import "extformat.h"
#endif
using namespace xlslib_core;
using namespace xlslib_strings;
#import "JXLSExtendedFormat.h"
#import "JXLSFont.h"
#define FORMAT(a) ((xlslib_core::xf_t *)(a))
@implementation JXLSExtendedFormat
{
xlslib_core::xf_t *_extFormat;
}
+(JXLSExtendedFormat *)formatWithFormat:(JXLSExtendedFormat *)aFormat
{
xf_t *xf;
xf = xf_t::xfDup((xf_t *)aFormat->_extFormat);
return [[JXLSExtendedFormat alloc] initWithExtendedFormat:xf];
}
- (instancetype)initWithExtendedFormat:(void *)xft
{
self = [super init];
_extFormat = ((xlslib_core::xf_t *)(xft));
return self;
}
- (void *)extendedFormat
{
return _extFormat;
}
- (void)setFont:(JXLSFont *)font
{
_extFormat->SetFont((font_t *)[font font]);
}
- (JXLSFont *)font
{
font_t *fidx;
fidx = _extFormat->GetFont();
return [[JXLSFont alloc] initWithFont:fidx];
}
- (void)setFormatBuiltin:(format_number_t)formatidx
{
_extFormat->SetFormat(formatidx);
}
- (void)setFormat:(format_t *)fmt
{
_extFormat->SetFormat((format_t *)fmt);
}
- (void)setHorizontalAlignment:(halign_option_t)ha_option
{
_extFormat->SetHAlign(ha_option);
}
- (uint8_t)horizontalAlignment
{
return _extFormat->GetHAlign();
}
- (void)setVerticalAlignment:(valign_option_t)va_option
{
_extFormat->SetVAlign(va_option);
}
- (uint8_t)verticalAlignment
{
return _extFormat->GetVAlign();
}
- (void)setIndentation:(indent_option_t)indent_option
{
_extFormat->SetIndent(indent_option);
}
- (uint8_t)indentation
{
return _extFormat->GetIndent();
}
- (void)setTextOrientation:(txtori_option_t)ori_option
{
_extFormat->SetTxtOrientation(ori_option);
}
- (uint8_t)textOrientation
{
return _extFormat->GetTxtOrientation();
}
- (void)setForegroundFillColor:(color_name_t)color
{
_extFormat->SetFillFGColor(color);
}
- (void)setForegroundFillColorIndex:(unsigned8_t)color
{
_extFormat->SetFillFGColor(color);
}
- (uint8_t)foregroundFillColor
{
return _extFormat->GetFillFGColorIdx();
}
- (void)setBackgroundFillColor:(color_name_t)color
{
_extFormat->SetFillBGColor(color);
}
- (void)setBackgroundFillColorIndex:(unsigned8_t)color
{
_extFormat->SetFillBGColor(color);
}
- (uint8_t)backgroundFillColor
{
return _extFormat->GetFillBGColorIdx();
}
- (void)setFillStyle:(fill_option_t)fill
{
_extFormat->SetFillStyle(fill);
}
- (uint8_t)fillStyle
{
return _extFormat->GetFillStyle();
}
- (void)setLocked:(BOOL)locked_opt
{
_extFormat->SetLocked((bool)locked_opt);
}
- (BOOL)locked
{
return (BOOL)_extFormat->IsLocked();
}
- (void)setHidden:(BOOL)hidden_opt
{
_extFormat->SetHidden((bool)hidden_opt);
}
- (BOOL)hidden
{
return (BOOL)_extFormat->IsHidden();
}
- (void)setWraps:(BOOL)wrap_opt
{
_extFormat->SetWrap((bool)wrap_opt);
}
- (BOOL)wrap
{
return (BOOL)_extFormat->IsWrap();
}
- (void)setBorderStyle:(border_style_t)style forSide:(border_side_t)side
{
_extFormat->SetBorderStyle(side, style);
}
- (void)setBorderColor:(color_name_t)color forSide:(border_side_t)side
{
_extFormat->SetBorderColor(side, color);
}
- (void)setBorderColorIndex:(unsigned8_t)color forSide:(border_side_t)side
{
_extFormat->SetBorderColor(side, color);
}
- (void)borderStyle:(border_side_t)side
{
_extFormat->GetBorderStyle(side);
}
@end