|
| 1 | +/* |
| 2 | + * -------------------------------------------------------------------------------- |
| 3 | + * <copyright company="Aspose" file="DrawingObjectInsert.swift"> |
| 4 | + * Copyright (c) 2020 Aspose.Words for Cloud |
| 5 | + * </copyright> |
| 6 | + * <summary> |
| 7 | + * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 8 | + * of this software and associated documentation files (the "Software"), to deal |
| 9 | + * in the Software without restriction, including without limitation the rights |
| 10 | + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 11 | + * copies of the Software, and to permit persons to whom the Software is |
| 12 | + * furnished to do so, subject to the following conditions: |
| 13 | + * |
| 14 | + * The above copyright notice and this permission notice shall be included in all |
| 15 | + * copies or substantial portions of the Software. |
| 16 | + * |
| 17 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 18 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 19 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 20 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 21 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 22 | + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 23 | + * SOFTWARE. |
| 24 | + * </summary> |
| 25 | + * -------------------------------------------------------------------------------- |
| 26 | + */ |
| 27 | + |
| 28 | +import Foundation |
| 29 | + |
| 30 | +// Drawing object element for insert. |
| 31 | +public class DrawingObjectInsert : Codable, WordsApiModel { |
| 32 | + // Gets or sets specifies where the distance to the image is measured from. |
| 33 | + public enum RelativeHorizontalPosition : String, Codable |
| 34 | + { |
| 35 | + // Enum value "margin" |
| 36 | + case margin = "Margin" |
| 37 | + |
| 38 | + // Enum value "page" |
| 39 | + case page = "Page" |
| 40 | + |
| 41 | + // Enum value "column" |
| 42 | + case column = "Column" |
| 43 | + |
| 44 | + // Enum value "_default" |
| 45 | + case _default = "Default" |
| 46 | + |
| 47 | + // Enum value "character" |
| 48 | + case character = "Character" |
| 49 | + |
| 50 | + // Enum value "leftMargin" |
| 51 | + case leftMargin = "LeftMargin" |
| 52 | + |
| 53 | + // Enum value "rightMargin" |
| 54 | + case rightMargin = "RightMargin" |
| 55 | + |
| 56 | + // Enum value "insideMargin" |
| 57 | + case insideMargin = "InsideMargin" |
| 58 | + |
| 59 | + // Enum value "outsideMargin" |
| 60 | + case outsideMargin = "OutsideMargin" |
| 61 | + } |
| 62 | + // Gets or sets specifies where the distance to the image measured from. |
| 63 | + public enum RelativeVerticalPosition : String, Codable |
| 64 | + { |
| 65 | + // Enum value "margin" |
| 66 | + case margin = "Margin" |
| 67 | + |
| 68 | + // Enum value "tableDefault" |
| 69 | + case tableDefault = "TableDefault" |
| 70 | + |
| 71 | + // Enum value "page" |
| 72 | + case page = "Page" |
| 73 | + |
| 74 | + // Enum value "paragraph" |
| 75 | + case paragraph = "Paragraph" |
| 76 | + |
| 77 | + // Enum value "textFrameDefault" |
| 78 | + case textFrameDefault = "TextFrameDefault" |
| 79 | + |
| 80 | + // Enum value "line" |
| 81 | + case line = "Line" |
| 82 | + |
| 83 | + // Enum value "topMargin" |
| 84 | + case topMargin = "TopMargin" |
| 85 | + |
| 86 | + // Enum value "bottomMargin" |
| 87 | + case bottomMargin = "BottomMargin" |
| 88 | + |
| 89 | + // Enum value "insideMargin" |
| 90 | + case insideMargin = "InsideMargin" |
| 91 | + |
| 92 | + // Enum value "outsideMargin" |
| 93 | + case outsideMargin = "OutsideMargin" |
| 94 | + } |
| 95 | + // Gets or sets specifies how to wrap text around the image. |
| 96 | + public enum WrapType : String, Codable |
| 97 | + { |
| 98 | + // Enum value "inline" |
| 99 | + case inline = "Inline" |
| 100 | + |
| 101 | + // Enum value "topBottom" |
| 102 | + case topBottom = "TopBottom" |
| 103 | + |
| 104 | + // Enum value "square" |
| 105 | + case square = "Square" |
| 106 | + |
| 107 | + // Enum value "_none" |
| 108 | + case _none = "None" |
| 109 | + |
| 110 | + // Enum value "tight" |
| 111 | + case tight = "Tight" |
| 112 | + |
| 113 | + // Enum value "through" |
| 114 | + case through = "Through" |
| 115 | + } |
| 116 | + |
| 117 | + // Field of position. |
| 118 | + private var position : DocumentPosition?; |
| 119 | + |
| 120 | + // Field of relativeHorizontalPosition. Gets or sets specifies where the distance to the image is measured from. |
| 121 | + private var relativeHorizontalPosition : RelativeHorizontalPosition?; |
| 122 | + |
| 123 | + // Field of _left. Gets or sets distance in points from the origin to the left side of the image. |
| 124 | + private var _left : Double?; |
| 125 | + |
| 126 | + // Field of relativeVerticalPosition. Gets or sets specifies where the distance to the image measured from. |
| 127 | + private var relativeVerticalPosition : RelativeVerticalPosition?; |
| 128 | + |
| 129 | + // Field of top. Gets or sets distance in points from the origin to the top side of the image. |
| 130 | + private var top : Double?; |
| 131 | + |
| 132 | + // Field of width. Gets or sets width of the drawing objects in points. |
| 133 | + private var width : Double?; |
| 134 | + |
| 135 | + // Field of height. Gets or sets height of the drawing object in points. |
| 136 | + private var height : Double?; |
| 137 | + |
| 138 | + // Field of wrapType. Gets or sets specifies how to wrap text around the image. |
| 139 | + private var wrapType : WrapType?; |
| 140 | + |
| 141 | + private enum CodingKeys: String, CodingKey { |
| 142 | + case position; |
| 143 | + case relativeHorizontalPosition; |
| 144 | + case _left; |
| 145 | + case relativeVerticalPosition; |
| 146 | + case top; |
| 147 | + case width; |
| 148 | + case height; |
| 149 | + case wrapType; |
| 150 | + case invalidCodingKey; |
| 151 | + } |
| 152 | + |
| 153 | + public init() { |
| 154 | + |
| 155 | + } |
| 156 | + |
| 157 | + public required init(from decoder: Decoder) throws { |
| 158 | + |
| 159 | + let container = try decoder.container(keyedBy: CodingKeys.self); |
| 160 | + self.position = try container.decodeIfPresent(DocumentPosition.self, forKey: .position); |
| 161 | + self.relativeHorizontalPosition = try container.decodeIfPresent(RelativeHorizontalPosition.self, forKey: .relativeHorizontalPosition); |
| 162 | + self._left = try container.decodeIfPresent(Double.self, forKey: ._left); |
| 163 | + self.relativeVerticalPosition = try container.decodeIfPresent(RelativeVerticalPosition.self, forKey: .relativeVerticalPosition); |
| 164 | + self.top = try container.decodeIfPresent(Double.self, forKey: .top); |
| 165 | + self.width = try container.decodeIfPresent(Double.self, forKey: .width); |
| 166 | + self.height = try container.decodeIfPresent(Double.self, forKey: .height); |
| 167 | + self.wrapType = try container.decodeIfPresent(WrapType.self, forKey: .wrapType); |
| 168 | + } |
| 169 | + |
| 170 | + public func encode(to encoder: Encoder) throws { |
| 171 | + |
| 172 | + var container = encoder.container(keyedBy: CodingKeys.self); |
| 173 | + if (self.position != nil) { |
| 174 | + try container.encode(self.position, forKey: .position); |
| 175 | + } |
| 176 | + if (self.relativeHorizontalPosition != nil) { |
| 177 | + try container.encode(self.relativeHorizontalPosition, forKey: .relativeHorizontalPosition); |
| 178 | + } |
| 179 | + if (self._left != nil) { |
| 180 | + try container.encode(self._left, forKey: ._left); |
| 181 | + } |
| 182 | + if (self.relativeVerticalPosition != nil) { |
| 183 | + try container.encode(self.relativeVerticalPosition, forKey: .relativeVerticalPosition); |
| 184 | + } |
| 185 | + if (self.top != nil) { |
| 186 | + try container.encode(self.top, forKey: .top); |
| 187 | + } |
| 188 | + if (self.width != nil) { |
| 189 | + try container.encode(self.width, forKey: .width); |
| 190 | + } |
| 191 | + if (self.height != nil) { |
| 192 | + try container.encode(self.height, forKey: .height); |
| 193 | + } |
| 194 | + if (self.wrapType != nil) { |
| 195 | + try container.encode(self.wrapType, forKey: .wrapType); |
| 196 | + } |
| 197 | + } |
| 198 | + |
| 199 | + // Sets position. |
| 200 | + public func setPosition(position : DocumentPosition?) { |
| 201 | + self.position = position; |
| 202 | + } |
| 203 | + |
| 204 | + // Gets position. |
| 205 | + public func getPosition() -> DocumentPosition? { |
| 206 | + return self.position; |
| 207 | + } |
| 208 | + |
| 209 | + // Sets relativeHorizontalPosition. Gets or sets specifies where the distance to the image is measured from. |
| 210 | + public func setRelativeHorizontalPosition(relativeHorizontalPosition : RelativeHorizontalPosition?) { |
| 211 | + self.relativeHorizontalPosition = relativeHorizontalPosition; |
| 212 | + } |
| 213 | + |
| 214 | + // Gets relativeHorizontalPosition. Gets or sets specifies where the distance to the image is measured from. |
| 215 | + public func getRelativeHorizontalPosition() -> RelativeHorizontalPosition? { |
| 216 | + return self.relativeHorizontalPosition; |
| 217 | + } |
| 218 | + |
| 219 | + // Sets _left. Gets or sets distance in points from the origin to the left side of the image. |
| 220 | + public func setLeft(_left : Double?) { |
| 221 | + self._left = _left; |
| 222 | + } |
| 223 | + |
| 224 | + // Gets _left. Gets or sets distance in points from the origin to the left side of the image. |
| 225 | + public func getLeft() -> Double? { |
| 226 | + return self._left; |
| 227 | + } |
| 228 | + |
| 229 | + // Sets relativeVerticalPosition. Gets or sets specifies where the distance to the image measured from. |
| 230 | + public func setRelativeVerticalPosition(relativeVerticalPosition : RelativeVerticalPosition?) { |
| 231 | + self.relativeVerticalPosition = relativeVerticalPosition; |
| 232 | + } |
| 233 | + |
| 234 | + // Gets relativeVerticalPosition. Gets or sets specifies where the distance to the image measured from. |
| 235 | + public func getRelativeVerticalPosition() -> RelativeVerticalPosition? { |
| 236 | + return self.relativeVerticalPosition; |
| 237 | + } |
| 238 | + |
| 239 | + // Sets top. Gets or sets distance in points from the origin to the top side of the image. |
| 240 | + public func setTop(top : Double?) { |
| 241 | + self.top = top; |
| 242 | + } |
| 243 | + |
| 244 | + // Gets top. Gets or sets distance in points from the origin to the top side of the image. |
| 245 | + public func getTop() -> Double? { |
| 246 | + return self.top; |
| 247 | + } |
| 248 | + |
| 249 | + // Sets width. Gets or sets width of the drawing objects in points. |
| 250 | + public func setWidth(width : Double?) { |
| 251 | + self.width = width; |
| 252 | + } |
| 253 | + |
| 254 | + // Gets width. Gets or sets width of the drawing objects in points. |
| 255 | + public func getWidth() -> Double? { |
| 256 | + return self.width; |
| 257 | + } |
| 258 | + |
| 259 | + // Sets height. Gets or sets height of the drawing object in points. |
| 260 | + public func setHeight(height : Double?) { |
| 261 | + self.height = height; |
| 262 | + } |
| 263 | + |
| 264 | + // Gets height. Gets or sets height of the drawing object in points. |
| 265 | + public func getHeight() -> Double? { |
| 266 | + return self.height; |
| 267 | + } |
| 268 | + |
| 269 | + // Sets wrapType. Gets or sets specifies how to wrap text around the image. |
| 270 | + public func setWrapType(wrapType : WrapType?) { |
| 271 | + self.wrapType = wrapType; |
| 272 | + } |
| 273 | + |
| 274 | + // Gets wrapType. Gets or sets specifies how to wrap text around the image. |
| 275 | + public func getWrapType() -> WrapType? { |
| 276 | + return self.wrapType; |
| 277 | + } |
| 278 | +} |
0 commit comments