GOffice.Doc¶
| Subclasses: | None | 
|---|
Methods¶
| Inherited: | GObject.Object (37) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
| add_image(id, image) | |
| end_read() | |
| get_dirty_time() | |
| get_image(id) | |
| get_images() | |
| get_meta_data() | |
| get_modtime() | |
| get_uri() | |
| image_fetch(id, type) | |
| init_read(input) | |
| init_write(output) | |
| is_dirty() | |
| is_pristine() | |
| read(xin, attrs) | |
| save_image(id) | |
| save_resource(gp) | |
| set_dirty(is_dirty) | |
| set_dirty_time(t) | |
| set_meta_data(data) | |
| set_modtime(modtime) | |
| set_pristine(pristine) | |
| set_uri(uri) | |
| update_meta_data() | |
| write(output) | 
Virtual Methods¶
| Inherited: | GObject.Object (7) | 
|---|
Properties¶
| Name | Type | Flags | Short Description | 
|---|---|---|---|
| dirty | bool | r/w | Whether the document has been changed. | 
| dirty-time | int | r/w | When the document was first changed. | 
| modtime | GLib.DateTime | r/w | The known file system modification time | 
| pristine | bool | r/w | Whether the document is unchanged since it was created. | 
| uri | str | r/w | The URI associated with this document. | 
Fields¶
| Inherited: | GObject.Object (1) | 
|---|
| Name | Type | Access | Description | 
|---|---|---|---|
| base | GObject.Object | r | |
| first_modification_time | int | r | |
| images | { object:object} | r | |
| meta_data | Gsf.DocMetaData | r | |
| modified | bool | r | |
| modtime | GLib.DateTime | r | |
| pristine | bool | r | |
| priv | object | r | |
| uri | str | r | 
Class Details¶
- 
class GOffice.Doc(**kwargs)¶
- Bases: - GObject.Object- Abstract: - No - Structure: - GOffice.DocClass- 
add_image(id, image)¶
- Parameters: - id (str) – the image name orNone
- image (GOffice.Image) – aGOffice.Image
 - Returns: - either image, in which case the document adds a reference on it, or an identical image for which the owner does not own a reference. - Return type: - Adds image to the document if no such image already exists. The name of the returned image might be different from id, even if given. 
- id (
 - 
end_read()¶
 - 
get_dirty_time()¶
- Returns: - the time (as in - GLib.get_real_time()) the document was first marked dirty.- Return type: - int
 - 
get_image(id)¶
- Parameters: - id ( - str) – the image name- Returns: - the - GOffice.Imageis one exist with name id. The caller does not own a reference.- Return type: - GOffice.Image
 - 
get_meta_data()¶
- Returns: - self’s metadata - Return type: - Gsf.DocMetaData
 - 
get_modtime()¶
- Returns: - the last known file system time stamp for the document, or - Noneif unknown.- Return type: - GLib.DateTime
 - 
image_fetch(id, type)¶
- Parameters: - id (str) – the name for the new image.
- type (GObject.GType) – the type of theGOffice.Imageto create if needed.
 - Returns: - the found or created - GOffice.Image.- Return type: - Searches for a - GOffice.Imagewith name id in the document image buffer and creates one if needed. The caller does not own a reference on the returned- GOffice.Image. This function must be called after a call to- GOffice.Doc.init_read(), otherwise it will emit a critical and return- None.
- id (
 - 
init_write(output)¶
- Parameters: - output ( - Gsf.XMLOut) –
 - 
is_pristine()¶
- Returns: - Trueif we can discard this doc.- Return type: - bool- This checks to see if the doc has ever been used ( approximately ) 
 - 
read(xin, attrs)¶
- Parameters: - xin (Gsf.XMLIn) –
- attrs (libxml2.Char) –
 
- xin (
 - 
save_image(id)¶
- Parameters: - id ( - str) – the Id of the- GOffice.Imageto save- Saves the image with the document. Each image will be saved only once. 
 - 
save_resource(gp)¶
- Parameters: - gp ( - GOffice.Persist) – the- GOffice.Persistto save- Saves the resource with the document. Each resource will be saved only once. 
 - 
set_dirty(is_dirty)¶
- Parameters: - is_dirty ( - bool) – bool- Changes the dirty state of self to is_dirty and clears the pristine state no matter what. 
 - 
set_dirty_time(t)¶
- Parameters: - t ( - int) – a timestamp from- GLib.get_real_time- Changes the dirty time, i.e., the time the document was first marked dirty. 
 - 
set_meta_data(data)¶
- Parameters: - data ( - Gsf.DocMetaData) –- Gsf.DocMetaData- Adds a ref to data. 
 - 
set_modtime(modtime)¶
- Parameters: - modtime ( - GLib.DateTimeor- None) – new file system time stamp- Sets the last known file system time stamp for the document, - Noneif unknown.
 - 
set_pristine(pristine)¶
- Parameters: - pristine ( - bool) – a- bool.- Sets the indication of whether this document is unchanged since it was created. Note: if both “dirty” and “pristine” are being set, set “pristine” last. 
 - 
set_uri(uri)¶
- Parameters: - uri ( - str) – the uri for this worksheet.- Returns: - Trueif the name was set succesfully.- Return type: - bool
 - 
update_meta_data()¶
- Signal that self’s metadata should be updated - statistics (sheet - GOffice.count, word- GOffice.count) - content (sheet names, bookmarks) - reloading linked items
 - 
write(output)¶
- Parameters: - output ( - Gsf.XMLOut) –
 
- 
Signal Details¶
- 
GOffice.Doc.signals.metadata_changed(doc)¶
- Signal Name: - metadata-changed- Flags: - RUN_LAST- Parameters: - doc ( - GOffice.Doc) – The object which received the signal
- 
GOffice.Doc.signals.metadata_update(doc)¶
- Signal Name: - metadata-update- Flags: - RUN_LAST- Parameters: - doc ( - GOffice.Doc) – The object which received the signal
Property Details¶
- 
GOffice.Doc.props.dirty¶
- Name: - dirty- Type: - bool- Default Value: - False- Flags: - READABLE,- WRITABLE- Whether the document has been changed. 
- 
GOffice.Doc.props.dirty_time¶
- Name: - dirty-time- Type: - int- Default Value: - 0- Flags: - READABLE,- WRITABLE- When the document was first changed. 
- 
GOffice.Doc.props.modtime¶
- Name: - modtime- Type: - GLib.DateTime- Default Value: - None- Flags: - READABLE,- WRITABLE- The known file system modification time