Gepub.Widget

g Atk.ImplementorIface Atk.ImplementorIface Gtk.Widget Gtk.Widget Atk.ImplementorIface->Gtk.Widget GObject.GInterface GObject.GInterface GObject.GInterface->Atk.ImplementorIface Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gepub.Widget Gepub.Widget Gtk.Buildable->Gtk.Widget Gtk.Container Gtk.Container WebKit2.WebViewBase WebKit2.WebViewBase Gtk.Container->WebKit2.WebViewBase Gtk.Widget->Gtk.Container WebKit2.WebView WebKit2.WebView WebKit2.WebView->Gepub.Widget WebKit2.WebViewBase->WebKit2.WebView

Subclasses:

None

Methods

Inherited:

WebKit2.WebView (93), Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10)

Structs:

Gtk.ContainerClass (5), Gtk.WidgetClass (12), GObject.ObjectClass (5)

class

new ()

chapter_next ()

chapter_prev ()

get_chapter ()

get_chapter_length ()

get_doc ()

get_fontfamily ()

get_fontsize ()

get_lineheight ()

get_margin ()

get_n_chapters ()

get_paginate ()

get_pos ()

page_next ()

page_prev ()

set_chapter (index)

set_doc (doc)

set_fontfamily (family)

set_fontsize (size)

set_lineheight (size)

set_margin (margin)

set_paginate (p)

set_pos (index)

Virtual Methods

Inherited:

WebKit2.WebView (27), Gtk.Container (10), Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10)

Properties

Inherited:

WebKit2.WebView (24), Gtk.Container (3), Gtk.Widget (39)

Name

Type

Flags

Short Description

chapter

int

r/w

Current chapter in the doc

chapter-pos

float

r/w

Current position in chapter as a percentage

doc

Gepub.Doc

r/w

The Gepub.Doc for this widget

nchapters

int

r

Number of chapters in the doc

paginate

bool

r/w

If the widget should paginate

Style Properties

Inherited:

Gtk.Widget (17)

Signals

Inherited:

WebKit2.WebView (28), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)

Fields

Inherited:

WebKit2.WebView (28), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)

Class Details

class Gepub.Widget(**kwargs)
Bases:

WebKit2.WebView

Abstract:

No

Structure:

Gepub.WidgetClass

classmethod new()
Returns:

the new Gepub.Widget created

Return type:

Gtk.Widget

chapter_next()
Returns:

True on success, False if there’s no next chapter

Return type:

bool

chapter_prev()
Returns:

True on success, False if there’s no prev chapter

Return type:

bool

get_chapter()
Returns:

the current chapter in the document

Return type:

int

get_chapter_length()
Returns:

the current chapter length

Return type:

int

get_doc()
Returns:

the Gepub.Doc

Return type:

Gepub.Doc

get_fontfamily()
Return type:

str

Gets the widget custom font family

get_fontsize()
Return type:

int

Gets the widget custom font size in pt, if 0, it’s not set

get_lineheight()
Return type:

float

Gets the widget custom line height, if 0, it’s not set

get_margin()
Return type:

int

Gets the widget left and right margin

get_n_chapters()
Returns:

the number of chapters in the document

Return type:

int

get_paginate()
Return type:

bool

Returns whether pagination is enabled or disabled

get_pos()
Returns:

the current position in the chapter

Return type:

float

page_next()
Returns:

True on success, False if there’s no next page

Return type:

bool

page_prev()
Returns:

True on success, False if there’s no next page

Return type:

bool

set_chapter(index)
Parameters:

index (int) – the new chapter

Sets the current chapter in the doc

set_doc(doc)
Parameters:

doc (Gepub.Doc or None) – a Gepub.Doc

Sets doc as the document displayed by the widget.

set_fontfamily(family)
Parameters:

family (str) – the custom font family name

Sets the widget custom font family

set_fontsize(size)
Parameters:

size (int) – the custom font size in pt

Sets the widget custom font size, use 0 to show book’s styles

set_lineheight(size)
Parameters:

size (float) – the custom line height

Sets the widget custom line height, the real size will be this number multiplied by the font size. Use 0 to show book’s styles

set_margin(margin)
Parameters:

margin (int) – the margin in pixels

Sets the widget left and right margin

set_paginate(p)
Parameters:

p (bool) – true if the widget should paginate

Enable or disable pagination

set_pos(index)
Parameters:

index (float) – the new pos

Sets the current position in the chapter

Property Details

Gepub.Widget.props.chapter
Name:

chapter

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE

Current chapter in the doc

Gepub.Widget.props.chapter_pos
Name:

chapter-pos

Type:

float

Default Value:

0.0

Flags:

READABLE, WRITABLE

Current position in chapter as a percentage

Gepub.Widget.props.doc
Name:

doc

Type:

Gepub.Doc

Default Value:

None

Flags:

READABLE, WRITABLE

The Gepub.Doc for this widget

Gepub.Widget.props.nchapters
Name:

nchapters

Type:

int

Default Value:

0

Flags:

READABLE

Number of chapters in the doc

Gepub.Widget.props.paginate
Name:

paginate

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

If the widget should paginate