presentationcontroller

class openlp.plugins.presentations.lib.presentationcontroller.PresentationController(plugin=None, name='PresentationController', document_class=<class 'openlp.plugins.presentations.lib.presentationcontroller.PresentationDocument'>)[source]

Bases: object

This class is used to control interactions with presentation applications by creating a runtime environment. This is a base class for presentation controllers to inherit from.

To create a new controller, take a copy of this file and name it so it ends with controller.py, i.e. foobarcontroller.py. Make sure it inherits PresentationController, and then fill in the blanks. If possible try to make sure it loads on all platforms, usually by using :mod:os.name checks, although __init__, check_available and presentation_deleted should always be implemented.

See ImpressController, PowerpointController or PptviewController for examples.

Basic Attributes

name
The name that appears in the options and the media manager.
enabled
The controller is enabled.
available
The controller is available on this machine. Set by init via call to check_available.
plugin
The presentationplugin object.
supports
The primary native file types this application supports.
also_supports
Other file types the application can import, although not necessarily the first choice due to potential incompatibilities.

Hook Functions

kill()
Called at system exit to clean up any running presentations.
check_available()
Returns True if presentation application is installed/can run on this machine.
presentation_deleted()
Deletes presentation specific files, e.g. thumbnails.
add_document(name)[source]

Called when a new presentation document is opened.

check_available()[source]

Presentation app is able to run on this machine.

close_presentation()[source]
enabled()[source]

Return whether the controller is currently enabled

is_available()[source]
kill()[source]

Called at system exit to clean up any running presentations and close the application.

remove_doc(doc=None)[source]

Called to remove an open document from the collection.

start_process()[source]

Loads a running version of the presentation application in the background.

class openlp.plugins.presentations.lib.presentationcontroller.PresentationDocument(controller, name)[source]

Bases: object

Base class for presentation documents to inherit from. Loads and closes the presentation as well as triggering the correct activities based on the users input

Hook Functions

load_presentation()
Load a presentation file
close_presentation()
Close presentation and clean up objects
presentation_loaded()
Returns True if presentation is currently loaded
is_active()
Returns True if a presentation is currently running
blank_screen()
Blanks the screen, making it black.
unblank_screen()
Unblanks the screen, restoring the output
is_blank
Returns true if screen is blank
stop_presentation()
Stops the presentation, removing it from the output display
start_presentation()
Starts the presentation from the beginning
get_slide_number()
Returns the current slide number, from 1
get_slide_count()
Returns total number of slides
goto_slide(slide_no)
Jumps directly to the requested slide.
next_step()
Triggers the next effect of slide on the running presentation
previous_step()
Triggers the previous slide on the running presentation
get_thumbnail_path(slide_no, check_exists)
Returns a path to an image containing a preview for the requested slide
blank_screen()[source]

Blanks the screen, making it black.

check_thumbnails()[source]

Returns True if the thumbnail images exist and are more recent than the powerpoint file.

close_presentation()[source]

Close presentation and clean up objects. Triggered by new object being added to SlideController

convert_thumbnail(file, idx)[source]

Convert the slide image the application made to a scaled 360px height .png image.

get_file_name()[source]

Return just the filename of the presentation, without the directory

get_slide_count()[source]

Returns total number of slides

get_slide_notes(slide_no)[source]

Returns the text on the slide

Parameters:slide_no – The slide the text is required for, starting at 1
get_slide_number()[source]

Returns the current slide number, from 1

get_slide_text(slide_no)[source]

Returns the text on the slide

Parameters:slide_no – The slide the text is required for, starting at 1
get_temp_folder()[source]

The location where thumbnail images will be stored

get_thumbnail_folder()[source]

The location where thumbnail images will be stored

get_thumbnail_path(slide_no, check_exists)[source]

Returns an image path containing a preview for the requested slide

Parameters:
  • slide_no – The slide an image is required for, starting at 1
  • check_exists
get_titles_and_notes()[source]

Reads the titles from the titles file and the notes files and returns the content in two lists

goto_slide(slide_no)[source]

Jumps directly to the requested slide.

Parameters:slide_no – The slide to jump to, starting at 1
is_active()[source]

Returns True if a presentation is currently running

is_blank()[source]

Returns true if screen is blank

is_loaded()[source]

Returns true if a presentation is loaded

load_presentation()[source]

Called when a presentation is added to the SlideController. Loads the presentation and starts it.

Returns False if the file could not be opened

next_step()[source]

Triggers the next effect of slide on the running presentation. This might be the next animation on the current slide, or the next slide

poll_slidenumber(is_live, hide_mode)[source]

Check the current slide number

presentation_deleted()[source]

Cleans up/deletes any controller specific files created for a file, e.g. thumbnails

previous_step()[source]

Triggers the previous slide on the running presentation

save_titles_and_notes(titles, notes)[source]

Performs the actual persisting of titles to the titles.txt and notes to the slideNote%.txt

start_presentation()[source]

Starts the presentation from the beginning

stop_presentation()[source]

Stops the presentation, removing it from the output display

unblank_screen()[source]

Unblanks (restores) the presentation

class openlp.plugins.presentations.lib.presentationcontroller.TextType[source]

Bases: object

Type Enumeration for Types of Text to request

Notes = 2
SlideText = 1
Title = 0