Advertisement
baulig

NSUserNotificationCenter.g.cs

Nov 21st, 2012
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.00 KB | None | 0 0
  1. //
  2. // Auto-generated from generator.cs, do not edit
  3. //
  4. // We keep references to objects, so warning 414 is expected
  5.  
  6. #pragma warning disable 414
  7.  
  8. using System;
  9. using System.Drawing;
  10. using System.Runtime.CompilerServices;
  11. using System.Runtime.InteropServices;
  12. using System.Diagnostics;
  13. using System.ComponentModel;
  14. using MonoMac.CoreFoundation;
  15. using MonoMac.Foundation;
  16. using MonoMac.ObjCRuntime;
  17. using MonoMac.CoreGraphics;
  18. using MonoMac.CoreAnimation;
  19. using MonoMac.CoreLocation;
  20. using MonoMac.QTKit;
  21. using MonoMac.CoreVideo;
  22. using MonoMac.CoreMedia;
  23. using MonoMac.OpenGL;
  24.  
  25. namespace MonoMac.Foundation {
  26. [Register("NSUserNotificationCenter", true)]
  27. public unsafe partial class NSUserNotificationCenter : NSObject {
  28. [CompilerGenerated]
  29. static readonly IntPtr selDefaultUserNotificationCenter = Selector.GetHandle ("defaultUserNotificationCenter");
  30. [CompilerGenerated]
  31. static readonly IntPtr selDelegate = Selector.GetHandle ("delegate");
  32. [CompilerGenerated]
  33. static readonly IntPtr selSetDelegate_ = Selector.GetHandle ("setDelegate:");
  34. [CompilerGenerated]
  35. static readonly IntPtr selScheduledNotifications = Selector.GetHandle ("scheduledNotifications");
  36. [CompilerGenerated]
  37. static readonly IntPtr selSetScheduledNotifications_ = Selector.GetHandle ("setScheduledNotifications:");
  38. [CompilerGenerated]
  39. static readonly IntPtr selDeliveredNotifications = Selector.GetHandle ("deliveredNotifications");
  40. [CompilerGenerated]
  41. static readonly IntPtr selScheduleNotification_ = Selector.GetHandle ("scheduleNotification:");
  42. [CompilerGenerated]
  43. static readonly IntPtr selRemoveScheduledNotification_ = Selector.GetHandle ("removeScheduledNotification:");
  44. [CompilerGenerated]
  45. static readonly IntPtr selDeliverNotification_ = Selector.GetHandle ("deliverNotification:");
  46. [CompilerGenerated]
  47. static readonly IntPtr selRemoveDeliveredNotification_ = Selector.GetHandle ("removeDeliveredNotification:");
  48. [CompilerGenerated]
  49. static readonly IntPtr selRemoveAllDeliveredNotifications = Selector.GetHandle ("removeAllDeliveredNotifications");
  50.  
  51. [CompilerGenerated]
  52. static readonly IntPtr class_ptr = Class.GetHandle ("NSUserNotificationCenter");
  53.  
  54. public override IntPtr ClassHandle { get { return class_ptr; } }
  55.  
  56. [EditorBrowsable (EditorBrowsableState.Advanced)]
  57.  
  58. [Export ("init")]
  59. public NSUserNotificationCenter () : base (NSObjectFlag.Empty)
  60. {
  61. if (IsDirectBinding) {
  62. Handle = MonoMac.ObjCRuntime.Messaging.IntPtr_objc_msgSend (this.Handle, Selector.Init);
  63. } else {
  64. Handle = MonoMac.ObjCRuntime.Messaging.IntPtr_objc_msgSendSuper (this.SuperHandle, Selector.Init);
  65. }
  66. }
  67.  
  68. [EditorBrowsable (EditorBrowsableState.Advanced)]
  69.  
  70. [Export ("initWithCoder:")]
  71. public NSUserNotificationCenter (NSCoder coder) : base (NSObjectFlag.Empty)
  72. {
  73. if (IsDirectBinding) {
  74. Handle = MonoMac.ObjCRuntime.Messaging.IntPtr_objc_msgSend_IntPtr (this.Handle, Selector.InitWithCoder, coder.Handle);
  75. } else {
  76. Handle = MonoMac.ObjCRuntime.Messaging.IntPtr_objc_msgSendSuper_IntPtr (this.SuperHandle, Selector.InitWithCoder, coder.Handle);
  77. }
  78. }
  79.  
  80. [EditorBrowsable (EditorBrowsableState.Advanced)]
  81.  
  82. public NSUserNotificationCenter (NSObjectFlag t) : base (t) {}
  83.  
  84. [EditorBrowsable (EditorBrowsableState.Advanced)]
  85.  
  86. public NSUserNotificationCenter (IntPtr handle) : base (handle) {}
  87.  
  88. [Export ("scheduleNotification:")]
  89. public virtual void ScheduleNotification (NSUserNotification notification)
  90. {
  91. if (notification == null)
  92. throw new ArgumentNullException ("notification");
  93. if (IsDirectBinding) {
  94. MonoMac.ObjCRuntime.Messaging.void_objc_msgSend_IntPtr (this.Handle, selScheduleNotification_, notification.Handle);
  95. } else {
  96. MonoMac.ObjCRuntime.Messaging.void_objc_msgSendSuper_IntPtr (this.SuperHandle, selScheduleNotification_, notification.Handle);
  97. }
  98. #pragma warning disable 168
  99. var postget0 = ScheduledNotifications;
  100. #pragma warning restore 168
  101. }
  102.  
  103. [Export ("removeScheduledNotification:")]
  104. public virtual void RemoveScheduledNotification (NSUserNotification notification)
  105. {
  106. if (notification == null)
  107. throw new ArgumentNullException ("notification");
  108. if (IsDirectBinding) {
  109. MonoMac.ObjCRuntime.Messaging.void_objc_msgSend_IntPtr (this.Handle, selRemoveScheduledNotification_, notification.Handle);
  110. } else {
  111. MonoMac.ObjCRuntime.Messaging.void_objc_msgSendSuper_IntPtr (this.SuperHandle, selRemoveScheduledNotification_, notification.Handle);
  112. }
  113. #pragma warning disable 168
  114. var postget0 = ScheduledNotifications;
  115. #pragma warning restore 168
  116. }
  117.  
  118. [Export ("deliverNotification:")]
  119. public virtual void DeliverNotification (NSUserNotification notification)
  120. {
  121. if (notification == null)
  122. throw new ArgumentNullException ("notification");
  123. if (IsDirectBinding) {
  124. MonoMac.ObjCRuntime.Messaging.void_objc_msgSend_IntPtr (this.Handle, selDeliverNotification_, notification.Handle);
  125. } else {
  126. MonoMac.ObjCRuntime.Messaging.void_objc_msgSendSuper_IntPtr (this.SuperHandle, selDeliverNotification_, notification.Handle);
  127. }
  128. #pragma warning disable 168
  129. var postget0 = DeliveredNotifications;
  130. #pragma warning restore 168
  131. }
  132.  
  133. [Export ("removeDeliveredNotification:")]
  134. public virtual void RemoveDeliveredNotification (NSUserNotification notification)
  135. {
  136. if (notification == null)
  137. throw new ArgumentNullException ("notification");
  138. if (IsDirectBinding) {
  139. MonoMac.ObjCRuntime.Messaging.void_objc_msgSend_IntPtr (this.Handle, selRemoveDeliveredNotification_, notification.Handle);
  140. } else {
  141. MonoMac.ObjCRuntime.Messaging.void_objc_msgSendSuper_IntPtr (this.SuperHandle, selRemoveDeliveredNotification_, notification.Handle);
  142. }
  143. #pragma warning disable 168
  144. var postget0 = DeliveredNotifications;
  145. #pragma warning restore 168
  146. }
  147.  
  148. [Export ("removeAllDeliveredNotifications")]
  149. public virtual void RemoveAllDeliveredNotifications ()
  150. {
  151. if (IsDirectBinding) {
  152. MonoMac.ObjCRuntime.Messaging.void_objc_msgSend (this.Handle, selRemoveAllDeliveredNotifications);
  153. } else {
  154. MonoMac.ObjCRuntime.Messaging.void_objc_msgSendSuper (this.SuperHandle, selRemoveAllDeliveredNotifications);
  155. }
  156. #pragma warning disable 168
  157. var postget0 = DeliveredNotifications;
  158. #pragma warning restore 168
  159. }
  160.  
  161. [CompilerGenerated]
  162. static object __mt_DefaultUserNotificationCenter_var_static;
  163. public static NSUserNotificationCenter DefaultUserNotificationCenter {
  164. [Export ("defaultUserNotificationCenter")]
  165. get {
  166. NSUserNotificationCenter ret;
  167. ret = (NSUserNotificationCenter) Runtime.GetNSObject (MonoMac.ObjCRuntime.Messaging.IntPtr_objc_msgSend (class_ptr, selDefaultUserNotificationCenter));
  168. __mt_DefaultUserNotificationCenter_var_static = ret;
  169. return ret;
  170. }
  171.  
  172. }
  173.  
  174. [CompilerGenerated]
  175. object __mt_WeakDelegate_var;
  176. public virtual NSObject WeakDelegate {
  177. [Export ("delegate")]
  178. get {
  179. NSObject ret;
  180. if (IsDirectBinding) {
  181. ret = (NSObject) Runtime.GetNSObject (MonoMac.ObjCRuntime.Messaging.IntPtr_objc_msgSend (this.Handle, selDelegate));
  182. } else {
  183. ret = (NSObject) Runtime.GetNSObject (MonoMac.ObjCRuntime.Messaging.IntPtr_objc_msgSendSuper (this.SuperHandle, selDelegate));
  184. }
  185. __mt_WeakDelegate_var = ret;
  186. return ret;
  187. }
  188.  
  189. [Export ("setDelegate:")]
  190. set {
  191. if (IsDirectBinding) {
  192. MonoMac.ObjCRuntime.Messaging.void_objc_msgSend_IntPtr (this.Handle, selSetDelegate_, value == null ? IntPtr.Zero : value.Handle);
  193. } else {
  194. MonoMac.ObjCRuntime.Messaging.void_objc_msgSendSuper_IntPtr (this.SuperHandle, selSetDelegate_, value == null ? IntPtr.Zero : value.Handle);
  195. }
  196. __mt_WeakDelegate_var = value;
  197. }
  198. }
  199.  
  200. public NSUserNotificationCenterDelegate Delegate {
  201. get {
  202. return WeakDelegate as NSUserNotificationCenterDelegate;
  203. }
  204. set {
  205. WeakDelegate = value;
  206. }
  207. }
  208.  
  209. [CompilerGenerated]
  210. object __mt_ScheduledNotifications_var;
  211. public virtual NSUserNotification[] ScheduledNotifications {
  212. [Export ("scheduledNotifications")]
  213. get {
  214. NSUserNotification[] ret;
  215. if (IsDirectBinding) {
  216. ret = NSArray.ArrayFromHandle<MonoMac.Foundation.NSUserNotification>(MonoMac.ObjCRuntime.Messaging.IntPtr_objc_msgSend (this.Handle, selScheduledNotifications));
  217. } else {
  218. ret = NSArray.ArrayFromHandle<MonoMac.Foundation.NSUserNotification>(MonoMac.ObjCRuntime.Messaging.IntPtr_objc_msgSendSuper (this.SuperHandle, selScheduledNotifications));
  219. }
  220. __mt_ScheduledNotifications_var = ret;
  221. return ret;
  222. }
  223.  
  224. [Export ("setScheduledNotifications:")]
  225. set {
  226. if (value == null)
  227. throw new ArgumentNullException ("value");
  228. var nsa_value = NSArray.FromNSObjects (value);
  229.  
  230. if (IsDirectBinding) {
  231. MonoMac.ObjCRuntime.Messaging.void_objc_msgSend_IntPtr (this.Handle, selSetScheduledNotifications_, nsa_value.Handle);
  232. } else {
  233. MonoMac.ObjCRuntime.Messaging.void_objc_msgSendSuper_IntPtr (this.SuperHandle, selSetScheduledNotifications_, nsa_value.Handle);
  234. }
  235. nsa_value.Dispose ();
  236.  
  237. __mt_ScheduledNotifications_var = value;
  238. }
  239. }
  240.  
  241. [CompilerGenerated]
  242. object __mt_DeliveredNotifications_var;
  243. public virtual NSUserNotification[] DeliveredNotifications {
  244. [Export ("deliveredNotifications")]
  245. get {
  246. NSUserNotification[] ret;
  247. if (IsDirectBinding) {
  248. ret = NSArray.ArrayFromHandle<MonoMac.Foundation.NSUserNotification>(MonoMac.ObjCRuntime.Messaging.IntPtr_objc_msgSend (this.Handle, selDeliveredNotifications));
  249. } else {
  250. ret = NSArray.ArrayFromHandle<MonoMac.Foundation.NSUserNotification>(MonoMac.ObjCRuntime.Messaging.IntPtr_objc_msgSendSuper (this.SuperHandle, selDeliveredNotifications));
  251. }
  252. __mt_DeliveredNotifications_var = ret;
  253. return ret;
  254. }
  255.  
  256. }
  257.  
  258. //
  259. // Events and properties from the delegate
  260. //
  261.  
  262. _NSUserNotificationCenterDelegate EnsureNSUserNotificationCenterDelegate ()
  263. {
  264. var del = WeakDelegate;
  265. if (del == null || (!(del is _NSUserNotificationCenterDelegate))){
  266. del = new _NSUserNotificationCenterDelegate ();
  267. WeakDelegate = del;
  268. }
  269. return (_NSUserNotificationCenterDelegate) del;
  270. }
  271.  
  272. #pragma warning disable 672
  273. [Register]
  274. sealed class _NSUserNotificationCenterDelegate : NSUserNotificationCenterDelegate {
  275. public _NSUserNotificationCenterDelegate () {}
  276.  
  277. internal EventHandler<UNCDidDeliverNotificationEventArgs> didDeliverNotification;
  278. [Preserve (Conditional = true)]
  279. public override void DidDeliverNotification (NSUserNotificationCenter center, NSUserNotification notification)
  280. {
  281. EventHandler<UNCDidDeliverNotificationEventArgs> handler = didDeliverNotification;
  282. if (handler != null){
  283. var args = new UNCDidDeliverNotificationEventArgs (notification);
  284. handler (center, args);
  285. }
  286. }
  287.  
  288. internal EventHandler<UNCDidActivateNotificationEventArgs> didActivateNotification;
  289. [Preserve (Conditional = true)]
  290. public override void DidActivateNotification (NSUserNotificationCenter center, NSUserNotification notification)
  291. {
  292. EventHandler<UNCDidActivateNotificationEventArgs> handler = didActivateNotification;
  293. if (handler != null){
  294. var args = new UNCDidActivateNotificationEventArgs (notification);
  295. handler (center, args);
  296. }
  297. }
  298.  
  299. internal UNCShouldPresentNotification shouldPresentNotification;
  300. [Preserve (Conditional = true)]
  301. public override bool ShouldPresentNotification (NSUserNotificationCenter center, NSUserNotification notification)
  302. {
  303. UNCShouldPresentNotification handler = shouldPresentNotification;
  304. if (handler != null)
  305. return handler (center, notification);
  306. return false;
  307. }
  308.  
  309. }
  310. #pragma warning restore 672
  311.  
  312. public event EventHandler<UNCDidDeliverNotificationEventArgs> DidDeliverNotification {
  313. add { EnsureNSUserNotificationCenterDelegate ().didDeliverNotification += value; }
  314. remove { EnsureNSUserNotificationCenterDelegate ().didDeliverNotification -= value; }
  315. }
  316.  
  317. public event EventHandler<UNCDidActivateNotificationEventArgs> DidActivateNotification {
  318. add { EnsureNSUserNotificationCenterDelegate ().didActivateNotification += value; }
  319. remove { EnsureNSUserNotificationCenterDelegate ().didActivateNotification -= value; }
  320. }
  321.  
  322. public UNCShouldPresentNotification ShouldPresentNotification {
  323. get { return EnsureNSUserNotificationCenterDelegate ().shouldPresentNotification; }
  324. set { EnsureNSUserNotificationCenterDelegate ().shouldPresentNotification = value; }
  325. }
  326.  
  327. protected override void Dispose (bool disposing)
  328. {
  329. __mt_WeakDelegate_var = null;
  330. __mt_ScheduledNotifications_var = null;
  331. __mt_DeliveredNotifications_var = null;
  332. base.Dispose (disposing);
  333. }
  334. } /* class NSUserNotificationCenter */
  335.  
  336.  
  337. //
  338. // EventArgs classes
  339. //
  340. public partial class UNCDidDeliverNotificationEventArgs : EventArgs {
  341. public UNCDidDeliverNotificationEventArgs (NSUserNotification notification)
  342. {
  343. this.Notification = notification;
  344. }
  345. public NSUserNotification Notification { get; set; }
  346. }
  347.  
  348. public partial class UNCDidActivateNotificationEventArgs : EventArgs {
  349. public UNCDidActivateNotificationEventArgs (NSUserNotification notification)
  350. {
  351. this.Notification = notification;
  352. }
  353. public NSUserNotification Notification { get; set; }
  354. }
  355.  
  356. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement