PapersDocument.Annotation

g GObject.Object GObject.Object PapersDocument.Annotation PapersDocument.Annotation GObject.Object->PapersDocument.Annotation

Subclasses:

PapersDocument.AnnotationMarkup

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

equal (other)

get_annotation_type ()

get_area ()

get_border_width ()

get_contents ()

get_hidden ()

get_modified ()

get_name ()

get_page ()

get_page_index ()

get_rgba ()

set_area (area)

set_border_width (width)

set_contents (contents)

set_hidden (hidden)

set_modified (modified)

set_modified_from_time_t (utime)

set_name (name)

set_rgba (rgba)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

area

PapersDocument.Rectangle

r/w

The area of the page where the annotation is placed

border-width

float

r/w

The annotation border width

contents

str

r/w

The annotation contents

hidden

bool

r/w

Whether the annotation is hidden or not

modified

str

r/w

Last modified date as string

name

str

r/w

The annotation unique name

page

PapersDocument.Page

w/co

The page wehere the annotation is

rgba

Gdk.RGBA

r/w

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class PapersDocument.Annotation(**kwargs)
Bases:

GObject.Object

Abstract:

Yes

Structure:

PapersDocument.AnnotationClass

equal(other)
Parameters:

other (PapersDocument.Annotation) – another PapersDocument.Annotation

Returns:

True if self is equal to other, False otherwise

Return type:

bool

Compare self and other.

get_annotation_type()
Return type:

PapersDocument.AnnotationType

get_area()
Returns:

a PapersDocument.Rectangle to be filled with the annotation area

Return type:

area: PapersDocument.Rectangle

Gets the area of self.

New in version 3.18.

get_border_width()
Return type:

float

Gets the border width of self.

New in version 48.0.

get_contents()
Returns:

a string with the contents of the annotation or None if self has no contents.

Return type:

str

Get the contents of self. The contents of self is the text that is displayed in the annotation, or an alternate description of the annotation’s content for non-text annotations

get_hidden()
Return type:

bool

Gets the hidden flag of self, i.e. whether it is hidden or not.

New in version 48.0.

get_modified()
Returns:

A string containing the last modification date.

Return type:

str

Get the last modification date of self.

get_name()
Returns:

the string with the annotation’s name.

Return type:

str

Get the name of self. The name of the annotation is a string that uniquely indenftifies self amongs all the annotations in the same page.

get_page()
Returns:

the PapersDocument.Page where self appears

Return type:

PapersDocument.Page

Get the page where self appears.

get_page_index()
Returns:

the page index.

Return type:

int

Get the index of the page where self appears. Note that the index is 0 based.

get_rgba()
Returns:

a Gdk.RGBA to be filled with the annotation color

Return type:

rgba: Gdk.RGBA

Gets the color of self.

New in version 3.6.

set_area(area)
Parameters:

area (PapersDocument.Rectangle) – a PapersDocument.Rectangle

Returns:

True if the area has been changed, False otherwise

Return type:

bool

Set the area of the annotation to area.

New in version 3.18.

set_border_width(width)
Parameters:

width (float) – double

Returns:

True if the border width has been changed, False otherwise

Return type:

bool

Set the area of the annotation to area.

New in version 48.0.

set_contents(contents)
Parameters:

contents (str) –

Returns:

True if the contents have been changed, False otherwise.

Return type:

bool

Set the contents of self. You can monitor changes in the annotation’s contents by connecting to notify::contents signal of self.

set_hidden(hidden)
Parameters:

hidden (bool) – a boolean

Returns:

True if the visibility of the annotation has been changed, False otherwise

Return type:

bool

Set whether the annotation is hidden or not.

New in version 48.0.

set_modified(modified)
Parameters:

modified (str) – string with the last modification date.

Returns:

True if the last modification date has been updated, False otherwise.

Return type:

bool

Set the last modification date of self to modified. To set the last modification date using a #time_t, use PapersDocument.Annotation.set_modified_from_time_t() instead. You can monitor changes to the last modification date by connecting to the notify::modified signal on self.

set_modified_from_time_t(utime)
Parameters:

utime (int) – a #time_t

Returns:

True if the last modified date has been updated, False otherwise.

Return type:

bool

Set the last modification date of self to utime. You can monitor changes to the last modification date by connecting to the notify::modified sinal on self. For the time-format used, see PapersDocument.Document.misc_format_datetime().

set_name(name)
Parameters:

name (str) –

Returns:

True when the name has been changed, False otherwise.

Return type:

bool

Set the name of self. You can monitor changes of the annotation name by connecting to the notify::name signal on self.

set_rgba(rgba)
Parameters:

rgba (Gdk.RGBA) – a Gdk.RGBA

Returns:

True if the color has been changed, False otherwise

Return type:

bool

Set the color of the annotation to rgba.

New in version 3.6.

Property Details

PapersDocument.Annotation.props.area
Name:

area

Type:

PapersDocument.Rectangle

Default Value:

None

Flags:

READABLE, WRITABLE

The area of the page where the annotation is placed.

New in version 3.18.

PapersDocument.Annotation.props.border_width
Name:

border-width

Type:

float

Default Value:

0.0

Flags:

READABLE, WRITABLE

The border width of the annotation. This is only partially implemented, as there is no way to set the color. Thus, it may only be used for padding at this moment.

New in version 48.0.

PapersDocument.Annotation.props.contents
Name:

contents

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The annotation contents

PapersDocument.Annotation.props.hidden
Name:

hidden

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

A flag to hide an annotation from the view.

New in version 48.0.

PapersDocument.Annotation.props.modified
Name:

modified

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

Last modified date as string

PapersDocument.Annotation.props.name
Name:

name

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The annotation unique name

PapersDocument.Annotation.props.page
Name:

page

Type:

PapersDocument.Page

Default Value:

None

Flags:

WRITABLE, CONSTRUCT_ONLY

The page wehere the annotation is

PapersDocument.Annotation.props.rgba
Name:

rgba

Type:

Gdk.RGBA

Default Value:

None

Flags:

READABLE, WRITABLE

The colour of the annotation as a Gdk.RGBA.

New in version 3.6.