-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotesdatetime.go
273 lines (215 loc) · 9.16 KB
/
notesdatetime.go
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
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_NOTESDATETIME_CLASS.html */
package domigo
import (
ole "github.com/go-ole/go-ole"
)
type NotesDateTime struct {
NotesStruct
}
func newNotesDateTime(dispatchPtr *ole.IDispatch) NotesDateTime {
return NotesDateTime{newNotesStruct(dispatchPtr)}
}
/* --------------------------------- Properties --------------------------------- */
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_DATEONLY_PROPERTY.html */
func (d NotesDateTime) DateOnly() (String, error) {
return getComProperty[String](d, "DateOnly")
}
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_GMTTIME_PROPERTY.html */
func (d NotesDateTime) GMTTime() (String, error) {
return getComProperty[String](d, "GMTTime")
}
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_ISDST_PROPERTY.html */
func (d NotesDateTime) IsDST() (Boolean, error) {
return getComProperty[Boolean](d, "IsDST")
}
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_ISVALIDDATE_PROPERTY_DATETIME.html */
func (d NotesDateTime) IsValidDate() (Boolean, error) {
return getComProperty[Boolean](d, "IsValidDate")
}
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_LOCALTIME_PROPERTY.html */
func (d NotesDateTime) LocalTime() (String, error) {
return getComProperty[String](d, "LocalTime")
}
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_LOCALTIME_PROPERTY.html */
func (d NotesDateTime) SetLocalTime(v String) error {
return putComProperty(d, "LocalTime", v)
}
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_LSGMTTIME_PROPERTY.html */
func (d NotesDateTime) LSGMTTime() (Time, error) {
return getComProperty[Time](d, "LSGMTTime")
}
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_LSLOCALTIME_PROPERTY.html */
func (d NotesDateTime) LSLocalTime() (Time, error) {
return getComProperty[Time](d, "LSLocalTime")
}
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_LSLOCALTIME_PROPERTY.html */
func (d NotesDateTime) SetLSLocalTime(v Time) error {
return putComProperty(d, "LSLocalTime", v)
}
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_PARENT_PROPERTY_DATETIME_COM.html */
func (d NotesDateTime) Parent() (NotesSession, error) {
return getComObjectProperty(d, newNotesSession, "Parent")
}
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_TIMEONLY_PROPERTY.html */
func (d NotesDateTime) TimeOnly() (String, error) {
return getComProperty[String](d, "TimeOnly")
}
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_TIMEZONE_PROPERTY.html */
func (d NotesDateTime) TimeZone() (Long, error) {
return getComProperty[Long](d, "TimeZone")
}
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_ZONETIME_PROPERTY.html */
func (d NotesDateTime) ZoneTime() (String, error) {
return getComProperty[String](d, "ZoneTime")
}
/* --------------------------------- Methods ------------------------------------ */
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_ADJUSTDAY_METHOD.html */
type notesDateTimeAdjustDayParams struct {
preserveLocalTime *Boolean
}
type notesDateTimeAdjustDayParam func(*notesDateTimeAdjustDayParams)
func WithNotesDateTimeAdjustDayPreserveLocalTime(preserveLocalTime Boolean) notesDateTimeAdjustDayParam {
return func(c *notesDateTimeAdjustDayParams) {
c.preserveLocalTime = &preserveLocalTime
}
}
func (d NotesDateTime) AdjustDay(n Integer, params ...notesDateTimeAdjustDayParam) error {
paramsStruct := ¬esDateTimeAdjustDayParams{}
paramsOrdered := []interface{}{n}
for _, p := range params {
p(paramsStruct)
}
if paramsStruct.preserveLocalTime != nil {
paramsOrdered = append(paramsOrdered, *paramsStruct.preserveLocalTime)
}
return callComVoidMethod(d, "AdjustDay", paramsOrdered...)
}
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_ADJUSTHOUR_METHOD.html */
type notesDateTimeAdjustHourParams struct {
preserveLocalTime *Boolean
}
type notesDateTimeAdjustHourParam func(*notesDateTimeAdjustHourParams)
func WithNotesDateTimeAdjustHourPreserveLocalTime(preserveLocalTime Boolean) notesDateTimeAdjustHourParam {
return func(c *notesDateTimeAdjustHourParams) {
c.preserveLocalTime = &preserveLocalTime
}
}
func (d NotesDateTime) AdjustHour(n Integer, params ...notesDateTimeAdjustHourParam) error {
paramsStruct := ¬esDateTimeAdjustHourParams{}
paramsOrdered := []interface{}{n}
for _, p := range params {
p(paramsStruct)
}
if paramsStruct.preserveLocalTime != nil {
paramsOrdered = append(paramsOrdered, *paramsStruct.preserveLocalTime)
}
return callComVoidMethod(d, "AdjustHour", paramsOrdered...)
}
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_ADJUSTMINUTE_METHOD.html */
type notesDateTimeAdjustMinuteParams struct {
preserveLocalTime *Boolean
}
type notesDateTimeAdjustMinuteParam func(*notesDateTimeAdjustMinuteParams)
func WithNotesDateTimeAdjustMinutePreserveLocalTime(preserveLocalTime Boolean) notesDateTimeAdjustMinuteParam {
return func(c *notesDateTimeAdjustMinuteParams) {
c.preserveLocalTime = &preserveLocalTime
}
}
func (d NotesDateTime) AdjustMinute(n Integer, params ...notesDateTimeAdjustMinuteParam) error {
paramsStruct := ¬esDateTimeAdjustMinuteParams{}
paramsOrdered := []interface{}{n}
for _, p := range params {
p(paramsStruct)
}
if paramsStruct.preserveLocalTime != nil {
paramsOrdered = append(paramsOrdered, *paramsStruct.preserveLocalTime)
}
return callComVoidMethod(d, "AdjustMinute", paramsOrdered...)
}
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_ADJUSTMONTH_METHOD.html */
type notesDateTimeAdjustMonthParams struct {
preserveLocalTime *Boolean
}
type notesDateTimeAdjustMonthParam func(*notesDateTimeAdjustMonthParams)
func WithNotesDateTimeAdjustMonthPreserveLocalTime(preserveLocalTime Boolean) notesDateTimeAdjustMonthParam {
return func(c *notesDateTimeAdjustMonthParams) {
c.preserveLocalTime = &preserveLocalTime
}
}
func (d NotesDateTime) AdjustMonth(n Integer, params ...notesDateTimeAdjustMonthParam) error {
paramsStruct := ¬esDateTimeAdjustMonthParams{}
paramsOrdered := []interface{}{n}
for _, p := range params {
p(paramsStruct)
}
if paramsStruct.preserveLocalTime != nil {
paramsOrdered = append(paramsOrdered, *paramsStruct.preserveLocalTime)
}
return callComVoidMethod(d, "AdjustMonth", paramsOrdered...)
}
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_ADJUSTSECOND_METHOD.html */
type notesDateTimeAdjustSecondParams struct {
preserveLocalTime *Boolean
}
type notesDateTimeAdjustSecondParam func(*notesDateTimeAdjustSecondParams)
func WithNotesDateTimeAdjustSecondPreserveLocalTime(preserveLocalTime Boolean) notesDateTimeAdjustSecondParam {
return func(c *notesDateTimeAdjustSecondParams) {
c.preserveLocalTime = &preserveLocalTime
}
}
func (d NotesDateTime) AdjustSecond(n Integer, params ...notesDateTimeAdjustSecondParam) error {
paramsStruct := ¬esDateTimeAdjustSecondParams{}
paramsOrdered := []interface{}{n}
for _, p := range params {
p(paramsStruct)
}
if paramsStruct.preserveLocalTime != nil {
paramsOrdered = append(paramsOrdered, *paramsStruct.preserveLocalTime)
}
return callComVoidMethod(d, "AdjustSecond", paramsOrdered...)
}
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_ADJUSTYEAR_METHOD.html */
type notesDateTimeAdjustYearParams struct {
preserveLocalTime *Boolean
}
type notesDateTimeAdjustYearParam func(*notesDateTimeAdjustYearParams)
func WithNotesDateTimeAdjustYearPreserveLocalTime(preserveLocalTime Boolean) notesDateTimeAdjustYearParam {
return func(c *notesDateTimeAdjustYearParams) {
c.preserveLocalTime = &preserveLocalTime
}
}
func (d NotesDateTime) AdjustYear(n Integer, params ...notesDateTimeAdjustYearParam) error {
paramsStruct := ¬esDateTimeAdjustYearParams{}
paramsOrdered := []interface{}{n}
for _, p := range params {
p(paramsStruct)
}
if paramsStruct.preserveLocalTime != nil {
paramsOrdered = append(paramsOrdered, *paramsStruct.preserveLocalTime)
}
return callComVoidMethod(d, "AdjustYear", paramsOrdered...)
}
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_CONVERTTOZONE_METHOD.html */
func (d NotesDateTime) ConvertToZone(newzone Integer, dst Boolean) error {
return callComVoidMethod(d, "ConvertToZone", newzone, dst)
}
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_SETANYDATE_METHOD.html */
func (d NotesDateTime) SetAnyDate() error {
return callComVoidMethod(d, "SetAnyDate")
}
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_SETANYTIME_METHOD.html */
func (d NotesDateTime) SetAnyTime() error {
return callComVoidMethod(d, "SetAnyTime")
}
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_SETNOW_METHOD.html */
func (d NotesDateTime) SetNow() error {
return callComVoidMethod(d, "SetNow")
}
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_TIMEDIFFERENCE_METHOD.html */
func (d NotesDateTime) TimeDifference(notesDateTime NotesDateTime) (Long, error) {
return callComMethod[Long](d, "TimeDifference", notesDateTime)
}
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_TIMEDIFFERENCEDOUBLE_METHOD.html */
func (d NotesDateTime) TimeDifferenceDouble(notesDateTime NotesDateTime) (Double, error) {
return callComMethod[Double](d, "TimeDifferenceDouble", notesDateTime)
}