summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/drawing/picture_locking.rb
blob: 9511cb155b09f3a9b4445899a0cb4c175312e7e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# frozen_string_literal: true

module Axlsx
  # The picture locking class defines the locking properties for pictures in your workbook.
  class PictureLocking
    include Axlsx::OptionsParser
    include Axlsx::SerializedAttributes
    include Axlsx::Accessors

    boolean_attr_accessor :noGrp, :noSelect, :noRot, :noChangeAspect,
                          :noMove, :noResize, :noEditPoints, :noAdjustHandles,
                          :noChangeArrowheads, :noChangeShapeType

    serializable_attributes :noGrp, :noSelect, :noRot, :noChangeAspect,
                            :noMove, :noResize, :noEditPoints, :noAdjustHandles,
                            :noChangeArrowheads, :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
      parse_options options
    end

    # Serializes the object
    # @param [String] str
    # @return [String]
    def to_xml_string(str = +'')
      serialized_tag('a:picLocks', str)
    end
  end
end