GOffice.Doc¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
Whether the document has been changed. |
||
r/w |
When the document was first changed. |
||
r/w |
The known file system modification time |
||
r/w |
Whether the document is unchanged since it was created. |
||
r/w |
State of document when last saved |
||
r/w |
Current state of document |
||
r/w |
The URI associated with this document. |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
base |
r |
||
first_modification_time |
r |
||
images |
r |
||
meta_data |
r |
||
modified |
r |
||
modtime |
r |
||
pristine |
r |
||
priv |
r |
||
uri |
r |
Class Details¶
- class GOffice.Doc(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- add_image(id, image)¶
- Parameters:
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.
- bump_state()¶
Sets the current state of the document to a fresh id.
- end_read()¶
- get_dirty_time()¶
- Returns:
the time (as in
GLib.get_real_time
()) the document was first marked dirty.- Return type:
- get_image(id)¶
- Parameters:
id (
str
) – the image name- Returns:
the
GOffice.Image
is one exist with name id. The caller does not own a reference.- Return type:
- get_meta_data()¶
- Returns:
self's metadata
- Return type:
- get_modtime()¶
- Returns:
the last known file system time stamp for the document, or
None
if unknown.- Return type:
- image_fetch(id, type)¶
- Parameters:
id (
str
) – the name for the new image.type (
GObject.GType
) – the type of theGOffice.Image
to create if needed.
- Returns:
the found or created
GOffice.Image
.- Return type:
Searches for a
GOffice.Image
with name id in the document image buffer and creates one if needed. The caller does not own a reference on the returnedGOffice.Image
. This function must be called after a call toGOffice.Doc.init_read
(), otherwise it will emit a critical and returnNone
.
- init_write(output)¶
- Parameters:
output (
Gsf.XMLOut
) –
- is_pristine()¶
-
This checks to see if the doc has ever been used ( approximately )
- read(xin, attrs)¶
- Parameters:
xin (
Gsf.XMLIn
) –attrs (
libxml2.Char
) –
- save_image(id)¶
- Parameters:
id (
str
) – the Id of theGOffice.Image
to save
Saves the image with the document. Each image will be saved only once.
- save_resource(gp)¶
- Parameters:
gp (
GOffice.Persist
) – theGOffice.Persist
to 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 fromGLib.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.DateTime
orNone
) – new file system time stamp
Sets the last known file system time stamp for the document,
None
if unknown.
- set_pristine(pristine)¶
-
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_saved_state(state)¶
- Parameters:
state (
int
) – state at the time of last save
Sets the state at the last time the document was saved.
- set_state(state)¶
- Parameters:
state (
int
) – state of document
Sets the current state of the document as a serial number that is intended to be incremented for each document change.
Setting the state will set the document’s dirty status also, assuming both the state and the saved state are known.
- set_uri(uri)¶
- update_meta_data()¶
Signal that self's metadata should be updated - statistics (sheet
GOffice.count
, wordGOffice.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:
- Parameters:
doc (
GOffice.Doc
) – The object which received the signal
- GOffice.Doc.signals.metadata_update(doc)¶
- Signal Name:
metadata-update
- Flags:
- Parameters:
doc (
GOffice.Doc
) – The object which received the signal
Property Details¶
- GOffice.Doc.props.dirty¶
-
Whether the document has been changed.
- GOffice.Doc.props.dirty_time¶
-
When the document was first changed.
- GOffice.Doc.props.modtime¶
- Name:
modtime
- Type:
- Default Value:
- Flags:
The known file system modification time
- GOffice.Doc.props.pristine¶
-
Whether the document is unchanged since it was created.
- GOffice.Doc.props.saved_state¶
-
State of document when last saved
- GOffice.Doc.props.state¶
-
Current state of document