FBPasteboard.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /**
  2. * Copyright (c) 2015-present, Facebook, Inc.
  3. * All rights reserved.
  4. *
  5. * This source code is licensed under the BSD-style license found in the
  6. * LICENSE file in the root directory of this source tree. An additional grant
  7. * of patent rights can be found in the PATENTS file in the same directory.
  8. */
  9. #import <XCTest/XCTest.h>
  10. NS_ASSUME_NONNULL_BEGIN
  11. #if !TARGET_OS_TV
  12. @interface FBPasteboard : NSObject
  13. /**
  14. Sets data to the general pasteboard
  15. @param data base64-encoded string containing the data chunk which is going to be written to the pasteboard
  16. @param type one of the possible data types to set: plaintext, url, image
  17. @param error If there is an error, upon return contains an NSError object that describes the problem
  18. @return YES if the operation was successful
  19. */
  20. + (BOOL)setData:(NSData *)data forType:(NSString *)type error:(NSError **)error;
  21. /**
  22. Gets the data contained in the general pasteboard
  23. @param type one of the possible data types to get: plaintext, url, image
  24. @param error If there is an error, upon return contains an NSError object that describes the problem
  25. @return NSData object, containing the pasteboard content or an empty string if the pasteboard is empty.
  26. nil is returned if there was an error while getting the data from the pasteboard
  27. */
  28. + (nullable NSData *)dataForType:(NSString *)type error:(NSError **)error;
  29. @end
  30. #endif
  31. NS_ASSUME_NONNULL_END