Class: UIC::Application::Presentation

Inherits:
Presentation show all
Extended by:
ElementBacked::ClassMethods
Includes:
ElementBacked
Defined in:
lib/ruic/presentation.rb

Overview

An Presentation is a Presentation that is associated with a specific .uia application. In addition to normal Presentation methods it has additional methods related to its presense in the application.

Instance Attribute Summary collapse

Attributes included from ElementBacked

#el, #owner

Attributes included from FileBacked

#doc, #file

Instance Method Summary collapse

Methods included from ElementBacked::ClassMethods

xmlattribute

Methods inherited from Presentation

#asset_by_id, #assets, #at, #attribute_linked?, #child_assets, #errors, #errors?, #find, #get_attribute, #has_slide?, #image_paths, #image_usage, #load_from_file, #master?, #owning_component, #parent_asset, #rebuild_caches_from_document, #replace_asset, #scene, #set_attribute, #slide_index, #slides_for, #to_xml, #unlink_attribute

Methods included from FileBacked

#file_found?, #filename, #save!, #save_as, #to_xml

Constructor Details

#initialize(application, el) ⇒ Presentation

Returns a new instance of Presentation.

Parameters:

  • application (Application)

    the UIC::Application object owning this presentation.

  • el (Nokogiri::XML::Element)

    the XML element in the .uia representing this presentation.



577
578
579
580
581
# File 'lib/ruic/presentation.rb', line 577

def initialize(application,el)
	self.owner = application
	self.el    = el
	super( application.path_to(src) )
end

Instance Attribute Details

#activeBoolean

Returns Is the presentation initially active in the application?.

Returns:

  • (Boolean)

    Is the presentation initially active in the application?



571
572
573
# File 'lib/ruic/presentation.rb', line 571

xmlattribute :active, ->(val){ val=="True" || val=="" } do |new_val|
	new_val ? 'True' : 'False'
end

#idString

Returns the id of the presentation asset in the .uia.

Returns:

  • (String)

    the id of the presentation asset in the .uia



559
560
561
562
563
# File 'lib/ruic/presentation.rb', line 559

xmlattribute :id do |new_id|
	main_preso = app.main_presentation
	super(new_id)
	app.main_presentation=self if main_preso==self
end

#srcString

Returns the path to the presentation file.

Returns:

  • (String)

    the path to the presentation file



567
# File 'lib/ruic/presentation.rb', line 567

xmlattribute :src

Instance Method Details

#path_to(el, from = nil) ⇒ Object

Overrides Presentation#path_to to prefix all absolute paths with the #id



585
586
587
# File 'lib/ruic/presentation.rb', line 585

def path_to( el, from=nil )
	from ? super : "#{id}:#{super}"
end