SmartAPI
Open Source .NET RQL library for RedDot CMS / OpenText WSM Management Server
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Pages
ContentClasses/Elements/IImage.cs
Go to the documentation of this file.
1 ï»¿// SmartAPI - .Net programmatic access to RedDot servers
2 //
3 // Copyright (C) 2013 erminas GbR
4 //
5 // This program is free software: you can redistribute it and/or modify it
6 // under the terms of the GNU General Public License as published by the Free Software Foundation,
7 // either version 3 of the License, or (at your option) any later version.
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11 // See the GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License along with this program.
14 // If not, see <http://www.gnu.org/licenses/>.
15 
16 using System.Collections.Generic;
17 using System.Linq;
18 using System.Xml;
19 using erminas.SmartAPI.CMS.Converter;
20 using erminas.SmartAPI.CMS.Project.Folder;
21 
22 namespace erminas.SmartAPI.CMS.Project.ContentClasses.Elements
23 {
25  {
26  ImageAlignment Align { get; set; }
27  AltType AltRequierement { get; set; }
28  string AltText { get; set; }
29  int? AutomaticMaximumScalingHeight { get; set; }
30  int? AutomaticMaximumScalingWidth { get; set; }
31  string Border { get; set; }
32  int? ColorDepthInBit { get; set; }
33 
37  string EligibleSuffixes { get; set; }
38 
39  IList<string> EligibleSuffixesList { get; set; }
40 
41  IFolder Folder { get; set; }
42  string HSpace { get; set; }
43  string HtmlHeight { get; set; }
44  string HtmlWidth { get; set; }
45  bool IsBorderAutomaticallyInsertedIntoPage { get; set; }
46  bool IsDragAndDropActivated { get; set; }
47  bool IsHeightAutomaticallyInsertedIntoPage { get; set; }
48  bool IsOnlyPathAndFilenameInserted { get; set; }
49  bool IsScaledOrConverted { get; set; }
50  bool IsWidthAutomaticallyInsertedIntoPage { get; set; }
51  int? MaxFileSizeInKB { get; set; }
52  string Quality { get; set; }
53  string RequiredNamePattern { get; set; }
54  int? RequiredPictureHeight { get; set; }
55  int? RequiredPictureWidth { get; set; }
56  ILanguageDependentValue<IFile> SampleImage { get; }
57  ILanguageDependentValue<IFile> SrcFile { get; }
58  string Supplement { get; set; }
59  TargetFormat TargetFormat { get; set; }
60  string Usemap { get; set; }
61  string VSpace { get; set; }
62  }
63 
64  //todo share code with IMedia
65  internal class Image : ExtendedContentClassContentElement, IImage
66  {
67  internal Image(IContentClass contentClass, XmlElement xmlElement) : base(contentClass, xmlElement)
68  {
69  }
70 
71  [RedDot("eltalign", ConverterType = typeof (StringEnumConverter<ImageAlignment>))]
72  public ImageAlignment Align
73  {
74  get { return GetAttributeValue<ImageAlignment>(); }
75  set { SetAttributeValue(value); }
76  }
77 
78  [RedDot("eltpresetalt", ConverterType = typeof (EnumConverter<AltType>))]
79  public AltType AltRequierement
80  {
81  get { return GetAttributeValue<AltType>(); }
82  set { SetAttributeValue(value); }
83  }
84 
85  [RedDot("eltalt")]
86  public string AltText
87  {
88  get { return GetAttributeValue<string>(); }
89  set { SetAttributeValue(value); }
90  }
91 
92  [RedDot("eltmaxpicheight")]
93  public int? AutomaticMaximumScalingHeight
94  {
95  get { return GetAttributeValue<int?>(); }
96  set { SetAttributeValue(value); }
97  }
98 
99  [RedDot("eltmaxpicwidth")]
100  public int? AutomaticMaximumScalingWidth
101  {
102  get { return GetAttributeValue<int?>(); }
103  set { SetAttributeValue(value); }
104  }
105 
106  [RedDot("eltborder")]
107  public string Border
108  {
109  get { return GetAttributeValue<string>(); }
110  set { SetAttributeValue(value); }
111  }
112 
113  [RedDot("eltpicdepth")]
114  public int? ColorDepthInBit
115  {
116  get { return GetAttributeValue<int?>(); }
117  set { SetAttributeValue(value); }
118  }
119 
120  [RedDot("eltsuffixes")]
121  public string EligibleSuffixes
122  {
123  get { return GetAttributeValue<string>(); }
124  set { SetAttributeValue(value); }
125  }
126 
127  public IList<string> EligibleSuffixesList
128  {
129  get
130  {
131  var suffixes = EligibleSuffixes;
132  if (string.IsNullOrEmpty(suffixes))
133  {
134  return new List<string>();
135  }
136  return suffixes.Split(';').Where(s => !string.IsNullOrEmpty(s)).ToList();
137  }
138  set { EligibleSuffixes = value == null ? null : string.Join(";", value); }
139  }
140 
141  [RedDot("eltfolderguid", ConverterType = typeof (FolderConverter))]
142  public IFolder Folder
143  {
144  get { return GetAttributeValue<IFolder>(); }
145  set { SetAttributeValue(value); }
146  }
147 
148  [RedDot("elthspace")]
149  public string HSpace
150  {
151  get { return GetAttributeValue<string>(); }
152  set { SetAttributeValue(value); }
153  }
154 
155  [RedDot("eltheight")]
156  public string HtmlHeight
157  {
158  get { return GetAttributeValue<string>(); }
159  set { SetAttributeValue(value); }
160  }
161 
162  [RedDot("eltwidth")]
163  public string HtmlWidth
164  {
165  get { return GetAttributeValue<string>(); }
166  set { SetAttributeValue(value); }
167  }
168 
169  [RedDot("eltautoborder")]
170  public bool IsBorderAutomaticallyInsertedIntoPage
171  {
172  get { return GetAttributeValue<bool>(); }
173  set { SetAttributeValue(value); }
174  }
175 
176  [RedDot("eltdragdrop")]
177  public bool IsDragAndDropActivated
178  {
179  get { return GetAttributeValue<bool>(); }
180  set { SetAttributeValue(value); }
181  }
182 
183  [RedDot("eltautoheight")]
184  public bool IsHeightAutomaticallyInsertedIntoPage
185  {
186  get { return GetAttributeValue<bool>(); }
187  set { SetAttributeValue(value); }
188  }
189 
190  [RedDot("eltonlyhrefvalue")]
191  public bool IsOnlyPathAndFilenameInserted
192  {
193  get { return GetAttributeValue<bool>(); }
194  set { SetAttributeValue(value); }
195  }
196 
197  [RedDot("eltconvert")]
198  public bool IsScaledOrConverted
199  {
200  get { return GetAttributeValue<bool>(); }
201  set { SetAttributeValue(value); }
202  }
203 
204  [RedDot("eltautowidth")]
205  public bool IsWidthAutomaticallyInsertedIntoPage
206  {
207  get { return GetAttributeValue<bool>(); }
208  set { SetAttributeValue(value); }
209  }
210 
211  [RedDot("eltmaxsize")]
212  public int? MaxFileSizeInKB
213  {
214  get { return GetAttributeValue<int?>(); }
215  set { SetAttributeValue(value); }
216  }
217 
218  [RedDot("eltcompression")]
219  public string Quality
220  {
221  get { return GetAttributeValue<string>(); }
222  set { SetAttributeValue(value); }
223  }
224 
225  [RedDot("eltfilename")]
226  public string RequiredNamePattern
227  {
228  get { return GetAttributeValue<string>(); }
229  set { SetAttributeValue(value); }
230  }
231 
232  [RedDot("eltpicheight")]
233  public int? RequiredPictureHeight
234  {
235  get { return GetAttributeValue<int?>(); }
236  set { SetAttributeValue(value); }
237  }
238 
239  [RedDot("eltpicwidth")]
240  public int? RequiredPictureWidth
241  {
242  get { return GetAttributeValue<int?>(); }
243  set { SetAttributeValue(value); }
244  }
245 
246  [RedDot("__examplefile", ConverterType = typeof (ExampleFileConverter), DependsOn = "eltfolderguid")]
247  public ILanguageDependentValue<IFile> SampleImage
248  {
249  get { return GetAttributeValue<ILanguageDependentValue<IFile>>(); }
250  }
251 
252  [RedDot("__srcfile", ConverterType = typeof (SrcFileConverter))]
253  public ILanguageDependentValue<IFile> SrcFile
254  {
255  get { return GetAttributeValue<ILanguageDependentValue<IFile>>(); }
256  }
257 
258  [RedDot("eltsupplement")]
259  public string Supplement
260  {
261  get { return GetAttributeValue<string>(); }
262  set { SetAttributeValue(value); }
263  }
264 
265  [RedDot("elttargetformat", ConverterType = typeof (StringEnumConverter<TargetFormat>))]
267  {
268  get { return GetAttributeValue<TargetFormat>(); }
269  set { SetAttributeValue(value); }
270  }
271 
272  [RedDot("eltusermap")]
273  public string Usemap
274  {
275  get { return GetAttributeValue<string>(); }
276  set { SetAttributeValue(value); }
277  }
278 
279  [RedDot("eltvspace")]
280  public string VSpace
281  {
282  get { return GetAttributeValue<string>(); }
283  set { SetAttributeValue(value); }
284  }
285  }
286 }