2010-04-07 Jb Evain <jbevain@novell.com>
[mcs.git] / class / Mono.WebBrowser / Mono.Mozilla / interfaces / nsITimer.cs
blobaa0e08329ca8d687a50f9e7d4eb73417676b3a78
1 // THIS FILE AUTOMATICALLY GENERATED BY xpidl2cs.pl
2 // EDITING IS PROBABLY UNWISE
3 // Permission is hereby granted, free of charge, to any person obtaining
4 // a copy of this software and associated documentation files (the
5 // "Software"), to deal in the Software without restriction, including
6 // without limitation the rights to use, copy, modify, merge, publish,
7 // distribute, sublicense, and/or sell copies of the Software, and to
8 // permit persons to whom the Software is furnished to do so, subject to
9 // the following conditions:
10 //
11 // The above copyright notice and this permission notice shall be
12 // included in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 // Copyright (c) 2007, 2008 Novell, Inc.
24 // Authors:
25 // Andreia Gaita (avidigal@novell.com)
28 using System;
29 using System.Runtime.InteropServices;
30 using System.Runtime.CompilerServices;
31 using System.Text;
33 namespace Mono.Mozilla {
35 [Guid ("436a83fa-b396-11d9-bcfa-00112478d626")]
36 [InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
37 [ComImport ()]
38 internal interface nsITimer {
40 #region nsITimer
41 [PreserveSigAttribute]
42 [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
43 int init ([MarshalAs (UnmanagedType.Interface) ] nsIObserver aObserver,
44 uint aDelay,
45 uint aType);
47 [PreserveSigAttribute]
48 [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
49 int initWithFuncCallback ( nsITimerCallbackDelegate aCallback,
50 IntPtr aClosure,
51 uint aDelay,
52 uint aType);
54 [PreserveSigAttribute]
55 [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
56 int initWithCallback ([MarshalAs (UnmanagedType.Interface) ] nsITimerCallback aCallback,
57 uint aDelay,
58 uint aType);
60 [PreserveSigAttribute]
61 [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
62 int cancel ();
64 [PreserveSigAttribute]
65 [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
66 int getDelay (out uint ret);
68 [PreserveSigAttribute]
69 [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
70 int setDelay (uint value);
72 [PreserveSigAttribute]
73 [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
74 int getType (out uint ret);
76 [PreserveSigAttribute]
77 [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
78 int setType (uint value);
80 [PreserveSigAttribute]
81 [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
82 int getClosure ( IntPtr ret);
84 [PreserveSigAttribute]
85 [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
86 int getCallback ([MarshalAs (UnmanagedType.Interface) ] out nsITimerCallback ret);
88 #endregion
92 internal class nsTimer {
93 public static nsITimer GetProxy (Mono.WebBrowser.IWebBrowser control, nsITimer obj)
95 object o = Base.GetProxyForObject (control, typeof(nsITimer).GUID, obj);
96 return o as nsITimer;
100 #if example
102 using System;
103 using System.Runtime.InteropServices;
104 using System.Runtime.CompilerServices;
105 using System.Text;
107 internal class Timer : nsITimer {
109 #region nsITimer
110 int nsITimer.init ([MarshalAs (UnmanagedType.Interface) ] nsIObserver aObserver,
111 uint aDelay,
112 uint aType)
114 return ;
119 int nsITimer.initWithFuncCallback ( nsITimerCallbackDelegate aCallback,
120 IntPtr aClosure,
121 uint aDelay,
122 uint aType)
124 return ;
129 int nsITimer.initWithCallback ([MarshalAs (UnmanagedType.Interface) ] nsITimerCallback aCallback,
130 uint aDelay,
131 uint aType)
133 return ;
138 int nsITimer.cancel ()
140 return ;
145 int nsITimer.getDelay (out uint ret)
148 return 0;
151 int nsITimer.setDelay (uint value)
155 return 0;
158 int nsITimer.getType (out uint ret)
161 return 0;
164 int nsITimer.setType (uint value)
168 return 0;
171 int nsITimer.getClosure ( IntPtr ret)
174 return IntPtr.Zero;
177 int nsITimer.getCallback ([MarshalAs (UnmanagedType.Interface) ] out nsITimerCallback ret)
180 return null;
183 #endregion
185 #endif