# Class: Document

## Document()

#### new Document()

文档类

Source:
  - Document.js, line 12

### Methods

#### (async, static) clearDirty() → {boolean}

清除编辑

Source:
  - Document.js, line 394

##### Returns:

true/false:成功/失败

Type
  boolean

#### (async, static) close(save) → {boolean}

关闭

##### Parameters:

Name | Type | Description
--- | --- | ---
`save` | boolean | 是否保存

Source:
  - Document.js, line 278

##### Returns:

true/false：成功/失败

Type
  boolean

#### (async, static) createObj() → {Promise.<Document>}

构造一个新的Document对象

Source:
  - Document.js, line 22

##### Returns:

Type
  Promise.<Document>

#### (async, static) fromXML(strXML) → {int}

从XML导入

##### Parameters:

Name | Type | Description
--- | --- | ---
`strXML` | String | XML

Source:
  - Document.js, line 380

##### Returns:

成功：返回1

Type
  int

#### (async, static) getAuthor() → {String}

获取文档作者

Source:
  - Document.js, line 66

##### Returns:

文档作者

Type
  String

#### (async, static) getCategory() → {String}

获取文档类别

Source:
  - Document.js, line 80

##### Returns:

文档类别

Type
  String

#### (async, static) getComments() → {String}

获取文档注释

Source:
  - Document.js, line 108

##### Returns:

文档注释

Type
  String

#### (async, static) getDocItemType() → {int}

获取文档项的类型

Source:
  - Document.js, line 136

##### Returns:

文档项类型（DocItemType中的类型）

Type
  int

#### (async, static) getFilePath() → {String}

获取文件路径

Source:
  - Document.js, line 321

##### Returns:

文件路径

Type
  String

#### (async, static) getIsDirty() → {boolean}

获取文档是否被编辑过

Source:
  - Document.js, line 150

##### Returns:

Type
  boolean

#### (async, static) getIsNew() → {boolean}

获取文档是否是新建的

Source:
  - Document.js, line 122

##### Returns:

是否是新建的

Type
  boolean

#### (async, static) getKeywords() → {String}

获取文档关键词

Source:
  - Document.js, line 94

##### Returns:

关键词

Type
  String

#### (async, static) getMaps() → {Object}

获取地图列表

Source:
  - Document.js, line 349

##### Returns:

获取地图列表对象 (Maps)

Type
  Object

#### (async, static) getSubject() → {String}

获取文档主题

Source:
  - Document.js, line 52

##### Returns:

文档主题

Type
  String

#### (async, static) getTitle() → {String}

获取文档标题

Source:
  - Document.js, line 38

##### Returns:

文档的标题

Type
  String

#### (async, static) getVersion() → {String}

获取文件版本

Source:
  - Document.js, line 335

##### Returns:

获取文件版本

Type
  String

#### (async, static) jNew() → {int}

新建

Source:
  - Document.js, line 248

##### Returns:

1/0:成功/失败

Type
  int

#### (async, static) open(filePath) → {int}

打开文件

##### Parameters:

Name | Type | Description
--- | --- | ---
`filePath` | String | 文件路径

Source:
  - Document.js, line 263

##### Returns:

1/0 : 成功/失败

Type
  int

#### (async, static) save() → {boolean}

保存

Source:
  - Document.js, line 292

##### Returns:

true/false：成功/失败

Type
  boolean

#### (async, static) saveAs(filePath) → {boolean}

另存为

##### Parameters:

Name | Type | Description
--- | --- | ---
`filePath` | String | 文件保存路径

Source:
  - Document.js, line 307

##### Returns:

true/false : 成功/失败

Type
  boolean

#### (async, static) setAuthor(author) → {Promise.<Void>}

设置文档作者

##### Parameters:

Name | Type | Description
--- | --- | ---
`author` | String | 文档作者

Source:
  - Document.js, line 193

##### Returns:

Type
  Promise.<Void>

#### (async, static) setCategory(category) → {Promise.<Void>}

设置文档类别

##### Parameters:

Name | Type | Description
--- | --- | ---
`category` | String | 文档类别

Source:
  - Document.js, line 207

##### Returns:

Type
  Promise.<Void>

#### (async, static) setComments(comments) → {Promise.<Void>}

设置文档注释

##### Parameters:

Name | Type | Description
--- | --- | ---
`comments` | String | 文档注释

Source:
  - Document.js, line 235

##### Returns:

Type
  Promise.<Void>

#### (async, static) setKeywords(keywords) → {Promise.<Void>}

设置文档关键词

##### Parameters:

Name | Type | Description
--- | --- | ---
`keywords` | String | 文档关键词

Source:
  - Document.js, line 221

##### Returns:

Type
  Promise.<Void>

#### (async, static) setSubject(subject) → {Promise.<Void>}

设置文档主题

##### Parameters:

Name | Type | Description
--- | --- | ---
`subject` | String | 文档主题

Source:
  - Document.js, line 179

##### Returns:

Type
  Promise.<Void>

#### (async, static) setTitle(title) → {Promise.<Void>}

设置文档标题

##### Parameters:

Name | Type | Description
--- | --- | ---
`title` | String | 文档标题

Source:
  - Document.js, line 165

##### Returns:

Type
  Promise.<Void>

#### (async, static) toXML() → {String}

保存为XML

Source:
  - Document.js, line 365

##### Returns:

成功：返回XML

Type
  String