2 // System.Drawing.PrinterSettings.cs
5 // Dennis Hayes (dennish@Raytek.com)
6 // Herve Poussineau (hpoussineau@fr.st)
7 // Andreas Nahr (ClassDevelopment@A-SoftTech.com)
9 // (C) 2002 Ximian, Inc
13 // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
15 // Permission is hereby granted, free of charge, to any person obtaining
16 // a copy of this software and associated documentation files (the
17 // "Software"), to deal in the Software without restriction, including
18 // without limitation the rights to use, copy, modify, merge, publish,
19 // distribute, sublicense, and/or sell copies of the Software, and to
20 // permit persons to whom the Software is furnished to do so, subject to
21 // the following conditions:
23 // The above copyright notice and this permission notice shall be
24 // included in all copies or substantial portions of the Software.
26 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
27 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
28 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
29 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
30 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
31 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
32 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
36 using System
.Runtime
.InteropServices
;
37 using System
.Collections
;
38 using System
.Drawing
.Printing
;
40 namespace System
.Drawing
.Printing
44 public class PrinterSettings
: ICloneable
46 public PrinterSettings()
52 public class PaperSourceCollection
: ICollection
54 ArrayList _PaperSources
= new ArrayList();
56 public PaperSourceCollection(PaperSource
[] array
) {
57 foreach (PaperSource ps
in array
)
58 _PaperSources
.Add(ps
);
61 public int Count { get { return _PaperSources.Count; }
}
62 bool ICollection
.IsSynchronized { get { return false; }
}
63 object ICollection
.SyncRoot { get { return this; }
}
65 public virtual PaperSource
this[int index
] {
66 get { return _PaperSources[index] as PaperSource; }
69 public IEnumerator
GetEnumerator()
71 return _PaperSources
.GetEnumerator();
74 void ICollection
.CopyTo(Array array
, int index
)
76 _PaperSources
.CopyTo(array
, index
);
80 public class PaperSizeCollection
: ICollection
82 ArrayList _PaperSizes
= new ArrayList();
84 public PaperSizeCollection(PaperSize
[] array
) {
85 foreach (PaperSize ps
in array
)
89 public int Count { get { return _PaperSizes.Count; }
}
90 bool ICollection
.IsSynchronized { get { return false; }
}
91 object ICollection
.SyncRoot { get { return this; }
}
93 public virtual PaperSize
this[int index
] {
94 get { return _PaperSizes[index] as PaperSize; }
97 public IEnumerator
GetEnumerator()
99 return _PaperSizes
.GetEnumerator();
102 void ICollection
.CopyTo(Array array
, int index
)
104 _PaperSizes
.CopyTo(array
, index
);
108 public class PrinterResolutionCollection
: ICollection
110 ArrayList _PrinterResolutions
= new ArrayList();
112 public PrinterResolutionCollection(PrinterResolution
[] array
) {
113 foreach (PrinterResolution pr
in array
)
114 _PrinterResolutions
.Add(pr
);
117 public int Count { get { return _PrinterResolutions.Count; }
}
118 bool ICollection
.IsSynchronized { get { return false; }
}
119 object ICollection
.SyncRoot { get { return this; }
}
121 public virtual PrinterResolution
this[int index
] {
122 get { return _PrinterResolutions[index] as PrinterResolution; }
125 public IEnumerator
GetEnumerator()
127 return _PrinterResolutions
.GetEnumerator();
130 void ICollection
.CopyTo(Array array
, int index
)
132 _PrinterResolutions
.CopyTo(array
, index
);
136 public class StringCollection
: ICollection
138 ArrayList _Strings
= new ArrayList();
140 public StringCollection(string[] array
) {
141 foreach (string s
in array
)
145 public int Count { get { return _Strings.Count; }
}
146 bool ICollection
.IsSynchronized { get { return false; }
}
147 object ICollection
.SyncRoot { get { return this; }
}
149 public virtual string this[int index
] {
150 get { return _Strings[index] as string; }
153 public IEnumerator
GetEnumerator()
155 return _Strings
.GetEnumerator();
158 void ICollection
.CopyTo(Array array
, int index
)
160 _Strings
.CopyTo(array
, index
);
166 [MonoTODO("PrinterSettings.CanDuplex")]
167 public bool CanDuplex
169 get { throw new NotImplementedException(); }
172 [MonoTODO("PrinterSettings.Collate")]
175 get { throw new NotImplementedException(); }
176 set { throw new NotImplementedException(); }
179 [MonoTODO("PrinterSettings.Copies")]
182 get { throw new NotImplementedException(); }
183 set { throw new NotImplementedException(); }
186 [MonoTODO("PrinterSettings.DefaultPageSettings")]
187 public PageSettings DefaultPageSettings
191 return new PageSettings(
193 // TODO: get default color mode for this printer
195 // TODO: get default orientation for this printer
197 // TODO: get default paper size for this printer
198 new PaperSize("A4", 827, 1169),
199 // TODO: get default paper source for this printer
200 new PaperSource("default", PaperSourceKind
.FormSource
),
201 // TODO: get default resolution for this printer
202 new PrinterResolution(300, 300, PrinterResolutionKind
.Medium
)
207 [MonoTODO("PrinterSettings.Duplex")]
210 get { throw new NotImplementedException(); }
211 set { throw new NotImplementedException(); }
214 [MonoTODO("PrinterSettings.FromPage")]
217 get { throw new NotImplementedException(); }
218 set { throw new NotImplementedException(); }
221 [MonoTODO("PrinterSettings.InstalledPrinters")]
222 public static PrinterSettings
.StringCollection InstalledPrinters
224 get { throw new NotImplementedException(); }
227 [MonoTODO("PrinterSettings.IsDefaultPrinter")]
228 public bool IsDefaultPrinter
230 get { throw new NotImplementedException(); }
233 [MonoTODO("PrinterSettings.IsPlotter")]
234 public bool IsPlotter
236 get { throw new NotImplementedException(); }
239 [MonoTODO("PrinterSettings.IsValid")]
242 get { throw new NotImplementedException(); }
245 [MonoTODO("PrinterSettings.LandscapeAngle")]
246 public int LandscapeAngle
248 get { throw new NotImplementedException(); }
251 [MonoTODO("PrinterSettings.MaximumCopies")]
252 public int MaximumCopies
254 get { throw new NotImplementedException(); }
257 [MonoTODO("PrinterSettings.MaximumPage")]
258 public int MaximumPage
260 get { throw new NotImplementedException(); }
261 set { throw new NotImplementedException(); }
264 [MonoTODO("PrinterSettings.MinimumPage")]
265 public int MinimumPage
267 get { throw new NotImplementedException(); }
268 set { throw new NotImplementedException(); }
271 [MonoTODO("PrinterSettings.PaperSizes")]
272 public PrinterSettings
.PaperSizeCollection PaperSizes
274 get { throw new NotImplementedException(); }
277 [MonoTODO("PrinterSettings.PaperSources")]
278 public PrinterSettings
.PaperSourceCollection PaperSources
280 get { throw new NotImplementedException(); }
283 [MonoTODO("PrinterSettings.PrinterName")]
284 public string PrinterName
286 get { throw new NotImplementedException(); }
287 set { throw new NotImplementedException(); }
290 [MonoTODO("PrinterSettings.PrinterResolutions")]
291 public PrinterSettings
.PrinterResolutionCollection PrinterResolutions
293 get { throw new NotImplementedException(); }
296 [MonoTODO("PrinterSettings.PrintRange")]
297 public PrintRange PrintRange
299 get { throw new NotImplementedException(); }
300 set { throw new NotImplementedException(); }
303 [MonoTODO("PrinterSettings.PrintToFile")]
304 public bool PrintToFile
306 get { throw new NotImplementedException(); }
307 set { throw new NotImplementedException(); }
310 [MonoTODO("PrinterSettings.SupportsColor")]
311 public bool SupportsColor
313 get { throw new NotImplementedException(); }
316 [MonoTODO("PrinterSettings.ToPage")]
319 get { throw new NotImplementedException(); }
320 set { throw new NotImplementedException(); }
325 [MonoTODO("PrinterSettings.Clone")]
326 public virtual object Clone()
328 throw new NotImplementedException();
331 [MonoTODO("PrinterSettings.CreateMeasurementGraphics")]
332 public Graphics
CreateMeasurementGraphics()
334 throw new NotImplementedException();
337 [MonoTODO("PrinterSettings.GetHdevmode")]
338 public IntPtr
GetHdevmode()
340 throw new NotImplementedException();
343 [MonoTODO("PrinterSettings.GetHdevmode")]
344 public IntPtr
GetHdevmode(PageSettings pageSettings
)
346 throw new NotImplementedException();
349 [MonoTODO("PrinterSettings.GetHdevname")]
350 public IntPtr
GetHdevnames()
352 throw new NotImplementedException();
355 [MonoTODO("PrinterSettings.SetHdevmode")]
356 public void SetHdevmode(IntPtr hdevmode
)
358 throw new NotImplementedException();
361 [MonoTODO("PrinterSettings.SetHdevnames")]
362 public void SetHdevnames(IntPtr hdevnames
)
364 throw new NotImplementedException();
367 [MonoTODO("PrinterSettings.ToString")]
368 public override string ToString()
370 throw new NotImplementedException();