-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotesdbdirectory.go
115 lines (91 loc) · 4.39 KB
/
notesdbdirectory.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
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_NOTESDBDIRECTORY_CLASS.html */
package domigo
import (
ole "github.com/go-ole/go-ole"
)
type NotesDbDirectoryFileType = Integer
const (
NOTESDBDIRECTORY_FILETYPE_DATABASE NotesDbDirectoryFileType = 1247
NOTESDBDIRECTORY_FILETYPE_NOTES_DATABASE NotesDbDirectoryFileType = 1247
NOTESDBDIRECTORY_FILETYPE_TEMPLATE NotesDbDirectoryFileType = 1248
NOTESDBDIRECTORY_FILETYPE_REPLICA_CANDIDATE NotesDbDirectoryFileType = 1245
NOTESDBDIRECTORY_FILETYPE_TEMPLATE_CANDIDATE NotesDbDirectoryFileType = 1246
)
type NotesDbDirectory struct {
NotesStruct
}
func newNotesDbDirectory(dispatchPtr *ole.IDispatch) NotesDbDirectory {
return NotesDbDirectory{newNotesStruct(dispatchPtr)}
}
/* --------------------------------- Properties --------------------------------- */
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_NAME_PROPERTY_DIRECTORY.html */
func (d NotesDbDirectory) Name() (String, error) {
return getComProperty[String](d, "Name")
}
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_PARENT_PROPERTY_DBDIRECTORY_COM.html */
func (d NotesDbDirectory) Parent() (NotesSession, error) {
return getComObjectProperty(d, newNotesSession, "Parent")
}
/* --------------------------------- Methods ------------------------------------ */
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_CREATEDATABASE_METHOD_DBDIRECTORY_COM.html */
type notesDbDirectoryCreateDatabaseParams struct {
open *Boolean
}
type notesDbDirectoryCreateDatabaseParam func(*notesDbDirectoryCreateDatabaseParams)
func WithNotesDbDirectoryCreateDatabaseOpen(open Boolean) notesDbDirectoryCreateDatabaseParam {
return func(c *notesDbDirectoryCreateDatabaseParams) {
c.open = &open
}
}
func (d NotesDbDirectory) CreateDatabase(dbfile String, params ...notesDbDirectoryCreateDatabaseParam) (NotesDatabase, error) {
paramsStruct := ¬esDbDirectoryCreateDatabaseParams{}
paramsOrdered := []interface{}{dbfile}
for _, p := range params {
p(paramsStruct)
}
if paramsStruct.open != nil {
paramsOrdered = append(paramsOrdered, *paramsStruct.open)
}
return callComObjectMethod(d, newNotesDatabase, "CreateDatabase", paramsOrdered...)
}
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_GETFIRSTDATABASE_METHOD.html */
func (d NotesDbDirectory) GetFirstDatabase(fileType NotesDbDirectoryFileType) (NotesDatabase, error) {
return callComObjectMethod(d, newNotesDatabase, "GetFirstDatabase", fileType)
}
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_GETNEXTDATABASE_METHOD.html */
func (d NotesDbDirectory) GetNextDatabase() (NotesDatabase, error) {
return callComObjectMethod(d, newNotesDatabase, "GetNextDatabase")
}
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_OPENDATABASE_METHOD_DBDIRECTORY_COM.html */
type notesDbDirectoryOpenDatabaseParams struct {
open *Boolean
}
type notesDbDirectoryOpenDatabaseParam func(*notesDbDirectoryOpenDatabaseParams)
func WithNotesDbDirectoryOpenDatabaseOpen(open Boolean) notesDbDirectoryOpenDatabaseParam {
return func(c *notesDbDirectoryOpenDatabaseParams) {
c.open = &open
}
}
func (d NotesDbDirectory) OpenDatabase(dbfile String, params ...notesDbDirectoryOpenDatabaseParam) (NotesDatabase, error) {
paramsStruct := ¬esDbDirectoryOpenDatabaseParams{}
paramsOrdered := []interface{}{dbfile}
for _, p := range params {
p(paramsStruct)
}
if paramsStruct.open != nil {
paramsOrdered = append(paramsOrdered, *paramsStruct.open)
}
return callComObjectMethod(d, newNotesDatabase, "OpenDatabase", paramsOrdered...)
}
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_OPENDATABASEBYREPLICAID_METHOD_DBDIRECTORY_COM.html */
func (d NotesDbDirectory) OpenDatabaseByReplicaID(rid String) (NotesDatabase, error) {
return callComObjectMethod(d, newNotesDatabase, "OpenDatabaseByReplicaID", rid)
}
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_OPENDATABASEIFMODIFIED_METHOD_DBDIRECTORY_COM.html */
func (d NotesDbDirectory) OpenDatabaseIfModified(dbfile String, notesDateTime NotesDateTime) (NotesDatabase, error) {
return callComObjectMethod(d, newNotesDatabase, "OpenDatabaseIfModified", dbfile, notesDateTime)
}
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_OPENMAILDATABASE_METHOD_DBDIRECTORY_COM.html */
func (d NotesDbDirectory) OpenMailDatabase() (NotesDatabase, error) {
return callComObjectMethod(d, newNotesDatabase, "OpenMailDatabase")
}