PageRenderTime 86ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 1ms

/src/foundation.cs

https://github.com/kjpou1/maccore
C# | 6779 lines | 4627 code | 1959 blank | 193 comment | 1 complexity | fd86bd4a55207ac9882d09cd1d103e34 MD5 | raw file
Possible License(s): Apache-2.0
  1. //
  2. // This file describes the API that the generator will produce
  3. //
  4. // Authors:
  5. // Geoff Norton
  6. // Miguel de Icaza
  7. // Aaron Bockover
  8. //
  9. // Copyright 2009, Novell, Inc.
  10. // Copyright 2010, Novell, Inc.
  11. // Copyright 2011-2013 Xamarin Inc.
  12. //
  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.
  31. //
  32. //
  33. using MonoMac.ObjCRuntime;
  34. using MonoMac.CoreFoundation;
  35. using MonoMac.Foundation;
  36. using MonoMac.CoreGraphics;
  37. using MonoMac.CoreMedia;
  38. #if MONOMAC
  39. using MonoMac.AppKit;
  40. #else
  41. using MonoMac.CoreLocation;
  42. using MonoMac.UIKit;
  43. #endif
  44. using System;
  45. using System.Drawing;
  46. using System.ComponentModel;
  47. namespace MonoMac.Foundation
  48. {
  49. public delegate int NSComparator (NSObject obj1, NSObject obj2);
  50. public delegate void NSAttributedRangeCallback (NSDictionary attrs, NSRange range, ref bool stop);
  51. public delegate void NSAttributedStringCallback (NSObject value, NSRange range, ref bool stop);
  52. public delegate bool NSEnumerateErrorHandler (NSUrl url, NSError error);
  53. [BaseType (typeof (NSObject))]
  54. public interface NSArray {
  55. [Export ("count")]
  56. uint Count { get; }
  57. [Export ("objectAtIndex:")]
  58. IntPtr ValueAt (uint idx);
  59. [Export ("arrayWithObjects:count:")][Static][Internal]
  60. NSArray FromObjects (IntPtr array, int count);
  61. [Export ("valueForKey:")]
  62. [MarshalNativeExceptions]
  63. NSObject ValueForKey (NSString key);
  64. [Export ("setValue:forKey:")]
  65. void SetValueForKey (NSObject value, NSString key);
  66. [Export ("writeToFile:atomically:")]
  67. bool WriteToFile (string path, bool useAuxiliaryFile);
  68. [Export ("arrayWithContentsOfFile:")][Static]
  69. NSArray FromFile (string path);
  70. [Export ("sortedArrayUsingComparator:")]
  71. NSArray Sort (NSComparator cmptr);
  72. [Export ("filteredArrayUsingPredicate:")]
  73. NSArray Filter (NSPredicate predicate);
  74. }
  75. [Since (3,2)]
  76. [BaseType (typeof (NSObject))]
  77. public partial interface NSAttributedString {
  78. [Export ("string")]
  79. string Value { get; }
  80. [Export ("attributesAtIndex:effectiveRange:")]
  81. NSDictionary GetAttributes (int location, out NSRange effectiveRange);
  82. [Export ("length")]
  83. int Length { get; }
  84. // TODO: figure out the type, this deserves to be strongly typed if possble
  85. [Export ("attribute:atIndex:effectiveRange:")]
  86. NSObject GetAttribute (string attribute, int location, out NSRange effectiveRange);
  87. [Export ("attributedSubstringFromRange:"), Internal]
  88. NSAttributedString Substring (NSRange range);
  89. [Export ("attributesAtIndex:longestEffectiveRange:inRange:")]
  90. NSDictionary GetAttributes (int location, out NSRange longestEffectiveRange, NSRange rangeLimit);
  91. [Export ("attribute:atIndex:longestEffectiveRange:inRange:")]
  92. NSObject GetAttribute (string attribute, int location, out NSRange longestEffectiveRange, NSRange rangeLimit);
  93. [Export ("isEqualToAttributedString:")]
  94. bool IsEqual (NSAttributedString other);
  95. [Export ("initWithString:")]
  96. IntPtr Constructor (string str);
  97. [Export ("initWithString:attributes:")]
  98. [EditorBrowsable (EditorBrowsableState.Advanced)]
  99. IntPtr Constructor (string str, NSDictionary attributes);
  100. [Export ("initWithAttributedString:")]
  101. IntPtr Constructor (NSAttributedString other);
  102. [Export ("enumerateAttributesInRange:options:usingBlock:")]
  103. void EnumerateAttributes (NSRange range, NSAttributedStringEnumeration options, NSAttributedRangeCallback callback);
  104. [Export ("enumerateAttribute:inRange:options:usingBlock:")]
  105. void EnumerateAttribute (NSString attributeName, NSRange inRange, NSAttributedStringEnumeration options, NSAttributedStringCallback callback);
  106. #if MONOMAC
  107. [Export("size")]
  108. SizeF Size { get; }
  109. [Field ("NSFontAttributeName", "AppKit")]
  110. NSString FontAttributeName { get; }
  111. [Field ("NSLinkAttributeName", "AppKit")]
  112. NSString LinkAttributeName { get; }
  113. [Field ("NSUnderlineStyleAttributeName", "AppKit")]
  114. NSString UnderlineStyleAttributeName { get; }
  115. [Field ("NSStrikethroughStyleAttributeName", "AppKit")]
  116. NSString StrikethroughStyleAttributeName { get; }
  117. [Field ("NSStrokeWidthAttributeName", "AppKit")]
  118. NSString StrokeWidthAttributeName { get; }
  119. [Field ("NSParagraphStyleAttributeName", "AppKit")]
  120. NSString ParagraphStyleAttributeName { get; }
  121. [Field ("NSForegroundColorAttributeName", "AppKit")]
  122. NSString ForegroundColorAttributeName { get; }
  123. [Field ("NSBackgroundColorAttributeName", "AppKit")]
  124. NSString BackgroundColorAttributeName { get; }
  125. [Field ("NSLigatureAttributeName", "AppKit")]
  126. NSString LigatureAttributeName { get; }
  127. [Field ("NSObliquenessAttributeName", "AppKit")]
  128. NSString ObliquenessAttributeName { get; }
  129. [Field ("NSSuperscriptAttributeName", "AppKit")]
  130. NSString SuperscriptAttributeName { get; }
  131. [Field ("NSAttachmentAttributeName", "AppKit")]
  132. NSString AttachmentAttributeName { get; }
  133. [Field ("NSBaselineOffsetAttributeName", "AppKit")]
  134. NSString BaselineOffsetAttributeName { get; }
  135. [Field ("NSKernAttributeName", "AppKit")]
  136. NSString KernAttributeName { get; }
  137. [Field ("NSStrokeColorAttributeName", "AppKit")]
  138. NSString StrokeColorAttributeName { get; }
  139. [Field ("NSUnderlineColorAttributeName", "AppKit")]
  140. NSString UnderlineColorAttributeName { get; }
  141. [Field ("NSStrikethroughColorAttributeName", "AppKit")]
  142. NSString StrikethroughColorAttributeName { get; }
  143. [Field ("NSShadowAttributeName", "AppKit")]
  144. NSString ShadowAttributeName { get; }
  145. [Field ("NSExpansionAttributeName", "AppKit")]
  146. NSString ExpansionAttributeName { get; }
  147. [Field ("NSCursorAttributeName", "AppKit")]
  148. NSString CursorAttributeName { get; }
  149. [Field ("NSToolTipAttributeName", "AppKit")]
  150. NSString ToolTipAttributeName { get; }
  151. [Field ("NSMarkedClauseSegmentAttributeName", "AppKit")]
  152. NSString MarkedClauseSegmentAttributeName { get; }
  153. [Field ("NSWritingDirectionAttributeName", "AppKit")]
  154. NSString WritingDirectionAttributeName { get; }
  155. [Field ("NSVerticalGlyphFormAttributeName", "AppKit")]
  156. NSString VerticalGlyphFormAttributeName { get; }
  157. [Export ("initWithData:options:documentAttributes:error:")]
  158. IntPtr Constructor (NSData data, NSDictionary options, out NSDictionary docAttributes, out NSError error);
  159. [Export ("initWithDocFormat:documentAttributes:")]
  160. IntPtr Constructor(NSData wordDocFormat, out NSDictionary docAttributes);
  161. [Export ("initWithHTML:baseURL:documentAttributes:")]
  162. IntPtr Constructor (NSData htmlData, NSUrl baseUrl, out NSDictionary docAttributes);
  163. [Export ("drawAtPoint:")]
  164. void DrawString (PointF point);
  165. [Export ("drawInRect:")]
  166. void DrawString (RectangleF rect);
  167. [Export ("drawWithRect:options:")]
  168. void DrawString (RectangleF rect, NSStringDrawingOptions options);
  169. #else
  170. [Since (6,0)]
  171. [Export ("size")]
  172. SizeF Size { get; }
  173. [Since (6,0)]
  174. [Export ("drawAtPoint:")]
  175. void DrawString (PointF point);
  176. [Since (6,0)]
  177. [Export ("drawInRect:")]
  178. void DrawString (RectangleF rect);
  179. [Since (6,0)]
  180. [Export ("drawWithRect:options:context:")]
  181. void DrawString (RectangleF rect, NSStringDrawingOptions options, [NullAllowed] NSStringDrawingContext context);
  182. [Since (6,0)]
  183. [Export ("boundingRectWithSize:options:context:")]
  184. RectangleF GetBoundingRect (SizeF size, NSStringDrawingOptions options, [NullAllowed] NSStringDrawingContext context);
  185. #endif
  186. }
  187. [BaseType (typeof (NSObject),
  188. Delegates=new string [] { "WeakDelegate" },
  189. Events=new Type [] { typeof (NSCacheDelegate)} )]
  190. [Since (4,0)]
  191. public interface NSCache {
  192. [Export ("objectForKey:")]
  193. NSObject ObjectForKey (NSObject key);
  194. [Export ("setObject:forKey:")]
  195. void SetObjectforKey (NSObject obj, NSObject key);
  196. [Export ("setObject:forKey:cost:")]
  197. void SetCost (NSObject obj, NSObject key, uint cost);
  198. [Export ("removeObjectForKey:")]
  199. void RemoveObjectForKey (NSObject key);
  200. [Export ("removeAllObjects")]
  201. void RemoveAllObjects ();
  202. //Detected properties
  203. [Export ("name")]
  204. string Name { get; set; }
  205. [Export ("delegate")]
  206. NSObject WeakDelegate { get; set; }
  207. [Wrap ("WeakDelegate")]
  208. NSCacheDelegate Delegate { get; set; }
  209. [Export ("totalCostLimit")]
  210. uint TotalCostLimit { get; set; }
  211. [Export ("countLimit")]
  212. uint CountLimit { get; set; }
  213. [Export ("evictsObjectsWithDiscardedContent")]
  214. bool EvictsObjectsWithDiscardedContent { get; set; }
  215. }
  216. [BaseType (typeof (NSObject))]
  217. [Model]
  218. [Protocol]
  219. public interface NSCacheDelegate {
  220. [Export ("cache:willEvictObject:"), EventArgs ("NSObject")]
  221. void WillEvictObject (NSCache cache, NSObject obj);
  222. }
  223. [BaseType (typeof (NSObject), Name="NSCachedURLResponse")]
  224. // instance created with 'init' will crash when Dispose is called
  225. [DisableDefaultCtor]
  226. public interface NSCachedUrlResponse {
  227. [Export ("initWithResponse:data:userInfo:storagePolicy:")]
  228. IntPtr Constructor (NSUrlResponse response, NSData data, [NullAllowed] NSDictionary userInfo, NSUrlCacheStoragePolicy storagePolicy);
  229. [Export ("initWithResponse:data:")]
  230. IntPtr Constructor (NSUrlResponse response, NSData data);
  231. [Export ("response")]
  232. NSUrlResponse Response { get; }
  233. [Export ("data")]
  234. NSData Data { get; }
  235. [Export ("userInfo")]
  236. NSDictionary UserInfo { get; }
  237. [Export ("storagePolicy")]
  238. NSUrlCacheStoragePolicy StoragePolicy { get; }
  239. }
  240. [BaseType (typeof (NSObject))]
  241. // 'init' returns NIL
  242. [DisableDefaultCtor]
  243. public interface NSCalendar {
  244. [Export ("initWithCalendarIdentifier:")]
  245. IntPtr Constructor (NSString identifier);
  246. [Export ("calendarIdentifier")]
  247. string Identifier { get; }
  248. [Export ("currentCalendar")] [Static]
  249. NSCalendar CurrentCalendar { get; }
  250. [Export ("locale")]
  251. NSLocale Locale { get; set; }
  252. [Export ("timeZone")]
  253. NSTimeZone TimeZone { get; set; }
  254. [Export ("firstWeekday")]
  255. uint FirstWeekDay { get; set; }
  256. [Export ("minimumDaysInFirstWeek")]
  257. uint MinimumDaysInFirstWeek { get; set; }
  258. //- (NSRange)minimumRangeOfUnit:(NSCalendarUnit)unit;
  259. //- (NSRange)maximumRangeOfUnit:(NSCalendarUnit)unit;
  260. //- (NSRange)rangeOfUnit:(NSCalendarUnit)smaller inUnit:(NSCalendarUnit)larger forDate:(NSDate *)date;
  261. //- (NSUInteger)ordinalityOfUnit:(NSCalendarUnit)smaller inUnit:(NSCalendarUnit)larger forDate:(NSDate *)date;
  262. //- (BOOL)rangeOfUnit:(NSCalendarUnit)unit startDate:(NSDate **)datep interval:(NSTimeInterval *)tip forDate:(NSDate *)date AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
  263. [Export ("components:fromDate:")]
  264. NSDateComponents Components (NSCalendarUnit unitFlags, NSDate fromDate);
  265. [Export ("components:fromDate:toDate:options:")]
  266. NSDateComponents Components (NSCalendarUnit unitFlags, NSDate fromDate, NSDate toDate, NSDateComponentsWrappingBehavior opts);
  267. [Export ("dateByAddingComponents:toDate:options:")]
  268. NSDate DateByAddingComponents (NSDateComponents comps, NSDate date, NSDateComponentsWrappingBehavior opts);
  269. [Export ("dateFromComponents:")]
  270. NSDate DateFromComponents (NSDateComponents comps);
  271. [Field ("NSGregorianCalendar"), Internal]
  272. NSString NSGregorianCalendar { get; }
  273. [Field ("NSBuddhistCalendar"), Internal]
  274. NSString NSBuddhistCalendar { get; }
  275. [Field ("NSChineseCalendar"), Internal]
  276. NSString NSChineseCalendar { get; }
  277. [Field ("NSHebrewCalendar"), Internal]
  278. NSString NSHebrewCalendar { get; }
  279. [Field ("NSIslamicCalendar"), Internal]
  280. NSString NSIslamicCalendar { get; }
  281. [Field ("NSIslamicCivilCalendar"), Internal]
  282. NSString NSIslamicCivilCalendar { get; }
  283. [Field ("NSJapaneseCalendar"), Internal]
  284. NSString NSJapaneseCalendar { get; }
  285. [Field ("NSRepublicOfChinaCalendar"), Internal]
  286. NSString NSRepublicOfChinaCalendar { get; }
  287. [Field ("NSPersianCalendar"), Internal]
  288. NSString NSPersianCalendar { get; }
  289. [Field ("NSIndianCalendar"), Internal]
  290. NSString NSIndianCalendar { get; }
  291. [Field ("NSISO8601Calendar"), Internal]
  292. NSString NSISO8601Calendar { get; }
  293. }
  294. [Since (3,2)]
  295. [BaseType (typeof (NSObject))]
  296. public interface NSCharacterSet {
  297. [Static, Export ("alphanumericCharacterSet")]
  298. NSCharacterSet Alphanumerics {get;}
  299. [Static, Export ("capitalizedLetterCharacterSet")]
  300. NSCharacterSet Capitalized {get;}
  301. // TODO/FIXME: constructor?
  302. [Static, Export ("characterSetWithBitmapRepresentation:")]
  303. NSCharacterSet FromBitmap (NSData data);
  304. // TODO/FIXME: constructor?
  305. [Static, Export ("characterSetWithCharactersInString:")]
  306. NSCharacterSet FromString (string aString);
  307. [Static, Export ("characterSetWithContentsOfFile:")]
  308. NSCharacterSet FromFile (string path);
  309. [Static, Export ("characterSetWithRange:")]
  310. NSCharacterSet FromRange (NSRange aRange);
  311. [Static, Export ("controlCharacterSet")]
  312. NSCharacterSet Controls {get;}
  313. [Static, Export ("decimalDigitCharacterSet")]
  314. NSCharacterSet DecimalDigits {get;}
  315. [Static, Export ("decomposableCharacterSet")]
  316. NSCharacterSet Decomposables {get;}
  317. [Static, Export ("illegalCharacterSet")]
  318. NSCharacterSet Illegals {get;}
  319. [Static, Export ("letterCharacterSet")]
  320. NSCharacterSet Letters {get;}
  321. [Static, Export ("lowercaseLetterCharacterSet")]
  322. NSCharacterSet LowercaseLetters {get;}
  323. [Static, Export ("newlineCharacterSet")]
  324. NSCharacterSet Newlines {get;}
  325. [Static, Export ("nonBaseCharacterSet")]
  326. NSCharacterSet Marks {get;}
  327. [Static, Export ("punctuationCharacterSet")]
  328. NSCharacterSet Punctuation {get;}
  329. [Static, Export ("symbolCharacterSet")]
  330. NSCharacterSet Symbols {get;}
  331. [Static, Export ("uppercaseLetterCharacterSet")]
  332. NSCharacterSet UppercaseLetters {get;}
  333. [Static, Export ("whitespaceAndNewlineCharacterSet")]
  334. NSCharacterSet WhitespaceAndNewlines {get;}
  335. [Static, Export ("whitespaceCharacterSet")]
  336. NSCharacterSet Whitespaces {get;}
  337. [Export ("bitmapRepresentation")]
  338. NSData GetBitmapRepresentation ();
  339. [Export ("characterIsMember:")]
  340. bool Contains (char aCharacter);
  341. [Export ("hasMemberInPlane:")]
  342. bool HasMemberInPlane (byte thePlane);
  343. [Export ("invertedSet")]
  344. NSCharacterSet InvertedSet {get;}
  345. [Export ("isSupersetOfSet:")]
  346. bool IsSupersetOf (NSCharacterSet theOtherSet);
  347. [Export ("longCharacterIsMember:")]
  348. bool Contains (uint theLongChar);
  349. }
  350. [BaseType (typeof (NSObject))]
  351. public interface NSCoder {
  352. //
  353. // Encoding and decoding
  354. //
  355. [Export ("encodeObject:")]
  356. void Encode (NSObject obj);
  357. [Export ("encodeRootObject:")]
  358. void EncodeRoot (NSObject obj);
  359. [Export ("decodeObject")]
  360. NSObject DecodeObject ();
  361. //
  362. // Encoding and decoding with keys
  363. //
  364. [Export ("encodeConditionalObject:forKey:")]
  365. void EncodeConditionalObject (NSObject val, string key);
  366. [Export ("encodeObject:forKey:")]
  367. void Encode (NSObject val, string key);
  368. [Export ("encodeBool:forKey:")]
  369. void Encode (bool val, string key);
  370. [Export ("encodeDouble:forKey:")]
  371. void Encode (double val, string key);
  372. [Export ("encodeFloat:forKey:")]
  373. void Encode (float val, string key);
  374. [Export ("encodeInt32:forKey:")]
  375. void Encode (int val, string key);
  376. [Export ("encodeInt64:forKey:")]
  377. void Encode (long val, string key);
  378. [Export ("encodeBytes:length:forKey:")]
  379. void EncodeBlock (IntPtr bytes, int length, string key);
  380. [Export ("containsValueForKey:")]
  381. bool ContainsKey (string key);
  382. [Export ("decodeBoolForKey:")]
  383. bool DecodeBool (string key);
  384. [Export ("decodeDoubleForKey:")]
  385. double DecodeDouble (string key);
  386. [Export ("decodeFloatForKey:")]
  387. float DecodeFloat (string key);
  388. [Export ("decodeInt32ForKey:")]
  389. int DecodeInt (string key);
  390. [Export ("decodeInt64ForKey:")]
  391. long DecodeLong (string key);
  392. [Export ("decodeObjectForKey:")]
  393. NSObject DecodeObject (string key);
  394. [Internal, Export ("decodeBytesForKey:returnedLength:")]
  395. IntPtr DecodeBytes (string key, IntPtr length_ptr);
  396. [Since (6,0)]
  397. [Export ("allowedClasses")]
  398. NSSet AllowedClasses { get; }
  399. [Since (6,0)]
  400. [Export ("requiresSecureCoding")]
  401. bool RequiresSecureCoding ();
  402. }
  403. [BaseType (typeof (NSPredicate))]
  404. public interface NSComparisonPredicate {
  405. [Static, Export ("predicateWithLeftExpression:rightExpression:modifier:type:options:")]
  406. NSPredicate Create (NSExpression leftExpression, NSExpression rightExpression, NSComparisonPredicateModifier comparisonModifier, NSPredicateOperatorType operatorType, NSComparisonPredicateOptions comparisonOptions);
  407. [Static, Export ("predicateWithLeftExpression:rightExpression:customSelector:")]
  408. NSPredicate FromSelector (NSExpression leftExpression, NSExpression rightExpression, Selector selector);
  409. [Export ("initWithLeftExpression:rightExpression:modifier:type:options:")]
  410. IntPtr Constructor (NSExpression leftExpression, NSExpression rightExpression, NSComparisonPredicateModifier comparisonModifier, NSPredicateOperatorType operatorType, NSComparisonPredicateOptions comparisonOptions);
  411. [Export ("initWithLeftExpression:rightExpression:customSelector:")]
  412. IntPtr Constructor (NSExpression leftExpression, NSExpression rightExpression, Selector selector);
  413. [Export ("predicateOperatorType")]
  414. NSPredicateOperatorType PredicateOperatorType { get; }
  415. [Export ("comparisonPredicateModifier")]
  416. NSComparisonPredicateModifier ComparisonPredicateModifier { get; }
  417. [Export ("leftExpression")]
  418. NSExpression LeftExpression { get; }
  419. [Export ("rightExpression")]
  420. NSExpression RightExpression { get; }
  421. [Export ("customSelector")]
  422. Selector CustomSelector { get; }
  423. [Export ("options")]
  424. NSComparisonPredicateOptions Options { get; }
  425. }
  426. [BaseType (typeof (NSPredicate))]
  427. [DisableDefaultCtor] // An uncaught exception was raised: Can't have a NOT predicate with no subpredicate.
  428. public interface NSCompoundPredicate {
  429. [Export ("initWithType:subpredicates:")]
  430. IntPtr Constructor (NSCompoundPredicateType type, NSPredicate[] subpredicates);
  431. [Export ("compoundPredicateType")]
  432. NSCompoundPredicateType Type { get; }
  433. [Export ("subpredicates")]
  434. NSPredicate[] Subpredicates { get; }
  435. [Static]
  436. [Export ("andPredicateWithSubpredicates:")]
  437. NSPredicate CreateAndPredicate (NSPredicate[] subpredicates);
  438. [Static]
  439. [Export ("orPredicateWithSubpredicates:")]
  440. NSPredicate CreateOrPredicate (NSPredicate [] subpredicates);
  441. [Static]
  442. [Export ("notPredicateWithSubpredicate:")]
  443. NSPredicate CreateNotPredicate (NSPredicate predicate);
  444. }
  445. [BaseType (typeof (NSObject))]
  446. public interface NSData {
  447. [Export ("dataWithContentsOfURL:")]
  448. [Static]
  449. NSData FromUrl (NSUrl url);
  450. [Export ("dataWithContentsOfURL:options:error:")]
  451. [Static]
  452. NSData FromUrl (NSUrl url, NSDataReadingOptions mask, out NSError error);
  453. [Export ("dataWithContentsOfFile:")][Static]
  454. NSData FromFile (string path);
  455. [Export ("dataWithContentsOfFile:options:error:")]
  456. [Static]
  457. NSData FromFile (string path, NSDataReadingOptions mask, out NSError error);
  458. [Export ("dataWithData:")]
  459. [Static]
  460. NSData FromData (NSData source);
  461. [Export ("dataWithBytes:length:"), Static]
  462. NSData FromBytes (IntPtr bytes, uint size);
  463. [Export ("bytes")]
  464. IntPtr Bytes { get; }
  465. [Export ("length")]
  466. uint Length { get; [NotImplemented] set; }
  467. [Export ("writeToFile:options:error:")]
  468. bool _Save (string file, int options, IntPtr addr);
  469. [Export ("writeToURL:options:error:")]
  470. bool _Save (NSUrl url, int options, IntPtr addr);
  471. [Export ("rangeOfData:options:range:")]
  472. [Since (4,0)]
  473. NSRange Find (NSData dataToFind, NSDataSearchOptions searchOptions, NSRange searchRange);
  474. }
  475. [BaseType (typeof (NSObject))]
  476. public interface NSDateComponents {
  477. [Since (4,0)]
  478. [Export ("timeZone")]
  479. NSTimeZone TimeZone { get; set; }
  480. [Export ("calendar")]
  481. [Since (4,0)]
  482. NSCalendar Calendar { get; set; }
  483. [Export ("quarter")]
  484. [Since (4,0)]
  485. int Quarter { get; set; }
  486. [Export ("date")]
  487. [Since (4,0)]
  488. NSDate Date { get; }
  489. //Detected properties
  490. [Export ("era")]
  491. int Era { get; set; }
  492. [Export ("year")]
  493. int Year { get; set; }
  494. [Export ("month")]
  495. int Month { get; set; }
  496. [Export ("day")]
  497. int Day { get; set; }
  498. [Export ("hour")]
  499. int Hour { get; set; }
  500. [Export ("minute")]
  501. int Minute { get; set; }
  502. [Export ("second")]
  503. int Second { get; set; }
  504. [Export ("week")]
  505. int Week { get; set; }
  506. [Export ("weekday")]
  507. int Weekday { get; set; }
  508. [Export ("weekdayOrdinal")]
  509. int WeekdayOrdinal { get; set; }
  510. [Since (5,0)]
  511. [Export ("weekOfMonth")]
  512. int WeekOfMonth { get; set; }
  513. [Since (5,0)]
  514. [Export ("weekOfYear")]
  515. int WeekOfYear { get; set; }
  516. [Since (5,0)]
  517. [Export ("yearForWeekOfYear")]
  518. int YearForWeekOfYear { get; set; }
  519. [Since (6,0)]
  520. [Export ("leapMonth")]
  521. bool IsLeapMonth { [Bind ("isLeapMonth")] get; set; }
  522. }
  523. [Since (6,0)]
  524. [BaseType (typeof (NSFormatter))]
  525. interface NSByteCountFormatter {
  526. [Export ("allowsNonnumericFormatting")]
  527. bool AllowsNonnumericFormatting { get; set; }
  528. [Export ("includesUnit")]
  529. bool IncludesUnit { get; set; }
  530. [Export ("includesCount")]
  531. bool IncludesCount { get; set; }
  532. [Export ("includesActualByteCount")]
  533. bool IncludesActualByteCount { get; set; }
  534. [Export ("adaptive")]
  535. bool Adaptive { [Bind ("isAdaptive")] get; set; }
  536. [Export ("zeroPadsFractionDigits")]
  537. bool ZeroPadsFractionDigits { get; set; }
  538. [Static]
  539. [Export ("stringFromByteCount:countStyle:")]
  540. string Format (long byteCount, NSByteCountFormatterCountStyle countStyle);
  541. [Export ("stringFromByteCount:")]
  542. string Format (long byteCount);
  543. [Export ("allowedUnits")]
  544. NSByteCountFormatterUnits AllowedUnits { get; set; }
  545. [Export ("countStyle")]
  546. NSByteCountFormatterCountStyle CountStyle { get; set; }
  547. }
  548. [BaseType (typeof (NSFormatter))]
  549. public interface NSDateFormatter {
  550. [Export ("stringFromDate:")]
  551. string ToString (NSDate date);
  552. [Export ("dateFromString:")]
  553. NSDate Parse (string date);
  554. [Export ("dateFormat")]
  555. string DateFormat { get; set; }
  556. [Export ("dateStyle")]
  557. NSDateFormatterStyle DateStyle { get; set; }
  558. [Export ("timeStyle")]
  559. NSDateFormatterStyle TimeStyle { get; set; }
  560. [Export ("locale")]
  561. NSLocale Locale { get; set; }
  562. [Export ("generatesCalendarDates")]
  563. bool GeneratesCalendarDates { get; set; }
  564. [Export ("formatterBehavior")]
  565. NSDateFormatterBehavior Behavior { get; set; }
  566. [Export ("defaultFormatterBehavior"), Static]
  567. NSDateFormatterBehavior DefaultBehavior { get; set; }
  568. [Export ("timeZone")]
  569. NSTimeZone TimeZone { get; set; }
  570. [Export ("calendar")]
  571. NSCalendar Calendar { get; set; }
  572. // not exposed as a property in documentation
  573. [Export ("isLenient")]
  574. bool IsLenient { get; [Bind ("setLenient:")] set; }
  575. [Export ("twoDigitStartDate")]
  576. NSDate TwoDigitStartDate { get; set; }
  577. [Export ("defaultDate")]
  578. NSDate DefaultDate { get; set; }
  579. [Export ("eraSymbols")]
  580. string [] EraSymbols { get; set; }
  581. [Export ("monthSymbols")]
  582. string [] MonthSymbols { get; set; }
  583. [Export ("shortMonthSymbols")]
  584. string [] ShortMonthSymbols { get; set; }
  585. [Export ("weekdaySymbols")]
  586. string [] WeekdaySymbols { get; set; }
  587. [Export ("shortWeekdaySymbols")]
  588. string [] ShortWeekdaySymbols { get; set; }
  589. [Export ("AMSymbol")]
  590. string AMSymbol { get; set; }
  591. [Export ("PMSymbol")]
  592. string PMSymbol { get; set; }
  593. [Export ("longEraSymbols")]
  594. string [] LongEraSymbols { get; set; }
  595. [Export ("veryShortMonthSymbols")]
  596. string [] VeryShortMonthSymbols { get; set; }
  597. [Export ("standaloneMonthSymbols")]
  598. string [] StandaloneMonthSymbols { get; set; }
  599. [Export ("shortStandaloneMonthSymbols")]
  600. string [] ShortStandaloneMonthSymbols { get; set; }
  601. [Export ("veryShortStandaloneMonthSymbols")]
  602. string [] VeryShortStandaloneMonthSymbols { get; set; }
  603. [Export ("veryShortWeekdaySymbols")]
  604. string [] VeryShortWeekdaySymbols { get; set; }
  605. [Export ("standaloneWeekdaySymbols")]
  606. string [] StandaloneWeekdaySymbols { get; set; }
  607. [Export ("shortStandaloneWeekdaySymbols")]
  608. string [] ShortStandaloneWeekdaySymbols { get; set; }
  609. [Export ("veryShortStandaloneWeekdaySymbols")]
  610. string [] VeryShortStandaloneWeekdaySymbols { get; set; }
  611. [Export ("quarterSymbols")]
  612. string [] QuarterSymbols { get; set; }
  613. [Export ("shortQuarterSymbols")]
  614. string [] ShortQuarterSymbols { get; set; }
  615. [Export ("standaloneQuarterSymbols")]
  616. string [] StandaloneQuarterSymbols { get; set; }
  617. [Export ("shortStandaloneQuarterSymbols")]
  618. string [] ShortStandaloneQuarterSymbols { get; set; }
  619. [Export ("gregorianStartDate")]
  620. NSDate GregorianStartDate { get; set; }
  621. }
  622. public delegate void NSFileHandleUpdateHandler (NSFileHandle handle);
  623. public interface NSFileHandleReadEventArgs {
  624. [Export ("NSFileHandleNotificationDataItem")]
  625. NSData AvailableData { get; }
  626. [Export ("NSFileHandleError", ArgumentSemantic.Assign)]
  627. int UnixErrorCode { get; }
  628. }
  629. public interface NSFileHandleConnectionAcceptedEventArgs {
  630. [Export ("NSFileHandleNotificationFileHandleItem")]
  631. NSFileHandle NearSocketConnection { get; }
  632. [Export ("NSFileHandleError", ArgumentSemantic.Assign)]
  633. int UnixErrorCode { get; }
  634. }
  635. [BaseType (typeof (NSObject))]
  636. [DisableDefaultCtor] // return invalid handle
  637. public interface NSFileHandle
  638. {
  639. [Export ("availableData")]
  640. NSData AvailableData ();
  641. [Export ("readDataToEndOfFile")]
  642. NSData ReadDataToEndOfFile ();
  643. [Export ("readDataOfLength:")]
  644. NSData ReadDataOfLength (uint length);
  645. [Export ("writeData:")]
  646. void WriteData (NSData data);
  647. [Export ("offsetInFile")]
  648. ulong OffsetInFile ();
  649. [Export ("seekToEndOfFile")]
  650. ulong SeekToEndOfFile ();
  651. [Export ("seekToFileOffset:")]
  652. void SeekToFileOffset (ulong offset);
  653. [Export ("truncateFileAtOffset:")]
  654. void TruncateFileAtOffset (ulong offset);
  655. [Export ("synchronizeFile")]
  656. void SynchronizeFile ();
  657. [Export ("closeFile")]
  658. void CloseFile ();
  659. [Static]
  660. [Export ("fileHandleWithStandardInput")]
  661. NSFileHandle FromStandardInput ();
  662. [Static]
  663. [Export ("fileHandleWithStandardOutput")]
  664. NSFileHandle FromStandardOutput ();
  665. [Static]
  666. [Export ("fileHandleWithStandardError")]
  667. NSFileHandle FromStandardError ();
  668. [Static]
  669. [Export ("fileHandleWithNullDevice")]
  670. NSFileHandle FromNullDevice ();
  671. [Static]
  672. [Export ("fileHandleForReadingAtPath:")]
  673. NSFileHandle OpenRead (string path);
  674. [Static]
  675. [Export ("fileHandleForWritingAtPath:")]
  676. NSFileHandle OpenWrite (string path);
  677. [Static]
  678. [Export ("fileHandleForUpdatingAtPath:")]
  679. NSFileHandle OpenUpdate (string path);
  680. [Static]
  681. [Export ("fileHandleForReadingFromURL:error:")]
  682. NSFileHandle OpenReadUrl (NSUrl url, out NSError error);
  683. [Static]
  684. [Export ("fileHandleForWritingToURL:error:")]
  685. NSFileHandle OpenWriteUrl (NSUrl url, out NSError error);
  686. [Static]
  687. [Export ("fileHandleForUpdatingURL:error:")]
  688. NSFileHandle OpenUpdateUrl (NSUrl url, out NSError error);
  689. [Export ("readInBackgroundAndNotifyForModes:")]
  690. void ReadInBackground (NSString [] notifyRunLoopModes);
  691. [Export ("readInBackgroundAndNotify")]
  692. void ReadInBackground ();
  693. [Export ("readToEndOfFileInBackgroundAndNotifyForModes:")]
  694. void ReadToEndOfFileInBackground (NSString [] notifyRunLoopModes);
  695. [Export ("readToEndOfFileInBackgroundAndNotify")]
  696. void ReadToEndOfFileInBackground ();
  697. [Export ("acceptConnectionInBackgroundAndNotifyForModes:")]
  698. void AcceptConnectionInBackground (NSString [] notifyRunLoopModes);
  699. [Export ("acceptConnectionInBackgroundAndNotify")]
  700. void AcceptConnectionInBackground ();
  701. [Export ("waitForDataInBackgroundAndNotifyForModes:")]
  702. void WaitForDataInBackground (NSString [] notifyRunLoopModes);
  703. [Export ("waitForDataInBackgroundAndNotify")]
  704. void WaitForDataInBackground ();
  705. [Export ("initWithFileDescriptor:closeOnDealloc:")]
  706. IntPtr Constructor (int fd, bool closeOnDealloc);
  707. [Export ("initWithFileDescriptor:")]
  708. IntPtr Constructor (int fd);
  709. [Export ("fileDescriptor")]
  710. int FileDescriptor { get; }
  711. [Export ("setReadabilityHandler:")]
  712. void SetReadabilityHandler ([NullAllowed] NSFileHandleUpdateHandler readCallback);
  713. [Export ("setWriteabilityHandler:")]
  714. void SetWriteabilityHandle ([NullAllowed] NSFileHandleUpdateHandler writeCallback);
  715. [Field ("NSFileHandleOperationException")]
  716. NSString OperationException { get; }
  717. [Field ("NSFileHandleReadCompletionNotification")]
  718. [Notification (typeof (NSFileHandleReadEventArgs))]
  719. NSString ReadCompletionNotification { get; }
  720. [Field ("NSFileHandleReadToEndOfFileCompletionNotification")]
  721. [Notification (typeof (NSFileHandleReadEventArgs))]
  722. NSString ReadToEndOfFileCompletionNotification { get; }
  723. [Field ("NSFileHandleConnectionAcceptedNotification")]
  724. [Notification (typeof (NSFileHandleConnectionAcceptedEventArgs))]
  725. NSString ConnectionAcceptedNotification { get; }
  726. [Field ("NSFileHandleDataAvailableNotification")]
  727. [Notification]
  728. NSString DataAvailableNotification { get; }
  729. }
  730. [BaseType (typeof (NSObject))]
  731. public interface NSPipe {
  732. [Export ("fileHandleForReading")]
  733. NSFileHandle ReadHandle { get; }
  734. [Export ("fileHandleForWriting")]
  735. NSFileHandle WriteHandle { get; }
  736. [Static]
  737. [Export ("pipe")]
  738. NSPipe Create ();
  739. }
  740. //@interface NSFormatter : NSObject <NSCopying, NSCoding>
  741. [BaseType (typeof (NSObject))]
  742. public interface NSFormatter {
  743. [Export ("stringForObjectValue:")]
  744. string StringFor (NSObject value);
  745. // - (NSAttributedString *)attributedStringForObjectValue:(id)obj withDefaultAttributes:(NSDictionary *)attrs;
  746. [Export ("editingStringForObjectValue:")]
  747. string EditingStringFor (NSObject value);
  748. }
  749. [BaseType (typeof (NSObject))]
  750. [Model]
  751. [Protocol]
  752. public interface NSKeyedArchiverDelegate {
  753. [Export ("archiver:didEncodeObject:"), EventArgs ("NSObject")]
  754. void EncodedObject (NSKeyedArchiver archiver, NSObject obj);
  755. [Export ("archiverDidFinish:")]
  756. void Finished (NSKeyedArchiver archiver);
  757. [Export ("archiver:willEncodeObject:"), DelegateName ("NSEncodeHook"), DefaultValue (null)]
  758. NSObject WillEncode (NSKeyedArchiver archiver, NSObject obj);
  759. [Export ("archiverWillFinish:")]
  760. void Finishing (NSKeyedArchiver archiver);
  761. [Export ("archiver:willReplaceObject:withObject:"), EventArgs ("NSArchiveReplace")]
  762. void ReplacingObject (NSKeyedArchiver archiver, NSObject oldObject, NSObject newObject);
  763. }
  764. [BaseType (typeof (NSObject))]
  765. [Model]
  766. [Protocol]
  767. public interface NSKeyedUnarchiverDelegate {
  768. [Export ("unarchiver:didDecodeObject:"), DelegateName ("NSDecoderCallback"), DefaultValue (null)]
  769. NSObject DecodedObject (NSKeyedUnarchiver unarchiver, NSObject obj);
  770. [Export ("unarchiverDidFinish:")]
  771. void Finished (NSKeyedUnarchiver unarchiver);
  772. [Export ("unarchiver:cannotDecodeObjectOfClassName:originalClasses:"), DelegateName ("NSDecoderHandler"), DefaultValue (null)]
  773. Class CannotDecodeClass (NSKeyedUnarchiver unarchiver, string klass, string [] classes);
  774. [Export ("unarchiverWillFinish:")]
  775. void Finishing (NSKeyedUnarchiver unarchiver);
  776. [Export ("unarchiver:willReplaceObject:withObject:"), EventArgs ("NSArchiveReplace")]
  777. void ReplacingObject (NSKeyedUnarchiver unarchiver, NSObject oldObject, NSObject newObject);
  778. }
  779. [BaseType (typeof (NSCoder),
  780. Delegates=new string [] {"WeakDelegate"},
  781. Events=new Type [] { typeof (NSKeyedArchiverDelegate) })]
  782. // Objective-C exception thrown. Name: NSInvalidArgumentException Reason: *** -[NSKeyedArchiver init]: cannot use -init for initialization
  783. [DisableDefaultCtor]
  784. public interface NSKeyedArchiver {
  785. [Export ("initForWritingWithMutableData:")]
  786. IntPtr Constructor (NSMutableData data);
  787. [Export ("archivedDataWithRootObject:")]
  788. [Static]
  789. NSData ArchivedDataWithRootObject (NSObject root);
  790. [Export ("archiveRootObject:toFile:")]
  791. [Static]
  792. bool ArchiveRootObjectToFile (NSObject root, string file);
  793. [Export ("finishEncoding")]
  794. void FinishEncoding ();
  795. [Export ("outputFormat")]
  796. NSPropertyListFormat PropertyListFormat { get; set; }
  797. [Wrap ("WeakDelegate")]
  798. NSKeyedArchiverDelegate Delegate { get; set; }
  799. [Export ("delegate", ArgumentSemantic.Assign)][NullAllowed]
  800. NSObject WeakDelegate { get; set; }
  801. [Export ("setClassName:forClass:")]
  802. void SetClassName (string name, Class kls);
  803. [Export ("classNameForClass:")]
  804. string GetClassName (Class kls);
  805. }
  806. [BaseType (typeof (NSCoder),
  807. Delegates=new string [] {"WeakDelegate"},
  808. Events=new Type [] { typeof (NSKeyedUnarchiverDelegate) })]
  809. // Objective-C exception thrown. Name: NSInvalidArgumentException Reason: *** -[NSKeyedUnarchiver init]: cannot use -init for initialization
  810. [DisableDefaultCtor]
  811. public interface NSKeyedUnarchiver {
  812. [Export ("initForReadingWithData:")]
  813. [MarshalNativeExceptions]
  814. IntPtr Constructor (NSData data);
  815. [Static, Export ("unarchiveObjectWithData:")]
  816. [MarshalNativeExceptions]
  817. NSObject UnarchiveObject (NSData data);
  818. [Static, Export ("unarchiveObjectWithFile:")]
  819. [MarshalNativeExceptions]
  820. NSObject UnarchiveFile (string file);
  821. [Export ("finishDecoding")]
  822. void FinishDecoding ();
  823. [Wrap ("WeakDelegate")]
  824. NSKeyedUnarchiverDelegate Delegate { get; set; }
  825. [Export ("delegate", ArgumentSemantic.Assign)][NullAllowed]
  826. NSObject WeakDelegate { get; set; }
  827. [Export ("setClass:forClassName:")]
  828. void SetClass (Class kls, string codedName);
  829. [Export ("classForClassName:")]
  830. Class GetClass (string codedName);
  831. }
  832. [BaseType (typeof (NSObject), Delegates=new string [] { "Delegate" }, Events=new Type [] { typeof (NSMetadataQueryDelegate)})]
  833. public interface NSMetadataQuery {
  834. [Export ("startQuery")]
  835. bool StartQuery ();
  836. [Export ("stopQuery")]
  837. void StopQuery ();
  838. [Export ("isStarted")]
  839. bool IsStarted { get; }
  840. [Export ("isGathering")]
  841. bool IsGathering { get; }
  842. [Export ("isStopped")]
  843. bool IsStopped { get; }
  844. [Export ("disableUpdates")]
  845. void DisableUpdates ();
  846. [Export ("enableUpdates")]
  847. void EnableUpdates ();
  848. [Export ("resultCount")]
  849. int ResultCount { get; }
  850. [Export ("resultAtIndex:")]
  851. NSObject ResultAtIndex (int idx);
  852. [Export ("results")]
  853. NSMetadataItem[] Results { get; }
  854. [Export ("indexOfResult:")]
  855. int IndexOfResult (NSObject result);
  856. [Export ("valueLists")]
  857. NSDictionary ValueLists { get; }
  858. [Export ("groupedResults")]
  859. NSObject [] GroupedResults { get; }
  860. [Export ("valueOfAttribute:forResultAtIndex:")]
  861. NSObject ValueOfAttribute (string attribyteName, int atIndex);
  862. [Export ("delegate", ArgumentSemantic.Assign), NullAllowed]
  863. NSMetadataQueryDelegate WeakDelegate { get; set; }
  864. [Wrap ("WeakDelegate")]
  865. NSMetadataQueryDelegate Delegate { get; set; }
  866. [Export ("predicate")]
  867. NSPredicate Predicate { get; set; }
  868. [Export ("sortDescriptors")]
  869. NSSortDescriptor[] SortDescriptors { get; set; }
  870. [Export ("valueListAttributes")]
  871. NSObject[] ValueListAttributes { get; set; }
  872. [Export ("groupingAttributes")]
  873. NSArray GroupingAttributes { get; set; }
  874. [Export ("notificationBatchingInterval")]
  875. double NotificationBatchingInterval { get; set; }
  876. [Export ("searchScopes")]
  877. NSObject [] SearchScopes { get; set; }
  878. // There is no info associated with these notifications
  879. [Field ("NSMetadataQueryDidStartGatheringNotification")]
  880. [Notification]
  881. NSString DidStartGatheringNotification { get; }
  882. [Field ("NSMetadataQueryGatheringProgressNotification")]
  883. [Notification]
  884. NSString GatheringProgressNotification { get; }
  885. [Field ("NSMetadataQueryDidFinishGatheringNotification")]
  886. [Notification]
  887. NSString DidFinishGatheringNotification { get; }
  888. [Field ("NSMetadataQueryDidUpdateNotification")]
  889. [Notification]
  890. NSString DidUpdateNotification { get; }
  891. [Field ("NSMetadataQueryResultContentRelevanceAttribute")]
  892. NSString ResultContentRelevanceAttribute { get; }
  893. // Scope constants for defined search locations
  894. #if MONOMAC
  895. [Field ("NSMetadataQueryUserHomeScope")]
  896. NSString UserHomeScope { get; }
  897. [Field ("NSMetadataQueryLocalComputerScope")]
  898. NSString LocalComputerScope { get; }
  899. [Field ("NSMetadataQueryNetworkScope")]
  900. NSString QueryNetworkScope { get; }
  901. [Field ("NSMetadataQueryLocalDocumentsScope")]
  902. NSString QueryLocalDocumentsScope { get; }
  903. #endif
  904. [Field ("NSMetadataQueryUbiquitousDocumentsScope")]
  905. NSString QueryUbiquitousDocumentsScope { get; }
  906. [Field ("NSMetadataQueryUbiquitousDataScope")]
  907. NSString QueryUbiquitousDataScope { get; }
  908. [Field ("NSMetadataItemFSNameKey")]
  909. NSString ItemFSNameKey { get; }
  910. [Field ("NSMetadataItemDisplayNameKey")]
  911. NSString ItemDisplayNameKey { get; }
  912. [Field ("NSMetadataItemURLKey")]
  913. NSString ItemURLKey { get; }
  914. [Field ("NSMetadataItemPathKey")]
  915. NSString ItemPathKey { get; }
  916. [Field ("NSMetadataItemFSSizeKey")]
  917. NSString ItemFSSizeKey { get; }
  918. [Field ("NSMetadataItemFSCreationDateKey")]
  919. NSString ItemFSCreationDateKey { get; }
  920. [Field ("NSMetadataItemFSContentChangeDateKey")]
  921. NSString ItemFSContentChangeDateKey { get; }
  922. [Field ("NSMetadataItemIsUbiquitousKey")]
  923. NSString ItemIsUbiquitousKey { get; }
  924. [Field ("NSMetadataUbiquitousItemHasUnresolvedConflictsKey")]
  925. NSString UbiquitousItemHasUnresolvedConflictsKey { get; }
  926. [Field ("NSMetadataUbiquitousItemIsDownloadedKey")]
  927. NSString UbiquitousItemIsDownloadedKey { get; }
  928. [Field ("NSMetadataUbiquitousItemIsDownloadingKey")]
  929. NSString UbiquitousItemIsDownloadingKey { get; }
  930. [Field ("NSMetadataUbiquitousItemIsUploadedKey")]
  931. NSString UbiquitousItemIsUploadedKey { get; }
  932. [Field ("NSMetadataUbiquitousItemIsUploadingKey")]
  933. NSString UbiquitousItemIsUploadingKey { get; }
  934. [Field ("NSMetadataUbiquitousItemPercentDownloadedKey")]
  935. NSString UbiquitousItemPercentDownloadedKey { get; }
  936. [Field ("NSMetadataUbiquitousItemPercentUploadedKey")]
  937. NSString UbiquitousItemPercentUploadedKey { get; }
  938. }
  939. [BaseType (typeof (NSObject))]
  940. [Model]
  941. [Protocol]
  942. public interface NSMetadataQueryDelegate {
  943. [Export ("metadataQuery:replacementObjectForResultObject:"), DelegateName ("NSMetadataQueryObject"), DefaultValue(null)]
  944. NSObject ReplacementObjectForResultObject (NSMetadataQuery query, NSMetadataItem result);
  945. [Export ("metadataQuery:replacementValueForAttribute:value:"), DelegateName ("NSMetadataQueryValue"), DefaultValue(null)]
  946. NSObject ReplacementValueForAttributevalue (NSMetadataQuery query, string attributeName, NSObject value);
  947. }
  948. [BaseType (typeof (NSObject))]
  949. public interface NSMetadataItem {
  950. [Export ("valueForAttribute:")]
  951. NSObject ValueForAttribute (string key);
  952. [Export ("valuesForAttributes:")]
  953. NSDictionary ValuesForAttributes (NSArray keys);
  954. [Export ("attributes")]
  955. NSObject [] Attributes { get; }
  956. }
  957. [BaseType (typeof (NSObject))]
  958. public interface NSMetadataQueryAttributeValueTuple {
  959. [Export ("attribute")]
  960. string Attribute { get; }
  961. [Export ("value")]
  962. NSObject Value { get; }
  963. [Export ("count")]
  964. int Count { get; }
  965. }
  966. [BaseType (typeof (NSObject))]
  967. public interface NSMetadataQueryResultGroup {
  968. [Export ("attribute")]
  969. string Attribute { get; }
  970. [Export ("value")]
  971. NSObject Value { get; }
  972. [Export ("subgroups")]
  973. NSObject [] Subgroups { get; }
  974. [Export ("resultCount")]
  975. int ResultCount { get; }
  976. [Export ("resultAtIndex:")]
  977. NSObject ResultAtIndex (uint idx);
  978. [Export ("results")]
  979. NSObject [] Results { get; }
  980. }
  981. // This API is only supported because a bunch of third-party
  982. // APIs are so poorly designed that they expose NSMutableArray
  983. // as a public property.
  984. [Obsolete ("You really should avoid using NSMutableArray in MonoTouch/MonoMac, this is usually used by poorly designed public APIs")]
  985. [BaseType (typeof (NSArray))]
  986. public interface NSMutableArray {
  987. [Export ("initWithCapacity:")]
  988. IntPtr Constructor (int capacity);
  989. [Export ("addObject:")]
  990. void Add (NSObject obj);
  991. [Export ("insertObject:atIndex:")]
  992. void Insert (NSObject obj, int index);
  993. [Export ("removeLastObject")]
  994. void RemoveLastObject ();
  995. [Export ("removeObjectAtIndex:")]
  996. void RemoveObject (int index);
  997. [Export ("replaceObjectAtIndex:withObject:")]
  998. void ReplaceObject (int index, NSObject withObject);
  999. [Export ("removeAllObjects")]
  1000. void RemoveAllObjects ();
  1001. [Export ("addObjectsFromArray:")]
  1002. void AddObjects (NSObject [] source);
  1003. [Export ("insertObjects:atIndexes:")]
  1004. void InsertObjects (NSObject [] objects, NSIndexSet atIndexes);
  1005. [Export ("removeObjectsAtIndexes:")]
  1006. void RemoveObjectsAtIndexes (NSIndexSet indexSet);
  1007. }
  1008. [Since (3,2)]
  1009. [BaseType (typeof (NSAttributedString))]
  1010. public interface NSMutableAttributedString {
  1011. [Export ("initWithString:")]
  1012. IntPtr Constructor (string str);
  1013. [Export ("initWithString:attributes:")]
  1014. IntPtr Constructor (string str, NSDictionary attributes);
  1015. [Export ("initWithAttributedString:")]
  1016. IntPtr Constructor (NSAttributedString other);
  1017. [Export ("replaceCharactersInRange:withString:")]
  1018. void Replace (NSRange range, string newValue);
  1019. [Export ("setAttributes:range:")]
  1020. void SetAttributes (NSDictionary attrs, NSRange range);
  1021. [Export ("addAttribute:value:range:")]
  1022. void AddAttribute (NSString attributeName, NSObject value, NSRange range);
  1023. [Export ("addAttributes:range:")]
  1024. void AddAttributes (NSDictionary attrs, NSRange range);
  1025. [Export ("removeAttribute:range:")]
  1026. void RemoveAttribute (string name, NSRange range);
  1027. [Export ("replaceCharactersInRange:withAttributedString:")]
  1028. void Replace (NSRange range, NSAttributedString value);
  1029. [Export ("insertAttributedString:atIndex:")]
  1030. void Insert (NSAttributedString attrString, int location);
  1031. [Export ("appendAttributedString:")]
  1032. void Append (NSAttributedString attrString);
  1033. [Export ("deleteCharactersInRange:")]
  1034. void DeleteRange (NSRange range);
  1035. [Export ("setAttributedString:")]
  1036. void SetString (NSAttributedString attrString);
  1037. [Export ("beginEditing")]
  1038. void BeginEditing ();
  1039. [Export ("endEditing")]
  1040. void EndEditing ();
  1041. }
  1042. [BaseType (typeof (NSData))]
  1043. public interface NSMutableData {
  1044. [Static, Export ("dataWithCapacity:")] [Autorelease]
  1045. NSMutableData FromCapacity (int capacity);
  1046. [Static, Export ("dataWithLength:")] [Autorelease]
  1047. NSMutableData FromLength (int length);
  1048. [Static, Export ("data")] [Autorelease]
  1049. NSMutableData Create ();
  1050. [Export ("setLength:")]
  1051. void SetLength (uint len);
  1052. [Export ("mutableBytes")]
  1053. IntPtr MutableBytes { get; }
  1054. [Export ("initWithCapacity:")]
  1055. IntPtr Constructor (uint len);
  1056. [Export ("appendData:")]
  1057. void AppendData (NSData other);
  1058. [Export ("appendBytes:length:")]
  1059. void AppendBytes (IntPtr bytes, uint len);
  1060. [Export ("setData:")]
  1061. void SetData (NSData data);
  1062. [Export ("length")]
  1063. [Override]
  1064. uint Length { get; set; }
  1065. }
  1066. [BaseType (typeof (NSObject))]
  1067. public interface NSDate {
  1068. [Export ("timeIntervalSinceReferenceDate")]
  1069. double SecondsSinceReferenceDate { get; }
  1070. [Export ("dateWithTimeIntervalSinceReferenceDate:")]
  1071. [Static]
  1072. NSDate FromTimeIntervalSinceReferenceDate (double secs);
  1073. [Static, Export ("dateWithTimeIntervalSince1970:")]
  1074. NSDate FromTimeIntervalSince1970 (double secs);
  1075. [Export ("date")]
  1076. [Static]
  1077. NSDate Now { get; }
  1078. [Export ("distantPast")]
  1079. [Static]
  1080. NSDate DistantPast { get; }
  1081. [Export ("distantFuture")]
  1082. [Static]
  1083. NSDate DistantFuture { get; }
  1084. [Export ("dateByAddingTimeInterval:")]
  1085. NSDate AddSeconds (double seconds);
  1086. [Export ("dateWithTimeIntervalSinceNow:")]
  1087. [Static]
  1088. NSDate FromTimeIntervalSinceNow (double secs);
  1089. }
  1090. [BaseType (typeof (NSObject))]
  1091. public interface NSDictionary {
  1092. [Export ("dictionaryWithContentsOfFile:")]
  1093. [Static]
  1094. NSDictionary FromFile (string path);
  1095. [Export ("dictionaryWithContentsOfURL:")]
  1096. [Static]
  1097. NSDictionary FromUrl (NSUrl url);
  1098. [Export ("dictionaryWithObject:forKey:")]
  1099. [Static]
  1100. NSDictionary FromObjectAndKey (NSObject obj, NSObject key);
  1101. [Export ("dictionaryWithDictionary:")]
  1102. [Static]
  1103. NSDictionary FromDictionary (NSDictionary source);
  1104. [Export ("dictionaryWithObjects:forKeys:count:")]
  1105. [Static, Internal]
  1106. NSDictionary FromObjectsAndKeysInternal ([NullAllowed] NSArray objects, [NullAllowed] NSArray keys, int count);
  1107. [Export ("dictionaryWithObjects:forKeys:")]
  1108. [Static, Internal]
  1109. NSDictionary FromObjectsAndKeysInternal ([NullAllowed] NSArray objects, [NullAllowed] NSArray keys);
  1110. [Export ("initWithDictionary:")]
  1111. IntPtr Constructor (NSDictionary other);
  1112. [Export ("initWithContentsOfFile:")]
  1113. IntPtr Constructor (string fileName);
  1114. [Export ("initWithObjects:forKeys:"), Internal]
  1115. IntPtr Constructor (NSArray objects, NSArray keys);
  1116. [Export ("initWithContentsOfURL:")]
  1117. IntPtr Constructor (NSUrl url);
  1118. [Export ("count")]
  1119. uint Count { get; }
  1120. [Export ("objectForKey:")]
  1121. NSObject ObjectForKey (NSObject key);
  1122. [Export ("allKeys")][Autorelease]
  1123. NSObject [] Keys { get; }
  1124. [Export ("allKeysForObject:")][Autorelease]
  1125. NSObject [] KeysForObject (NSObject obj);
  1126. [Export ("allValues")][Autorelease]
  1127. NSObject [] Values { get; }
  1128. [Export ("descriptionInStringsFileFormat")]
  1129. string DescriptionInStringsFileFormat { get; }
  1130. [Export ("isEqualToDictionary:")]
  1131. bool IsEqualToDictionary (NSDictionary other);
  1132. [Export ("objectEnumerator")]
  1133. NSEnumerator ObjectEnumerator { get; }
  1134. [Export ("objectsForKeys:notFoundMarker:")][Autorelease]
  1135. NSObject [] ObjectsForKeys (NSArray keys, NSObject marker);
  1136. [Export ("writeToFile:atomically:")]
  1137. bool WriteToFile (string path, bool useAuxiliaryFile);
  1138. [Export ("writeToURL:atomically:")]
  1139. bool WriteToUrl (NSUrl url, bool atomically);
  1140. [Since (6,0)]
  1141. [Static]
  1142. [Export ("sharedKeySetForKeys:")]
  1143. NSObject GetSharedKeySetForKeys (NSObject [] keys);
  1144. }
  1145. [BaseType (typeof (NSObject))]
  1146. public interface NSEnumerator {
  1147. [Export ("nextObject")]
  1148. NSObject NextObject ();
  1149. }
  1150. [BaseType (typeof (NSObject))]
  1151. [DisableDefaultCtor]
  1152. public interface NSError {
  1153. [Static, Export ("errorWithDomain:code:userInfo:")]
  1154. NSError FromDomain (NSString domain, int code, [NullAllowed] NSDictionary userInfo);
  1155. [Export ("initWithDomain:code:userInfo:")]
  1156. IntPtr Constructor (NSString domain, int code, [NullAllowed] NSDictionary userInfo);
  1157. [Export ("domain")]
  1158. string Domain { get; }
  1159. [Export ("code")]
  1160. int Code { get; }
  1161. [Export ("userInfo")]
  1162. NSDictionary UserInfo { get; }
  1163. [Export ("localizedDescription")]
  1164. string LocalizedDescription { get; }
  1165. [Field ("NSCocoaErrorDomain")]
  1166. NSString CocoaErrorDomain { get;}
  1167. [Field ("NSPOSIXErrorDomain")]
  1168. NSString PosixErrorDomain { get; }
  1169. [Field ("NSOSStatusErrorDomain")]
  1170. NSString OsStatusErrorDomain { get; }
  1171. [Field ("NSMachErrorDomain")]
  1172. NSString MachErrorDomain { get; }
  1173. [Field ("NSUnderlyingErrorKey")]
  1174. NSString UnderlyingErrorKey { get; }
  1175. [Field ("NSLocalizedDescriptionKey")]
  1176. NSString LocalizedDescriptionKey { get; }
  1177. [Field ("NSLocalizedFailureReasonErrorKey")]
  1178. NSString LocalizedFailureReasonErrorKey { get; }
  1179. [Field ("NSLocalizedRecoverySuggestionErrorKey")]
  1180. NSString LocalizedRecoverySuggestionErrorKey { get; }
  1181. [Field ("NSLocalizedRecoveryOptionsErrorKey")]
  1182. NSString LocalizedRecoveryOptionsErrorKey { get; }
  1183. [Field ("NSRecoveryAttempterErrorKey")]
  1184. NSString RecoveryAttempterErrorKey { get; }
  1185. [Field ("NSHelpAnchorErrorKey")]
  1186. NSString HelpAnchorErrorKey { get; }
  1187. [Field ("NSStringEncodingErrorKey")]
  1188. NSString StringEncodingErrorKey { get; }
  1189. [Field ("NSURLErrorKey")]
  1190. NSString UrlErrorKey { get; }
  1191. [Field ("NSFilePathErrorKey")]
  1192. NSString FilePathErrorKey { get; }
  1193. }
  1194. [BaseType (typeof (NSObject))]
  1195. // 'init' returns NIL
  1196. [DisableDefaultCtor]
  1197. public interface NSException {
  1198. [Export ("initWithName:reason:userInfo:")]
  1199. IntPtr Constructor (string name, string reason, [NullAllowed] NSDictionary userInfo);
  1200. [Export ("name")]
  1201. string Name { get; }
  1202. [Export ("reason")]
  1203. string Reason { get; }
  1204. [Export ("userInfo")]
  1205. NSObject UserInfo { get; }
  1206. [Export ("callStackReturnAddresses")]
  1207. NSNumber[] CallStackReturnAddresses { get; }
  1208. }
  1209. public delegate void NSExpressionHandler (NSObject evaluatedObject, NSExpression [] expressions, NSMutableDictionary context);
  1210. [BaseType (typeof (NSObject))]
  1211. // Objective-C exception thrown. Name: NSInvalidArgumentException Reason: *** -predicateFormat cannot be sent to an abstract object of class NSExpression: Create a concrete instance!
  1212. [DisableDefaultCtor]
  1213. public interface NSExpression {
  1214. [Static, Export ("expressionForConstantValue:")]
  1215. NSExpression FromConstant (NSObject obj);
  1216. [Static, Export ("expressionForEvaluatedObject")]
  1217. NSExpression ExpressionForEvaluatedObject { get; }
  1218. [Static, Export ("expressionForVariable:")]
  1219. NSExpression FromVariable (string string1);
  1220. [Static, Export ("expressionForKeyPath:")]
  1221. NSExpression FromKeyPath (string keyPath);
  1222. [Static, Export ("expressionForFunction:arguments:")]
  1223. NSExpression FromFunction (string name, NSExpression[] parameters);
  1224. [Static, Export ("expressionWithFormat:argumentArray:")]
  1225. NSExpression FromFormat (string format, NSExpression [] parameters);
  1226. //+ (NSExpression *)expressionForAggregate:(NSArray *)subexpressions;
  1227. [Static, Export ("expressionForAggregate:")]
  1228. NSExpression FromAggregate (NSExpression [] subexpressions);
  1229. [Static, Export ("expressionForUnionSet:with:")]
  1230. NSExpression FromUnionSet (NSExpression left, NSExpression right);
  1231. [Static, Export ("expressionForIntersectSet:with:")]
  1232. NSExpression FromIntersectSet (NSExpression left, NSExpression right);
  1233. [Static, Export ("expressionForMinusSet:with:")]
  1234. NSExpression FromMinusSet (NSExpression left, NSExpression right);
  1235. //+ (NSExpression *)expressionForSubquery:(NSExpression *)expression usingIteratorVariable:(NSString *)variable predicate:(id)predicate;
  1236. [Static, Export ("expressionForSubquery:usingIteratorVariable:predicate:")]
  1237. NSExpression FromSubquery (NSExpression expression, string variable, NSObject predicate);
  1238. [Static, Export ("expressionForFunction:selectorName:arguments:")]
  1239. NSExpression FromFunction (NSExpression target, string name, NSExpression[] parameters);
  1240. [Static, Export ("expressionForBlock:arguments:")]
  1241. NSExpression FromFunction (NSExpressionHandler target, NSExpression[] parameters);
  1242. [Export ("initWithExpressionType:")]
  1243. IntPtr Constructor (NSExpressionType type);
  1244. [Export ("expressionType")]
  1245. NSExpressionType ExpressionType { get; }
  1246. [Export ("constantValue")]
  1247. NSObject ConstantValue { get; }
  1248. [Export ("keyPath")]
  1249. string KeyPath { get; }
  1250. [Export ("function")]
  1251. string Function { get; }
  1252. [Export ("variable")]
  1253. string Variable { get; }
  1254. [Export ("operand")]
  1255. NSExpression Operand { get; }
  1256. [Export ("arguments")]
  1257. NSExpression[] Arguments { get; }
  1258. [Export ("collection")]
  1259. NSObject Collection { get; }
  1260. [Export ("predicate")]
  1261. NSPredicate Predicate { get; }
  1262. [Export ("leftExpression")]
  1263. NSExpression LeftExpression { get; }
  1264. [Export ("rightExpression")]
  1265. NSExpression RightExpression { get; }
  1266. [Export ("expressionValueWithObject:context:")]
  1267. NSExpression ExpressionValueWithObject (NSObject object1, NSMutableDictionary context);
  1268. }
  1269. [BaseType (typeof (NSObject))]
  1270. public interface NSNull {
  1271. [Export ("null"), Static]
  1272. NSNull Null { get; }
  1273. }
  1274. delegate void NSLingusticEnumerator (NSString tag, NSRange tokenRange, NSRange sentenceRange, ref bool stop);
  1275. [BaseType (typeof (NSObject))]
  1276. interface NSLinguisticTagger {
  1277. [Export ("initWithTagSchemes:options:")]
  1278. IntPtr Constructor (NSString [] tagSchemes, NSLinguisticTaggerOptions opts);
  1279. [Export ("tagSchemes")]
  1280. NSString [] TagSchemes { get; }
  1281. [Static]
  1282. [Export ("availableTagSchemesForLanguage:")]
  1283. NSString [] GetAvailableTagSchemesForLanguage (string language);
  1284. [Export ("setOrthography:range:")]
  1285. void SetOrthographyrange (NSOrthography orthography, NSRange range);
  1286. [Export ("orthographyAtIndex:effectiveRange:")]
  1287. NSOrthography GetOrthography (int charIndex, ref NSRange effectiveRange);
  1288. [Export ("stringEditedInRange:changeInLength:")]
  1289. void StringEditedInRange (NSRange newRange, int delta);
  1290. [Export ("enumerateTagsInRange:scheme:options:usingBlock:")]
  1291. void EnumerateTagsInRange (NSRange range, NSString tagScheme, NSLinguisticTaggerOptions opts, NSLingusticEnumerator enumerator);
  1292. [Export ("sentenceRangeForRange:")]
  1293. NSRange GetSentenceRangeForRange (NSRange range);
  1294. [Export ("tagAtIndex:scheme:tokenRange:sentenceRange:")]
  1295. string GetTag (int charIndex, NSString tagScheme, ref NSRange tokenRange, ref NSRange sentenceRange);
  1296. [Export ("tagsInRange:scheme:options:tokenRanges:"), Internal]
  1297. NSString [] GetTagsInRange (NSRange range, NSString tagScheme, NSLinguisticTaggerOptions opts, ref NSArray tokenRanges);
  1298. [Export ("possibleTagsAtIndex:scheme:tokenRange:sentenceRange:scores:"), Internal]
  1299. NSString [] GetPossibleTags (int charIndex, NSString tagScheme, ref NSRange tokenRange, ref NSRange sentenceRange, ref NSArray scores);
  1300. //Detected properties
  1301. [Export ("string")]
  1302. string AnalysisString { get; set; }
  1303. }
  1304. [Static]
  1305. public interface NSLinguisticTag {
  1306. [Field ("NSLinguisticTagSchemeTokenType")]
  1307. NSString SchemeTokenType { get; }
  1308. [Field ("NSLinguisticTagSchemeLexicalClass")]
  1309. NSString SchemeLexicalClass { get; }
  1310. [Field ("NSLinguisticTagSchemeNameType")]
  1311. NSString SchemeNameType { get; }
  1312. [Field ("NSLinguisticTagSchemeNameTypeOrLexicalClass")]
  1313. NSString SchemeNameTypeOrLexicalClass { get; }
  1314. [Field ("NSLinguisticTagSchemeLemma")]
  1315. NSString SchemeLemma { get; }
  1316. [Field ("NSLinguisticTagSchemeLanguage")]
  1317. NSString SchemeLanguage { get; }
  1318. [Field ("NSLinguisticTagSchemeScript")]
  1319. NSString SchemeScript { get; }
  1320. [Field ("NSLinguisticTagWord")]
  1321. NSString Word { get; }
  1322. [Field ("NSLinguisticTagPunctuation")]
  1323. NSString Punctuation { get; }
  1324. [Field ("NSLinguisticTagWhitespace")]
  1325. NSString Whitespace { get; }
  1326. [Field ("NSLinguisticTagOther")]
  1327. NSString Other { get; }
  1328. [Field ("NSLinguisticTagNoun")]
  1329. NSString Noun { get; }
  1330. [Field ("NSLinguisticTagVerb")]
  1331. NSString Verb { get; }
  1332. [Field ("NSLinguisticTagAdjective")]
  1333. NSString Adjective { get; }
  1334. [Field ("NSLinguisticTagAdverb")]
  1335. NSString Adverb { get; }
  1336. [Field ("NSLinguisticTagPronoun")]
  1337. NSString Pronoun { get; }
  1338. [Field ("NSLinguisticTagDeterminer")]
  1339. NSString Determiner { get; }
  1340. [Field ("NSLinguisticTagParticle")]
  1341. NSString Particle { get; }
  1342. [Field ("NSLinguisticTagPreposition")]
  1343. NSString Preposition { get; }
  1344. [Field ("NSLinguisticTagNumber")]
  1345. NSString Number { get; }
  1346. [Field ("NSLinguisticTagConjunction")]
  1347. NSString Conjunction { get; }
  1348. [Field ("NSLinguisticTagInterjection")]
  1349. NSString Interjection { get; }
  1350. [Field ("NSLinguisticTagClassifier")]
  1351. NSString Classifier { get; }
  1352. [Field ("NSLinguisticTagIdiom")]
  1353. NSString Idiom { get; }
  1354. [Field ("NSLinguisticTagOtherWord")]
  1355. NSString OtherWord { get; }
  1356. [Field ("NSLinguisticTagSentenceTerminator")]
  1357. NSString SentenceTerminator { get; }
  1358. [Field ("NSLinguisticTagOpenQuote")]
  1359. NSString OpenQuote { get; }
  1360. [Field ("NSLinguisticTagCloseQuote")]
  1361. NSString CloseQuote { get; }
  1362. [Field ("NSLinguisticTagOpenParenthesis")]
  1363. NSString OpenParenthesis { get; }
  1364. [Field ("NSLinguisticTagCloseParenthesis")]
  1365. NSString CloseParenthesis { get; }
  1366. [Field ("NSLinguisticTagWordJoiner")]
  1367. NSString WordJoiner { get; }
  1368. [Field ("NSLinguisticTagDash")]
  1369. NSString Dash { get; }
  1370. [Field ("NSLinguisticTagOtherPunctuation")]
  1371. NSString OtherPunctuation { get; }
  1372. [Field ("NSLinguisticTagParagraphBreak")]
  1373. NSString ParagraphBreak { get; }
  1374. [Field ("NSLinguisticTagOtherWhitespace")]
  1375. NSString OtherWhitespace { get; }
  1376. [Field ("NSLinguisticTagPersonalName")]
  1377. NSString PersonalName { get; }
  1378. [Field ("NSLinguisticTagPlaceName")]
  1379. NSString PlaceName { get; }
  1380. [Field ("NSLinguisticTagOrganizationName")]
  1381. NSString OrganizationName { get; }
  1382. }
  1383. [BaseType (typeof (NSObject))]
  1384. // 'init' returns NIL so it's not usable evenif it does not throw an ObjC exception
  1385. [DisableDefaultCtor]
  1386. public interface NSLocale {
  1387. [Static]
  1388. [Export ("systemLocale")]
  1389. NSLocale SystemLocale { get; }
  1390. [Static]
  1391. [Export ("currentLocale")]
  1392. NSLocale CurrentLocale { get; }
  1393. [Static]
  1394. [Export ("autoupdatingCurrentLocale")]
  1395. NSLocale AutoUpdatingCurrentLocale { get; }
  1396. [Export ("initWithLocaleIdentifier:")]
  1397. IntPtr Constructor (string identifier);
  1398. [Export ("localeIdentifier")]
  1399. string LocaleIdentifier { get; }
  1400. [Export ("availableLocaleIdentifiers")][Static]
  1401. string [] AvailableLocaleIdentifiers { get; }
  1402. [Export ("ISOLanguageCodes")][Static]
  1403. string [] ISOLanguageCodes { get; }
  1404. [Export ("ISOCurrencyCodes")][Static]
  1405. string [] ISOCurrencyCodes { get; }
  1406. [Export ("ISOCountryCodes")][Static]
  1407. string [] ISOCountryCodes { get; }
  1408. [Export ("commonISOCurrencyCodes")][Static]
  1409. string [] CommonISOCurrencyCodes { get; }
  1410. [Export ("preferredLanguages")][Static]
  1411. string [] PreferredLanguages { get; }
  1412. [Export ("componentsFromLocaleIdentifier:")][Static]
  1413. NSDictionary ComponentsFromLocaleIdentifier (string identifier);
  1414. [Export ("localeIdentifierFromComponents:")][Static]
  1415. string LocaleIdentifierFromComponents (NSDictionary dict);
  1416. [Export ("canonicalLanguageIdentifierFromString:")][Static]
  1417. string CanonicalLanguageIdentifierFromString (string str);
  1418. [Export ("canonicalLocaleIdentifierFromString:")][Static]
  1419. string CanonicalLocaleIdentifierFromString (string str);
  1420. [Export ("characterDirectionForLanguage:")][Static]
  1421. NSLocaleLanguageDirection GetCharacterDirection (string isoLanguageCode);
  1422. [Export ("lineDirectionForLanguage:")][Static]
  1423. NSLocaleLanguageDirection GetLineDirection (string isoLanguageCode);
  1424. [Field ("NSCurrentLocaleDidChangeNotification")]
  1425. [Notification]
  1426. NSString CurrentLocaleDidChangeNotification { get; }
  1427. [Export ("objectForKey:"), Internal]
  1428. NSObject ObjectForKey (NSString key);
  1429. [Export ("displayNameForKey:value:"), Internal]
  1430. NSString DisplayNameForKey (NSString key, string value);
  1431. [Internal, Field ("NSLocaleIdentifier")]
  1432. NSString _Identifier { get; }
  1433. [Internal, Field ("NSLocaleLanguageCode")]
  1434. NSString _LanguageCode { get; }
  1435. [Internal, Field ("NSLocaleCountryCode")]
  1436. NSString _CountryCode { get; }
  1437. [Internal, Field ("NSLocaleScriptCode")]
  1438. NSString _ScriptCode { get; }
  1439. [Internal, Field ("NSLocaleVariantCode")]
  1440. NSString _VariantCode { get; }
  1441. [Internal, Field ("NSLocaleExemplarCharacterSet")]
  1442. NSString _ExemplarCharacterSet { get; }
  1443. [Internal, Field ("NSLocaleCalendar")]
  1444. NSString _Calendar { get; }
  1445. [Internal, Field ("NSLocaleCollationIdentifier")]
  1446. NSString _CollationIdentifier { get; }
  1447. [Internal, Field ("NSLocaleUsesMetricSystem")]
  1448. NSString _UsesMetricSystem { get; }
  1449. [Internal, Field ("NSLocaleMeasurementSystem")]
  1450. NSString _MeasurementSystem { get; }
  1451. [Internal, Field ("NSLocaleDecimalSeparator")]
  1452. NSString _DecimalSeparator { get; }
  1453. [Internal, Field ("NSLocaleGroupingSeparator")]
  1454. NSString _GroupingSeparator { get; }
  1455. [Internal, Field ("NSLocaleCurrencySymbol")]
  1456. NSString _CurrencySymbol { get; }
  1457. [Internal, Field ("NSLocaleCurrencyCode")]
  1458. NSString _CurrencyCode { get; }
  1459. [Internal, Field ("NSLocaleCollatorIdentifier")]
  1460. NSString _CollatorIdentifier { get; }
  1461. [Internal, Field ("NSLocaleQuotationBeginDelimiterKey")]
  1462. NSString _QuotationBeginDelimiterKey { get; }
  1463. [Internal, Field ("NSLocaleQuotationEndDelimiterKey")]
  1464. NSString _QuotationEndDelimiterKey { get; }
  1465. [Internal, Field ("NSLocaleAlternateQuotationBeginDelimiterKey")]
  1466. NSString _AlternateQuotationBeginDelimiterKey { get; }
  1467. [Internal, Field ("NSLocaleAlternateQuotationEndDelimiterKey")]
  1468. NSString _AlternateQuotationEndDelimiterKey { get; }
  1469. }
  1470. [BaseType (typeof (NSObject))]
  1471. // init returns NIL
  1472. [DisableDefaultCtor]
  1473. public interface NSRunLoop {
  1474. [Export ("currentRunLoop")][Static][IsThreadStatic]
  1475. NSRunLoop Current { get; }
  1476. [Export ("mainRunLoop")][Static]
  1477. NSRunLoop Main { get; }
  1478. [Export ("currentMode")]
  1479. NSString CurrentMode { get; }
  1480. [Export ("getCFRunLoop")]
  1481. CFRunLoop GetCFRunLoop ();
  1482. [Export ("addTimer:forMode:")]
  1483. void AddTimer (NSTimer timer, NSString forMode);
  1484. [Export ("limitDateForMode:")]
  1485. NSDate LimitDateForMode (NSString mode);
  1486. [Export ("acceptInputForMode:beforeDate:")]
  1487. void AcceptInputForMode (NSString mode, NSDate limitDate);
  1488. [Export ("run")]
  1489. void Run ();
  1490. [Export ("runUntilDate:")]
  1491. void RunUntil (NSDate date);
  1492. [Export ("runMode:beforeDate:")]
  1493. bool RunUntil (NSString runLoopMode, NSDate limitdate);
  1494. [Field ("NSDefaultRunLoopMode")]
  1495. NSString NSDefaultRunLoopMode { get; }
  1496. [Field ("NSRunLoopCommonModes")]
  1497. NSString NSRunLoopCommonModes { get; }
  1498. #if MONOMAC
  1499. [Field ("NSConnectionReplyMode")]
  1500. NSString NSRunLoopConnectionReplyMode { get; }
  1501. [Field ("NSModalPanelRunLoopMode", "AppKit")]
  1502. NSString NSRunLoopModalPanelMode { get; }
  1503. [Field ("NSEventTrackingRunLoopMode", "AppKit")]
  1504. NSString NSRunLoopEventTracking { get; }
  1505. #else
  1506. [Field ("UITrackingRunLoopMode", "UIKit")]
  1507. NSString UITrackingRunLoopMode { get; }
  1508. #endif
  1509. }
  1510. [BaseType (typeof (NSObject))]
  1511. public interface NSSet {
  1512. [Export ("set")][Static]
  1513. NSSet CreateSet ();
  1514. [Export ("initWithSet:")]
  1515. IntPtr Constructor (NSSet other);
  1516. [Export ("initWithArray:")]
  1517. IntPtr Constructor (NSArray other);
  1518. [Export ("count")]
  1519. uint Count { get; }
  1520. [Export ("anyObject")]
  1521. NSObject AnyObject { get; }
  1522. [Export ("containsObject:")]
  1523. bool Contains (NSObject id);
  1524. [Export ("allObjects")][Internal]
  1525. IntPtr _AllObjects ();
  1526. [Export ("isEqualToSet:")]
  1527. bool IsEqualToSet (NSSet other);
  1528. [Export ("objectEnumerator"), Internal]
  1529. NSEnumerator _GetEnumerator ();
  1530. [Export ("isSubsetOfSet:")]
  1531. bool IsSubsetOf (NSSet other);
  1532. [Export ("enumerateObjectsUsingBlock:")]
  1533. [Since (4,0)]
  1534. void Enumerate (NSSetEnumerator enumerator);
  1535. [Export ("setByAddingObjectsFromSet:"), Internal]
  1536. NSSet SetByAddingObjectsFromSet (NSSet other);
  1537. [Export ("intersectsSet:")]
  1538. bool IntersectsSet (NSSet other);
  1539. }
  1540. [BaseType (typeof (NSObject))]
  1541. public interface NSSortDescriptor {
  1542. [Export ("initWithKey:ascending:")]
  1543. IntPtr Constructor (string key, bool ascending);
  1544. [Export ("initWithKey:ascending:selector:")]
  1545. IntPtr Constructor (string key, bool ascending, Selector selector);
  1546. [Export ("key")]
  1547. string Key { get; }
  1548. [Export ("ascending")]
  1549. bool Ascending { get; }
  1550. [Export ("selector")]
  1551. Selector Selector { get; }
  1552. [Export ("compareObject:toObject:")]
  1553. NSComparisonResult Compare (NSObject object1, NSObject object2);
  1554. [Export ("reversedSortDescriptor")]
  1555. NSObject ReversedSortDescriptor { get; }
  1556. }
  1557. [BaseType (typeof(NSObject))]
  1558. [Dispose ("if (disposing) { Invalidate (); } ")]
  1559. // init returns NIL
  1560. [DisableDefaultCtor]
  1561. public interface NSTimer {
  1562. // TODO: scheduledTimerWithTimeInterval:invocation:repeats:
  1563. [Static, Export ("scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:")]
  1564. NSTimer CreateScheduledTimer (double seconds, NSObject target, Selector selector, [NullAllowed] NSObject userInfo, bool repeats);
  1565. // TODO: timerWithTimeInterval:invocation:repeats:
  1566. [Static, Export ("timerWithTimeInterval:target:selector:userInfo:repeats:")]
  1567. NSTimer CreateTimer (double seconds, NSObject target, Selector selector, [NullAllowed] NSObject userInfo, bool repeats);
  1568. [Export ("initWithFireDate:interval:target:selector:userInfo:repeats:")]
  1569. IntPtr Constructor (NSDate date, double seconds, NSObject target, Selector selector, [NullAllowed] NSObject userInfo, bool repeats);
  1570. [Export ("fire")]
  1571. void Fire ();
  1572. [Export ("fireDate")]
  1573. NSDate FireDate { get; set; }
  1574. [Export ("invalidate")]
  1575. void Invalidate ();
  1576. [Export ("isValid")]
  1577. bool IsValid { get; }
  1578. [Export ("timeInterval")]
  1579. double TimeInterval { get; }
  1580. [Export ("userInfo")]
  1581. NSObject UserInfo { get; }
  1582. }
  1583. [BaseType (typeof(NSObject))]
  1584. // NSTimeZone is an abstract class that defines the behavior of time zone objects. -> http://developer.apple.com/library/ios/#documentation/Cocoa/Reference/Foundation/Classes/NSTimeZone_Class/Reference/Reference.html
  1585. // calling 'init' returns a NIL pointer, i.e. an unusable instance
  1586. [DisableDefaultCtor]
  1587. public interface NSTimeZone {
  1588. [Export ("initWithName:")]
  1589. IntPtr Constructor (string name);
  1590. [Export ("initWithName:data:")]
  1591. IntPtr Constructor (string name, NSData data);
  1592. [Export ("name")]
  1593. string Name { get; }
  1594. [Export ("data")]
  1595. NSData Data { get; }
  1596. [Export ("secondsFromGMTForDate:")]
  1597. int SecondsFromGMT (NSDate date);
  1598. [Export ("abbreviationForDate:")]
  1599. string Abbreviation (NSDate date);
  1600. [Export ("isDaylightSavingTimeForDate:")]
  1601. bool IsDaylightSavingsTime (NSDate date);
  1602. [Export ("daylightSavingTimeOffsetForDate:")]
  1603. double DaylightSavingTimeOffset (NSDate date);
  1604. [Export ("nextDaylightSavingTimeTransitionAfterDate:")]
  1605. NSDate NextDaylightSavingTimeTransitionAfter (NSDate date);
  1606. [Static, Export ("timeZoneWithName:")]
  1607. NSTimeZone FromName (string tzName);
  1608. [Static, Export ("timeZoneWithName:data:")]
  1609. NSTimeZone FromName (string tzName, NSData data);
  1610. [Static, Export ("localTimeZone")]
  1611. NSTimeZone LocalTimeZone { get; }
  1612. [Export ("secondsFromGMT")]
  1613. int GetSecondsFromGMT { get; }
  1614. [Export ("defaultTimeZone"), Static]
  1615. NSTimeZone DefaultTimeZone { get; set; }
  1616. [Export ("resetSystemTimeZone"), Static]
  1617. void ResetSystemTimeZone ();
  1618. [Export ("systemTimeZone"), Static]
  1619. NSTimeZone SystemTimeZone { get; }
  1620. [Export ("timeZoneWithAbbreviation:"), Static]
  1621. NSTimeZone FromAbbreviation (string abbreviation);
  1622. [Export ("knownTimeZoneNames"), Static, Internal]
  1623. string[] _KnownTimeZoneNames { get; }
  1624. [Export ("timeZoneDataVersion"), Static]
  1625. string DataVersion { get; }
  1626. }
  1627. interface NSUbiquitousKeyValueStoreChangeEventArgs {
  1628. [Export ("NSUbiquitousKeyValueStoreChangedKeysKey")]
  1629. string [] ChangedKeys { get; }
  1630. [Export ("NSUbiquitousKeyValueStoreChangeReasonKey")]
  1631. NSUbiquitousKeyValueStoreChangeReason ChangeReason { get; }
  1632. }
  1633. [BaseType (typeof (NSObject))]
  1634. interface NSUbiquitousKeyValueStore {
  1635. [Static]
  1636. [Export ("defaultStore")]
  1637. NSUbiquitousKeyValueStore DefaultStore { get; }
  1638. [Export ("objectForKey:"), Internal]
  1639. NSObject ObjectForKey (string aKey);
  1640. [Export ("setObject:forKey:"), Internal]
  1641. void SetObjectForKey (NSObject anObject, string aKey);
  1642. [Export ("removeObjectForKey:")]
  1643. void Remove (string aKey);
  1644. [Export ("stringForKey:")]
  1645. string GetString (string aKey);
  1646. [Export ("arrayForKey:")]
  1647. NSObject [] GetArray (string aKey);
  1648. [Export ("dictionaryForKey:")]
  1649. NSDictionary GetDictionary (string aKey);
  1650. [Export ("dataForKey:")]
  1651. NSData GetData (string aKey);
  1652. [Export ("longLongForKey:")]
  1653. long GetLong (string aKey);
  1654. [Export ("doubleForKey:")]
  1655. double GetDouble (string aKey);
  1656. [Export ("boolForKey:")]
  1657. bool GetBool (string aKey);
  1658. [Export ("setString:forKey:"), Internal]
  1659. void _SetString (string aString, string aKey);
  1660. [Export ("setData:forKey:"), Internal]
  1661. void _SetData (NSData data, string key);
  1662. [Export ("setArray:forKey:"), Internal]
  1663. void _SetArray (NSObject [] array, string key);
  1664. [Export ("setDictionary:forKey:"), Internal]
  1665. void _SetDictionary (NSDictionary aDictionary, string aKey);
  1666. [Export ("setLongLong:forKey:"), Internal]
  1667. void _SetLong (long value, string aKey);
  1668. [Export ("setDouble:forKey:"), Internal]
  1669. void _SetDouble (double value, string aKey);
  1670. [Export ("setBool:forKey:"), Internal]
  1671. void _SetBool (bool value, string aKey);
  1672. [Export ("dictionaryRepresentation")]
  1673. NSDictionary DictionaryRepresentation ();
  1674. [Export ("synchronize")]
  1675. bool Synchronize ();
  1676. [Field ("NSUbiquitousKeyValueStoreDidChangeExternallyNotification")]
  1677. [Notification (typeof (NSUbiquitousKeyValueStoreChangeEventArgs))]
  1678. NSString DidChangeExternallyNotification { get; }
  1679. [Field ("NSUbiquitousKeyValueStoreChangeReasonKey")]
  1680. NSString ChangeReasonKey { get; }
  1681. [Field ("NSUbiquitousKeyValueStoreChangedKeysKey")]
  1682. NSString ChangedKeysKey { get; }
  1683. }
  1684. [BaseType (typeof (NSObject), Name="NSUUID")]
  1685. public interface NSUuid {
  1686. [Export ("initWithUUIDString:")]
  1687. IntPtr Constructor (string str);
  1688. // bound manually to keep the managed/native signatures identical
  1689. //[Export ("initWithUUIDBytes:"), Internal]
  1690. //IntPtr Constructor (IntPtr bytes, bool unused);
  1691. [Export ("getUUIDBytes:"), Internal]
  1692. void GetUuidBytes (IntPtr uuid);
  1693. [Export ("UUIDString")]
  1694. string AsString ();
  1695. }
  1696. [BaseType (typeof (NSObject))]
  1697. public interface NSUserDefaults {
  1698. [Static]
  1699. [Export ("standardUserDefaults")]
  1700. NSUserDefaults StandardUserDefaults { get; }
  1701. [Static]
  1702. [Export ("resetStandardUserDefaults")]
  1703. void ResetStandardUserDefaults ();
  1704. [Export ("initWithUser:")]
  1705. IntPtr Constructor (string username);
  1706. [Export ("objectForKey:")][Internal]
  1707. NSObject ObjectForKey (string defaultName);
  1708. [Export ("setObject:forKey:")][Internal]
  1709. void SetObjectForKey (NSObject value, string defaultName);
  1710. [Export ("removeObjectForKey:")]
  1711. void RemoveObject (string defaultName);
  1712. [Export ("stringForKey:")]
  1713. string StringForKey (string defaultName);
  1714. [Export ("arrayForKey:")]
  1715. NSObject [] ArrayForKey (string defaultName);
  1716. [Export ("dictionaryForKey:")]
  1717. NSDictionary DictionaryForKey (string defaultName);
  1718. [Export ("dataForKey:")]
  1719. NSData DataForKey (string defaultName);
  1720. [Export ("stringArrayForKey:")]
  1721. string [] StringArrayForKey (string defaultName);
  1722. [Export ("integerForKey:")]
  1723. int IntForKey (string defaultName);
  1724. [Export ("floatForKey:")]
  1725. float FloatForKey (string defaultName);
  1726. [Export ("doubleForKey:")]
  1727. double DoubleForKey (string defaultName);
  1728. [Export ("boolForKey:")]
  1729. bool BoolForKey (string defaultName);
  1730. [Export ("setInteger:forKey:")]
  1731. void SetInt (int value, string defaultName);
  1732. [Export ("setFloat:forKey:")]
  1733. void SetFloat (float value, string defaultName);
  1734. [Export ("setDouble:forKey:")]
  1735. void SetDouble (double value, string defaultName);
  1736. [Export ("setBool:forKey:")]
  1737. void SetBool (bool value, string defaultName);
  1738. [Export ("registerDefaults:")]
  1739. void RegisterDefaults (NSDictionary registrationDictionary);
  1740. [Export ("addSuiteNamed:")]
  1741. void AddSuite (string suiteName);
  1742. [Export ("removeSuiteNamed:")]
  1743. void RemoveSuite (string suiteName);
  1744. [Export ("dictionaryRepresentation")]
  1745. NSDictionary AsDictionary ();
  1746. [Export ("volatileDomainNames")]
  1747. string [] VolatileDomainNames ();
  1748. [Export ("volatileDomainForName:")]
  1749. NSDictionary GetVolatileDomain (string domainName);
  1750. [Export ("setVolatileDomain:forName:")]
  1751. void SetVolatileDomain (NSDictionary domain, string domainName);
  1752. [Export ("removeVolatileDomainForName:")]
  1753. void RemoveVolatileDomain (string domainName);
  1754. [Export ("persistentDomainNames")]
  1755. string [] PersistentDomainNames ();
  1756. [Export ("persistentDomainForName:")]
  1757. NSDictionary PersistentDomainForName (string domainName);
  1758. [Export ("setPersistentDomain:forName:")]
  1759. void SetPersistentDomain (NSDictionary domain, string domainName);
  1760. [Export ("removePersistentDomainForName:")]
  1761. void RemovePersistentDomain (string domainName);
  1762. [Export ("synchronize")]
  1763. bool Synchronize ();
  1764. [Export ("objectIsForcedForKey:")]
  1765. bool ObjectIsForced (string key);
  1766. [Export ("objectIsForcedForKey:inDomain:")]
  1767. bool ObjectIsForced (string key, string domain);
  1768. [Field ("NSGlobalDomain")]
  1769. NSString GlobalDomain { get; }
  1770. [Field ("NSArgumentDomain")]
  1771. NSString ArgumentDomain { get; }
  1772. [Field ("NSRegistrationDomain")]
  1773. NSString RegistrationDomain { get; }
  1774. }
  1775. [BaseType (typeof (NSObject), Name="NSURL")]
  1776. // init returns NIL
  1777. [DisableDefaultCtor]
  1778. public interface NSUrl {
  1779. [Export ("initWithScheme:host:path:")]
  1780. IntPtr Constructor (string scheme, string host, string path);
  1781. [Export ("initFileURLWithPath:isDirectory:")]
  1782. IntPtr Constructor (string path, bool isDir);
  1783. [Export ("initWithString:")]
  1784. IntPtr Constructor (string path);
  1785. [Export ("initWithString:relativeToURL:")]
  1786. IntPtr Constructor (string path, NSUrl relativeToUrl);
  1787. [Export ("URLWithString:")][Static]
  1788. NSUrl FromString (string s);
  1789. [Export ("URLWithString:relativeToURL:")][Internal][Static]
  1790. NSUrl _FromStringRelative (string url, NSUrl relative);
  1791. [Export ("absoluteString")]
  1792. string AbsoluteString { get; }
  1793. [Export ("absoluteURL")]
  1794. NSUrl AbsoluteUrl { get; }
  1795. [Export ("baseURL")]
  1796. NSUrl BaseUrl { get; }
  1797. [Export ("fragment")]
  1798. string Fragment { get; }
  1799. [Export ("host")]
  1800. string Host { get; }
  1801. [Export ("isEqual:")]
  1802. bool IsEqual (NSUrl other);
  1803. [Export ("isFileURL")]
  1804. bool IsFileUrl { get; }
  1805. [Export ("parameterString")]
  1806. string ParameterString { get;}
  1807. [Export ("password")]
  1808. string Password { get;}
  1809. [Export ("path")]
  1810. string Path { get;}
  1811. [Export ("query")]
  1812. string Query { get;}
  1813. [Export ("relativePath")]
  1814. string RelativePath { get;}
  1815. [Export ("relativeString")]
  1816. string RelativeString { get;}
  1817. [Export ("resourceSpecifier")]
  1818. string ResourceSpecifier { get;}
  1819. [Export ("scheme")]
  1820. string Scheme { get;}
  1821. [Export ("user")]
  1822. string User { get;}
  1823. [Export ("standardizedURL")]
  1824. NSUrl StandardizedUrl { get; }
  1825. [Export ("URLByAppendingPathComponent:isDirectory:")]
  1826. NSUrl Append (string pathComponent, bool isDirectory);
  1827. #if MONOMAC && !MONOMAC_BOOTSTRAP
  1828. /* These methods come from NURL_AppKitAdditions */
  1829. [Export ("URLFromPasteboard:")]
  1830. [Static]
  1831. NSUrl FromPasteboard (NSPasteboard pasteboard);
  1832. [Export ("writeToPasteboard:")]
  1833. void WriteToPasteboard (NSPasteboard pasteboard);
  1834. [Export("bookmarkDataWithContentsOfURL:error:")]
  1835. [Static]
  1836. NSData GetBookmarkData (NSUrl bookmarkFileUrl, out NSError error);
  1837. [Export("URLByResolvingBookmarkData:options:relativeToURL:bookmarkDataIsStale:error:")]
  1838. [Static]
  1839. NSUrl FromBookmarkData (NSData data, NSUrlBookmarkResolutionOptions options, [NullAllowed] NSUrl relativeToUrl, out bool isStale, out NSError error);
  1840. [Export("writeBookmarkData:toURL:options:error:")]
  1841. [Static]
  1842. bool WriteBookmarkData (NSData data, NSUrl bookmarkFileUrl, NSUrlBookmarkCreationOptions options, out NSError error);
  1843. [Export("startAccessingSecurityScopedResource")]
  1844. bool StartAccessingSecurityScopedResource();
  1845. [Export("stopAccessingSecurityScopedResource")]
  1846. void StopAccessingSecurityScopedResource();
  1847. [Export("filePathURL")]
  1848. NSUrl FilePathUrl { get; }
  1849. [Export("fileReferenceURL")]
  1850. NSUrl FileReferenceUrl { get; }
  1851. #endif
  1852. [Export ("getResourceValue:forKey:error:"), Internal]
  1853. bool GetResourceValue (out NSObject value, string key, out NSError error);
  1854. [Export ("resourceValuesForKeys:error:")]
  1855. NSDictionary GetResourceValues (NSString [] keys, out NSError error);
  1856. [Export ("setResourceValue:forKey:error:"), Internal]
  1857. bool SetResourceValue (NSObject value, string key, out NSError error);
  1858. //[Export ("port")]
  1859. //NSNumber Port { get;}
  1860. [Field ("NSURLNameKey")]
  1861. NSString NameKey { get; }
  1862. [Field ("NSURLLocalizedNameKey")]
  1863. NSString LocalizedNameKey { get; }
  1864. [Field ("NSURLIsRegularFileKey")]
  1865. NSString IsRegularFileKey { get; }
  1866. [Field ("NSURLIsDirectoryKey")]
  1867. NSString IsDirectoryKey { get; }
  1868. [Field ("NSURLIsSymbolicLinkKey")]
  1869. NSString IsSymbolicLinkKey { get; }
  1870. [Field ("NSURLIsVolumeKey")]
  1871. NSString IsVolumeKey { get; }
  1872. [Field ("NSURLIsPackageKey")]
  1873. NSString IsPackageKey { get; }
  1874. [Field ("NSURLIsSystemImmutableKey")]
  1875. NSString IsSystemImmutableKey { get; }
  1876. [Field ("NSURLIsUserImmutableKey")]
  1877. NSString IsUserImmutableKey { get; }
  1878. [Field ("NSURLIsHiddenKey")]
  1879. NSString IsHiddenKey { get; }
  1880. [Field ("NSURLHasHiddenExtensionKey")]
  1881. NSString HasHiddenExtensionKey { get; }
  1882. [Field ("NSURLCreationDateKey")]
  1883. NSString CreationDateKey { get; }
  1884. [Field ("NSURLContentAccessDateKey")]
  1885. NSString ContentAccessDateKey { get; }
  1886. [Field ("NSURLContentModificationDateKey")]
  1887. NSString ContentModificationDateKey { get; }
  1888. [Field ("NSURLAttributeModificationDateKey")]
  1889. NSString AttributeModificationDateKey { get; }
  1890. [Field ("NSURLLinkCountKey")]
  1891. NSString LinkCountKey { get; }
  1892. [Field ("NSURLParentDirectoryURLKey")]
  1893. NSString ParentDirectoryURLKey { get; }
  1894. [Field ("NSURLVolumeURLKey")]
  1895. NSString VolumeURLKey { get; }
  1896. [Field ("NSURLTypeIdentifierKey")]
  1897. NSString TypeIdentifierKey { get; }
  1898. [Field ("NSURLLocalizedTypeDescriptionKey")]
  1899. NSString LocalizedTypeDescriptionKey { get; }
  1900. [Field ("NSURLLabelNumberKey")]
  1901. NSString LabelNumberKey { get; }
  1902. [Field ("NSURLLabelColorKey")]
  1903. NSString LabelColorKey { get; }
  1904. [Field ("NSURLLocalizedLabelKey")]
  1905. NSString LocalizedLabelKey { get; }
  1906. [Field ("NSURLEffectiveIconKey")]
  1907. NSString EffectiveIconKey { get; }
  1908. [Field ("NSURLCustomIconKey")]
  1909. NSString CustomIconKey { get; }
  1910. [Field ("NSURLFileSizeKey")]
  1911. NSString FileSizeKey { get; }
  1912. [Field ("NSURLFileAllocatedSizeKey")]
  1913. NSString FileAllocatedSizeKey { get; }
  1914. [Field ("NSURLIsAliasFileKey")]
  1915. NSString IsAliasFileKey { get; }
  1916. [Field ("NSURLVolumeLocalizedFormatDescriptionKey")]
  1917. NSString VolumeLocalizedFormatDescriptionKey { get; }
  1918. [Field ("NSURLVolumeTotalCapacityKey")]
  1919. NSString VolumeTotalCapacityKey { get; }
  1920. [Field ("NSURLVolumeAvailableCapacityKey")]
  1921. NSString VolumeAvailableCapacityKey { get; }
  1922. [Field ("NSURLVolumeResourceCountKey")]
  1923. NSString VolumeResourceCountKey { get; }
  1924. [Field ("NSURLVolumeSupportsPersistentIDsKey")]
  1925. NSString VolumeSupportsPersistentIDsKey { get; }
  1926. [Field ("NSURLVolumeSupportsSymbolicLinksKey")]
  1927. NSString VolumeSupportsSymbolicLinksKey { get; }
  1928. [Field ("NSURLVolumeSupportsHardLinksKey")]
  1929. NSString VolumeSupportsHardLinksKey { get; }
  1930. [Field ("NSURLVolumeSupportsJournalingKey")]
  1931. NSString VolumeSupportsJournalingKey { get; }
  1932. [Field ("NSURLVolumeIsJournalingKey")]
  1933. NSString VolumeIsJournalingKey { get; }
  1934. [Field ("NSURLVolumeSupportsSparseFilesKey")]
  1935. NSString VolumeSupportsSparseFilesKey { get; }
  1936. [Field ("NSURLVolumeSupportsZeroRunsKey")]
  1937. NSString VolumeSupportsZeroRunsKey { get; }
  1938. [Field ("NSURLVolumeSupportsCaseSensitiveNamesKey")]
  1939. NSString VolumeSupportsCaseSensitiveNamesKey { get; }
  1940. [Field ("NSURLVolumeSupportsCasePreservedNamesKey")]
  1941. NSString VolumeSupportsCasePreservedNamesKey { get; }
  1942. // 5.0 Additions
  1943. [Since (5,0)]
  1944. [Field ("NSURLKeysOfUnsetValuesKey")]
  1945. NSString KeysOfUnsetValuesKey { get; }
  1946. [Since (5,0)]
  1947. [Field ("NSURLFileResourceIdentifierKey")]
  1948. NSString FileResourceIdentifierKey { get; }
  1949. [Since (5,0)]
  1950. [Field ("NSURLVolumeIdentifierKey")]
  1951. NSString VolumeIdentifierKey { get; }
  1952. [Since (5,0)]
  1953. [Field ("NSURLPreferredIOBlockSizeKey")]
  1954. NSString PreferredIOBlockSizeKey { get; }
  1955. [Since (5,0)]
  1956. [Field ("NSURLIsReadableKey")]
  1957. NSString IsReadableKey { get; }
  1958. [Since (5,0)]
  1959. [Field ("NSURLIsWritableKey")]
  1960. NSString IsWritableKey { get; }
  1961. [Since (5,0)]
  1962. [Field ("NSURLIsExecutableKey")]
  1963. NSString IsExecutableKey { get; }
  1964. [Since (5,0)]
  1965. [Field ("NSURLIsMountTriggerKey")]
  1966. NSString IsMountTriggerKey { get; }
  1967. [Since (5,0)]
  1968. [Field ("NSURLFileSecurityKey")]
  1969. NSString FileSecurityKey { get; }
  1970. [Since (5,0)]
  1971. [Field ("NSURLFileResourceTypeKey")]
  1972. NSString FileResourceTypeKey { get; }
  1973. [Since (5,0)]
  1974. [Field ("NSURLFileResourceTypeNamedPipe")]
  1975. NSString FileResourceTypeNamedPipe { get; }
  1976. [Since (5,0)]
  1977. [Field ("NSURLFileResourceTypeCharacterSpecial")]
  1978. NSString FileResourceTypeCharacterSpecial { get; }
  1979. [Since (5,0)]
  1980. [Field ("NSURLFileResourceTypeDirectory")]
  1981. NSString FileResourceTypeDirectory { get; }
  1982. [Since (5,0)]
  1983. [Field ("NSURLFileResourceTypeBlockSpecial")]
  1984. NSString FileResourceTypeBlockSpecial { get; }
  1985. [Since (5,0)]
  1986. [Field ("NSURLFileResourceTypeRegular")]
  1987. NSString FileResourceTypeRegular { get; }
  1988. [Since (5,0)]
  1989. [Field ("NSURLFileResourceTypeSymbolicLink")]
  1990. NSString FileResourceTypeSymbolicLink { get; }
  1991. [Since (5,0)]
  1992. [Field ("NSURLFileResourceTypeSocket")]
  1993. NSString FileResourceTypeSocket { get; }
  1994. [Since (5,0)]
  1995. [Field ("NSURLFileResourceTypeUnknown")]
  1996. NSString FileResourceTypeUnknown { get; }
  1997. [Since (5,0)]
  1998. [Field ("NSURLTotalFileSizeKey")]
  1999. NSString TotalFileSizeKey { get; }
  2000. [Since (5,0)]
  2001. [Field ("NSURLTotalFileAllocatedSizeKey")]
  2002. NSString TotalFileAllocatedSizeKey { get; }
  2003. [Since (5,0)]
  2004. [Field ("NSURLVolumeSupportsRootDirectoryDatesKey")]
  2005. NSString VolumeSupportsRootDirectoryDatesKey { get; }
  2006. [Since (5,0)]
  2007. [Field ("NSURLVolumeSupportsVolumeSizesKey")]
  2008. NSString VolumeSupportsVolumeSizesKey { get; }
  2009. [Since (5,0)]
  2010. [Field ("NSURLVolumeSupportsRenamingKey")]
  2011. NSString VolumeSupportsRenamingKey { get; }
  2012. [Since (5,0)]
  2013. [Field ("NSURLVolumeSupportsAdvisoryFileLockingKey")]
  2014. NSString VolumeSupportsAdvisoryFileLockingKey { get; }
  2015. [Since (5,0)]
  2016. [Field ("NSURLVolumeSupportsExtendedSecurityKey")]
  2017. NSString VolumeSupportsExtendedSecurityKey { get; }
  2018. [Since (5,0)]
  2019. [Field ("NSURLVolumeIsBrowsableKey")]
  2020. NSString VolumeIsBrowsableKey { get; }
  2021. [Since (5,0)]
  2022. [Field ("NSURLVolumeMaximumFileSizeKey")]
  2023. NSString VolumeMaximumFileSizeKey { get; }
  2024. [Since (5,0)]
  2025. [Field ("NSURLVolumeIsEjectableKey")]
  2026. NSString VolumeIsEjectableKey { get; }
  2027. [Since (5,0)]
  2028. [Field ("NSURLVolumeIsRemovableKey")]
  2029. NSString VolumeIsRemovableKey { get; }
  2030. [Since (5,0)]
  2031. [Field ("NSURLVolumeIsInternalKey")]
  2032. NSString VolumeIsInternalKey { get; }
  2033. [Since (5,0)]
  2034. [Field ("NSURLVolumeIsAutomountedKey")]
  2035. NSString VolumeIsAutomountedKey { get; }
  2036. [Since (5,0)]
  2037. [Field ("NSURLVolumeIsLocalKey")]
  2038. NSString VolumeIsLocalKey { get; }
  2039. [Since (5,0)]
  2040. [Field ("NSURLVolumeIsReadOnlyKey")]
  2041. NSString VolumeIsReadOnlyKey { get; }
  2042. [Since (5,0)]
  2043. [Field ("NSURLVolumeCreationDateKey")]
  2044. NSString VolumeCreationDateKey { get; }
  2045. [Since (5,0)]
  2046. [Field ("NSURLVolumeURLForRemountingKey")]
  2047. NSString VolumeURLForRemountingKey { get; }
  2048. [Since (5,0)]
  2049. [Field ("NSURLVolumeUUIDStringKey")]
  2050. NSString VolumeUUIDStringKey { get; }
  2051. [Since (5,0)]
  2052. [Field ("NSURLVolumeNameKey")]
  2053. NSString VolumeNameKey { get; }
  2054. [Since (5,0)]
  2055. [Field ("NSURLVolumeLocalizedNameKey")]
  2056. NSString VolumeLocalizedNameKey { get; }
  2057. [Since (5,0)]
  2058. [Field ("NSURLIsUbiquitousItemKey")]
  2059. NSString IsUbiquitousItemKey { get; }
  2060. [Since (5,0)]
  2061. [Field ("NSURLUbiquitousItemHasUnresolvedConflictsKey")]
  2062. NSString UbiquitousItemHasUnresolvedConflictsKey { get; }
  2063. [Since (5,0)]
  2064. [Field ("NSURLUbiquitousItemIsDownloadedKey")]
  2065. NSString UbiquitousItemIsDownloadedKey { get; }
  2066. [Since (5,0)]
  2067. [Field ("NSURLUbiquitousItemIsDownloadingKey")]
  2068. NSString UbiquitousItemIsDownloadingKey { get; }
  2069. [Since (5,0)]
  2070. [Field ("NSURLUbiquitousItemIsUploadedKey")]
  2071. NSString UbiquitousItemIsUploadedKey { get; }
  2072. [Since (5,0)]
  2073. [Field ("NSURLUbiquitousItemIsUploadingKey")]
  2074. NSString UbiquitousItemIsUploadingKey { get; }
  2075. [Since (5,0)]
  2076. [Field ("NSURLUbiquitousItemPercentDownloadedKey")]
  2077. [Obsolete ("Deprecated in iOS 6.0. Use NSMetadataQuery.UbiquitousItemPercentDownloadedKey on NSMetadataItem")]
  2078. NSString UbiquitousItemPercentDownloadedKey { get; }
  2079. [Since (5,0)]
  2080. [Obsolete ("Deprecated in iOS 6.0. Use NSMetadataQuery.NSMetadataUbiquitousItemPercentUploadedKey on NSMetadataItem")]
  2081. [Field ("NSURLUbiquitousItemPercentUploadedKey")]
  2082. NSString UbiquitousItemPercentUploadedKey { get; }
  2083. [Since (5,1)]
  2084. [MountainLion]
  2085. [Field ("NSURLIsExcludedFromBackupKey")]
  2086. NSString IsExcludedFromBackupKey { get; }
  2087. [Export ("bookmarkDataWithOptions:includingResourceValuesForKeys:relativeToURL:error:")]
  2088. NSData CreateBookmarkData (NSUrlBookmarkCreationOptions options, string [] resourceValues, [NullAllowed] NSUrl relativeUrl, out NSError error);
  2089. [Export ("initByResolvingBookmarkData:options:relativeToURL:bookmarkDataIsStale:error:")]
  2090. IntPtr Constructor (NSData bookmarkData, NSUrlBookmarkResolutionOptions resolutionOptions, [NullAllowed] NSUrl relativeUrl, out bool bookmarkIsStale, out NSError error);
  2091. [Field ("NSURLPathKey")]
  2092. [Since (6,0)][MountainLion]
  2093. NSString PathKey { get; }
  2094. }
  2095. [BaseType (typeof (NSObject), Name="NSURLCache")]
  2096. public interface NSUrlCache {
  2097. [Export ("sharedURLCache"), Static]
  2098. NSUrlCache SharedCache { get; set; }
  2099. [Export ("initWithMemoryCapacity:diskCapacity:diskPath:")]
  2100. IntPtr Constructor (uint memoryCapacity, uint diskCapacity, string diskPath);
  2101. [Export ("cachedResponseForRequest:")]
  2102. NSCachedUrlResponse CachedResponseForRequest (NSUrlRequest request);
  2103. [Export ("storeCachedResponse:forRequest:")]
  2104. void StoreCachedResponse (NSCachedUrlResponse cachedResponse, NSUrlRequest forRequest);
  2105. [Export ("removeCachedResponseForRequest:")]
  2106. void RemoveCachedResponse (NSUrlRequest request);
  2107. [Export ("removeAllCachedResponses")]
  2108. void RemoveAllCachedResponses ();
  2109. [Export ("memoryCapacity")]
  2110. uint MemoryCapacity { get; set; }
  2111. [Export ("diskCapacity")]
  2112. uint DiskCapacity { get; set; }
  2113. [Export ("currentMemoryUsage")]
  2114. uint CurrentMemoryUsage { get; }
  2115. [Export ("currentDiskUsage")]
  2116. uint CurrentDiskUsage { get; }
  2117. }
  2118. [BaseType (typeof (NSObject), Name="NSURLAuthenticationChallenge")]
  2119. // 'init' returns NIL
  2120. [DisableDefaultCtor]
  2121. public interface NSUrlAuthenticationChallenge {
  2122. [Export ("initWithProtectionSpace:proposedCredential:previousFailureCount:failureResponse:error:sender:")]
  2123. IntPtr Constructor (NSUrlProtectionSpace space, NSUrlCredential credential, int previousFailureCount, NSUrlResponse response, [NullAllowed] NSError error, NSUrlConnection sender);
  2124. [Export ("initWithAuthenticationChallenge:sender:")]
  2125. IntPtr Constructor (NSUrlAuthenticationChallenge challenge, NSUrlConnection sender);
  2126. [Export ("protectionSpace")]
  2127. NSUrlProtectionSpace ProtectionSpace { get; }
  2128. [Export ("proposedCredential")]
  2129. NSUrlCredential ProposedCredential { get; }
  2130. [Export ("previousFailureCount")]
  2131. int PreviousFailureCount { get; }
  2132. [Export ("failureResponse")]
  2133. NSUrlResponse FailureResponse { get; }
  2134. [Export ("error")]
  2135. NSError Error { get; }
  2136. [Export ("sender")]
  2137. NSUrlConnection Sender { get; }
  2138. }
  2139. public delegate void NSUrlConnectionDataResponse (NSUrlResponse response, NSData data, NSError error);
  2140. [BaseType (typeof (NSObject), Name="NSURLConnection")]
  2141. public interface NSUrlConnection {
  2142. [Export ("canHandleRequest:")][Static]
  2143. bool CanHandleRequest (NSUrlRequest request);
  2144. [Export ("connectionWithRequest:delegate:")][Static]
  2145. NSUrlConnection FromRequest (NSUrlRequest request, NSUrlConnectionDelegate connectionDelegate);
  2146. [Export ("initWithRequest:delegate:")]
  2147. IntPtr Constructor (NSUrlRequest request, NSUrlConnectionDelegate connectionDelegate);
  2148. [Export ("initWithRequest:delegate:startImmediately:")]
  2149. IntPtr Constructor (NSUrlRequest request, NSUrlConnectionDelegate connectionDelegate, bool startImmediately);
  2150. [Export ("start")]
  2151. void Start ();
  2152. [Export ("cancel")]
  2153. void Cancel ();
  2154. [Export ("scheduleInRunLoop:forMode:")]
  2155. void Schedule (NSRunLoop aRunLoop, NSString forMode);
  2156. [Export ("unscheduleFromRunLoop:forMode:")]
  2157. void Unschedule (NSRunLoop aRunLoop, NSString forMode);
  2158. /* Adopted by the NSUrlAuthenticationChallengeSender protocol */
  2159. [Export ("useCredential:forAuthenticationChallenge:")]
  2160. void UseCredentials (NSUrlCredential credential, NSUrlAuthenticationChallenge challenge);
  2161. [Export ("continueWithoutCredentialForAuthenticationChallenge:")]
  2162. void ContinueWithoutCredentialForAuthenticationChallenge (NSUrlAuthenticationChallenge challenge);
  2163. [Export ("cancelAuthenticationChallenge:")]
  2164. void CancelAuthenticationChallenge (NSUrlAuthenticationChallenge challenge);
  2165. [Since (5,0)]
  2166. [Export ("performDefaultHandlingForAuthenticationChallenge:")]
  2167. void PerformDefaultHandlingForChallenge (NSUrlAuthenticationChallenge challenge);
  2168. [Since (5,0)]
  2169. [Export ("rejectProtectionSpaceAndContinueWithChallenge:")]
  2170. void RejectProtectionSpaceAndContinueWithChallenge (NSUrlAuthenticationChallenge challenge);
  2171. #if !MONOMAC
  2172. [Since (5,0)]
  2173. [Export ("originalRequest")]
  2174. NSUrlRequest OriginalRequest { get; }
  2175. [Since (5,0)]
  2176. [Export ("currentRequest")]
  2177. NSUrlRequest CurrentRequest { get; }
  2178. #endif
  2179. [Export ("setDelegateQueue:")]
  2180. [Since (5,0)]
  2181. void SetDelegateQueue (NSOperationQueue queue);
  2182. [Since (5,0)]
  2183. [Static]
  2184. [Export ("sendAsynchronousRequest:queue:completionHandler:")]
  2185. [Async (ResultTypeName = "NSUrlAsyncResult", MethodName="SendRequestAsync")]
  2186. void SendAsynchronousRequest (NSUrlRequest request, NSOperationQueue queue, NSUrlConnectionDataResponse completionHandler);
  2187. #if !MONOMAC
  2188. // Extension from iOS5, NewsstandKit
  2189. [Export ("newsstandAssetDownload")]
  2190. MonoTouch.NewsstandKit.NKAssetDownload NewsstandAssetDownload { get; }
  2191. #endif
  2192. }
  2193. [BaseType (typeof (NSObject), Name="NSURLConnectionDelegate")]
  2194. [Model]
  2195. [Protocol]
  2196. public interface NSUrlConnectionDelegate {
  2197. [Export ("connection:willSendRequest:redirectResponse:")]
  2198. NSUrlRequest WillSendRequest (NSUrlConnection connection, NSUrlRequest request, NSUrlResponse response);
  2199. [Export ("connection:canAuthenticateAgainstProtectionSpace:")]
  2200. bool CanAuthenticateAgainstProtectionSpace (NSUrlConnection connection, NSUrlProtectionSpace protectionSpace);
  2201. [Export ("connection:needNewBodyStream:")]
  2202. NSInputStream NeedNewBodyStream (NSUrlConnection connection, NSUrlRequest request);
  2203. [Export ("connection:didReceiveAuthenticationChallenge:")]
  2204. void ReceivedAuthenticationChallenge (NSUrlConnection connection, NSUrlAuthenticationChallenge challenge);
  2205. [Export ("connection:didCancelAuthenticationChallenge:")]
  2206. void CanceledAuthenticationChallenge (NSUrlConnection connection, NSUrlAuthenticationChallenge challenge);
  2207. [Export ("connectionShouldUseCredentialStorage:")]
  2208. bool ConnectionShouldUseCredentialStorage (NSUrlConnection connection);
  2209. [Export ("connection:didReceiveResponse:")]
  2210. void ReceivedResponse (NSUrlConnection connection, NSUrlResponse response);
  2211. [Export ("connection:didReceiveData:")]
  2212. void ReceivedData (NSUrlConnection connection, NSData data);
  2213. [Export ("connection:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:")]
  2214. void SentBodyData (NSUrlConnection connection, int bytesWritten, int totalBytesWritten, int totalBytesExpectedToWrite);
  2215. [Export ("connectionDidFinishLoading:")]
  2216. void FinishedLoading (NSUrlConnection connection);
  2217. [Export ("connection:didFailWithError:")]
  2218. void FailedWithError (NSUrlConnection connection, NSError error);
  2219. [Export ("connection:willCacheResponse:")]
  2220. NSCachedUrlResponse WillCacheResponse (NSUrlConnection connection, NSCachedUrlResponse cachedResponse);
  2221. }
  2222. [BaseType (typeof (NSUrlConnectionDelegate), Name="NSUrlConnectionDownloadDelegate")]
  2223. [Model]
  2224. [Protocol]
  2225. public interface NSUrlConnectionDownloadDelegate {
  2226. [Export ("connection:didWriteData:totalBytesWritten:expectedTotalBytes:")]
  2227. void WroteData (NSUrlConnection connection, long bytesWritten, long totalBytesWritten, long expectedTotalBytes);
  2228. [Export ("connectionDidResumeDownloading:totalBytesWritten:expectedTotalBytes:")]
  2229. void ResumedDownloading (NSUrlConnection connection, long totalBytesWritten, long expectedTotalBytes);
  2230. [Abstract]
  2231. [Export ("connectionDidFinishDownloading:destinationURL:")]
  2232. void FinishedDownloading (NSUrlConnection connection, NSUrl destinationUrl);
  2233. }
  2234. [BaseType (typeof (NSObject), Name="NSURLCredential")]
  2235. // crash when calling NSObjecg.get_Description (and likely other selectors)
  2236. [DisableDefaultCtor]
  2237. public interface NSUrlCredential {
  2238. [Export ("persistence")]
  2239. NSUrlCredentialPersistence Persistence { get; }
  2240. [Export ("initWithUser:password:persistence:")]
  2241. IntPtr Constructor (string user, string password, NSUrlCredentialPersistence persistence);
  2242. [Static]
  2243. [Export ("credentialWithUser:password:persistence:")]
  2244. NSUrlCredential FromUserPasswordPersistance (string user, string password, NSUrlCredentialPersistence persistence);
  2245. [Export ("user")]
  2246. string User { get; }
  2247. [Export ("password")]
  2248. string Password { get; }
  2249. [Export ("hasPassword")]
  2250. bool HasPassword {get; }
  2251. //[Export ("initWithIdentity:certificates:persistence:")]
  2252. //IntPtr Constructor (IntPtr SecIdentityRef, IntPtr [] secCertificateRefArray, NSUrlCredentialPersistence persistance);
  2253. //[Static]
  2254. //[Export ("credentialWithIdentity:certificates:persistence:")]
  2255. //NSUrlCredential FromIdentityCertificatesPersistance (IntPtr SecIdentityRef, IntPtr [] secCertificateRefArray, NSUrlCredentialPersistence persistence);
  2256. [Export ("identity")]
  2257. IntPtr Identity {get; }
  2258. //[Export ("certificates")]
  2259. //IntPtr [] Certificates { get; }
  2260. // bound manually to keep the managed/native signatures identical
  2261. //[Export ("initWithTrust:")]
  2262. //IntPtr Constructor (IntPtr SecTrustRef_trust, bool ignored);
  2263. [Static]
  2264. [Export ("credentialForTrust:")]
  2265. NSUrlCredential FromTrust (IntPtr SecTrustRef_trust);
  2266. }
  2267. [BaseType (typeof (NSObject), Name="NSURLCredentialStorage")]
  2268. // init returns NIL -> SharedCredentialStorage
  2269. [DisableDefaultCtor]
  2270. public interface NSUrlCredentialStorage {
  2271. [Static]
  2272. [Export ("sharedCredentialStorage")]
  2273. NSUrlCredentialStorage SharedCredentialStorage { get; }
  2274. [Export ("credentialsForProtectionSpace:")]
  2275. NSDictionary GetCredentials (NSUrlProtectionSpace forProtectionSpace);
  2276. [Export ("allCredentials")]
  2277. NSDictionary AllCredentials { get; }
  2278. [Export ("setCredential:forProtectionSpace:")]
  2279. void SetCredential (NSUrlCredential credential, NSUrlProtectionSpace forProtectionSpace);
  2280. [Export ("removeCredential:forProtectionSpace:")]
  2281. void RemoveCredential (NSUrlCredential credential, NSUrlProtectionSpace forProtectionSpace);
  2282. [Export ("defaultCredentialForProtectionSpace:")]
  2283. NSUrlCredential GetDefaultCredential (NSUrlProtectionSpace forProtectionSpace);
  2284. [Export ("setDefaultCredential:forProtectionSpace:")]
  2285. void SetDefaultCredential (NSUrlCredential credential, NSUrlProtectionSpace forProtectionSpace);
  2286. }
  2287. interface NSUndoManagerCloseUndoGroupEventArgs {
  2288. // Bug in docs, see header file
  2289. [Export ("NSUndoManagerGroupIsDiscardableKey")]
  2290. [NullAllowed]
  2291. bool Discardable { get; }
  2292. }
  2293. [BaseType (typeof (NSObject))]
  2294. public interface NSUndoManager {
  2295. [Export ("beginUndoGrouping")]
  2296. void BeginUndoGrouping ();
  2297. [Export ("endUndoGrouping")]
  2298. void EndUndoGrouping ();
  2299. [Export ("groupingLevel")]
  2300. int GroupingLevel { get; }
  2301. [Export ("disableUndoRegistration")]
  2302. void DisableUndoRegistration ();
  2303. [Export ("enableUndoRegistration")]
  2304. void EnableUndoRegistration ();
  2305. [Export ("isUndoRegistrationEnabled")]
  2306. bool IsUndoRegistrationEnabled { get; }
  2307. [Export ("groupsByEvent")]
  2308. bool GroupsByEvent { get; set; }
  2309. [Export ("levelsOfUndo")]
  2310. int LevelsOfUndo { get; set; }
  2311. [Export ("runLoopModes")]
  2312. string [] RunLoopModes { get; set; }
  2313. [Export ("undo")]
  2314. void Undo ();
  2315. [Export ("redo")]
  2316. void Redo ();
  2317. [Export ("undoNestedGroup")]
  2318. void UndoNestedGroup ();
  2319. [Export ("canUndo")]
  2320. bool CanUndo { get; }
  2321. [Export ("canRedo")]
  2322. bool CanRedo { get; }
  2323. [Export ("isUndoing")]
  2324. bool IsUndoing { get; }
  2325. [Export ("isRedoing")]
  2326. bool IsRedoing { get; }
  2327. [Export ("removeAllActions")]
  2328. void RemoveAllActions ();
  2329. [Export ("removeAllActionsWithTarget:")]
  2330. void RemoveAllActions (NSObject target);
  2331. [Export ("registerUndoWithTarget:selector:object:")]
  2332. void RegisterUndoWithTarget (NSObject target, Selector selector, NSObject anObject);
  2333. [Export ("prepareWithInvocationTarget:")]
  2334. NSObject PrepareWithInvocationTarget (NSObject target);
  2335. [Export ("undoActionName")]
  2336. string UndoActionName { get; }
  2337. [Export ("redoActionName")]
  2338. string RedoActionName { get; }
  2339. [Export ("setActionName:")]
  2340. void SetActionname (string actionName);
  2341. [Export ("undoMenuItemTitle")]
  2342. string UndoMenuItemTitle { get; }
  2343. [Export ("redoMenuItemTitle")]
  2344. string RedoMenuItemTitle { get; }
  2345. [Export ("undoMenuTitleForUndoActionName:")]
  2346. string UndoMenuTitleForUndoActionName (string name);
  2347. [Export ("redoMenuTitleForUndoActionName:")]
  2348. string RedoMenuTitleForUndoActionName (string name);
  2349. [Field ("NSUndoManagerCheckpointNotification")]
  2350. [Notification]
  2351. NSString CheckpointNotification { get; }
  2352. [Field ("NSUndoManagerDidOpenUndoGroupNotification")]
  2353. [Notification]
  2354. NSString DidOpenUndoGroupNotification { get; }
  2355. [Field ("NSUndoManagerDidRedoChangeNotification")]
  2356. [Notification]
  2357. NSString DidRedoChangeNotification { get; }
  2358. [Field ("NSUndoManagerDidUndoChangeNotification")]
  2359. [Notification]
  2360. NSString DidUndoChangeNotification { get; }
  2361. [Field ("NSUndoManagerWillCloseUndoGroupNotification")]
  2362. [Notification (typeof (NSUndoManagerCloseUndoGroupEventArgs))]
  2363. NSString WillCloseUndoGroupNotification { get; }
  2364. [Field ("NSUndoManagerWillRedoChangeNotification")]
  2365. [Notification]
  2366. NSString WillRedoChangeNotification { get; }
  2367. [Field ("NSUndoManagerWillUndoChangeNotification")]
  2368. [Notification]
  2369. NSString WillUndoChangeNotification { get; }
  2370. [Since (5,0)]
  2371. [Export ("setActionIsDiscardable:")]
  2372. void SetActionIsDiscardable (bool discardable);
  2373. [Since (5,0)]
  2374. [Export ("undoActionIsDiscardable")]
  2375. bool UndoActionIsDiscardable { get; }
  2376. [Since (5,0)]
  2377. [Export ("redoActionIsDiscardable")]
  2378. bool RedoActionIsDiscardable { get; }
  2379. [Field ("NSUndoManagerGroupIsDiscardableKey")]
  2380. NSString GroupIsDiscardableKey { get; }
  2381. [Field ("NSUndoManagerDidCloseUndoGroupNotification")]
  2382. [Notification (typeof (NSUndoManagerCloseUndoGroupEventArgs))]
  2383. NSString DidCloseUndoGroupNotification { get; }
  2384. }
  2385. [BaseType (typeof (NSObject), Name="NSURLProtectionSpace")]
  2386. // 'init' returns NIL
  2387. [DisableDefaultCtor]
  2388. public interface NSUrlProtectionSpace {
  2389. [Export ("initWithHost:port:protocol:realm:authenticationMethod:")]
  2390. IntPtr Constructor (string host, int port, string protocol, string realm, string authenticationMethod);
  2391. //[Export ("initWithProxyHost:port:type:realm:authenticationMethod:")]
  2392. //IntPtr Constructor (string host, int port, string type, string realm, string authenticationMethod);
  2393. [Export ("realm")]
  2394. string Realm { get; }
  2395. [Export ("receivesCredentialSecurely")]
  2396. bool ReceivesCredentialSecurely { get; }
  2397. [Export ("isProxy")]
  2398. bool IsProxy { get; }
  2399. [Export ("host")]
  2400. string Host { get; }
  2401. [Export ("port")]
  2402. int Port { get; }
  2403. [Export ("proxyType")]
  2404. string ProxyType { get; }
  2405. [Export ("protocol")]
  2406. string Protocol { get; }
  2407. [Export ("authenticationMethod")]
  2408. string AuthenticationMethod { get; }
  2409. // NSURLProtectionSpace(NSClientCertificateSpace)
  2410. [Export ("distinguishedNames")]
  2411. NSData [] DistinguishedNames { get; }
  2412. // NSURLProtectionSpace(NSServerTrustValidationSpace)
  2413. [Export ("serverTrust")]
  2414. IntPtr ServerTrust { get ; }
  2415. [Field ("NSURLProtectionSpaceHTTP")]
  2416. NSString HTTP { get; }
  2417. [Field ("NSURLProtectionSpaceHTTPS")]
  2418. NSString HTTPS { get; }
  2419. [Field ("NSURLProtectionSpaceFTP")]
  2420. NSString FTP { get; }
  2421. [Field ("NSURLProtectionSpaceHTTPProxy")]
  2422. NSString HTTPProxy { get; }
  2423. [Field ("NSURLProtectionSpaceHTTPSProxy")]
  2424. NSString HTTPSProxy { get; }
  2425. [Field ("NSURLProtectionSpaceFTPProxy")]
  2426. NSString FTPProxy { get; }
  2427. [Field ("NSURLProtectionSpaceSOCKSProxy")]
  2428. NSString SOCKSProxy { get; }
  2429. [Field ("NSURLAuthenticationMethodDefault")]
  2430. NSString AuthenticationMethodDefault { get; }
  2431. [Field ("NSURLAuthenticationMethodHTTPBasic")]
  2432. NSString AuthenticationMethodHTTPBasic { get; }
  2433. [Field ("NSURLAuthenticationMethodHTTPDigest")]
  2434. NSString AuthenticationMethodHTTPDigest { get; }
  2435. [Field ("NSURLAuthenticationMethodHTMLForm")]
  2436. NSString AuthenticationMethodHTMLForm { get; }
  2437. [Field ("NSURLAuthenticationMethodNTLM")]
  2438. NSString AuthenticationMethodNTL { get; }
  2439. [Field ("NSURLAuthenticationMethodNegotiate")]
  2440. NSString AuthenticationMethodNegotiat { get; }
  2441. [Field ("NSURLAuthenticationMethodClientCertificate")]
  2442. NSString AuthenticationMethodClientCertificate { get; }
  2443. [Field ("NSURLAuthenticationMethodServerTrust")]
  2444. NSString AuthenticationMethodServerTrus { get; }
  2445. }
  2446. [BaseType (typeof (NSObject), Name="NSURLRequest")]
  2447. public interface NSUrlRequest {
  2448. [Export ("initWithURL:")]
  2449. IntPtr Constructor (NSUrl url);
  2450. [Export ("initWithURL:cachePolicy:timeoutInterval:")]
  2451. IntPtr Constructor (NSUrl url, NSUrlRequestCachePolicy cachePolicy, double timeoutInterval);
  2452. [Export ("requestWithURL:")][Static]
  2453. NSUrlRequest FromUrl (NSUrl url);
  2454. [Export ("URL")]
  2455. NSUrl Url { get; }
  2456. [Export ("cachePolicy")]
  2457. NSUrlRequestCachePolicy CachePolicy { get; }
  2458. [Export ("timeoutInterval")]
  2459. double TimeoutInterval { get; }
  2460. [Export ("mainDocumentURL")]
  2461. NSUrl MainDocumentURL { get; }
  2462. [Export ("networkServiceType")]
  2463. NSUrlRequestNetworkServiceType NetworkServiceType { get; }
  2464. [Export ("allowsCellularAccess")]
  2465. bool AllowsCellularAccess { get; }
  2466. [Export ("HTTPMethod")]
  2467. string HttpMethod { get; }
  2468. [Export ("allHTTPHeaderFields")]
  2469. NSDictionary Headers { get; }
  2470. [Internal][Export ("valueForHTTPHeaderField:")]
  2471. string Header (string field);
  2472. [Export ("HTTPBody")]
  2473. NSData Body { get; }
  2474. [Export ("HTTPBodyStream")]
  2475. NSInputStream BodyStream { get; }
  2476. [Export ("HTTPShouldHandleCookies")]
  2477. bool ShouldHandleCookies { get; }
  2478. }
  2479. [BaseType (typeof (NSDictionary))]
  2480. public interface NSMutableDictionary {
  2481. [Export ("dictionaryWithContentsOfFile:")]
  2482. [Static]
  2483. NSMutableDictionary FromFile (string path);
  2484. [Export ("dictionaryWithContentsOfURL:")]
  2485. [Static]
  2486. NSMutableDictionary FromUrl (NSUrl url);
  2487. [Export ("dictionaryWithObject:forKey:")]
  2488. [Static]
  2489. NSMutableDictionary FromObjectAndKey (NSObject obj, NSObject key);
  2490. [Export ("dictionaryWithDictionary:")]
  2491. [Static,New]
  2492. NSMutableDictionary FromDictionary (NSDictionary source);
  2493. [Export ("dictionaryWithObjects:forKeys:count:")]
  2494. [Static, Internal]
  2495. NSMutableDictionary FromObjectsAndKeysInternalCount (NSArray objects, NSArray keys, int count);
  2496. [Export ("dictionaryWithObjects:forKeys:")]
  2497. [Static, Internal, New]
  2498. NSMutableDictionary FromObjectsAndKeysInternal (NSArray objects, NSArray Keys);
  2499. [Export ("initWithDictionary:")]
  2500. IntPtr Constructor (NSDictionary other);
  2501. [Export ("initWithContentsOfFile:")]
  2502. IntPtr Constructor (string fileName);
  2503. [Export ("initWithContentsOfURL:")]
  2504. IntPtr Constructor (NSUrl url);
  2505. [Export ("removeAllObjects"), Internal]
  2506. void RemoveAllObjects ();
  2507. [Export ("removeObjectForKey:"), Internal]
  2508. void RemoveObjectForKey (NSObject key);
  2509. [Export ("setObject:forKey:"), Internal]
  2510. void SetObject (NSObject obj, NSObject key);
  2511. [Since (6,0)]
  2512. [Static]
  2513. [Export ("dictionaryWithSharedKeySet:")]
  2514. NSDictionary FromSharedKeySet (NSObject sharedKeyToken);
  2515. }
  2516. [BaseType (typeof (NSSet))]
  2517. public interface NSMutableSet {
  2518. [Export ("initWithArray:")]
  2519. IntPtr Constructor (NSArray other);
  2520. [Export ("initWithSet:")]
  2521. IntPtr Constructor (NSSet other);
  2522. [Export ("initWithCapacity:")]
  2523. IntPtr Constructor (int capacity);
  2524. [Export ("addObject:")]
  2525. void Add (NSObject nso);
  2526. [Export ("removeObject:")]
  2527. void Remove (NSObject nso);
  2528. [Export ("removeAllObjects")]
  2529. void RemoveAll ();
  2530. [Export ("addObjectsFromArray:")]
  2531. void AddObjects (NSObject [] objects);
  2532. [Internal, Export ("minusSet:")]
  2533. void MinusSet (NSSet other);
  2534. }
  2535. [BaseType (typeof (NSUrlRequest), Name="NSMutableURLRequest")]
  2536. public interface NSMutableUrlRequest {
  2537. [Export ("initWithURL:")]
  2538. IntPtr Constructor (NSUrl url);
  2539. [Export ("initWithURL:cachePolicy:timeoutInterval:")]
  2540. IntPtr Constructor (NSUrl url, NSUrlRequestCachePolicy cachePolicy, double timeoutInterval);
  2541. [New][Export ("URL")]
  2542. NSUrl Url { get; set; }
  2543. [New][Export ("cachePolicy")]
  2544. NSUrlRequestCachePolicy CachePolicy { get; set; }
  2545. [New][Export ("timeoutInterval")]
  2546. double TimeoutInterval { set; get; }
  2547. [New][Export ("mainDocumentURL")]
  2548. NSUrl MainDocumentURL { get; set; }
  2549. [New][Export ("HTTPMethod")]
  2550. string HttpMethod { get; set; }
  2551. [New][Export ("allHTTPHeaderFields")]
  2552. NSDictionary Headers { get; set; }
  2553. [Internal][Export ("setValue:forHTTPHeaderField:")]
  2554. void _SetValue (string value, string field);
  2555. [New][Export ("HTTPBody")]
  2556. NSData Body { get; set; }
  2557. [New][Export ("HTTPBodyStream")]
  2558. NSInputStream BodyStream { get; set; }
  2559. [New][Export ("HTTPShouldHandleCookies")]
  2560. bool ShouldHandleCookies { get; set; }
  2561. [Export ("networkServiceType")]
  2562. NSUrlRequestNetworkServiceType NetworkServiceType { set; get; }
  2563. [New] [Export ("allowsCellularAccess")]
  2564. bool AllowsCellularAccess { get; set; }
  2565. }
  2566. [BaseType (typeof (NSObject), Name="NSURLResponse")]
  2567. public interface NSUrlResponse {
  2568. [Export ("initWithURL:MIMEType:expectedContentLength:textEncodingName:")]
  2569. IntPtr Constructor (NSUrl url, string mimetype, int expectedContentLength, [NullAllowed] string textEncodingName);
  2570. [Export ("URL")]
  2571. NSUrl Url { get; }
  2572. [Export ("MIMEType")]
  2573. string MimeType { get; }
  2574. [Export ("expectedContentLength")]
  2575. long ExpectedContentLength { get; }
  2576. [Export ("textEncodingName")]
  2577. string TextEncodingName { get; }
  2578. [Export ("suggestedFilename")]
  2579. string SuggestedFilename { get; }
  2580. }
  2581. [BaseType (typeof (NSObject), Delegates=new string [] { "WeakDelegate" }, Events=new Type [] { typeof (NSStreamDelegate)} )]
  2582. public interface NSStream {
  2583. [Export ("open")]
  2584. void Open ();
  2585. [Export ("close")]
  2586. void Close ();
  2587. [Export ("delegate", ArgumentSemantic.Assign), NullAllowed]
  2588. NSObject WeakDelegate { get; set; }
  2589. [Wrap ("WeakDelegate")]
  2590. NSStreamDelegate Delegate { get; set; }
  2591. [Export ("propertyForKey:"), Internal]
  2592. NSObject PropertyForKey (NSString key);
  2593. [Export ("setProperty:forKey:"), Internal]
  2594. bool SetPropertyForKey (NSObject property, NSString key);
  2595. [Export ("scheduleInRunLoop:forMode:")]
  2596. void Schedule (NSRunLoop aRunLoop, string mode);
  2597. [Export ("removeFromRunLoop:forMode:")]
  2598. void Unschedule (NSRunLoop aRunLoop, string mode);
  2599. [Export ("streamStatus")]
  2600. NSStreamStatus Status { get; }
  2601. [Export ("streamError")]
  2602. NSError Error { get; }
  2603. [Field ("NSStreamSocketSecurityLevelKey")]
  2604. NSString SocketSecurityLevelKey { get; }
  2605. [Field ("NSStreamSocketSecurityLevelNone")]
  2606. NSString SocketSecurityLevelNone { get; }
  2607. [Field ("NSStreamSocketSecurityLevelSSLv2")]
  2608. NSString SocketSecurityLevelSslV2 { get; }
  2609. [Field ("NSStreamSocketSecurityLevelSSLv3")]
  2610. NSString SocketSecurityLevelSslV3 { get; }
  2611. [Field ("NSStreamSocketSecurityLevelTLSv1")]
  2612. NSString SocketSecurityLevelTlsV1 { get; }
  2613. [Field ("NSStreamSocketSecurityLevelNegotiatedSSL")]
  2614. NSString SocketSecurityLevelNegotiatedSsl { get; }
  2615. [Field ("NSStreamSOCKSProxyConfigurationKey")]
  2616. NSString SocksProxyConfigurationKey { get; }
  2617. [Field ("NSStreamSOCKSProxyHostKey")]
  2618. NSString SocksProxyHostKey { get; }
  2619. [Field ("NSStreamSOCKSProxyPortKey")]
  2620. NSString SocksProxyPortKey { get; }
  2621. [Field ("NSStreamSOCKSProxyVersionKey")]
  2622. NSString SocksProxyVersionKey { get; }
  2623. [Field ("NSStreamSOCKSProxyUserKey")]
  2624. NSString SocksProxyUserKey { get; }
  2625. [Field ("NSStreamSOCKSProxyPasswordKey")]
  2626. NSString SocksProxyPasswordKey { get; }
  2627. [Field ("NSStreamSOCKSProxyVersion4")]
  2628. NSString SocksProxyVersion4 { get; }
  2629. [Field ("NSStreamSOCKSProxyVersion5")]
  2630. NSString SocksProxyVersion5 { get; }
  2631. [Field ("NSStreamDataWrittenToMemoryStreamKey")]
  2632. NSString DataWrittenToMemoryStreamKey { get; }
  2633. [Field ("NSStreamFileCurrentOffsetKey")]
  2634. NSString FileCurrentOffsetKey { get; }
  2635. [Field ("NSStreamSocketSSLErrorDomain")]
  2636. NSString SocketSslErrorDomain { get; }
  2637. [Field ("NSStreamSOCKSErrorDomain")]
  2638. NSString SocksErrorDomain { get; }
  2639. [Field ("NSStreamNetworkServiceType")]
  2640. NSString NetworkServiceType { get; }
  2641. [Field ("NSStreamNetworkServiceTypeVoIP")]
  2642. NSString NetworkServiceTypeVoIP { get; }
  2643. [Field ("NSStreamNetworkServiceTypeVideo")]
  2644. NSString NetworkServiceTypeVideo { get; }
  2645. [Field ("NSStreamNetworkServiceTypeBackground")]
  2646. NSString NetworkServiceTypeBackground { get; }
  2647. [Field ("NSStreamNetworkServiceTypeVoice")]
  2648. NSString NetworkServiceTypeVoice { get; }
  2649. }
  2650. [BaseType (typeof (NSObject))]
  2651. [Model]
  2652. [Protocol]
  2653. public interface NSStreamDelegate {
  2654. [Export ("stream:handleEvent:"), EventArgs ("NSStream"), EventName ("OnEvent")]
  2655. void HandleEvent (NSStream theStream, NSStreamEvent streamEvent);
  2656. }
  2657. [BaseType (typeof (NSObject)), Bind ("NSString")]
  2658. public interface NSString2 {
  2659. #if MONOMAC
  2660. [Bind ("sizeWithAttributes:")]
  2661. SizeF StringSize ([NullAllowed] NSDictionary attributedStringAttributes);
  2662. [Bind ("boundingRectWithSize:options:attributes:")]
  2663. RectangleF BoundingRectWithSize (SizeF size, NSStringDrawingOptions options, NSDictionary attributes);
  2664. [Bind ("drawAtPoint:withAttributes:")]
  2665. void DrawString (PointF point, NSDictionary attributes);
  2666. [Bind ("drawInRect:withAttributes:")]
  2667. void DrawString (RectangleF rect, NSDictionary attributes);
  2668. [Bind ("drawWithRect:options:attributes:")]
  2669. void DrawString (RectangleF rect, NSStringDrawingOptions options, NSDictionary attributes);
  2670. #else
  2671. [Bind ("sizeWithFont:")]
  2672. SizeF StringSize (UIFont font);
  2673. [Bind ("sizeWithFont:forWidth:lineBreakMode:")]
  2674. SizeF StringSize (UIFont font, float forWidth, UILineBreakMode breakMode);
  2675. [Bind ("sizeWithFont:constrainedToSize:")]
  2676. SizeF StringSize (UIFont font, SizeF constrainedToSize);
  2677. [Bind ("sizeWithFont:constrainedToSize:lineBreakMode:")]
  2678. SizeF StringSize (UIFont font, SizeF constrainedToSize, UILineBreakMode lineBreakMode);
  2679. [Bind ("sizeWithFont:minFontSize:actualFontSize:forWidth:lineBreakMode:")]
  2680. SizeF StringSize (UIFont font, float minFontSize, ref float actualFontSize, float forWidth, UILineBreakMode lineBreakMode);
  2681. [Bind ("drawAtPoint:withFont:")]
  2682. SizeF DrawString (PointF point, UIFont font);
  2683. [Bind ("drawAtPoint:forWidth:withFont:lineBreakMode:")]
  2684. SizeF DrawString (PointF point, float width, UIFont font, UILineBreakMode breakMode);
  2685. [Bind ("drawAtPoint:forWidth:withFont:fontSize:lineBreakMode:baselineAdjustment:")]
  2686. SizeF DrawString (PointF point, float width, UIFont font, float fontSize, UILineBreakMode breakMode, UIBaselineAdjustment adjustment);
  2687. [Bind ("drawAtPoint:forWidth:withFont:minFontSize:actualFontSize:lineBreakMode:baselineAdjustment:")]
  2688. SizeF DrawString (PointF point, float width, UIFont font, float minFontSize, ref float actualFontSize, UILineBreakMode breakMode, UIBaselineAdjustment adjustment);
  2689. [Bind ("drawInRect:withFont:")]
  2690. SizeF DrawString (RectangleF rect, UIFont font);
  2691. [Bind ("drawInRect:withFont:lineBreakMode:")]
  2692. SizeF DrawString (RectangleF rect, UIFont font, UILineBreakMode mode);
  2693. [Bind ("drawInRect:withFont:lineBreakMode:alignment:")]
  2694. SizeF DrawString (RectangleF rect, UIFont font, UILineBreakMode mode, UITextAlignment alignment);
  2695. #endif
  2696. [Export ("characterAtIndex:")]
  2697. char _characterAtIndex (int index);
  2698. [Export ("length")]
  2699. int Length {get;}
  2700. [Export ("hash"), Internal]
  2701. int Hash ();
  2702. [Export ("isEqualToString:"), Internal]
  2703. bool IsEqualTo (IntPtr handle);
  2704. [Export ("compare:")]
  2705. NSComparisonResult Compare (NSString aString);
  2706. [Export ("compare:options:")]
  2707. NSComparisonResult Compare (NSString aString, NSStringCompareOptions mask);
  2708. [Export ("compare:options:range:")]
  2709. NSComparisonResult Compare (NSString aString, NSStringCompareOptions mask, NSRange range);
  2710. [Export ("compare:options:range:locale:")]
  2711. NSComparisonResult Compare (NSString aString, NSStringCompareOptions mask, NSRange range, [NullAllowed] NSLocale locale);
  2712. [Export ("stringByReplacingCharactersInRange:withString:")]
  2713. NSString Replace (NSRange range, NSString replacement);
  2714. // start methods from NSStringPathExtensions category
  2715. [Static]
  2716. [Export("pathWithComponents:")]
  2717. string[] PathWithComponents( string[] components );
  2718. [Export("pathComponents")]
  2719. string[] PathComponents { get; }
  2720. [Export("isAbsolutePath")]
  2721. bool IsAbsolutePath { get; }
  2722. [Export("lastPathComponent")]
  2723. NSString LastPathComponent { get; }
  2724. [Export("stringByDeletingLastPathComponent")]
  2725. NSString DeleteLastPathComponent();
  2726. [Export("stringByAppendingPathComponent:")]
  2727. NSString AppendPathComponent( NSString str );
  2728. [Export("pathExtension")]
  2729. NSString PathExtension { get; }
  2730. [Export("stringByDeletingPathExtension")]
  2731. NSString DeletePathExtension();
  2732. [Export("stringByAppendingPathExtension:")]
  2733. NSString AppendPathExtension( NSString str );
  2734. [Export("stringByAbbreviatingWithTildeInPath")]
  2735. NSString AbbreviateTildeInPath();
  2736. [Export("stringByExpandingTildeInPath")]
  2737. NSString ExpandTildeInPath();
  2738. [Export("stringByStandardizingPath")]
  2739. NSString StandarizePath();
  2740. [Export("stringByResolvingSymlinksInPath")]
  2741. NSString ResolveSymlinksInPath();
  2742. [Export("stringsByAppendingPaths:")]
  2743. string[] AppendPaths( string[] paths );
  2744. // end methods from NSStringPathExtensions category
  2745. [Since (6,0)]
  2746. [Export ("capitalizedStringWithLocale:")]
  2747. string Capitalize (NSLocale locale);
  2748. [Since (6,0)]
  2749. [Export ("lowercaseStringWithLocale:")]
  2750. string ToLower (NSLocale locale);
  2751. [Since (6,0)]
  2752. [Export ("uppercaseStringWithLocale:")]
  2753. string ToUpper (NSLocale locale);
  2754. }
  2755. #if !MONOMAC
  2756. [Since (6,0)]
  2757. [BaseType (typeof (NSObject))]
  2758. public interface NSStringDrawingContext {
  2759. [Export ("minimumScaleFactor")]
  2760. float MinimumScaleFactor { get; set; }
  2761. [Export ("minimumTrackingAdjustment")]
  2762. float MinimumTrackingAdjustment { get; set; }
  2763. [Export ("actualScaleFactor")]
  2764. float ActualScaleFactor { get; }
  2765. [Export ("actualTrackingAdjustment")]
  2766. float ActualTrackingAdjustment { get; }
  2767. [Export ("totalBounds")]
  2768. RectangleF TotalBounds { get; }
  2769. }
  2770. #endif
  2771. [BaseType (typeof (NSStream))]
  2772. [DefaultCtorVisibility (Visibility.Protected)]
  2773. public interface NSInputStream {
  2774. [Export ("hasBytesAvailable")]
  2775. bool HasBytesAvailable ();
  2776. [Export ("initWithFileAtPath:")]
  2777. IntPtr Constructor (string path);
  2778. [Export ("initWithData:")]
  2779. IntPtr Constructor (NSData data);
  2780. [Export ("initWithURL:")]
  2781. IntPtr Constructor (NSUrl url);
  2782. [Static]
  2783. [Export ("inputStreamWithData:")]
  2784. NSInputStream FromData (NSData data);
  2785. [Static]
  2786. [Export ("inputStreamWithFileAtPath:")]
  2787. NSInputStream FromFile (string path);
  2788. [Static]
  2789. [Export ("inputStreamWithURL:")]
  2790. NSInputStream FromUrl (NSUrl url);
  2791. }
  2792. //
  2793. // We expose NSString versions of these methods because it could
  2794. // avoid an extra lookup in cases where there is a large volume of
  2795. // calls being made and the keys are mostly tokens
  2796. //
  2797. [BaseType (typeof (NSObject)), Bind ("NSObject")]
  2798. public interface NSObject2 {
  2799. [Export ("observeValueForKeyPath:ofObject:change:context:")]
  2800. void ObserveValue (NSString keyPath, NSObject ofObject, NSDictionary change, IntPtr context);
  2801. [Export ("addObserver:forKeyPath:options:context:")]
  2802. void AddObserver (NSObject observer, NSString keyPath, NSKeyValueObservingOptions options, IntPtr context);
  2803. [Export ("removeObserver:forKeyPath:")]
  2804. void RemoveObserver (NSObject observer, NSString keyPath);
  2805. [Export ("willChangeValueForKey:")]
  2806. void WillChangeValue (string forKey);
  2807. [Export ("didChangeValueForKey:")]
  2808. void DidChangeValue (string forKey);
  2809. [Export ("willChange:valuesAtIndexes:forKey:")]
  2810. void WillChange (NSKeyValueChange changeKind, NSIndexSet indexes, NSString forKey);
  2811. [Export ("didChange:valuesAtIndexes:forKey:")]
  2812. void DidChange (NSKeyValueChange changeKind, NSIndexSet indexes, NSString forKey);
  2813. [Export ("willChangeValueForKey:withSetMutation:usingObjects:")]
  2814. void WillChange (NSString forKey, NSKeyValueSetMutationKind mutationKind, NSSet objects);
  2815. [Export ("didChangeValueForKey:withSetMutation:usingObjects:")]
  2816. void DidChange (NSString forKey, NSKeyValueSetMutationKind mutationKind, NSSet objects);
  2817. [Static, Export ("keyPathsForValuesAffectingValueForKey:")]
  2818. NSSet GetKeyPathsForValuesAffecting (NSString key);
  2819. [Static, Export ("automaticallyNotifiesObserversForKey:")]
  2820. bool AutomaticallyNotifiesObserversForKey (string key);
  2821. [Export ("valueForKey:")]
  2822. [MarshalNativeExceptions]
  2823. NSObject ValueForKey (NSString key);
  2824. [Export ("setValue:forKey:")]
  2825. void SetValueForKey (NSObject value, NSString key);
  2826. [Export ("valueForKeyPath:")]
  2827. NSObject ValueForKeyPath (NSString keyPath);
  2828. [Export ("setValue:forKeyPath:")]
  2829. void SetValueForKeyPath (NSObject value, NSString keyPath);
  2830. [Export ("valueForUndefinedKey:")]
  2831. NSObject ValueForUndefinedKey (NSString key);
  2832. [Export ("setValue:forUndefinedKey:")]
  2833. void SetValueForUndefinedKey (NSObject value, NSString undefinedKey);
  2834. [Export ("setNilValueForKey:")]
  2835. void SetNilValueForKey (NSString key);
  2836. [Export ("dictionaryWithValuesForKeys:")]
  2837. NSDictionary GetDictionaryOfValuesFromKeys (NSString [] keys);
  2838. [Export ("setValuesForKeysWithDictionary:")]
  2839. void SetValuesForKeysWithDictionary (NSDictionary keyedValues);
  2840. [Field ("NSKeyValueChangeKindKey")]
  2841. NSString ChangeKindKey { get; }
  2842. [Field ("NSKeyValueChangeNewKey")]
  2843. NSString ChangeNewKey { get; }
  2844. [Field ("NSKeyValueChangeOldKey")]
  2845. NSString ChangeOldKey { get; }
  2846. [Field ("NSKeyValueChangeIndexesKey")]
  2847. NSString ChangeIndexesKey { get; }
  2848. [Field ("NSKeyValueChangeNotificationIsPriorKey")]
  2849. NSString ChangeNotificationIsPriorKey { get; }
  2850. #if MONOMAC
  2851. // Cocoa Bindings added by Kenneth J. Pouncey 2010/11/17
  2852. [Export ("exposedBindings")]
  2853. NSString[] ExposedBindings ();
  2854. [Export ("valueClassForBinding:")]
  2855. Class BindingValueClass (string binding);
  2856. [Export ("bind:toObject:withKeyPath:options:")]
  2857. void Bind (string binding, NSObject observable, string keyPath, [NullAllowed] NSDictionary options);
  2858. [Export ("unbind:")]
  2859. void Unbind (string binding);
  2860. [Export ("infoForBinding:")]
  2861. NSDictionary BindingInfo (string binding);
  2862. [Export ("optionDescriptionsForBinding:")]
  2863. NSObject[] BindingOptionDescriptions (string aBinding);
  2864. // NSPlaceholders (informal) protocol
  2865. [Static]
  2866. [Export ("defaultPlaceholderForMarker:withBinding:")]
  2867. NSObject GetDefaultPlaceholder (NSObject marker, string binding);
  2868. [Static]
  2869. [Export ("setDefaultPlaceholder:forMarker:withBinding:")]
  2870. void SetDefaultPlaceholder (NSObject placeholder, NSObject marker, string binding);
  2871. [Export ("objectDidEndEditing:")]
  2872. void ObjectDidEndEditing (NSObject editor);
  2873. [Export ("commitEditing")]
  2874. bool CommitEditing ();
  2875. [Export ("commitEditingWithDelegate:didCommitSelector:contextInfo:")]
  2876. //void CommitEditingWithDelegateDidCommitSelectorContextInfo (NSObject objDelegate, Selector didCommitSelector, IntPtr contextInfo);
  2877. void CommitEditing (NSObject objDelegate, Selector didCommitSelector, IntPtr contextInfo);
  2878. #endif
  2879. [Export ("copy")]
  2880. NSObject Copy ();
  2881. [Export ("mutableCopy")]
  2882. NSObject MutableCopy ();
  2883. [Export ("description")]
  2884. string Description { get; }
  2885. [Export ("debugDescription")]
  2886. string DebugDescription { get; }
  2887. //
  2888. // Extra Perform methods, with selectors
  2889. //
  2890. [Export ("performSelector:withObject:afterDelay:inModes:")]
  2891. void PerformSelector (Selector selector, NSObject withObject, double afterDelay, NSString [] nsRunLoopModes);
  2892. [Export ("performSelector:onThread:withObject:waitUntilDone:")]
  2893. void PerformSelector (Selector selector, NSThread onThread, NSObject withObject, bool waitUntilDone);
  2894. [Export ("performSelector:onThread:withObject:waitUntilDone:modes:")]
  2895. void PerformSelector (Selector selector, NSThread onThread, NSObject withObject, bool waitUntilDone, NSString [] nsRunLoopModes);
  2896. [Static, Export ("cancelPreviousPerformRequestsWithTarget:")]
  2897. void CancelPreviousPerformRequest (NSObject aTarget);
  2898. [Static, Export ("cancelPreviousPerformRequestsWithTarget:selector:object:")]
  2899. void CancelPreviousPerformRequest (NSObject aTarget, Selector selector, [NullAllowed] NSObject argument);
  2900. }
  2901. [BaseType (typeof (NSObject))]
  2902. [Since (4,0)]
  2903. public interface NSOperation {
  2904. [Export ("start")]
  2905. void Start ();
  2906. [Export ("main")]
  2907. void Main ();
  2908. [Export ("isCancelled")]
  2909. bool IsCancelled { get; }
  2910. [Export ("cancel")]
  2911. void Cancel ();
  2912. [Export ("isExecuting")]
  2913. bool IsExecuting { get; }
  2914. [Export ("isFinished")]
  2915. bool IsFinished { get; }
  2916. [Export ("isConcurrent")]
  2917. bool IsConcurrent { get; }
  2918. [Export ("isReady")]
  2919. bool IsReady { get; }
  2920. [Export ("addDependency:")][PostGet ("Dependencies")]
  2921. void AddDependency (NSOperation op);
  2922. [Export ("removeDependency:")][PostGet ("Dependencies")]
  2923. void RemoveDependency (NSOperation op);
  2924. [Export ("dependencies")]
  2925. NSOperation [] Dependencies { get; }
  2926. [Export ("waitUntilFinished")]
  2927. void WaitUntilFinishedNS ();
  2928. [Export ("threadPriority")]
  2929. double ThreadPriority { get; set; }
  2930. //Detected properties
  2931. [Export ("queuePriority")]
  2932. NSOperationQueuePriority QueuePriority { get; set; }
  2933. }
  2934. [BaseType (typeof (NSOperation))]
  2935. [Since (4,0)]
  2936. public interface NSBlockOperation {
  2937. [Static]
  2938. [Export ("blockOperationWithBlock:")]
  2939. NSBlockOperation Create (/* non null */ NSAction method);
  2940. [Export ("addExecutionBlock:")]
  2941. void AddExecutionBlock (/* non null */ NSAction method);
  2942. [Export ("executionBlocks")]
  2943. NSObject [] ExecutionBlocks { get; }
  2944. }
  2945. [BaseType (typeof (NSObject))]
  2946. [Since (4,0)]
  2947. public interface NSOperationQueue {
  2948. [Export ("addOperation:")][PostGet ("Operations")]
  2949. void AddOperation ([NullAllowed] NSOperation op);
  2950. [Export ("addOperations:waitUntilFinished:")][PostGet ("Operations")]
  2951. void AddOperations ([NullAllowed] NSOperation [] operations, bool waitUntilFinished);
  2952. [Export ("addOperationWithBlock:")][PostGet ("Operations")]
  2953. void AddOperation (/* non null */ NSAction operation);
  2954. [Export ("operations")]
  2955. NSOperation [] Operations { get; }
  2956. [Export ("operationCount")]
  2957. int OperationCount { get; }
  2958. [Export ("name")]
  2959. string Name { get; set; }
  2960. [Export ("cancelAllOperations")][PostGet ("Operations")]
  2961. void CancelAllOperations ();
  2962. [Export ("waitUntilAllOperationsAreFinished")]
  2963. void WaitUntilAllOperationsAreFinished ();
  2964. [Static]
  2965. [Export ("currentQueue")]
  2966. NSOperationQueue CurrentQueue { get; }
  2967. [Static]
  2968. [Export ("mainQueue")]
  2969. NSOperationQueue MainQueue { get; }
  2970. //Detected properties
  2971. [Export ("maxConcurrentOperationCount")]
  2972. int MaxConcurrentOperationCount { get; set; }
  2973. [Export ("suspended")]
  2974. bool Suspended { [Bind ("isSuspended")]get; set; }
  2975. }
  2976. [BaseType (typeof (NSObject))]
  2977. public interface NSOrderedSet {
  2978. [Export ("initWithObject:")]
  2979. IntPtr Constructor (NSObject start);
  2980. [Export ("initWithArray:"), Internal]
  2981. IntPtr Constructor (NSArray array);
  2982. [Export ("initWithSet:")]
  2983. IntPtr Constructor (NSSet source);
  2984. [Export ("initWithOrderedSet:")]
  2985. IntPtr Constructor (NSOrderedSet source);
  2986. [Export ("count")]
  2987. int Count { get; }
  2988. [Export ("objectAtIndex:"), Internal]
  2989. NSObject GetObject (int idx);
  2990. [Export ("array"), Internal]
  2991. IntPtr _ToArray ();
  2992. [Export ("indexOfObject:")]
  2993. int IndexOf (NSObject obj);
  2994. [Export ("objectEnumerator"), Internal]
  2995. NSEnumerator _GetEnumerator ();
  2996. [Export ("set")]
  2997. NSSet AsSet ();
  2998. [Export ("containsObject:")]
  2999. bool Contains (NSObject obj);
  3000. [Export ("firstObject")]
  3001. NSObject FirstObject ();
  3002. [Export ("lastObject")]
  3003. NSObject LastObject ();
  3004. [Export ("isEqualToOrderedSet:")]
  3005. bool IsEqualToOrderedSet (NSOrderedSet other);
  3006. [Export ("intersectsOrderedSet:")]
  3007. bool Intersects (NSOrderedSet other);
  3008. [Export ("intersectsSet:")]
  3009. bool Intersects (NSSet other);
  3010. [Export ("isSubsetOfOrderedSet:")]
  3011. bool IsSubset (NSOrderedSet other);
  3012. [Export ("isSubsetOfSet:")]
  3013. bool IsSubset (NSSet other);
  3014. [Export ("reversedOrderedSet")]
  3015. NSOrderedSet GetReverseOrderedSet ();
  3016. }
  3017. [BaseType (typeof (NSOrderedSet))]
  3018. public interface NSMutableOrderedSet {
  3019. [Export ("initWithObject:")]
  3020. IntPtr Constructor (NSObject start);
  3021. [Export ("initWithSet:")]
  3022. IntPtr Constructor (NSSet source);
  3023. [Export ("initWithOrderedSet:")]
  3024. IntPtr Constructor (NSOrderedSet source);
  3025. [Export ("initWithCapacity:")]
  3026. IntPtr Constructor (int capacity);
  3027. [Export ("initWithArray:"), Internal]
  3028. IntPtr Constructor (NSArray array);
  3029. [Export ("unionSet:"), Internal]
  3030. void UnionSet (NSSet other);
  3031. [Export ("minusSet:"), Internal]
  3032. void MinusSet (NSSet other);
  3033. [Export ("insertObject:atIndex:")]
  3034. void Insert (NSObject obj, int atIndex);
  3035. [Export ("removeObjectAtIndex:")]
  3036. void Remove (int index);
  3037. [Export ("replaceObjectAtIndex:withObject:")]
  3038. void Replace (int objectAtIndex, NSObject newObject);
  3039. [Export ("addObject:")]
  3040. void Add (NSObject obj);
  3041. [Export ("addObjectsFromArray:")]
  3042. void AddObjects (NSObject [] source);
  3043. [Export ("insertObjects:atIndexes:")]
  3044. void InsertObjects (NSObject [] objects, NSIndexSet atIndexes);
  3045. [Export ("removeObjectsAtIndexes:")]
  3046. void RemoveObjects (NSIndexSet indexSet);
  3047. [Export ("exchangeObjectAtIndex:withObjectAtIndex:")]
  3048. void ExchangeObject (int first, int second);
  3049. [Export ("moveObjectsAtIndexes:toIndex:")]
  3050. void MoveObjects (NSIndexSet indexSet, int destination);
  3051. [Export ("setObject:atIndex:")]
  3052. void SetObject (NSObject obj, int index);
  3053. [Export ("replaceObjectsAtIndexes:withObjects:")]
  3054. void ReplaceObjects (NSIndexSet indexSet, NSObject [] replacementObjects);
  3055. [Export ("removeObjectsInRange:")]
  3056. void RemoveObjects (NSRange range);
  3057. [Export ("removeAllObjects")]
  3058. void RemoveAllObjects ();
  3059. [Export ("removeObject:")]
  3060. void RemoveObject (NSObject obj);
  3061. [Export ("removeObjectsInArray:")]
  3062. void RemoveObjects (NSObject [] objects);
  3063. [Export ("intersectOrderedSet:")]
  3064. void Intersect (NSOrderedSet intersectWith);
  3065. [Export ("sortUsingComparator:")]
  3066. void Sort (NSComparator comparator);
  3067. [Export ("sortWithOptions:usingComparator:")]
  3068. void Sort (NSSortOptions sortOptions, NSComparator comparator);
  3069. [Export ("sortRange:options:usingComparator:")]
  3070. void SortRange (NSRange range, NSSortOptions sortOptions, NSComparator comparator);
  3071. }
  3072. [BaseType (typeof (NSObject))]
  3073. // Objective-C exception thrown. Name: NSInvalidArgumentException Reason: *** -[__NSArrayM insertObject:atIndex:]: object cannot be nil
  3074. [DisableDefaultCtor]
  3075. public interface NSOrthography {
  3076. [Export ("dominantScript")]
  3077. string DominantScript { get; }
  3078. [Export ("languageMap")]
  3079. NSDictionary LanguageMap { get; }
  3080. [Export ("dominantLanguage")]
  3081. string DominantLanguage { get; }
  3082. [Export ("allScripts")]
  3083. string [] AllScripts { get; }
  3084. [Export ("allLanguages")]
  3085. string [] AllLanguages { get; }
  3086. [Export ("languagesForScript:")]
  3087. string [] LanguagesForScript (string script);
  3088. [Export ("dominantLanguageForScript:")]
  3089. string DominantLanguageForScript (string script);
  3090. [Export ("initWithDominantScript:languageMap:")]
  3091. IntPtr Constructor (string dominantScript, [NullAllowed] NSDictionary languageMap);
  3092. }
  3093. [BaseType (typeof (NSStream))]
  3094. [DisableDefaultCtor] // crash when used
  3095. public interface NSOutputStream {
  3096. [Export ("initToMemory")]
  3097. IntPtr Constructor ();
  3098. [Export ("hasSpaceAvailable")]
  3099. bool HasSpaceAvailable ();
  3100. //[Export ("initToBuffer:capacity:")]
  3101. //IntPtr Constructor (uint8_t buffer, NSUInteger capacity);
  3102. [Export ("initToFileAtPath:append:")]
  3103. IntPtr Constructor (string path, bool shouldAppend);
  3104. [Static]
  3105. [Export ("outputStreamToMemory")]
  3106. NSObject OutputStreamToMemory ();
  3107. //[Static]
  3108. //[Export ("outputStreamToBuffer:capacity:")]
  3109. //NSObject OutputStreamToBuffer (uint8_t buffer, NSUInteger capacity);
  3110. [Static]
  3111. [Export ("outputStreamToFileAtPath:append:")]
  3112. NSOutputStream CreateFile (string path, bool shouldAppend);
  3113. }
  3114. [BaseType (typeof (NSObject), Name="NSHTTPCookie")]
  3115. // default 'init' crash both simulator and devices
  3116. [DisableDefaultCtor]
  3117. public interface NSHttpCookie {
  3118. [Export ("initWithProperties:")]
  3119. IntPtr Constructor (NSDictionary properties);
  3120. [Export ("cookieWithProperties:"), Static]
  3121. NSHttpCookie CookieFromProperties (NSDictionary properties);
  3122. [Export ("requestHeaderFieldsWithCookies:"), Static]
  3123. NSDictionary RequestHeaderFieldsWithCookies (NSHttpCookie [] cookies);
  3124. [Export ("cookiesWithResponseHeaderFields:forURL:"), Static]
  3125. NSHttpCookie [] CookiesWithResponseHeaderFields (NSDictionary headerFields, NSUrl url);
  3126. [Export ("properties")]
  3127. NSDictionary Properties { get; }
  3128. [Export ("version")]
  3129. uint Version { get; }
  3130. [Export ("value")]
  3131. string Value { get; }
  3132. [Export ("expiresDate")]
  3133. NSDate ExpiresDate { get; }
  3134. [Export ("isSessionOnly")]
  3135. bool IsSessionOnly { get; }
  3136. [Export ("domain")]
  3137. string Domain { get; }
  3138. [Export ("name")]
  3139. string Name { get; }
  3140. [Export ("path")]
  3141. string Path { get; }
  3142. [Export ("isSecure")]
  3143. bool IsSecure { get; }
  3144. [Export ("isHTTPOnly")]
  3145. bool IsHttpOnly { get; }
  3146. [Export ("comment")]
  3147. string Comment { get; }
  3148. [Export ("commentURL")]
  3149. NSUrl CommentUrl { get; }
  3150. [Export ("portList")]
  3151. NSNumber [] PortList { get; }
  3152. }
  3153. [BaseType (typeof (NSObject), Name="NSHTTPCookieStorage")]
  3154. // NSHTTPCookieStorage implements a singleton object -> use SharedStorage since 'init' returns NIL
  3155. [DisableDefaultCtor]
  3156. public interface NSHttpCookieStorage {
  3157. [Export ("sharedHTTPCookieStorage"), Static]
  3158. NSHttpCookieStorage SharedStorage { get; }
  3159. [Export ("cookies")]
  3160. NSHttpCookie [] Cookies { get; }
  3161. [Export ("setCookie:")]
  3162. void SetCookie (NSHttpCookie cookie);
  3163. [Export ("deleteCookie:")]
  3164. void DeleteCookie (NSHttpCookie cookie);
  3165. [Export ("cookiesForURL:")]
  3166. NSHttpCookie [] CookiesForUrl (NSUrl url);
  3167. [Export ("setCookies:forURL:mainDocumentURL:")]
  3168. void SetCookies (NSHttpCookie [] cookies, NSUrl forUrl, NSUrl mainDocumentUrl);
  3169. [Export ("cookieAcceptPolicy")]
  3170. NSHttpCookieAcceptPolicy AcceptPolicy { get; set; }
  3171. [Export ("sortedCookiesUsingDescriptors:")]
  3172. NSHttpCookie [] GetSortedCookies (NSSortDescriptor [] sortDescriptors);
  3173. }
  3174. [BaseType (typeof (NSUrlResponse), Name="NSHTTPURLResponse")]
  3175. public interface NSHttpUrlResponse {
  3176. [Since (5,0)]
  3177. [Export ("initWithURL:statusCode:HTTPVersion:headerFields:")]
  3178. IntPtr Constructor (NSUrl url, int statusCode, string httpVersion, NSDictionary headerFields);
  3179. [Export ("statusCode")]
  3180. int StatusCode { get; }
  3181. [Export ("allHeaderFields")]
  3182. NSDictionary AllHeaderFields { get; }
  3183. [Export ("localizedStringForStatusCode:")][Static]
  3184. string LocalizedStringForStatusCode (int statusCode);
  3185. }
  3186. [BaseType (typeof (NSObject))]
  3187. #if MONOMAC
  3188. [DisableDefaultCtor] // An uncaught exception was raised: -[__NSCFDictionary removeObjectForKey:]: attempt to remove nil key
  3189. #endif
  3190. public partial interface NSBundle {
  3191. [Export ("mainBundle")][Static]
  3192. NSBundle MainBundle { get; }
  3193. [Export ("bundleWithPath:")][Static]
  3194. NSBundle FromPath (string path);
  3195. [Export ("initWithPath:")]
  3196. IntPtr Constructor (string path);
  3197. [Export ("bundleForClass:")][Static]
  3198. NSBundle FromClass (Class c);
  3199. [Export ("bundleWithIdentifier:")][Static]
  3200. NSBundle FromIdentifier (string str);
  3201. [Export ("allBundles")][Static]
  3202. NSBundle [] _AllBundles { get; }
  3203. [Export ("allFrameworks")][Static]
  3204. NSBundle [] AllFrameworks { get; }
  3205. [Export ("load")]
  3206. bool Load ();
  3207. [Export ("isLoaded")]
  3208. bool IsLoaded { get; }
  3209. [Export ("unload")]
  3210. bool Unload ();
  3211. [Export ("bundlePath")]
  3212. string BundlePath { get; }
  3213. [Export ("resourcePath")]
  3214. string ResourcePath { get; }
  3215. [Export ("executablePath")]
  3216. string ExecutablePath { get; }
  3217. [Export ("pathForAuxiliaryExecutable:")]
  3218. string PathForAuxiliaryExecutable (string s);
  3219. [Export ("privateFrameworksPath")]
  3220. string PrivateFrameworksPath { get; }
  3221. [Export ("sharedFrameworksPath")]
  3222. string SharedFrameworksPath { get; }
  3223. [Export ("sharedSupportPath")]
  3224. string SharedSupportPath { get; }
  3225. [Export ("builtInPlugInsPath")]
  3226. string BuiltinPluginsPath { get; }
  3227. [Export ("bundleIdentifier")]
  3228. string BundleIdentifier { get; }
  3229. [Export ("classNamed:")]
  3230. Class ClassNamed (string className);
  3231. [Export ("principalClass")]
  3232. Class PrincipalClass { get; }
  3233. [Export ("pathForResource:ofType:inDirectory:")][Static]
  3234. string PathForResourceAbsolute (string name, [NullAllowed] string ofType, string bundleDirectory);
  3235. [Export ("pathForResource:ofType:")]
  3236. string PathForResource (string name, [NullAllowed] string ofType);
  3237. // TODO: this conflicts with the above with our generator.
  3238. //[Export ("pathForResource:ofType:inDirectory:")]
  3239. //string PathForResource (string name, string ofType, string subpath);
  3240. [Export ("pathForResource:ofType:inDirectory:forLocalization:")]
  3241. string PathForResource (string name, [NullAllowed] string ofType, string subpath, string localizationName);
  3242. [Export ("localizedStringForKey:value:table:")]
  3243. string LocalizedString ([NullAllowed] string key, [NullAllowed] string value, [NullAllowed] string table);
  3244. [Export ("objectForInfoDictionaryKey:")]
  3245. NSObject ObjectForInfoDictionary (string key);
  3246. [Export ("developmentLocalization")]
  3247. string DevelopmentLocalization { get; }
  3248. [Export ("infoDictionary")]
  3249. NSDictionary InfoDictionary{ get; }
  3250. // Additions from AppKit
  3251. #if MONOMAC
  3252. // https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/NSBundle_AppKitAdditions/Reference/Reference.html
  3253. [Static]
  3254. [Export ("loadNibNamed:owner:")]
  3255. bool LoadNib (string nibName, NSObject owner);
  3256. [Export ("pathForImageResource:")]
  3257. string PathForImageResource (string resource);
  3258. [Export ("pathForSoundResource:")]
  3259. string PathForSoundResource (string resource);
  3260. [Export("appStoreReceiptURL")]
  3261. NSUrl AppStoreReceiptUrl { get; }
  3262. #else
  3263. // http://developer.apple.com/library/ios/#documentation/uikit/reference/NSBundle_UIKitAdditions/Introduction/Introduction.html
  3264. [Export ("loadNibNamed:owner:options:")]
  3265. NSArray LoadNib (string nibName, [NullAllowed] NSObject owner, [NullAllowed] NSDictionary options);
  3266. #endif
  3267. [Export ("bundleURL")]
  3268. [Since (4,0)]
  3269. NSUrl BundleUrl { get; }
  3270. [Export ("resourceURL")]
  3271. [Since (4,0)]
  3272. NSUrl ResourceUrl { get; }
  3273. [Export ("executableURL")]
  3274. [Since (4,0)]
  3275. NSUrl ExecutableUrl { get; }
  3276. [Export ("URLForAuxiliaryExecutable:")]
  3277. [Since (4,0)]
  3278. NSUrl UrlForAuxiliaryExecutable (string executable);
  3279. [Export ("privateFrameworksURL")]
  3280. [Since (4,0)]
  3281. NSUrl PrivateFrameworksUrl { get; }
  3282. [Export ("sharedFrameworksURL")]
  3283. [Since (4,0)]
  3284. NSUrl SharedFrameworksUrl { get; }
  3285. [Export ("sharedSupportURL")]
  3286. [Since (4,0)]
  3287. NSUrl SharedSupportUrl { get; }
  3288. [Export ("builtInPlugInsURL")]
  3289. [Since (4,0)]
  3290. NSUrl BuiltInPluginsUrl { get; }
  3291. [Export ("initWithURL:")]
  3292. [Since (4,0)]
  3293. IntPtr Constructor (NSUrl url);
  3294. [Static, Export ("bundleWithURL:")]
  3295. [Since (4,0)]
  3296. NSBundle FromUrl (NSUrl url);
  3297. [Export ("preferredLocalizations")]
  3298. string [] PreferredLocalizations { get; }
  3299. [Export ("localizations")]
  3300. string [] Localizations { get; }
  3301. }
  3302. [BaseType (typeof (NSObject))]
  3303. public interface NSIndexPath {
  3304. [Export ("indexPathWithIndex:")][Static]
  3305. NSIndexPath FromIndex (uint index);
  3306. [Export ("indexPathWithIndexes:length:")][Internal][Static]
  3307. NSIndexPath _FromIndex (IntPtr indexes, int len);
  3308. [Export ("indexPathByAddingIndex:")]
  3309. NSIndexPath IndexPathByAddingIndex (uint index);
  3310. [Export ("indexPathByRemovingLastIndex")]
  3311. NSIndexPath IndexPathByRemovingLastIndex ();
  3312. [Export ("indexAtPosition:")]
  3313. uint IndexAtPosition (int position);
  3314. [Export ("length")]
  3315. int Length { get; }
  3316. [Export ("getIndexes:")][Internal]
  3317. void _GetIndexes (IntPtr target);
  3318. [Export ("compare:")]
  3319. int Compare (NSIndexPath other);
  3320. #if !MONOMAC
  3321. // NSIndexPath UIKit Additions Reference
  3322. // https://developer.apple.com/library/ios/#documentation/UIKit/Reference/NSIndexPath_UIKitAdditions/Reference/Reference.html
  3323. [Export ("row")]
  3324. int Row { get; }
  3325. [Export ("section")]
  3326. int Section { get; }
  3327. [Static]
  3328. [Export ("indexPathForRow:inSection:")]
  3329. NSIndexPath FromRowSection (int row, int section);
  3330. [Export ("item")]
  3331. [Since (6,0)]
  3332. int Item { get; }
  3333. [Static]
  3334. [Since (6,0)]
  3335. [Export ("indexPathForItem:inSection:")]
  3336. NSIndexPath FromItemSection (int item, int section);
  3337. #endif
  3338. }
  3339. public delegate void NSRangeIterator (NSRange range, ref bool stop);
  3340. [BaseType (typeof (NSObject))]
  3341. public interface NSIndexSet {
  3342. [Static, Export ("indexSetWithIndex:")]
  3343. NSIndexSet FromIndex (int idx);
  3344. [Static, Export ("indexSetWithIndexesInRange:")]
  3345. NSIndexSet FromNSRange (NSRange indexRange);
  3346. [Export ("initWithIndex:")]
  3347. IntPtr Constructor (uint index);
  3348. [Export ("initWithIndexSet:")]
  3349. IntPtr Constructor (NSIndexSet other);
  3350. [Export ("count")]
  3351. int Count { get; }
  3352. [Export ("isEqualToIndexSet:")]
  3353. bool IsEqual (NSIndexSet other);
  3354. [Export ("firstIndex")]
  3355. uint FirstIndex { get; }
  3356. [Export ("lastIndex")]
  3357. uint LastIndex { get; }
  3358. [Export ("indexGreaterThanIndex:")]
  3359. uint IndexGreaterThan (uint index);
  3360. [Export ("indexLessThanIndex:")]
  3361. uint IndexLessThan (uint index);
  3362. [Export ("indexGreaterThanOrEqualToIndex:")]
  3363. uint IndexGreaterThanOrEqual (uint index);
  3364. [Export ("indexLessThanOrEqualToIndex:")]
  3365. uint IndexLessThanOrEqual (uint index);
  3366. [Export ("containsIndex:")]
  3367. bool Contains (uint index);
  3368. [Export ("containsIndexes:")]
  3369. bool Contains (NSIndexSet indexes);
  3370. [Export ("enumerateRangesUsingBlock:")]
  3371. void EnumerateRanges (NSRangeIterator iterator);
  3372. [Export ("enumerateRangesWithOptions:usingBlock:")]
  3373. void EnumerateRanges (NSEnumerationOptions opts, NSRangeIterator iterator);
  3374. [Export ("enumerateRangesInRange:options:usingBlock:")]
  3375. void EnumerateRanges (NSRange range, NSEnumerationOptions opts, NSRangeIterator iterator);
  3376. }
  3377. [BaseType (typeof (NSObject))]
  3378. [DisableDefaultCtor] // from the docs: " you should not create these objects using alloc and init."
  3379. public interface NSInvocation {
  3380. [Export ("selector")]
  3381. Selector Selector { get; set; }
  3382. [Export ("target")]
  3383. NSObject Target { get; set; }
  3384. // FIXME: We need some special marshaling support to handle these buffers...
  3385. [Internal, Export ("setArgument:atIndex:")]
  3386. void _SetArgument (IntPtr buffer, int index);
  3387. [Internal, Export ("getArgument:atIndex:")]
  3388. void _GetArgument (IntPtr buffer, int index);
  3389. [Internal, Export ("setReturnValue:")]
  3390. void _SetReturnValue (IntPtr buffer);
  3391. [Internal, Export ("getReturnValue:")]
  3392. void _GetReturnValue (IntPtr buffer);
  3393. [Export ("invoke")]
  3394. void Invoke ();
  3395. [Export ("invokeWithTarget:")]
  3396. void Invoke (NSObject target);
  3397. [Export ("methodSignature")]
  3398. NSMethodSignature MethodSignature { get; }
  3399. }
  3400. [BaseType (typeof (NSObject))]
  3401. [DisableDefaultCtor] // `init` returns a null handle
  3402. public interface NSMethodSignature {
  3403. [Export ("numberOfArguments")]
  3404. uint NumberOfArguments { get; }
  3405. [Export ("frameLength")]
  3406. uint FrameLength { get; }
  3407. [Export ("methodReturnLength")]
  3408. uint MethodReturnLength { get; }
  3409. [Export ("isOneway")]
  3410. bool IsOneway { get; }
  3411. }
  3412. [BaseType (typeof (NSObject), Name="NSJSONSerialization")]
  3413. // Objective-C exception thrown. Name: NSInvalidArgumentException Reason: *** +[NSJSONSerialization allocWithZone:]: Do not create instances of NSJSONSerialization in this release
  3414. [DisableDefaultCtor]
  3415. interface NSJsonSerialization {
  3416. [Static]
  3417. [Export ("isValidJSONObject:")]
  3418. bool IsValidJSONObject (NSObject obj);
  3419. [Static]
  3420. [Export ("dataWithJSONObject:options:error:")]
  3421. NSData Serialize (NSObject obj, NSJsonWritingOptions opt, out NSError error);
  3422. [Static]
  3423. [Export ("JSONObjectWithData:options:error:")]
  3424. NSObject Deserialize (NSData data, NSJsonReadingOptions opt, NSError error);
  3425. [Static]
  3426. [Export ("writeJSONObject:toStream:options:error:")]
  3427. int Serialize (NSObject obj, NSOutputStream stream, NSJsonWritingOptions opt, out NSError error);
  3428. [Static]
  3429. [Export ("JSONObjectWithStream:options:error:")]
  3430. NSObject Deserialize (NSInputStream stream, NSJsonReadingOptions opt, out NSError error);
  3431. }
  3432. [BaseType (typeof (NSIndexSet))]
  3433. public interface NSMutableIndexSet {
  3434. [Export ("initWithIndex:")]
  3435. IntPtr Constructor (uint index);
  3436. [Export ("initWithIndexSet:")]
  3437. IntPtr Constructor (NSIndexSet other);
  3438. [Export ("addIndexes:")]
  3439. void Add (NSIndexSet other);
  3440. [Export ("removeIndexes:")]
  3441. void Remove (NSIndexSet other);
  3442. [Export ("removeAllIndexes")]
  3443. void Clear ();
  3444. [Export ("addIndex:")]
  3445. void Add (uint index);
  3446. [Export ("removeIndex:")]
  3447. void Remove (uint index);
  3448. [Export ("shiftIndexesStartingAtIndex:by:")]
  3449. void ShiftIndexes (uint startIndex, int delta);
  3450. }
  3451. [BaseType (typeof (NSObject), Delegates=new string [] { "WeakDelegate" }, Events=new Type [] { typeof (NSNetServiceDelegate)})]
  3452. public interface NSNetService {
  3453. [Export ("initWithDomain:type:name:port:")]
  3454. IntPtr Constructor (string domain, string type, string name, int port);
  3455. [Export ("initWithDomain:type:name:")]
  3456. IntPtr Constructor (string domain, string type, string name);
  3457. [Export ("delegate", ArgumentSemantic.Assign), NullAllowed]
  3458. NSObject WeakDelegate { get; set; }
  3459. [Wrap ("WeakDelegate")]
  3460. NSNetServiceDelegate Delegate { get; set; }
  3461. [Export ("scheduleInRunLoop:forMode:")]
  3462. void Schedule (NSRunLoop aRunLoop, string forMode);
  3463. // For consistency with other APIs (NSUrlConnection) we call this Unschedule
  3464. [Export ("removeFromRunLoop:forMode:")]
  3465. void Unschedule (NSRunLoop aRunLoop, string forMode);
  3466. [Export ("domain")]
  3467. string Domain { get; }
  3468. [Export ("type")]
  3469. string Type { get; }
  3470. [Export ("name")]
  3471. string Name { get; }
  3472. [Export ("addresses")]
  3473. NSData [] Addresses { get; }
  3474. [Export ("port")]
  3475. int Port { get; }
  3476. [Export ("publish")]
  3477. void Publish ();
  3478. [Export ("publishWithOptions:")]
  3479. void Publish (NSNetServiceOptions options);
  3480. [Obsolete ("Deprecated in iOS 2.0 / OSX 10.4, use Resolve(double)")]
  3481. [Export ("resolve")]
  3482. void Resolve ();
  3483. [Export ("resolveWithTimeout:")]
  3484. void Resolve (double timeOut);
  3485. [Export ("stop")]
  3486. void Stop ();
  3487. [Static, Export ("dictionaryFromTXTRecordData:")]
  3488. NSDictionary DictionaryFromTxtRecord (NSData data);
  3489. [Static, Export ("dataFromTXTRecordDictionary:")]
  3490. NSData DataFromTxtRecord (NSDictionary dictionary);
  3491. [Export ("hostName")]
  3492. string HostName { get; }
  3493. [Internal, Export ("getInputStream:outputStream:")]
  3494. bool GetStreams (IntPtr ptrToInputStorage, IntPtr ptrToOutputStorage);
  3495. [Export ("TXTRecordData")]
  3496. NSData GetTxtRecordData ();
  3497. [Export ("setTXTRecordData:")]
  3498. bool SetTxtRecordData (NSData data);
  3499. //NSData TxtRecordData { get; set; }
  3500. [Export ("startMonitoring")]
  3501. void StartMonitoring ();
  3502. [Export ("stopMonitoring")]
  3503. void StopMonitoring ();
  3504. }
  3505. [Model, BaseType (typeof (NSObject))]
  3506. [Protocol]
  3507. public interface NSNetServiceDelegate {
  3508. [Export ("netServiceWillPublish:")]
  3509. void WillPublish (NSNetService sender);
  3510. [Export ("netServiceDidPublish:")]
  3511. void Published (NSNetService sender);
  3512. [Export ("netService:didNotPublish:"), EventArgs ("NSNetServiceError")]
  3513. void PublishFailure (NSNetService sender, NSDictionary errors);
  3514. [Export ("netServiceWillResolve:")]
  3515. void WillResolve (NSNetService sender);
  3516. [Export ("netServiceDidResolveAddress:")]
  3517. void AddressResolved (NSNetService sender);
  3518. [Export ("netService:didNotResolve:"), EventArgs ("NSNetServiceError")]
  3519. void ResolveFailure (NSNetService sender, NSDictionary errors);
  3520. [Export ("netServiceDidStop:")]
  3521. void Stopped (NSNetService sender);
  3522. [Export ("netService:didUpdateTXTRecordData:"), EventArgs ("NSNetServiceData")]
  3523. void UpdatedTxtRecordData (NSNetService sender, NSData data);
  3524. }
  3525. [BaseType (typeof (NSObject),
  3526. Delegates=new string [] {"WeakDelegate"},
  3527. Events=new Type [] {typeof (NSNetServiceBrowserDelegate)})]
  3528. public interface NSNetServiceBrowser {
  3529. [Export ("delegate", ArgumentSemantic.Assign), NullAllowed]
  3530. NSObject WeakDelegate { get; set; }
  3531. [Wrap ("WeakDelegate")]
  3532. NSNetServiceBrowserDelegate Delegate { get; set; }
  3533. [Export ("scheduleInRunLoop:forMode:")]
  3534. void Schedule (NSRunLoop aRunLoop, string forMode);
  3535. // For consistency with other APIs (NSUrlConnection) we call this Unschedule
  3536. [Export ("removeFromRunLoop:forMode:")]
  3537. void Unschedule (NSRunLoop aRunLoop, string forMode);
  3538. [Export ("searchForBrowsableDomains")]
  3539. void SearchForBrowsableDomains ();
  3540. [Export ("searchForRegistrationDomains")]
  3541. void SearchForRegistrationDomains ();
  3542. [Export ("searchForServicesOfType:inDomain:")]
  3543. void SearchForServices (string type, string domain);
  3544. [Export ("stop")]
  3545. void Stop ();
  3546. }
  3547. [Model, BaseType (typeof (NSObject))]
  3548. [Protocol]
  3549. public interface NSNetServiceBrowserDelegate {
  3550. [Export ("netServiceBrowserWillSearch:")]
  3551. void SearchStarted (NSNetServiceBrowser sender);
  3552. [Export ("netServiceBrowserDidStopSearch:")]
  3553. void SearchStopped (NSNetServiceBrowser sender);
  3554. [Export ("netServiceBrowser:didNotSearch:"), EventArgs ("NSNetServiceError")]
  3555. void NotSearched (NSNetServiceBrowser sender, NSDictionary errors);
  3556. [Export ("netServiceBrowser:didFindDomain:moreComing:"), EventArgs ("NSNetDomain")]
  3557. void FoundDomain (NSNetServiceBrowser sender, string domain, bool moreComing);
  3558. [Export ("netServiceBrowser:didFindService:moreComing:"), EventArgs ("NSNetService")]
  3559. void FoundService (NSNetServiceBrowser sender, NSNetService service, bool moreComing);
  3560. [Export ("netServiceBrowser:didRemoveDomain:moreComing:"), EventArgs ("NSNetDomain")]
  3561. void DomainRemoved (NSNetServiceBrowser sender, string domain, bool moreComing);
  3562. [Export ("netServiceBrowser:didRemoveService:moreComing:"), EventArgs ("NSNetService")]
  3563. void ServiceRemoved (NSNetServiceBrowser sender, NSNetService service, bool moreComing);
  3564. }
  3565. [BaseType (typeof (NSObject))]
  3566. // Objective-C exception thrown. Name: NSGenericException Reason: *** -[NSConcreteNotification init]: should never be used
  3567. [DisableDefaultCtor]
  3568. public interface NSNotification {
  3569. [Export ("name")]
  3570. string Name { get; }
  3571. [Export ("object")]
  3572. NSObject Object { get; }
  3573. [Export ("userInfo")]
  3574. NSDictionary UserInfo { get; }
  3575. [Export ("notificationWithName:object:")][Static]
  3576. NSNotification FromName (string name, NSObject obj);
  3577. [Export ("notificationWithName:object:userInfo:")][Static]
  3578. NSNotification FromName (string name, NSObject obj, NSDictionary userInfo);
  3579. }
  3580. [BaseType (typeof (NSObject))]
  3581. public interface NSNotificationCenter {
  3582. [Static][Export ("defaultCenter")]
  3583. NSNotificationCenter DefaultCenter { get; }
  3584. [Export ("addObserver:selector:name:object:")]
  3585. [PostSnippet ("AddObserverToList (observer, aName, anObject);")]
  3586. void AddObserver (NSObject observer, Selector aSelector, [NullAllowed] NSString aName, [NullAllowed] NSObject anObject);
  3587. [Export ("postNotification:")]
  3588. void PostNotification (NSNotification notification);
  3589. [Export ("postNotificationName:object:")]
  3590. void PostNotificationName (string aName, [NullAllowed] NSObject anObject);
  3591. [Export ("postNotificationName:object:userInfo:")]
  3592. void PostNotificationName (string aName, [NullAllowed] NSObject anObject, [NullAllowed] NSDictionary aUserInfo);
  3593. [Export ("removeObserver:")]
  3594. [PostSnippet ("RemoveObserversFromList (observer, null, null);")]
  3595. void RemoveObserver (NSObject observer);
  3596. [Export ("removeObserver:name:object:")]
  3597. [PostSnippet ("RemoveObserversFromList (observer, aName, anObject);")]
  3598. void RemoveObserver (NSObject observer, [NullAllowed] string aName, [NullAllowed] NSObject anObject);
  3599. [Since (4,0)]
  3600. [Export ("addObserverForName:object:queue:usingBlock:")]
  3601. NSObject AddObserver (string name, NSObject obj, NSOperationQueue queue, NSNotificationHandler handler);
  3602. }
  3603. #if MONOMAC
  3604. [BaseType (typeof (NSNotificationCenter))]
  3605. public interface NSDistributedNotificationCenter {
  3606. [Static]
  3607. [Export ("defaultCenter")]
  3608. NSObject DefaultCenter { get; }
  3609. [Export ("addObserver:selector:name:object:suspensionBehavior:")]
  3610. void AddObserver (NSObject observer, Selector selector, [NullAllowed] string notificationName, [NullAllowed] string notificationSenderc, NSNotificationSuspensionBehavior suspensionBehavior);
  3611. [Export ("postNotificationName:object:userInfo:deliverImmediately:")]
  3612. void PostNotificationName (string name, [NullAllowed] string anObject, [NullAllowed] NSDictionary userInfo, bool deliverImmediately);
  3613. [Export ("postNotificationName:object:userInfo:options:")]
  3614. void PostNotificationName (string name, [NullAllowed] string anObjecb, [NullAllowed] NSDictionary userInfo, NSNotificationFlags options);
  3615. [Export ("addObserver:selector:name:object:")]
  3616. void AddObserver (NSObject observer, Selector aSelector, [NullAllowed] string aName, [NullAllowed] NSObject anObject);
  3617. [Export ("postNotificationName:object:")]
  3618. void PostNotificationName (string aName, [NullAllowed] string anObject);
  3619. [Export ("postNotificationName:object:userInfo:")]
  3620. void PostNotificationName (string aName, [NullAllowed] string anObject, [NullAllowed] NSDictionary aUserInfo);
  3621. [Export ("removeObserver:name:object:")]
  3622. void RemoveObserver (NSObject observer, [NullAllowed] string aName, [NullAllowed] NSObject anObject);
  3623. //Detected properties
  3624. [Export ("suspended")]
  3625. bool Suspended { get; set; }
  3626. [Field ("NSLocalNotificationCenterType")]
  3627. NSString NSLocalNotificationCenterType {get;}
  3628. }
  3629. #endif
  3630. [BaseType (typeof (NSObject))]
  3631. public interface NSNotificationQueue {
  3632. [Static][IsThreadStatic]
  3633. [Export ("defaultQueue")]
  3634. NSObject DefaultQueue { get; }
  3635. [Export ("initWithNotificationCenter:")]
  3636. IntPtr Constructor (NSNotificationCenter notificationCenter);
  3637. [Export ("enqueueNotification:postingStyle:")]
  3638. void EnqueueNotification (NSNotification notification, NSPostingStyle postingStyle);
  3639. [Export ("enqueueNotification:postingStyle:coalesceMask:forModes:")]
  3640. void EnqueueNotification (NSNotification notification, NSPostingStyle postingStyle, NSNotificationCoalescing coalesceMask, string [] modes);
  3641. [Export ("dequeueNotificationsMatching:coalesceMask:")]
  3642. void DequeueNotificationsMatchingcoalesceMask (NSNotification notification, NSNotificationCoalescing coalesceMask);
  3643. }
  3644. public delegate void NSNotificationHandler (NSNotification notification);
  3645. [BaseType (typeof (NSObject))]
  3646. // init returns NIL
  3647. [DisableDefaultCtor]
  3648. public partial interface NSValue {
  3649. [Export ("getValue:")]
  3650. void StoreValueAtAddress (IntPtr value);
  3651. [Export ("objCType")][Internal]
  3652. IntPtr ObjCTypePtr ();
  3653. //[Export ("initWithBytes:objCType:")][Internal]
  3654. //NSValue InitFromBytes (IntPtr byte_ptr, IntPtr char_ptr_type);
  3655. //[Export ("valueWithBytes:objCType:")][Static][Internal]
  3656. //+ (NSValue *)valueWithBytes:(const void *)value objCType:(const char *)type;
  3657. //+ (NSValue *)value:(const void *)value withObjCType:(const char *)type;
  3658. [Static]
  3659. [Export ("valueWithNonretainedObject:")]
  3660. NSValue ValueFromNonretainedObject (NSObject anObject);
  3661. [Export ("nonretainedObjectValue")]
  3662. NSObject NonretainedObjectValue { get; }
  3663. [Static]
  3664. [Export ("valueWithPointer:")]
  3665. NSValue ValueFromPointer (IntPtr pointer);
  3666. [Export ("pointerValue")]
  3667. IntPtr PointerValue { get; }
  3668. [Export ("isEqualToValue:")]
  3669. bool IsEqualTo (NSValue value);
  3670. [Export ("valueWithRange:")][Static]
  3671. NSValue FromRange(NSRange range);
  3672. #if MONOMAC
  3673. [Static, Export ("valueWithCMTime:"), Lion]
  3674. NSValue FromCMTime (CMTime time);
  3675. [Export ("CMTimeValue"), Lion]
  3676. CMTime CMTimeValue { get; }
  3677. [Static, Export ("valueWithCMTimeMapping:"), Lion]
  3678. NSValue FromCMTimeMapping (CMTimeMapping timeMapping);
  3679. [Export ("CMTimeMappingValue"), Lion]
  3680. CMTimeMapping CMTimeMappingValue { get; }
  3681. [Static, Export ("valueWithCMTimeRange:"), Lion]
  3682. NSValue FromCMTimeRange (CMTimeRange timeRange);
  3683. [Export ("CMTimeRangeValue"), Lion]
  3684. CMTimeRange CMTimeRangeValue { get; }
  3685. [Export ("valueWithRect:"), Static]
  3686. NSValue FromRectangleF (System.Drawing.RectangleF rect);
  3687. [Export ("valueWithSize:")][Static]
  3688. NSValue FromSizeF (System.Drawing.SizeF size);
  3689. [Export ("valueWithPoint:")][Static]
  3690. NSValue FromPointF (System.Drawing.PointF point);
  3691. [Export ("rectValue")]
  3692. System.Drawing.RectangleF RectangleFValue { get; }
  3693. [Export ("sizeValue")]
  3694. System.Drawing.SizeF SizeFValue { get; }
  3695. [Export ("pointValue")]
  3696. System.Drawing.PointF PointFValue { get; }
  3697. [Export ("rangeValue")]
  3698. NSRange RangeValue { get; }
  3699. #else
  3700. [Static, Export ("valueWithCMTime:"), Since (4,0)]
  3701. NSValue FromCMTime (CMTime time);
  3702. [Export ("CMTimeValue"), Since (4,0)]
  3703. CMTime CMTimeValue { get; }
  3704. [Static, Export ("valueWithCMTimeMapping:"), Since (4,0)]
  3705. NSValue FromCMTimeMapping (CMTimeMapping timeMapping);
  3706. [Export ("CMTimeMappingValue"), Since (4,0)]
  3707. CMTimeMapping CMTimeMappingValue { get; }
  3708. [Static, Export ("valueWithCMTimeRange:"), Since (4,0)]
  3709. NSValue FromCMTimeRange (CMTimeRange timeRange);
  3710. [Export ("CMTimeRangeValue"), Since (4,0)]
  3711. CMTimeRange CMTimeRangeValue { get; }
  3712. [Export ("CGAffineTransformValue")]
  3713. MonoMac.CoreGraphics.CGAffineTransform CGAffineTransformValue { get; }
  3714. [Export ("UIEdgeInsetsValue")]
  3715. MonoMac.UIKit.UIEdgeInsets UIEdgeInsetsValue { get; }
  3716. [Export ("valueWithCGAffineTransform:")][Static]
  3717. NSValue FromCGAffineTransform (MonoMac.CoreGraphics.CGAffineTransform tran);
  3718. [Export ("valueWithUIEdgeInsets:")][Static]
  3719. NSValue FromUIEdgeInsets (MonoMac.UIKit.UIEdgeInsets insets);
  3720. [Export ("valueWithUIOffset:")][Static]
  3721. NSValue FromUIOffset (MonoMac.UIKit.UIOffset insets);
  3722. [Export ("UIOffsetValue")]
  3723. UIOffset UIOffsetValue { get; }
  3724. [Export ("valueWithCGRect:")][Static]
  3725. NSValue FromRectangleF (System.Drawing.RectangleF rect);
  3726. [Export ("CGRectValue")]
  3727. System.Drawing.RectangleF RectangleFValue { get; }
  3728. [Export ("valueWithCGSize:")][Static]
  3729. NSValue FromSizeF (System.Drawing.SizeF size);
  3730. [Export ("CGSizeValue")]
  3731. System.Drawing.SizeF SizeFValue { get; }
  3732. [Export ("CGPointValue")]
  3733. System.Drawing.PointF PointFValue { get; }
  3734. [Export ("valueWithCGPoint:")][Static]
  3735. NSValue FromPointF (System.Drawing.PointF point);
  3736. [Export ("valueWithCATransform3D:")][Static]
  3737. NSValue FromCATransform3D (MonoMac.CoreAnimation.CATransform3D transform);
  3738. [Export ("CATransform3DValue")]
  3739. MonoMac.CoreAnimation.CATransform3D CATransform3DValue { get; }
  3740. [Static, Export ("valueWithMKCoordinate:")]
  3741. NSValue FromMKCoordinate (MonoTouch.CoreLocation.CLLocationCoordinate2D coordinate);
  3742. [Static, Export ("valueWithMKCoordinateSpan:")]
  3743. NSValue FromMKCoordinateSpan (MonoTouch.MapKit.MKCoordinateSpan coordinateSpan);
  3744. [Export ("MKCoordinateValue")]
  3745. MonoTouch.CoreLocation.CLLocationCoordinate2D CoordinateValue { get; }
  3746. [Export ("MKCoordinateSpanValue")]
  3747. MonoTouch.MapKit.MKCoordinateSpan CoordinateSpanValue { get; }
  3748. #endif
  3749. }
  3750. [BaseType (typeof (NSValue))]
  3751. // init returns NIL
  3752. [DisableDefaultCtor]
  3753. public interface NSNumber {
  3754. [Export ("charValue")]
  3755. sbyte SByteValue { get; }
  3756. [Export ("unsignedCharValue")]
  3757. byte ByteValue { get; }
  3758. [Export ("shortValue")]
  3759. short Int16Value { get; }
  3760. [Export ("unsignedShortValue")]
  3761. ushort UInt16Value { get; }
  3762. [Export ("intValue")]
  3763. int Int32Value { get; }
  3764. [Export ("unsignedIntValue")]
  3765. uint UInt32Value { get; }
  3766. //[Export ("longValue")]
  3767. //int LongValue ();
  3768. //
  3769. //[Export ("unsignedLongValue")]
  3770. //uint UnsignedLongValue ();
  3771. [Export ("longLongValue")]
  3772. long Int64Value { get; }
  3773. [Export ("unsignedLongLongValue")]
  3774. ulong UInt64Value { get; }
  3775. [Export ("floatValue")]
  3776. float FloatValue { get; }
  3777. [Export ("doubleValue")]
  3778. double DoubleValue { get; }
  3779. [Export ("decimalValue")]
  3780. NSDecimal NSDecimalValue { get; }
  3781. [Export ("boolValue")]
  3782. bool BoolValue { get; }
  3783. [Export ("integerValue")]
  3784. int IntValue { get; }
  3785. [Export ("unsignedIntegerValue")]
  3786. uint UnsignedIntegerValue { get; }
  3787. [Export ("stringValue")]
  3788. string StringValue { get; }
  3789. [Export ("compare:")]
  3790. int Compare (NSNumber otherNumber);
  3791. [Export ("isEqualToNumber:")]
  3792. bool IsEqualToNumber (NSNumber number);
  3793. [Export ("descriptionWithLocale:")]
  3794. string DescriptionWithLocale (NSLocale locale);
  3795. [Export ("initWithChar:")]
  3796. IntPtr Constructor (sbyte value);
  3797. [Export ("initWithUnsignedChar:")]
  3798. IntPtr Constructor (byte value);
  3799. [Export ("initWithShort:")]
  3800. IntPtr Constructor (short value);
  3801. [Export ("initWithUnsignedShort:")]
  3802. IntPtr Constructor (ushort value);
  3803. [Export ("initWithInt:")]
  3804. IntPtr Constructor (int value);
  3805. [Export ("initWithUnsignedInt:")]
  3806. IntPtr Constructor (uint value);
  3807. //[Export ("initWithLong:")]
  3808. //IntPtr Constructor (long value);
  3809. //
  3810. //[Export ("initWithUnsignedLong:")]
  3811. //IntPtr Constructor (ulong value);
  3812. [Export ("initWithLongLong:")]
  3813. IntPtr Constructor (long value);
  3814. [Export ("initWithUnsignedLongLong:")]
  3815. IntPtr Constructor (ulong value);
  3816. [Export ("initWithFloat:")]
  3817. IntPtr Constructor (float value);
  3818. [Export ("initWithDouble:")]
  3819. IntPtr Constructor (double value);
  3820. [Export ("initWithBool:")]
  3821. IntPtr Constructor (bool value);
  3822. [Export ("numberWithChar:")][Static]
  3823. NSNumber FromSByte (sbyte value);
  3824. [Static]
  3825. [Export ("numberWithUnsignedChar:")]
  3826. NSNumber FromByte (byte value);
  3827. [Static]
  3828. [Export ("numberWithShort:")]
  3829. NSNumber FromInt16 (short value);
  3830. [Static]
  3831. [Export ("numberWithUnsignedShort:")]
  3832. NSNumber FromUInt16 (ushort value);
  3833. [Static]
  3834. [Export ("numberWithInt:")]
  3835. NSNumber FromInt32 (int value);
  3836. [Static]
  3837. [Export ("numberWithUnsignedInt:")]
  3838. NSNumber FromUInt32 (uint value);
  3839. //[Static]
  3840. //[Export ("numberWithLong:")]
  3841. //NSNumber * numberWithLong: (long value);
  3842. //
  3843. //[Static]
  3844. //[Export ("numberWithUnsignedLong:")]
  3845. //NSNumber * numberWithUnsignedLong: (unsigned long value);
  3846. [Static]
  3847. [Export ("numberWithLongLong:")]
  3848. NSNumber FromInt64 (long value);
  3849. [Static]
  3850. [Export ("numberWithUnsignedLongLong:")]
  3851. NSNumber FromUInt64 (ulong value);
  3852. [Static]
  3853. [Export ("numberWithFloat:")]
  3854. NSNumber FromFloat (float value);
  3855. [Static]
  3856. [Export ("numberWithDouble:")]
  3857. NSNumber FromDouble (double value);
  3858. [Static]
  3859. [Export ("numberWithBool:")]
  3860. NSNumber FromBoolean (bool value);
  3861. }
  3862. [BaseType (typeof (NSFormatter))]
  3863. interface NSNumberFormatter {
  3864. [Export ("stringFromNumber:")]
  3865. string StringFromNumber (NSNumber number);
  3866. [Export ("numberFromString:")]
  3867. NSNumber NumberFromString (string text);
  3868. [Static]
  3869. [Export ("localizedStringFromNumber:numberStyle:")]
  3870. string LocalizedStringFromNumbernumberStyle (NSNumber num, NSNumberFormatterStyle nstyle);
  3871. //Detected properties
  3872. [Export ("numberStyle")]
  3873. NSNumberFormatterStyle NumberStyle { get; set; }
  3874. [Export ("locale")]
  3875. NSLocale Locale { get; set; }
  3876. [Export ("generatesDecimalNumbers")]
  3877. bool GeneratesDecimalNumbers { get; set; }
  3878. [Export ("formatterBehavior")]
  3879. NSNumberFormatterBehavior FormatterBehavior { get; set; }
  3880. [Static]
  3881. [Export ("defaultFormatterBehavior")]
  3882. NSNumberFormatterBehavior DefaultFormatterBehavior { get; set; }
  3883. [Export ("negativeFormat")]
  3884. string NegativeFormat { get; set; }
  3885. [Export ("textAttributesForNegativeValues")]
  3886. NSDictionary TextAttributesForNegativeValues { get; set; }
  3887. [Export ("positiveFormat")]
  3888. string PositiveFormat { get; set; }
  3889. [Export ("textAttributesForPositiveValues")]
  3890. NSDictionary TextAttributesForPositiveValues { get; set; }
  3891. [Export ("allowsFloats")]
  3892. bool AllowsFloats { get; set; }
  3893. [Export ("decimalSeparator")]
  3894. string DecimalSeparator { get; set; }
  3895. [Export ("alwaysShowsDecimalSeparator")]
  3896. bool AlwaysShowsDecimalSeparator { get; set; }
  3897. [Export ("currencyDecimalSeparator")]
  3898. string CurrencyDecimalSeparator { get; set; }
  3899. [Export ("usesGroupingSeparator")]
  3900. bool UsesGroupingSeparator { get; set; }
  3901. [Export ("groupingSeparator")]
  3902. string GroupingSeparator { get; set; }
  3903. [Export ("zeroSymbol")]
  3904. string ZeroSymbol { get; set; }
  3905. [Export ("textAttributesForZero")]
  3906. NSDictionary TextAttributesForZero { get; set; }
  3907. [Export ("nilSymbol")]
  3908. string NilSymbol { get; set; }
  3909. [Export ("textAttributesForNil")]
  3910. NSDictionary TextAttributesForNil { get; set; }
  3911. [Export ("notANumberSymbol")]
  3912. string NotANumberSymbol { get; set; }
  3913. [Export ("textAttributesForNotANumber")]
  3914. NSDictionary TextAttributesForNotANumber { get; set; }
  3915. [Export ("positiveInfinitySymbol")]
  3916. string PositiveInfinitySymbol { get; set; }
  3917. [Export ("textAttributesForPositiveInfinity")]
  3918. NSDictionary TextAttributesForPositiveInfinity { get; set; }
  3919. [Export ("negativeInfinitySymbol")]
  3920. string NegativeInfinitySymbol { get; set; }
  3921. [Export ("textAttributesForNegativeInfinity")]
  3922. NSDictionary TextAttributesForNegativeInfinity { get; set; }
  3923. [Export ("positivePrefix")]
  3924. string PositivePrefix { get; set; }
  3925. [Export ("positiveSuffix")]
  3926. string PositiveSuffix { get; set; }
  3927. [Export ("negativePrefix")]
  3928. string NegativePrefix { get; set; }
  3929. [Export ("negativeSuffix")]
  3930. string NegativeSuffix { get; set; }
  3931. [Export ("currencyCode")]
  3932. string CurrencyCode { get; set; }
  3933. [Export ("currencySymbol")]
  3934. string CurrencySymbol { get; set; }
  3935. [Export ("internationalCurrencySymbol")]
  3936. string InternationalCurrencySymbol { get; set; }
  3937. [Export ("percentSymbol")]
  3938. string PercentSymbol { get; set; }
  3939. [Export ("perMillSymbol")]
  3940. string PerMillSymbol { get; set; }
  3941. [Export ("minusSign")]
  3942. string MinusSign { get; set; }
  3943. [Export ("plusSign")]
  3944. string PlusSign { get; set; }
  3945. [Export ("exponentSymbol")]
  3946. string ExponentSymbol { get; set; }
  3947. [Export ("groupingSize")]
  3948. uint GroupingSize { get; set; }
  3949. [Export ("secondaryGroupingSize")]
  3950. uint SecondaryGroupingSize { get; set; }
  3951. [Export ("multiplier")]
  3952. NSNumber Multiplier { get; set; }
  3953. [Export ("formatWidth")]
  3954. uint FormatWidth { get; set; }
  3955. [Export ("paddingCharacter")]
  3956. string PaddingCharacter { get; set; }
  3957. [Export ("paddingPosition")]
  3958. NSNumberFormatterPadPosition PaddingPosition { get; set; }
  3959. [Export ("roundingMode")]
  3960. NSNumberFormatterRoundingMode RoundingMode { get; set; }
  3961. [Export ("roundingIncrement")]
  3962. NSNumber RoundingIncrement { get; set; }
  3963. [Export ("minimumIntegerDigits")]
  3964. int MinimumIntegerDigits { get; set; }
  3965. [Export ("maximumIntegerDigits")]
  3966. int MaximumIntegerDigits { get; set; }
  3967. [Export ("minimumFractionDigits")]
  3968. int MinimumFractionDigits { get; set; }
  3969. [Export ("maximumFractionDigits")]
  3970. int MaximumFractionDigits { get; set; }
  3971. [Export ("minimum")]
  3972. NSNumber Minimum { get; set; }
  3973. [Export ("maximum")]
  3974. NSNumber Maximum { get; set; }
  3975. [Export ("currencyGroupingSeparator")]
  3976. string CurrencyGroupingSeparator { get; set; }
  3977. [Export ("lenient")]
  3978. bool Lenient { [Bind ("isLenient")]get; set; }
  3979. [Export ("usesSignificantDigits")]
  3980. bool UsesSignificantDigits { get; set; }
  3981. [Export ("minimumSignificantDigits")]
  3982. uint MinimumSignificantDigits { get; set; }
  3983. [Export ("maximumSignificantDigits")]
  3984. uint MaximumSignificantDigits { get; set; }
  3985. [Export ("partialStringValidationEnabled")]
  3986. bool PartialStringValidationEnabled { [Bind ("isPartialStringValidationEnabled")]get; set; }
  3987. }
  3988. [BaseType (typeof (NSNumber))]
  3989. public interface NSDecimalNumber {
  3990. [Export ("initWithMantissa:exponent:isNegative:")]
  3991. IntPtr Constructor (long mantissa, short exponent, bool isNegative);
  3992. [Export ("initWithDecimal:")]
  3993. IntPtr Constructor (NSDecimal dec);
  3994. [Export ("initWithString:")]
  3995. IntPtr Constructor (string numberValue);
  3996. [Export ("initWithString:locale:")]
  3997. IntPtr Constructor (string numberValue, NSObject locale);
  3998. [Export ("descriptionWithLocale:")]
  3999. string DescriptionWithLocale (NSLocale locale);
  4000. [Export ("decimalValue")]
  4001. NSDecimal NSDecimalValue { get; }
  4002. [Export ("zero")][Static]
  4003. NSDecimalNumber Zero { get; }
  4004. [Export ("one")][Static]
  4005. NSDecimalNumber One { get; }
  4006. [Export ("minimumDecimalNumber")][Static]
  4007. NSDecimalNumber MinValue { get; }
  4008. [Export ("maximumDecimalNumber")][Static]
  4009. NSDecimalNumber MaxValue { get; }
  4010. [Export ("notANumber")][Static]
  4011. NSDecimalNumber NaN { get; }
  4012. //
  4013. // All the behavior ones require:
  4014. // id <NSDecimalNumberBehaviors>)behavior;
  4015. [Export ("decimalNumberByAdding:")]
  4016. NSDecimalNumber Add (NSDecimalNumber d);
  4017. [Export ("decimalNumberByAdding:withBehavior:")]
  4018. NSDecimalNumber Add (NSDecimalNumber d, NSObject Behavior);
  4019. [Export ("decimalNumberBySubtracting:")]
  4020. NSDecimalNumber Subtract (NSDecimalNumber d);
  4021. [Export ("decimalNumberBySubtracting:withBehavior:")]
  4022. NSDecimalNumber Subtract (NSDecimalNumber d, NSObject Behavior);
  4023. [Export ("decimalNumberByMultiplyingBy:")]
  4024. NSDecimalNumber Multiply (NSDecimalNumber d);
  4025. [Export ("decimalNumberByMultiplyingBy:withBehavior:")]
  4026. NSDecimalNumber Multiply (NSDecimalNumber d, NSObject Behavior);
  4027. [Export ("decimalNumberByDividingBy:")]
  4028. NSDecimalNumber Divide (NSDecimalNumber d);
  4029. [Export ("decimalNumberByDividingBy:withBehavior:")]
  4030. NSDecimalNumber Divide (NSDecimalNumber d, NSObject Behavior);
  4031. [Export ("decimalNumberByRaisingToPower:")]
  4032. NSDecimalNumber RaiseTo (uint power);
  4033. [Export ("decimalNumberByRaisingToPower:withBehavior:")]
  4034. NSDecimalNumber RaiseTo (uint power, NSObject Behavior);
  4035. [Export ("decimalNumberByMultiplyingByPowerOf10:")]
  4036. NSDecimalNumber MultiplyPowerOf10 (short power);
  4037. [Export ("decimalNumberByMultiplyingByPowerOf10:withBehavior:")]
  4038. NSDecimalNumber MultiplyPowerOf10 (short power, NSObject Behavior);
  4039. [Export ("decimalNumberByRoundingAccordingToBehavior:")]
  4040. NSDecimalNumber Rounding (NSObject behavior);
  4041. [Export ("compare:")]
  4042. int Compare (NSNumber other);
  4043. [Export ("defaultBehavior")][Static]
  4044. NSObject DefaultBehavior { get; set; }
  4045. [Export ("doubleValue")]
  4046. double DoubleValue { get; }
  4047. }
  4048. [BaseType (typeof (NSObject))]
  4049. public interface NSThread {
  4050. [Static, Export ("currentThread")]
  4051. NSThread Current { get; }
  4052. //+ (void)detachNewThreadSelector:(SEL)selector toTarget:(id)target withObject:(id)argument;
  4053. [Static, Export ("isMultiThreaded")]
  4054. bool IsMultiThreaded { get; }
  4055. //- (NSMutableDictionary *)threadDictionary;
  4056. [Static, Export ("sleepUntilDate:")]
  4057. void SleepUntil (NSDate date);
  4058. [Static, Export ("sleepForTimeInterval:")]
  4059. void SleepFor (double timeInterval);
  4060. [Static, Export ("exit")]
  4061. void Exit ();
  4062. [Static, Export ("threadPriority"), Internal]
  4063. double _GetPriority ();
  4064. [Static, Export ("setThreadPriority:"), Internal]
  4065. bool _SetPriority (double priority);
  4066. //+ (NSArray *)callStackReturnAddresses;
  4067. [Export ("name")]
  4068. string Name { get; set; }
  4069. [Export ("stackSize")]
  4070. uint StackSize { get; set; }
  4071. [Export ("isMainThread")]
  4072. bool IsMainThread { get; }
  4073. // MainThread is already used for the instance selector and we can't reuse the same name
  4074. [Static]
  4075. [Export ("isMainThread")]
  4076. bool IsMain { get; }
  4077. [Static]
  4078. [Export ("mainThread")]
  4079. NSThread MainThread { get; }
  4080. [Export ("initWithTarget:selector:object:")]
  4081. IntPtr Constructor (NSObject target, Selector selector, [NullAllowed] NSObject argument);
  4082. [Export ("isExecuting")]
  4083. bool IsExecuting { get; }
  4084. [Export ("isFinished")]
  4085. bool IsFinished { get; }
  4086. [Export ("isCancelled")]
  4087. bool IsCancelled { get; }
  4088. [Export ("cancel")]
  4089. void Cancel ();
  4090. [Export ("start")]
  4091. void Start ();
  4092. [Export ("main")]
  4093. void Main ();
  4094. }
  4095. [BaseType (typeof (NSObject))]
  4096. [DisableDefaultCtor]
  4097. public interface NSPort {
  4098. [Static, Export ("port")]
  4099. NSPort Create ();
  4100. [Export ("invalidate")]
  4101. void Invalidate ();
  4102. [Export ("isValid")]
  4103. bool IsValid { get; }
  4104. [Export ("delegate"), NullAllowed]
  4105. NSObject WeakDelegate { get; set; }
  4106. [Wrap ("WeakDelegate"), NullAllowed]
  4107. NSPortDelegate Delegate { get; set; }
  4108. }
  4109. [Model, BaseType (typeof (NSObject))]
  4110. public interface NSPortDelegate {
  4111. [Export ("handlePortMessage:")]
  4112. void MessageReceived (NSPortMessage message);
  4113. }
  4114. [BaseType (typeof (NSObject))]
  4115. public interface NSPortMessage {
  4116. [Export ("initWithSendPort:receivePort:components:")]
  4117. IntPtr Constructor (NSPort sendPort, NSPort recvPort, NSArray components);
  4118. [Export ("sendBeforeDate:")]
  4119. bool SendBefore (NSDate date);
  4120. [Export ("components")]
  4121. NSArray Components { get; }
  4122. [Export ("receivePort")]
  4123. NSPort ReceivePort { get; }
  4124. [Export ("sendPort")]
  4125. NSPort SendPort { get; }
  4126. [Export ("msgid")]
  4127. uint MsgId { get; set; }
  4128. }
  4129. [BaseType (typeof (NSPort))]
  4130. public interface NSMachPort {
  4131. [Static, Export ("portWithMachPort:")]
  4132. NSPort FromMachPort (uint port);
  4133. [Static, Export ("portWithMachPort:options:")]
  4134. NSPort FromMachPort (uint port, NSMachPortRights options);
  4135. [Export ("machPort")]
  4136. uint MachPort { get; }
  4137. [Export ("removeFromRunLoop:forMode:")]
  4138. void RemoveFromRunLoop (NSRunLoop runLoop, NSString mode);
  4139. [Export ("scheduleInRunLoop:forMode:")]
  4140. void ScheduleInRunLoop (NSRunLoop runLoop, NSString mode);
  4141. [Export ("delegate"), NullAllowed]
  4142. NSObject WeakDelegate { get; set; }
  4143. [Wrap ("WeakDelegate"), NullAllowed]
  4144. NSMachPortDelegate Delegate { get; set; }
  4145. }
  4146. [Model, BaseType (typeof (NSPortDelegate))]
  4147. public interface NSMachPortDelegate {
  4148. [Export ("handleMachMessage:")]
  4149. void MachMessageReceived (IntPtr msgHeader);
  4150. }
  4151. [BaseType (typeof (NSObject))]
  4152. public interface NSProcessInfo {
  4153. [Export ("processInfo")][Static]
  4154. NSProcessInfo ProcessInfo { get; }
  4155. [Export ("arguments")]
  4156. string [] Arguments { get; }
  4157. [Export ("environment")]
  4158. NSDictionary Environment { get; }
  4159. [Export ("processIdentifier")]
  4160. int ProcessIdentifier { get; }
  4161. [Export ("globallyUniqueString")]
  4162. string GloballyUniqueString { get; }
  4163. [Export ("processName")]
  4164. string ProcessName { get; set; }
  4165. [Export ("hostName")]
  4166. string HostName { get; }
  4167. [Export ("operatingSystem")]
  4168. int OperatingSystem { get; }
  4169. [Export ("operatingSystemName")]
  4170. string OperatingSystemName { get; }
  4171. [Export ("operatingSystemVersionString")]
  4172. string OperatingSystemVersionString { get; }
  4173. [Export ("physicalMemory")]
  4174. ulong PhysicalMemory { get; }
  4175. [Export ("processorCount")]
  4176. int ProcessorCount { get; }
  4177. [Export ("activeProcessorCount")]
  4178. int ActiveProcessorCount { get; }
  4179. [Export ("systemUptime")]
  4180. double SystemUptime { get; }
  4181. [Export ("enableSuddenTermination")]
  4182. void EnableSuddenTermination ();
  4183. [Export ("disableSuddenTermination")]
  4184. void DisableSuddenTermination ();
  4185. [Export ("enableAutomaticTermination:")]
  4186. void EnableAutomaticTermination (string reason);
  4187. [Export ("disableAutomaticTermination:")]
  4188. void DisableAutomaticTermination (string reason);
  4189. [Export ("automaticTerminationSupportEnabled")]
  4190. bool AutomaticTerminationSupportEnabled { get; set; }
  4191. }
  4192. [BaseType (typeof (NSMutableData))]
  4193. [Since (4,0)]
  4194. public interface NSPurgeableData {
  4195. }
  4196. public delegate void NSFileCoordinatorWorker (NSUrl newUrl);
  4197. public delegate void NSFileCoordinatorWorkerRW (NSUrl newReadingUrl, NSUrl newWritingUrl);
  4198. [BaseType (typeof (NSObject))]
  4199. interface NSFileCoordinator {
  4200. [Static, Export ("addFilePresenter:")][PostGet ("FilePresenters")]
  4201. void AddFilePresenter (NSFilePresenter filePresenter);
  4202. [Static]
  4203. [Export ("removeFilePresenter:")][PostGet ("FilePresenters")]
  4204. void RemoveFilePresenter (NSFilePresenter filePresenter);
  4205. [Static]
  4206. [Export ("filePresenters")]
  4207. NSFilePresenter [] FilePresenters { get; }
  4208. [Export ("initWithFilePresenter:")]
  4209. IntPtr Constructor ([NullAllowed] NSFilePresenter filePresenterOrNil);
  4210. [Export ("coordinateReadingItemAtURL:options:error:byAccessor:")]
  4211. void CoordinateRead (NSUrl itemUrl, NSFileCoordinatorReadingOptions options, out NSError error, /* non null */ NSFileCoordinatorWorker worker);
  4212. [Export ("coordinateWritingItemAtURL:options:error:byAccessor:")]
  4213. void CoordinateWrite (NSUrl url, NSFileCoordinatorWritingOptions options, out NSError error, /* non null */ NSFileCoordinatorWorker worker);
  4214. [Export ("coordinateReadingItemAtURL:options:writingItemAtURL:options:error:byAccessor:")]
  4215. void CoordinateReadWrite (NSUrl readingURL, NSFileCoordinatorReadingOptions readingOptions, NSUrl writingURL, NSFileCoordinatorWritingOptions writingOptions, out NSError error, /* non null */ NSFileCoordinatorWorkerRW readWriteWorker);
  4216. [Export ("coordinateWritingItemAtURL:options:writingItemAtURL:options:error:byAccessor:")]
  4217. void CoordinateWriteWrite (NSUrl writingURL, NSFileCoordinatorWritingOptions writingOptions, NSUrl writingURL2, NSFileCoordinatorWritingOptions writingOptions2, out NSError error, /* non null */ NSFileCoordinatorWorkerRW writeWriteWorker);
  4218. [Export ("prepareForReadingItemsAtURLs:options:writingItemsAtURLs:options:error:byAccessor:")]
  4219. void CoordinateBatc (NSUrl [] readingURLs, NSFileCoordinatorReadingOptions readingOptions, NSUrl [] writingURLs, NSFileCoordinatorWritingOptions writingOptions, out NSError error, /* non null */ NSAction batchHandler);
  4220. [Export ("itemAtURL:didMoveToURL:")]
  4221. void ItemMoved (NSUrl fromUrl, NSUrl toUrl);
  4222. [Export ("cancel")]
  4223. void Cancel ();
  4224. [Since (6,0)]
  4225. [MountainLion]
  4226. [Export ("itemAtURL:willMoveToURL:")]
  4227. void WillMove (NSUrl oldUrl, NSUrl newUrl);
  4228. }
  4229. [BaseType (typeof (NSObject))]
  4230. public partial interface NSFileManager {
  4231. [Field("NSFileType")]
  4232. NSString NSFileType { get; }
  4233. [Field("NSFileTypeDirectory")]
  4234. NSString TypeDirectory { get; }
  4235. [Field("NSFileTypeRegular")]
  4236. NSString TypeRegular { get; }
  4237. [Field("NSFileTypeSymbolicLink")]
  4238. NSString TypeSymbolicLink { get; }
  4239. [Field("NSFileTypeSocket")]
  4240. NSString TypeSocket { get; }
  4241. [Field("NSFileTypeCharacterSpecial")]
  4242. NSString TypeCharacterSpecial { get; }
  4243. [Field("NSFileTypeBlockSpecial")]
  4244. NSString TypeBlockSpecial { get; }
  4245. [Field("NSFileTypeUnknown")]
  4246. NSString TypeUnknown { get; }
  4247. [Field("NSFileSize")]
  4248. NSString Size { get; }
  4249. [Field("NSFileModificationDate")]
  4250. NSString ModificationDate { get; }
  4251. [Field("NSFileReferenceCount")]
  4252. NSString ReferenceCount { get; }
  4253. [Field("NSFileDeviceIdentifier")]
  4254. NSString DeviceIdentifier { get; }
  4255. [Field("NSFileOwnerAccountName")]
  4256. NSString OwnerAccountName { get; }
  4257. [Field("NSFileGroupOwnerAccountName")]
  4258. NSString GroupOwnerAccountName { get; }
  4259. [Field("NSFilePosixPermissions")]
  4260. NSString PosixPermissions { get; }
  4261. [Field("NSFileSystemNumber")]
  4262. NSString SystemNumber { get; }
  4263. [Field("NSFileSystemFileNumber")]
  4264. NSString SystemFileNumber { get; }
  4265. [Field("NSFileExtensionHidden")]
  4266. NSString ExtensionHidden { get; }
  4267. [Field("NSFileHFSCreatorCode")]
  4268. NSString HfsCreatorCode { get; }
  4269. [Field("NSFileHFSTypeCode")]
  4270. NSString HfsTypeCode { get; }
  4271. [Field("NSFileImmutable")]
  4272. NSString Immutable { get; }
  4273. [Field("NSFileAppendOnly")]
  4274. NSString AppendOnly { get; }
  4275. [Field("NSFileCreationDate")]
  4276. NSString CreationDate { get; }
  4277. [Field("NSFileOwnerAccountID")]
  4278. NSString OwnerAccountID { get; }
  4279. [Field("NSFileGroupOwnerAccountID")]
  4280. NSString GroupOwnerAccountID { get; }
  4281. [Field("NSFileBusy")]
  4282. NSString Busy { get; }
  4283. #if !MONOMAC
  4284. [Field ("NSFileProtectionKey")]
  4285. NSString FileProtectionKey { get; }
  4286. [Field ("NSFileProtectionNone")]
  4287. NSString FileProtectionNone { get; }
  4288. [Field ("NSFileProtectionComplete")]
  4289. NSString FileProtectionComplete { get; }
  4290. [Since (5,0)]
  4291. [Field ("NSFileProtectionCompleteUnlessOpen")]
  4292. NSString FileProtectionCompleteUnlessOpen { get; }
  4293. [Since (5,0)]
  4294. [Field ("NSFileProtectionCompleteUntilFirstUserAuthentication")]
  4295. NSString FileProtectionCompleteUntilFirstUserAuthentication { get; }
  4296. #endif
  4297. [Field("NSFileSystemSize")]
  4298. NSString SystemSize { get; }
  4299. [Field("NSFileSystemFreeSize")]
  4300. NSString SystemFreeSize { get; }
  4301. [Field("NSFileSystemNodes")]
  4302. NSString SystemNodes { get; }
  4303. [Field("NSFileSystemFreeNodes")]
  4304. NSString SystemFreeNodes { get; }
  4305. [Static, Export ("defaultManager")]
  4306. NSFileManager DefaultManager { get; }
  4307. [Export ("delegate")]
  4308. NSObject WeakDelegate { get; set; }
  4309. [Wrap ("WeakDelegate")]
  4310. NSFileManagerDelegate Delegate { get; set; }
  4311. [Export ("setAttributes:ofItemAtPath:error:")]
  4312. bool SetAttributes (NSDictionary attributes, string path, out NSError error);
  4313. [Export ("createDirectoryAtPath:withIntermediateDirectories:attributes:error:")]
  4314. bool CreateDirectory (string path, bool createIntermediates, [NullAllowed] NSDictionary attributes, out NSError error);
  4315. [Export ("contentsOfDirectoryAtPath:error:")]
  4316. string[] GetDirectoryContent (string path, out NSError error);
  4317. [Export ("subpathsOfDirectoryAtPath:error:")]
  4318. string[] GetDirectoryContentRecursive (string path, out NSError error);
  4319. [Export ("attributesOfItemAtPath:error:")][Internal]
  4320. NSDictionary _GetAttributes (string path, out NSError error);
  4321. [Export ("attributesOfFileSystemForPath:error:")][Internal]
  4322. NSDictionary _GetFileSystemAttributes (String path, out NSError error);
  4323. [Export ("createSymbolicLinkAtPath:withDestinationPath:error:")]
  4324. bool CreateSymbolicLink (string path, string destPath, out NSError error);
  4325. [Export ("destinationOfSymbolicLinkAtPath:error:")]
  4326. string GetSymbolicLinkDestination (string path, out NSError error);
  4327. [Export ("copyItemAtPath:toPath:error:")]
  4328. bool Copy (string srcPath, string dstPath, out NSError error);
  4329. [Export ("moveItemAtPath:toPath:error:")]
  4330. bool Move (string srcPath, string dstPath, out NSError error);
  4331. [Export ("linkItemAtPath:toPath:error:")]
  4332. bool Link (string srcPath, string dstPath, out NSError error);
  4333. [Export ("removeItemAtPath:error:")]
  4334. bool Remove ([NullAllowed] string path, out NSError error);
  4335. #if DEPRECATED
  4336. // These are not available on iOS, and deprecated on OSX.
  4337. [Export ("linkPath:toPath:handler:")]
  4338. bool LinkPath (string src, string dest, IntPtr handler);
  4339. [Export ("copyPath:toPath:handler:")]
  4340. bool CopyPath (string src, string dest, IntPtr handler);
  4341. [Export ("movePath:toPath:handler:")]
  4342. bool MovePath (string src, string dest, IntPtr handler);
  4343. [Export ("removeFileAtPath:handler:")]
  4344. bool RemoveFileAtPath (string path, IntPtr handler);
  4345. #endif
  4346. [Export ("currentDirectoryPath")]
  4347. string GetCurrentDirectory ();
  4348. [Export ("changeCurrentDirectoryPath:")]
  4349. bool ChangeCurrentDirectory (string path);
  4350. [Export ("fileExistsAtPath:")]
  4351. bool FileExists (string path);
  4352. [Export ("fileExistsAtPath:isDirectory:")]
  4353. bool FileExists (string path, ref bool isDirectory);
  4354. [Export ("isReadableFileAtPath:")]
  4355. bool IsReadableFile (string path);
  4356. [Export ("isWritableFileAtPath:")]
  4357. bool IsWritableFile (string path);
  4358. [Export ("isExecutableFileAtPath:")]
  4359. bool IsExecutableFile (string path);
  4360. [Export ("isDeletableFileAtPath:")]
  4361. bool IsDeletableFile (string path);
  4362. [Export ("contentsEqualAtPath:andPath:")]
  4363. bool ContentsEqual (string path1, string path2);
  4364. [Export ("displayNameAtPath:")]
  4365. string DisplayName (string path);
  4366. [Export ("componentsToDisplayForPath:")]
  4367. string[] ComponentsToDisplay (string path);
  4368. [Export ("enumeratorAtPath:")]
  4369. NSDirectoryEnumerator GetEnumerator (string path);
  4370. [Export ("subpathsAtPath:")]
  4371. string[] Subpaths (string path);
  4372. [Export ("contentsAtPath:")]
  4373. NSData Contents (string path);
  4374. [Export ("createFileAtPath:contents:attributes:")]
  4375. bool CreateFile (string path, NSData data, [NullAllowed] NSDictionary attr);
  4376. [Since (4,0)]
  4377. [Export ("contentsOfDirectoryAtURL:includingPropertiesForKeys:options:error:")]
  4378. NSUrl[] GetDirectoryContent (NSUrl url, NSArray properties, NSDirectoryEnumerationOptions options, out NSError error);
  4379. [Since (4,0)]
  4380. [Export ("copyItemAtURL:toURL:error:")]
  4381. bool Copy (NSUrl srcUrl, NSUrl dstUrl, out NSError error);
  4382. [Since (4,0)]
  4383. [Export ("moveItemAtURL:toURL:error:")]
  4384. bool Move (NSUrl srcUrl, NSUrl dstUrl, out NSError error);
  4385. [Since (4,0)]
  4386. [Export ("linkItemAtURL:toURL:error:")]
  4387. bool Link (NSUrl srcUrl, NSUrl dstUrl, out NSError error);
  4388. [Since (4,0)]
  4389. [Export ("removeItemAtURL:error:")]
  4390. bool Remove ([NullAllowed] NSUrl url, out NSError error);
  4391. [Since (4,0)]
  4392. [Export ("enumeratorAtURL:includingPropertiesForKeys:options:errorHandler:")]
  4393. NSDirectoryEnumerator GetEnumerator (NSUrl url, [NullAllowed] NSArray properties, NSDirectoryEnumerationOptions options, [NullAllowed] NSEnumerateErrorHandler handler);
  4394. [Since (4,0)]
  4395. [Export ("URLForDirectory:inDomain:appropriateForURL:create:error:")]
  4396. NSUrl GetUrl (NSSearchPathDirectory directory, NSSearchPathDomain domain, [NullAllowed] NSUrl url, bool shouldCreate, out NSError error);
  4397. [Since (4,0)]
  4398. [Export ("URLsForDirectory:inDomains:")]
  4399. NSUrl[] GetUrls (NSSearchPathDirectory directory, NSSearchPathDomain domains);
  4400. [Since (4,0)]
  4401. [Export ("replaceItemAtURL:withItemAtURL:backupItemName:options:resultingItemURL:error:")]
  4402. bool Replace (NSUrl originalItem, NSUrl newItem, [NullAllowed] string backupItemName, NSFileManagerItemReplacementOptions options, out NSUrl resultingURL, out NSError error);
  4403. [Since (4,0)]
  4404. [Export ("mountedVolumeURLsIncludingResourceValuesForKeys:options:")]
  4405. NSUrl[] GetMountedVolumes ([NullAllowed] NSArray properties, NSVolumeEnumerationOptions options);
  4406. // Methods to convert paths to/from C strings for passing to system calls - Not implemented
  4407. ////- (const char *)fileSystemRepresentationWithPath:(NSString *)path;
  4408. //[Export ("fileSystemRepresentationWithPath:")]
  4409. //const char FileSystemRepresentationWithPath (string path);
  4410. ////- (NSString *)stringWithFileSystemRepresentation:(const char *)str length:(NSUInteger)len;
  4411. //[Export ("stringWithFileSystemRepresentation:length:")]
  4412. //string StringWithFileSystemRepresentation (const char str, uint len);
  4413. [Since (5,0)]
  4414. [Export ("createDirectoryAtURL:withIntermediateDirectories:attributes:error:")]
  4415. bool CreateDirectory (NSUrl url, bool createIntermediates, [NullAllowed] NSDictionary attributes, out NSError error);
  4416. [Since (5,0)]
  4417. [Export ("createSymbolicLinkAtURL:withDestinationURL:error:")]
  4418. bool CreateSymbolicLink (NSUrl url, NSUrl destURL, out NSError error);
  4419. [Since (5,0)]
  4420. [Export ("setUbiquitous:itemAtURL:destinationURL:error:")]
  4421. bool SetUbiquitous (bool flag, NSUrl url, NSUrl destinationUrl, out NSError error);
  4422. [Since (5,0)]
  4423. [Export ("isUbiquitousItemAtURL:")]
  4424. bool IsUbiquitous (NSUrl url);
  4425. [Since (5,0)]
  4426. [Export ("startDownloadingUbiquitousItemAtURL:error:")]
  4427. bool StartDownloadingUbiquitous (NSUrl url, out NSError error);
  4428. [Since (5,0)]
  4429. [Export ("evictUbiquitousItemAtURL:error:")]
  4430. bool EvictUbiquitous (NSUrl url, out NSError error);
  4431. [Since (5,0)]
  4432. [Export ("URLForUbiquityContainerIdentifier:")]
  4433. NSUrl GetUrlForUbiquityContainer ([NullAllowed] string containerIdentifier);
  4434. [Since (5,0)]
  4435. [Export ("URLForPublishingUbiquitousItemAtURL:expirationDate:error:")]
  4436. NSUrl GetUrlForPublishingUbiquitousItem (NSUrl url, out NSDate expirationDate, out NSError error);
  4437. [Since (6,0)]
  4438. [MountainLion]
  4439. [Export ("ubiquityIdentityToken")]
  4440. NSObject UbiquityIdentityToken { get; }
  4441. [Since (6,0)]
  4442. [MountainLion]
  4443. [Field ("NSUbiquityIdentityDidChangeNotification")]
  4444. [Notification]
  4445. NSString UbiquityIdentityDidChangeNotification { get; }
  4446. }
  4447. [BaseType(typeof(NSObject))]
  4448. [Model]
  4449. [Protocol]
  4450. public interface NSFileManagerDelegate {
  4451. [Export("fileManager:shouldCopyItemAtPath:toPath:")]
  4452. bool ShouldCopyItemAtPath(NSFileManager fm, NSString srcPath, NSString dstPath);
  4453. #if MONOTOUCH
  4454. [Export("fileManager:shouldCopyItemAtURL:toURL:")]
  4455. bool ShouldCopyItemAtUrl(NSFileManager fm, NSUrl srcUrl, NSUrl dstUrl);
  4456. [Export ("fileManager:shouldLinkItemAtURL:toURL:")]
  4457. bool ShouldLinkItemAtUrl (NSFileManager fileManager, NSUrl srcUrl, NSUrl dstUrl);
  4458. [Export ("fileManager:shouldMoveItemAtURL:toURL:")]
  4459. bool ShouldMoveItemAtUrl (NSFileManager fileManager, NSUrl srcUrl, NSUrl dstUrl);
  4460. [Export ("fileManager:shouldProceedAfterError:copyingItemAtURL:toURL:")]
  4461. bool ShouldProceedAfterErrorCopyingItem (NSFileManager fileManager, NSError error, NSUrl srcUrl, NSUrl dstUrl);
  4462. [Export ("fileManager:shouldProceedAfterError:linkingItemAtURL:toURL:")]
  4463. bool ShouldProceedAfterErrorLinkingItem (NSFileManager fileManager, NSError error, NSUrl srcUrl, NSUrl dstUrl);
  4464. [Export ("fileManager:shouldProceedAfterError:movingItemAtURL:toURL:")]
  4465. bool ShouldProceedAfterErrorMovingItem (NSFileManager fileManager, NSError error, NSUrl srcUrl, NSUrl dstUrl);
  4466. [Export ("fileManager:shouldRemoveItemAtURL:")]
  4467. bool ShouldRemoveItemAtUrl (NSFileManager fileManager, NSUrl url);
  4468. [Export ("fileManager:shouldProceedAfterError:removingItemAtURL:")]
  4469. bool ShouldProceedAfterErrorRemovingItem (NSFileManager fileManager, NSError error, NSUrl url);
  4470. #endif
  4471. [Export ("fileManager:shouldProceedAfterError:")]
  4472. bool ShouldProceedAfterError (NSFileManager fm, NSDictionary errorInfo);
  4473. // Deprecated
  4474. //[Export ("fileManager:willProcessPath:")]
  4475. //void WillProcessPath (NSFileManager fm, string path);
  4476. [Export ("fileManager:shouldCopyItemAtPath:toPath:")]
  4477. bool ShouldCopyItemAtPath (NSFileManager fileManager, string srcPath, string dstPath);
  4478. [Export ("fileManager:shouldProceedAfterError:copyingItemAtPath:toPath:")]
  4479. bool ShouldProceedAfterErrorCopyingItem (NSFileManager fileManager, NSError error, string srcPath, string dstPath);
  4480. [Export ("fileManager:shouldMoveItemAtPath:toPath:")]
  4481. bool ShouldMoveItemAtPath (NSFileManager fileManager, string srcPath, string dstPath);
  4482. [Export ("fileManager:shouldProceedAfterError:movingItemAtPath:toPath:")]
  4483. bool ShouldProceedAfterErrorMovingItem (NSFileManager fileManager, NSError error, string srcPath, string dstPath);
  4484. [Export ("fileManager:shouldLinkItemAtPath:toPath:")]
  4485. bool ShouldLinkItemAtPath (NSFileManager fileManager, string srcPath, string dstPath);
  4486. [Export ("fileManager:shouldProceedAfterError:linkingItemAtPath:toPath:")]
  4487. bool ShouldProceedAfterErrorLinkingItem (NSFileManager fileManager, NSError error, string srcPath, string dstPath);
  4488. [Export ("fileManager:shouldRemoveItemAtPath:")]
  4489. bool ShouldRemoveItemAtPath (NSFileManager fileManager, string path);
  4490. [Export ("fileManager:shouldProceedAfterError:removingItemAtPath:")]
  4491. bool ShouldProceedAfterErrorRemovingItem (NSFileManager fileManager, NSError error, string path);
  4492. }
  4493. [BaseType (typeof (NSObject))]
  4494. [Model]
  4495. [Protocol]
  4496. partial interface NSFilePresenter {
  4497. [Abstract]
  4498. [Export ("presentedItemURL")]
  4499. NSUrl PresentedItemURL { get; }
  4500. [Export ("presentedItemOperationQueue")]
  4501. NSOperationQueue PesentedItemOperationQueue { get; }
  4502. #if DOUBLE_BLOCKS
  4503. [Export ("relinquishPresentedItemToReader:")]
  4504. void RelinquishPresentedItem (NSAction readerAction);
  4505. [Export ("relinquishPresentedItemToWriter:")]
  4506. void RelinquishPresentedItem (NSAction writerAction);
  4507. [Export ("savePresentedItemChangesWithCompletionHandler:")]
  4508. void SavePresentedItemChanges (...);
  4509. [Export ("accommodatePresentedItemDeletionWithCompletionHandler:")]
  4510. void AccommodatePresentedItem (..);
  4511. #endif
  4512. [Export ("presentedItemDidMoveToURL:")]
  4513. void PresentedItemMoved (NSUrl newURL);
  4514. [Export ("presentedItemDidChange")]
  4515. void PresentedItemChanged ();
  4516. [Export ("presentedItemDidGainVersion:")]
  4517. void PresentedItemGainedVersion (NSFileVersion version);
  4518. [Export ("presentedItemDidLoseVersion:")]
  4519. void PresentedItemLostVersion (NSFileVersion version);
  4520. [Export ("presentedItemDidResolveConflictVersion:")]
  4521. void PresentedItemResolveConflictVersion (NSFileVersion version);
  4522. #if DOUBLE_BLOCKS
  4523. [Export ("accommodatePresentedSubitemDeletionAtURL:completionHandler:NSError*errorOrNil))completionHandler")]
  4524. void AccommodatePresentedSubitemDeletion (NSUrl url,
  4525. #endif
  4526. [Export ("presentedSubitemDidAppearAtURL:")]
  4527. void PresentedSubitemAppeared (NSUrl atUrl);
  4528. [Export ("presentedSubitemAtURL:didMoveToURL:")]
  4529. void PresentedSubitemMoved (NSUrl oldURL, NSUrl newURL);
  4530. [Export ("presentedSubitemDidChangeAtURL:")]
  4531. void PresentedSubitemChanged (NSUrl url);
  4532. [Export ("presentedSubitemAtURL:didGainVersion:")]
  4533. void PresentedSubitemGainedVersion (NSUrl url, NSFileVersion version);
  4534. [Export ("presentedSubitemAtURL:didLoseVersion:")]
  4535. void PresentedSubitemLostVersion (NSUrl url, NSFileVersion version);
  4536. [Export ("presentedSubitemAtURL:didResolveConflictVersion:")]
  4537. void PresentedSubitemResolvedConflictVersion (NSUrl url, NSFileVersion version);
  4538. }
  4539. [BaseType (typeof (NSObject))]
  4540. // Objective-C exception thrown. Name: NSGenericException Reason: -[NSFileVersion init]: You have to use one of the factory methods to instantiate NSFileVersion.
  4541. [DisableDefaultCtor]
  4542. interface NSFileVersion {
  4543. [Export ("URL")]
  4544. NSUrl Url { get; }
  4545. [Export ("localizedName")]
  4546. string LocalizedName { get; }
  4547. [Export ("localizedNameOfSavingComputer")]
  4548. string LocalizedNameOfSavingComputer { get; }
  4549. [Export ("modificationDate")]
  4550. NSDate ModificationDate { get; }
  4551. [Export ("persistentIdentifier")]
  4552. NSObject PersistentIdentifier { get; }
  4553. [Export ("conflict")]
  4554. bool IsConflict { [Bind ("isConflict")] get; }
  4555. [Export ("resolved")]
  4556. bool Resolved { [Bind ("isResolved")] get; set; }
  4557. #if MONOMAC
  4558. [Export ("discardable")]
  4559. bool Discardable { [Bind ("isDiscardable")] get; set; }
  4560. #endif
  4561. [Static]
  4562. [Export ("currentVersionOfItemAtURL:")]
  4563. NSFileVersion GetCurrentVersion (NSUrl url);
  4564. [Static]
  4565. [Export ("otherVersionsOfItemAtURL:")]
  4566. NSFileVersion [] GetOtherVersions (NSUrl url);
  4567. [Static]
  4568. [Export ("unresolvedConflictVersionsOfItemAtURL:")]
  4569. NSFileVersion [] GetUnresolvedConflictVersions (NSUrl url);
  4570. [Static]
  4571. [Export ("versionOfItemAtURL:forPersistentIdentifier:")]
  4572. NSFileVersion GetSpecificVersion (NSUrl url, NSObject persistentIdentifier);
  4573. #if MONOMAC
  4574. [Static]
  4575. [Export ("addVersionOfItemAtURL:withContentsOfURL:options:error:")]
  4576. NSFileVersion AddVersion (NSUrl url, NSUrl contentsURL, NSFileVersionAddingOptions options, out NSError outError);
  4577. [Static]
  4578. [Export ("temporaryDirectoryURLForNewVersionOfItemAtURL:")]
  4579. NSUrl TemporaryDirectoryForItem (NSUrl url);
  4580. #endif
  4581. [Export ("replaceItemAtURL:options:error:")]
  4582. NSUrl ReplaceItem (NSUrl url, NSFileVersionReplacingOptions options, out NSError error);
  4583. [Export ("removeAndReturnError:")]
  4584. bool Remove (out NSError outError);
  4585. [Static]
  4586. [Export ("removeOtherVersionsOfItemAtURL:error:")]
  4587. bool RemoveOtherVersions (NSUrl url, out NSError outError);
  4588. }
  4589. [BaseType (typeof (NSObject))]
  4590. public interface NSFileWrapper {
  4591. [Export ("initWithURL:options:error:")]
  4592. IntPtr Constructor (NSUrl url, NSFileWrapperReadingOptions options, out NSError outError);
  4593. [Export ("initDirectoryWithFileWrappers:")]
  4594. IntPtr Constructor (NSDictionary childrenByPreferredName);
  4595. [Export ("initRegularFileWithContents:")]
  4596. IntPtr Constructor (NSData contents);
  4597. [Export ("initSymbolicLinkWithDestinationURL:")]
  4598. IntPtr Constructor (NSUrl urlToSymbolicLink);
  4599. // Constructor clash
  4600. //[Export ("initWithSerializedRepresentation:")]
  4601. //IntPtr Constructor (NSData serializeRepresentation);
  4602. [Export ("isDirectory")]
  4603. bool IsDirectory { get; }
  4604. [Export ("isRegularFile")]
  4605. bool IsRegularFile { get; }
  4606. [Export ("isSymbolicLink")]
  4607. bool IsSymbolicLink { get; }
  4608. [Export ("matchesContentsOfURL:")]
  4609. bool MatchesContentsOfURL (NSUrl url);
  4610. [Export ("readFromURL:options:error:")]
  4611. bool Read (NSUrl url, NSFileWrapperReadingOptions options, out NSError outError);
  4612. [Export ("writeToURL:options:originalContentsURL:error:")]
  4613. bool Write (NSUrl url, NSFileWrapperWritingOptions options, NSUrl originalContentsURL, out NSError outError);
  4614. [Export ("serializedRepresentation")]
  4615. NSData GetSerializedRepresentation ();
  4616. [Export ("addFileWrapper:")]
  4617. string AddFileWrapper (NSFileWrapper child);
  4618. [Export ("addRegularFileWithContents:preferredFilename:")]
  4619. string AddRegularFile (NSData dataContents, string preferredFilename);
  4620. [Export ("removeFileWrapper:")]
  4621. void RemoveFileWrapper (NSFileWrapper child);
  4622. [Export ("fileWrappers")]
  4623. NSDictionary FileWrappers { get; }
  4624. [Export ("keyForFileWrapper:")]
  4625. string KeyForFileWrapper (NSFileWrapper child);
  4626. [Export ("regularFileContents")]
  4627. NSData GetRegularFileContents ();
  4628. [Export ("symbolicLinkDestinationURL")]
  4629. NSUrl SymbolicLinkDestinationURL { get; }
  4630. //Detected properties
  4631. [Export ("preferredFilename")]
  4632. string PreferredFilename { get; set; }
  4633. [Export ("filename")]
  4634. string Filename { get; set; }
  4635. [Export ("fileAttributes")]
  4636. NSDictionary FileAttributes { get; set; }
  4637. }
  4638. [BaseType (typeof (NSEnumerator))]
  4639. public interface NSDirectoryEnumerator {
  4640. [Export ("fileAttributes")]
  4641. NSDictionary FileAttributes { get; }
  4642. [Export ("directoryAttributes")]
  4643. NSDictionary DirectoryAttributes { get; }
  4644. [Export ("skipDescendents")]
  4645. void SkipDescendents ();
  4646. #if MONOTOUCH
  4647. [Export ("level")]
  4648. int Level { get; }
  4649. #endif
  4650. #if MONOMAC
  4651. ////- (unsigned long long)fileSize;
  4652. //[Export ("fileSize")]
  4653. //unsigned long long FileSize ([Target] NSDictionary fileAttributes);
  4654. [Export ("fileModificationDate")]
  4655. NSDate FileModificationDate ([Target] NSDictionary fileAttributes);
  4656. [Export ("fileType")]
  4657. string FileType ([Target] NSDictionary fileAttributes);
  4658. [Export ("filePosixPermissions")]
  4659. uint FilePosixPermissions ([Target] NSDictionary fileAttributes);
  4660. [Export ("fileOwnerAccountName")]
  4661. string FileOwnerAccountName ([Target] NSDictionary fileAttributes);
  4662. [Export ("fileGroupOwnerAccountName")]
  4663. string FileGroupOwnerAccountName ([Target] NSDictionary fileAttributes);
  4664. [Export ("fileSystemNumber")]
  4665. int FileSystemNumber ([Target] NSDictionary fileAttributes);
  4666. [Export ("fileSystemFileNumber")]
  4667. uint FileSystemFileNumber ([Target] NSDictionary fileAttributes);
  4668. [Export ("fileExtensionHidden")]
  4669. bool FileExtensionHidden ([Target] NSDictionary fileAttributes);
  4670. [Export ("fileHFSCreatorCode")]
  4671. uint FileHfsCreatorCode ([Target] NSDictionary fileAttributes);
  4672. [Export ("fileHFSTypeCode")]
  4673. uint FileHfsTypeCode ([Target] NSDictionary fileAttributes);
  4674. [Export ("fileIsImmutable")]
  4675. bool FileIsImmutable ([Target] NSDictionary fileAttributes);
  4676. [Export ("fileIsAppendOnly")]
  4677. bool FileIsAppendOnly ([Target] NSDictionary fileAttributes);
  4678. [Export ("fileCreationDate")]
  4679. NSDate FileCreationDate ([Target] NSDictionary fileAttributes);
  4680. [Export ("fileOwnerAccountID")]
  4681. NSNumber FileOwnerAccountID ([Target] NSDictionary fileAttributes);
  4682. [Export ("fileGroupOwnerAccountID")]
  4683. NSNumber FileGroupOwnerAccountID ([Target] NSDictionary fileAttributes);
  4684. #endif
  4685. }
  4686. public delegate bool NSPredicateEvaluator (NSObject evaluatedObject, NSDictionary bindings);
  4687. [BaseType (typeof (NSObject))]
  4688. [Since (4,0)]
  4689. // 'init' returns NIL
  4690. [DisableDefaultCtor]
  4691. public interface NSPredicate {
  4692. [Static]
  4693. [Export ("predicateWithFormat:argumentArray:")]
  4694. NSPredicate FromFormat (string predicateFormat, NSObject[] arguments);
  4695. [Static, Export ("predicateWithValue:")]
  4696. NSPredicate FromValue (bool value);
  4697. [Static, Export ("predicateWithBlock:")]
  4698. NSPredicate FromExpression (NSPredicateEvaluator evaluator);
  4699. [Export ("predicateFormat")]
  4700. string PredicateFormat { get; }
  4701. [Export ("predicateWithSubstitutionVariables:")]
  4702. NSPredicate PredicateWithSubstitutionVariables (NSDictionary substitutionVariables);
  4703. [Export ("evaluateWithObject:")]
  4704. bool EvaluateWithObject (NSObject obj);
  4705. [Export ("evaluateWithObject:substitutionVariables:")]
  4706. bool EvaluateWithObject (NSObject obj, NSDictionary substitutionVariables);
  4707. }
  4708. #if MONOMAC
  4709. [BaseType (typeof (NSObject), Name="NSURLDownload")]
  4710. public interface NSUrlDownload {
  4711. [Static, Export ("canResumeDownloadDecodedWithEncodingMIMEType:")]
  4712. bool CanResumeDownloadDecodedWithEncodingMimeType (string mimeType);
  4713. [Export ("initWithRequest:delegate:")]
  4714. IntPtr Constructor (NSUrlRequest request, NSObject delegate1);
  4715. [Export ("initWithResumeData:delegate:path:")]
  4716. IntPtr Constructor (NSData resumeData, NSObject delegate1, string path);
  4717. [Export ("cancel")]
  4718. void Cancel ();
  4719. [Export ("setDestination:allowOverwrite:")]
  4720. void SetDestination (string path, bool allowOverwrite);
  4721. [Export ("request")]
  4722. NSUrlRequest Request { get; }
  4723. [Export ("resumeData")]
  4724. NSData ResumeData { get; }
  4725. [Export ("deletesFileUponFailure")]
  4726. bool DeletesFileUponFailure { get; set; }
  4727. }
  4728. [BaseType (typeof (NSObject))]
  4729. [Model]
  4730. public interface NSUrlDownloadDelegate {
  4731. [Export ("downloadDidBegin:")]
  4732. void DownloadBegan (NSUrlDownload download);
  4733. [Export ("download:willSendRequest:redirectResponse:")]
  4734. NSUrlRequest WillSendRequest (NSUrlDownload download, NSUrlRequest request, NSUrlResponse redirectResponse);
  4735. [Export ("download:didReceiveAuthenticationChallenge:")]
  4736. void ReceivedAuthenticationChallenge (NSUrlDownload download, NSUrlAuthenticationChallenge challenge);
  4737. [Export ("download:didCancelAuthenticationChallenge:")]
  4738. void CanceledAuthenticationChallenge (NSUrlDownload download, NSUrlAuthenticationChallenge challenge);
  4739. [Export ("download:didReceiveResponse:")]
  4740. void ReceivedResponse (NSUrlDownload download, NSUrlResponse response);
  4741. //- (void)download:(NSUrlDownload *)download willResumeWithResponse:(NSUrlResponse *)response fromByte:(long long)startingByte;
  4742. [Export ("download:willResumeWithResponse:fromByte:")]
  4743. void Resume (NSUrlDownload download, NSUrlResponse response, long startingByte);
  4744. //- (void)download:(NSUrlDownload *)download didReceiveDataOfLength:(NSUInteger)length;
  4745. [Export ("download:didReceiveDataOfLength:")]
  4746. void ReceivedData (NSUrlDownload download, uint length);
  4747. [Export ("download:shouldDecodeSourceDataOfMIMEType:")]
  4748. bool DecodeSourceData (NSUrlDownload download, string encodingType);
  4749. [Export ("download:decideDestinationWithSuggestedFilename:")]
  4750. void DecideDestination (NSUrlDownload download, string suggestedFilename);
  4751. [Export ("download:didCreateDestination:")]
  4752. void CreatedDestination (NSUrlDownload download, string path);
  4753. [Export ("downloadDidFinish:")]
  4754. void Finished (NSUrlDownload download);
  4755. [Export ("download:didFailWithError:")]
  4756. void FailedWithError(NSUrlDownload download, NSError error);
  4757. }
  4758. #endif
  4759. interface NSUrlProtocolClient {
  4760. }
  4761. [BaseType (typeof (NSObject),
  4762. Name="NSURLProtocol",
  4763. Delegates=new string [] {"WeakClient"})]
  4764. interface NSUrlProtocol {
  4765. [Export ("initWithRequest:cachedResponse:client:")]
  4766. IntPtr Constructor (NSUrlRequest request, [NullAllowed] NSCachedUrlResponse cachedResponse, NSUrlProtocolClient client);
  4767. [Export ("client")]
  4768. NSObject WeakClient { get; }
  4769. [Export ("request")]
  4770. NSUrlRequest Request { get; }
  4771. [Export ("cachedResponse")]
  4772. NSCachedUrlResponse CachedResponse { get; }
  4773. [Static]
  4774. [Export ("canInitWithRequest:")]
  4775. bool CanInitWithRequest (NSUrlRequest request);
  4776. [Static]
  4777. [Export ("canonicalRequestForRequest:")]
  4778. NSUrlRequest GetCanonicalRequest (NSUrlRequest forRequest);
  4779. [Static]
  4780. [Export ("requestIsCacheEquivalent:toRequest:")]
  4781. bool IsRequestCacheEquivalent (NSUrlRequest first, NSUrlRequest second);
  4782. [Export ("startLoading")]
  4783. void StartLoading ();
  4784. [Export ("stopLoading")]
  4785. void StopLoading ();
  4786. [Static]
  4787. [Export ("propertyForKey:inRequest:")]
  4788. NSObject GetProperty (string key, NSUrlRequest inRequest);
  4789. [Static]
  4790. [Export ("setProperty:forKey:inRequest:")]
  4791. void SetProperty ([NullAllowed] NSObject value, string key, NSMutableUrlRequest inRequest);
  4792. [Static]
  4793. [Export ("removePropertyForKey:inRequest:")]
  4794. void RemoveProperty (string propertyKey, NSMutableUrlRequest request);
  4795. [Static]
  4796. [Export ("registerClass:")]
  4797. bool RegisterClass (Class protocolClass);
  4798. [Static]
  4799. [Export ("unregisterClass:")]
  4800. void UnregisterClass (Class protocolClass);
  4801. }
  4802. [BaseType (typeof(NSObject))]
  4803. [DisableDefaultCtor]
  4804. public interface NSPropertyListSerialization {
  4805. [Static, Export ("dataWithPropertyList:format:options:error:")]
  4806. NSData DataWithPropertyList (NSObject plist, NSPropertyListFormat format,
  4807. NSPropertyListWriteOptions options, out NSError error);
  4808. [Static, Export ("writePropertyList:toStream:format:options:error:")]
  4809. int WritePropertyList (NSObject plist, NSOutputStream stream, NSPropertyListFormat format,
  4810. NSPropertyListWriteOptions options, out NSError error);
  4811. [Static, Export ("propertyListWithData:options:format:error:")]
  4812. NSObject PropertyListWithData (NSData data, NSPropertyListReadOptions options,
  4813. ref NSPropertyListFormat format, out NSError error);
  4814. [Static, Export ("propertyListWithStream:options:format:error:")]
  4815. NSObject PropertyListWithStream (NSInputStream stream, NSPropertyListReadOptions options,
  4816. ref NSPropertyListFormat format, out NSError error);
  4817. [Static, Export ("propertyList:isValidForFormat:")]
  4818. bool IsValidForFormat (NSObject plist, NSPropertyListFormat format);
  4819. }
  4820. }