diff options
| author | Randy Morgan <[email protected]> | 2011-12-02 18:45:12 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2011-12-02 18:45:12 +0900 |
| commit | b376e6eb11a9cec2589fe1495e6c61db066c92ab (patch) | |
| tree | d8bb9484460ccaf1994d555a2a271fffb3a4ac2b /lib/axlsx/drawing/picture_locking.rb | |
| parent | 3def8f8895a62783cf2e36152d786429e25bb90e (diff) | |
| download | caxlsx-b376e6eb11a9cec2589fe1495e6c61db066c92ab.tar.gz caxlsx-b376e6eb11a9cec2589fe1495e6c61db066c92ab.zip | |
adding in the picture locking class and tests
Diffstat (limited to 'lib/axlsx/drawing/picture_locking.rb')
| -rw-r--r-- | lib/axlsx/drawing/picture_locking.rb | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/lib/axlsx/drawing/picture_locking.rb b/lib/axlsx/drawing/picture_locking.rb new file mode 100644 index 00000000..b1c4850e --- /dev/null +++ b/lib/axlsx/drawing/picture_locking.rb @@ -0,0 +1,72 @@ +module Axlsx + # The picture locking class defines the locking properties for pictures in your workbook. + class PictureLocking + + + attr_reader :noGrp + attr_reader :noSelect + attr_reader :noRot + attr_reader :noChangeAspect + attr_reader :noMove + attr_reader :noResize + attr_reader :noEditPoints + attr_reader :noAdjustHandles + attr_reader :noChangeArrowheads + attr_reader :noChangeShapeType + + # Creates a new PictureLocking object + # @option options [Boolean] noGrp + # @option options [Boolean] noSelect + # @option options [Boolean] noRot + # @option options [Boolean] noChangeAspect + # @option options [Boolean] noMove + # @option options [Boolean] noResize + # @option options [Boolean] noEditPoints + # @option options [Boolean] noAdjustHandles + # @option options [Boolean] noChangeArrowheads + # @option options [Boolean] noChangeShapeType + def initialize(options={}) + @noChangeAspect = true + options.each do |o| + self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}=" + end + end + + # @see noGrp + def noGrp=(v) Axlsx::validate_boolean v; @noGrp = v end + + # @see noSelect + def noSelect=(v) Axlsx::validate_boolean v; @noSelect = v end + + # @see noRot + def noRot=(v) Axlsx::validate_boolean v; @noRot = v end + + # @see noChangeAspect + def noChangeAspect=(v) Axlsx::validate_boolean v; @noChangeAspect = v end + + # @see noMove + def noMove=(v) Axlsx::validate_boolean v; @noMove = v end + + # @see noResize + def noResize=(v) Axlsx::validate_boolean v; @noResize = v end + + # @see noEditPoints + def noEditPoints=(v) Axlsx::validate_boolean v; @noEditPoints = v end + + # @see noAdjustHandles + def noAdjustHandles=(v) Axlsx::validate_boolean v; @noAdjustHandles = v end + + # @see noChangeArrowheads + def noChangeArrowheads=(v) Axlsx::validate_boolean v; @noChangeArrowheads = v end + + # @see noChangeShapeType + def noChangeShapeType=(v) Axlsx::validate_boolean v; @noChangeShapeType = v end + + # Serializes the picture locking + # @param [Nokogiri::XML::Builder] xml The document builder instance this objects xml will be added to. + # @return [String] + def to_xml(xml) + xml[:a].picLocks(self.instance_values) + end + end +end |
