**** Merged from MCS ****
[mono-project.git] / mcs / class / System.Windows.Forms / System.Windows.Forms / AxHost.cs
blobfd9a95ef18b4d2658a8123d7d19d6c6d6db36b3b
1 //
2 // System.Windows.Forms.AxHost
3 //
4 // Author:
5 // stubbed out by Jaak Simm (jaaksimm@firm.ee)
6 // Dennis hayes (dennish@raytek.com)
7 //
8 // (C) Ximian, Inc., 2002/3
9 //
13 // Permission is hereby granted, free of charge, to any person obtaining
14 // a copy of this software and associated documentation files (the
15 // "Software"), to deal in the Software without restriction, including
16 // without limitation the rights to use, copy, modify, merge, publish,
17 // distribute, sublicense, and/or sell copies of the Software, and to
18 // permit persons to whom the Software is furnished to do so, subject to
19 // the following conditions:
20 //
21 // The above copyright notice and this permission notice shall be
22 // included in all copies or substantial portions of the Software.
23 //
24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
28 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
29 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
30 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32 using System;
33 using System.ComponentModel;
34 using System.Drawing;
35 using System.Runtime.Serialization;
37 namespace System.Windows.Forms {
39 /// <summary>
40 /// Wraps ActiveX controls and exposes them as fully featured Windows Forms controls.
41 /// </summary>
43 [MonoTODO]
44 public abstract class AxHost : Control, ISupportInitialize, ICustomTypeDescriptor {
46 /// --- Constructors ---
47 /// Class AxHost does not have a constructor for non-internal purposes.
48 /// Thus, no constructor is stubbed out.
49 /// Here are the two AxHost constructors for supporting .NET Framework infrastructure:
50 protected AxHost(string clsid){
53 protected AxHost(string clsid,int flags){
56 /// --- public Properties ---
57 /// Properties supporting .NET framework, only. Not stubbed out:
58 public bool EditMode {
59 get {
60 throw new NotImplementedException ();
64 [MonoTODO]
65 public override Color BackColor {
66 get {
67 //FIXME:
68 return base.BackColor;
70 set {
71 //FIXME:
72 base.BackColor = value;
76 [MonoTODO]
77 public override Image BackgroundImage {
78 get {
79 //FIXME:
80 return base.BackgroundImage;
82 set {
83 //FIXME:
84 base.BackgroundImage = value;
88 [MonoTODO]
89 public ContainerControl ContainingControl {
90 get {
91 throw new NotImplementedException ();
93 set {
94 //FIXME:
98 [MonoTODO]
99 public override ContextMenu ContextMenu {
100 get {
101 //FIXME:
102 return base.ContextMenu;
104 set {
105 //FIXME:
106 base.ContextMenu = value;
110 [MonoTODO]
111 protected override CreateParams CreateParams {
112 get {
113 //FIXME:
114 return base.CreateParams;
118 [MonoTODO]
119 public override Cursor Cursor {
120 get {
121 //FIXME:
122 return base.Cursor;
124 set {
125 //FIXME:
126 base.Cursor = value;
130 [MonoTODO]
131 protected override Size DefaultSize {
132 get {
133 //FIXME:
134 return base.DefaultSize;
138 [MonoTODO]
139 public new virtual bool Enabled {
140 get {
141 //FIXME:
142 throw new NotImplementedException ();
144 set {
145 //FIXME:
149 [MonoTODO]
150 public override Font Font {
151 get {
152 //FIXME:
153 return base.Font;
155 set {
156 //FIXME:
157 base.Font = value;
161 [MonoTODO]
162 public override Color ForeColor {
163 get {
164 //FIXME:
165 return base.ForeColor;
167 set {
168 //FIXME:
169 base.ForeColor = value;
173 [MonoTODO]
174 public bool HasAboutBox {
175 get {
176 throw new NotImplementedException ();
180 [MonoTODO]
181 public AxHost.State OcxState {
182 get {
183 //FIXME:
184 throw new NotImplementedException ();
186 set {
187 //FIXME:
191 [MonoTODO]
192 //FIXME
193 public new virtual bool RightToLeft {
194 get {
195 throw new NotImplementedException ();
197 set {
198 //FIXME:
202 [MonoTODO]
203 public override ISite Site {
204 set {
205 //FIXME:
209 [MonoTODO]
210 public override string Text {
211 get {
212 //FIXME:
213 return base.Text;
215 set {
216 //FIXME:
217 base.Text = value;
221 /// --- methods ---
222 /// internal .NET framework supporting methods, not stubbed out:
223 ///
225 [MonoTODO]
226 protected virtual void CreateSink(){
229 [MonoTODO]
230 protected virtual void DetachSink(){
233 [MonoTODO]
234 public void DoVerb(int verb){
237 [MonoTODO]
238 [CLSCompliant(false)]
239 protected static Color GetColorFromOleColor(uint color){
240 throw new NotImplementedException ();
243 [MonoTODO]
244 protected static Font GetFontFromIFont(object font){
245 throw new NotImplementedException ();
248 [MonoTODO]
249 protected static Font GetFontFromIFontDisp(object font){
250 throw new NotImplementedException ();
253 [MonoTODO]
254 protected static object GetIFontDispFromFont(Font font){
255 throw new NotImplementedException ();
258 [MonoTODO]
259 protected static object GetIFontFromFont(Font font){
260 throw new NotImplementedException ();
263 [MonoTODO]
264 protected static object GetIPictureDispFromPicture(Image image){
265 throw new NotImplementedException ();
268 [MonoTODO]
269 protected static object GetIPictureFromCursor(Cursor cursor){
270 throw new NotImplementedException ();
273 [MonoTODO]
274 protected static object GetIPictureFromPicture(Image image){
275 throw new NotImplementedException ();
278 [MonoTODO]
279 protected static double GetOADateFromTime(DateTime time){
280 throw new NotImplementedException ();
283 [MonoTODO]
284 [CLSCompliant(false)]
285 protected static uint GetOleColorFromColor(Color color){
286 throw new NotImplementedException ();
289 [MonoTODO]
290 protected static Image GetPictureFromIPicture(object picture){
291 throw new NotImplementedException ();
294 [MonoTODO]
295 protected static Image GetPictureFromIPictureDisp(object picture){
296 throw new NotImplementedException ();
299 [MonoTODO]
300 protected static DateTime GetTimeFromOADate(double date){
301 throw new NotImplementedException ();
304 [MonoTODO]
305 public void InvokeEditMode(){
308 [MonoTODO]
309 public void MakeDirty(){
312 protected bool PropsValid(){
313 throw new NotImplementedException ();
316 protected void RaiseOnMouseDown(short button,short shift,int x,int y){
319 protected void RaiseOnMouseDown(short button,short shift,float x,float y){
322 protected void RaiseOnMouseDown(object o1,object o2,object o3,object o4){
325 protected void RaiseOnMouseMove(short button,short shift,int x,int y){
328 protected void RaiseOnMouseMove(short button,short shift,float x,float y){
331 protected void RaiseOnMouseMove(object o1,object o2,object o3,object o4){
334 protected void RaiseOnMouseUp(short button,short shift,int x,int y){
337 protected void RaiseOnMouseUp(short button,short shift,float x,float y){
340 protected void RaiseOnMouseUp(object o1,object o2,object o3,object o4){
343 [MonoTODO]
344 protected virtual void AttachInterfaces() {
345 //FIXME:
348 [MonoTODO]
349 public void BeginInit() {
350 //FIXME:
353 [MonoTODO]
354 protected override void CreateHandle() {
355 //FIXME:
356 base.CreateHandle();
359 [MonoTODO]
360 protected override void DestroyHandle() {
361 //FIXME:
362 base.DestroyHandle();
365 [MonoTODO]
366 protected override void Dispose(bool disposing) {
367 //FIXME:
368 base.Dispose(disposing);
371 [MonoTODO]
372 public virtual void EndInit() {
373 //FIXME:
376 [MonoTODO]
377 public object GetOcx() {
378 throw new NotImplementedException ();
381 [MonoTODO]
382 public bool HasPropertyPages() {
383 throw new NotImplementedException ();
386 [MonoTODO]
387 protected override bool IsInputChar(char charCode) {
388 //FIXME:
389 return base.IsInputChar(charCode);
392 /// --- methods used with events ---
393 [MonoTODO]
394 protected override void OnBackColorChanged(EventArgs e) {
395 //FIXME:
396 base.OnBackColorChanged(e);
399 [MonoTODO]
400 protected override void OnFontChanged(EventArgs e) {
401 //FIXME:
402 base.OnFontChanged(e);
405 [MonoTODO]
406 protected override void OnForeColorChanged(EventArgs e) {
407 //FIXME:
408 base.OnForeColorChanged(e);
411 [MonoTODO]
412 protected override void OnHandleCreated(EventArgs e) {
413 //FIXME:
414 base.OnHandleCreated(e);
417 [MonoTODO]
418 protected virtual void OnInPlaceActive() {
419 //FIXME:
423 [MonoTODO]
424 protected override void OnLostFocus(EventArgs e) {
425 //FIXME:
426 base.OnLostFocus(e);
428 /// --- END OF: methods used with events ---
430 [MonoTODO]
431 public override bool PreProcessMessage(ref Message msg) {
432 //FIXME:
433 return base.PreProcessMessage(ref msg);
436 [MonoTODO]
437 protected override bool ProcessMnemonic(char charCode) {
438 //FIXME:
439 return base.ProcessMnemonic(charCode);
442 [MonoTODO]
443 protected override bool ProcessDialogKey(Keys keyData) { // .NET V1.1 Beta
444 //FIXME:
445 return base.ProcessDialogKey(keyData);
448 [MonoTODO]
449 protected void SetAboutBoxDelegate(AxHost.AboutBoxDelegate d) {
450 //FIXME:
453 [MonoTODO]
454 protected override void SetBoundsCore(int x,int y,int width,int height,BoundsSpecified specified) {
455 //FIXME:
456 base.SetBoundsCore(x,y,width,height,specified);
459 [MonoTODO]
460 protected override void SetVisibleCore(bool value) {
461 //FIXME:
462 base.SetVisibleCore(value);
465 [MonoTODO]
466 public void ShowAboutBox() {
467 //FIXME:
470 [MonoTODO]
471 public void ShowPropertyPages() {
472 //FIXME:
475 [MonoTODO]
476 public void ShowPropertyPages(Control control) {
477 //FIXME:
480 [MonoTODO]
481 protected override void WndProc(ref Message m) {
482 //FIXME:
483 base.WndProc(ref m);
486 /// --- public delegates ---
487 //[Serializable]
488 protected delegate void AboutBoxDelegate();
490 /// --- ICustomTypeDescriptor methods ---
491 /// Note: all of them are supporting .NET framework, but have to be stubbed out for the interface
493 [MonoTODO]
494 AttributeCollection ICustomTypeDescriptor.GetAttributes()
496 throw new NotImplementedException ();
499 [MonoTODO]
500 string ICustomTypeDescriptor.GetClassName()
502 //FIXME:
503 return "";
506 [MonoTODO]
507 string ICustomTypeDescriptor.GetComponentName()
509 //FIXME:
510 return "";
513 [MonoTODO]
514 TypeConverter ICustomTypeDescriptor.GetConverter()
516 throw new NotImplementedException ();
519 [MonoTODO]
520 EventDescriptor ICustomTypeDescriptor.GetDefaultEvent()
522 throw new NotImplementedException ();
525 [MonoTODO]
526 PropertyDescriptor ICustomTypeDescriptor.GetDefaultProperty()
528 throw new NotImplementedException ();
531 [MonoTODO]
532 object ICustomTypeDescriptor.GetEditor(Type editorBaseType)
534 throw new NotImplementedException ();
537 [MonoTODO]
538 EventDescriptorCollection ICustomTypeDescriptor.GetEvents()
540 throw new NotImplementedException ();
543 [MonoTODO]
544 EventDescriptorCollection ICustomTypeDescriptor.GetEvents(Attribute[] attributes)
546 throw new NotImplementedException ();
549 [MonoTODO]
550 PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties()
552 throw new NotImplementedException ();
555 [MonoTODO]
556 PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties(Attribute[] attributes)
558 throw new NotImplementedException ();
561 [MonoTODO]
562 object ICustomTypeDescriptor.GetPropertyOwner(PropertyDescriptor pd)
564 throw new NotImplementedException ();
568 /// sub-class: AxHost.InvalidActiveXStateException
569 /// <summary>
570 /// The exception that is thrown when the ActiveX control is referenced while in an invalid state.
571 /// </summary>
572 [MonoTODO]
573 public class InvalidActiveXStateException : Exception {
578 /// sub-class: AxHost.State
579 /// <summary>
580 /// Encapsulates the persisted state of an ActiveX control.
582 /// Note: the class does not contain any documented methods, just only those supporting .NET framework
583 /// </summary>
584 [MonoTODO]
585 [Serializable]
586 public class State : ISerializable {
588 /// The classes only constructor is supporting .NET framework, and thus not stubbed out:
589 /// - [Serializable] public AxHost.State(Stream ms,int storageType,bool manualUpdate,string licKey);
591 /// --- Methods ---
592 //[Serializable]
593 void ISerializable.GetObjectData(SerializationInfo si,StreamingContext context)
595 throw new NotImplementedException ();
599 //protected bool RenderRightToLeft{
602 public enum ActiveXInvokeKind {
603 MethodInvoke = 0,
604 PropertyGet = 1,
605 PropertySet = 2
608 [MonoTODO]
609 public class AxComponentEditor {// add ref to swf.desing : WindowsFormsComponentEditor {
613 [MonoTODO]
614 public class ConnectionPointCookie {
617 public class StateConverter : System.ComponentModel.TypeConverter {
620 [AttributeUsage(AttributeTargets.Class)]
621 public sealed class ClsidAttribute : Attribute {
622 string clsid;
624 public ClsidAttribute (string clsid)
626 this.clsid = clsid;
629 public string Value {
630 get {
631 return clsid;
636 [AttributeUsage(AttributeTargets.Assembly)]
637 public sealed class TypeLibraryTimeStampAttribute : Attribute{