Revision: 29011
http://sourceforge.net/p/bibdesk/svn/29011
Author: hofman
Date: 2025-02-17 10:20:15 +0000 (Mon, 17 Feb 2025)
Log Message:
-----------
add nullable qqualifiers for BibItem class
Modified Paths:
--------------
trunk/bibdesk/BibItem.h
Modified: trunk/bibdesk/BibItem.h
===================================================================
--- trunk/bibdesk/BibItem.h 2025-02-17 09:49:36 UTC (rev 29010)
+++ trunk/bibdesk/BibItem.h 2025-02-17 10:20:15 UTC (rev 29011)
@@ -43,6 +43,8 @@
#import "BDSKLinkedFile.h"
#import "BDSKItemDownload.h"
+NS_ASSUME_NONNULL_BEGIN
+
extern NSString *BDSKBibItemKeyKey;
extern NSString *BDSKBibItemOldValueKey;
extern NSString *BDSKBibItemNewValueKey;
@@ -132,9 +134,9 @@
@property (class, nonatomic, readonly) NSString *placeholderCiteKey;
+ (NSData *)archivedPublications:(NSArray *)array;
-+ (NSArray *)publicationsFromPasteboard:(NSPasteboard *)pboard
macroResolver:(BDSKMacroResolver *)aMacroResolver;
++ (NSArray *)publicationsFromPasteboard:(NSPasteboard *)pboard
macroResolver:(nullable BDSKMacroResolver *)aMacroResolver;
-- (id)copyWithMacroResolver:(BDSKMacroResolver *)aMacroResolver;
+- (id)copyWithMacroResolver:(nullable BDSKMacroResolver *)aMacroResolver;
- (NSArray *)files;
- (NSUInteger)countOfFiles;
@@ -150,27 +152,27 @@
- (void)addURLString:(NSString *)urlString;
-- (BOOL)migrateFilesWithRemoveOptions:(BDSKRemoveFieldsOption)removeMask
numberOfAddedFiles:(NSInteger *)numberOfAddedFiles
numberOfRemovedFields:(NSInteger *)numberOfRemovedFields error:(NSError
**)outError;
+- (BOOL)migrateFilesWithRemoveOptions:(BDSKRemoveFieldsOption)removeMask
numberOfAddedFiles:(NSInteger * _Nullable)numberOfAddedFiles
numberOfRemovedFields:(NSInteger * _Nullable)numberOfRemovedFields
error:(NSError **)outError;
@property (nonatomic, readonly) NSArray *localFiles;
@property (nonatomic, readonly) NSArray *existingLocalFiles;
@property (nonatomic, readonly) NSArray *remoteURLs;
-@property (nonatomic, readonly) NSArray *downloads;
+@property (nonatomic, nullable, readonly) NSArray *downloads;
@property (nonatomic, readonly) NSArray *usedMacros;
@property (nonatomic, readonly) NSArray *usedLocalMacros;
-- (NSURL *)suggestedURLForLinkedFile:(BDSKLinkedFile *)file;
+- (nullable NSURL *)suggestedURLForLinkedFile:(BDSKLinkedFile *)file;
- (BOOL)canSetURLForLinkedFile:(BDSKLinkedFile *)file;
- (BOOL)autoFileLinkedFile:(BDSKLinkedFile *)file;
-@property (nonatomic, readonly) NSSet *filesToBeFiled;
+@property (nonatomic, nullable, readonly) NSSet *filesToBeFiled;
- (void)addFileToBeFiled:(BDSKLinkedFile *)file;
- (void)removeFileToBeFiled:(BDSKLinkedFile *)file;
@property (nonatomic) BOOL localUrlNeedsToBeFiled;
- (BOOL)autoFileLocalUrl;
-- (NSURL *)suggestedURLForField:(NSString *)field;
+- (nullable NSURL *)suggestedURLForField:(NSString *)field;
- (BOOL)canSetURLForField:(NSString *)field;
- (void)basePathDidChange;
@@ -194,11 +196,11 @@
@param isNew Boolean determines if the item is new for the BibTeX
document. Determines if the date-added should be set. Should be YES unless when
reading the BibTeX source file.
@result The receiver, initialized to type and containing authors
authArray.
*/
-- (instancetype)initWithType:(NSString *)type citeKey:(NSString *)key
pubFields:(NSDictionary *)fieldsDict files:(NSArray *)filesArray
isNew:(BOOL)isNew;
+- (instancetype)initWithType:(NSString *)type citeKey:(nullable NSString *)key
pubFields:(nullable NSDictionary *)fieldsDict files:(nullable NSArray
*)filesArray isNew:(BOOL)isNew;
-- (instancetype)initWithType:(NSString *)type citeKey:(NSString *)key
pubFields:(NSDictionary *)fieldsDict;
+- (instancetype)initWithType:(NSString *)type citeKey:(nullable NSString *)key
pubFields:(nullable NSDictionary *)fieldsDict;
-- (instancetype)initWithType:(NSString *)type citeKey:(NSString *)key
pubFields:(NSMutableDictionary *)fieldsDict URLStrings:(NSArray *)urlsArray;
+- (instancetype)initWithType:(NSString *)type citeKey:(nullable NSString *)key
pubFields:(nullable NSMutableDictionary *)fieldsDict URLStrings:(nullable
NSArray *)urlsArray;
/*!
@method dealloc
@@ -206,11 +208,11 @@
*/
- (void)dealloc;
-@property (nonatomic, weak) id<BDSKOwner> owner;
+@property (nonatomic, nullable, weak) id<BDSKOwner> owner;
-@property (nonatomic, strong) BDSKMacroResolver *macroResolver;
+@property (nonatomic, nullable, strong) BDSKMacroResolver *macroResolver;
-@property (nonatomic, readonly) NSUndoManager *undoManager;
+@property (nonatomic, nullable, readonly) NSUndoManager *undoManager;
//
----------------------------------------------------------------------------------------
// comparisons
@@ -223,7 +225,7 @@
@property (nonatomic, readonly) NSUInteger equivalenceHash;
// accessors for fileorder
-@property (nonatomic, strong) NSNumber *fileOrder;
+@property (nonatomic, nullable, strong) NSNumber *fileOrder;
/* Methods for handling people objects (BibAuthors) which may be any people
type (Author, Editor, etc.)
*/
@@ -230,7 +232,7 @@
- (void)rebuildPeopleIfNeeded;
@property (nonatomic, readonly) NSSet *allPeople;
- (NSArray *)peopleArrayForField:(NSString *)field;
-- (NSArray *)peopleArrayForField:(NSString *)field inherit:(BOOL)inherit;
+- (NSArray *)peopleArrayForField:(NSString *)field inherit:(BOOL)inherit;
@property (nonatomic, readonly) NSDictionary *people;
- (NSDictionary *)peopleInheriting:(BOOL)inherit;
@@ -243,7 +245,7 @@
@param field (description)
@result (description)
*/
-- (NSString *)peopleStringForDisplayFromField:(NSString *)field;
+- (nullable NSString *)peopleStringForDisplayFromField:(NSString *)field;
/*!
@method numberOfAuthors
@@ -298,10 +300,10 @@
*/
- (BibAuthor *)authorAtIndex:(NSUInteger)index inherit:(BOOL)inherit;
-@property (nonatomic, readonly) BibAuthor *firstAuthor;
-@property (nonatomic, readonly) BibAuthor *secondAuthor;
-@property (nonatomic, readonly) BibAuthor *thirdAuthor;
-@property (nonatomic, readonly) BibAuthor *lastAuthor;
+@property (nonatomic, nullable, readonly) BibAuthor *firstAuthor;
+@property (nonatomic, nullable, readonly) BibAuthor *secondAuthor;
+@property (nonatomic, nullable, readonly) BibAuthor *thirdAuthor;
+@property (nonatomic, nullable, readonly) BibAuthor *lastAuthor;
/*!
@method bibTeXAuthorString
@@ -396,10 +398,10 @@
*/
- (BibAuthor *)authorOrEditorAtIndex:(NSUInteger)index inherit:(BOOL)inherit;
-@property (nonatomic, readonly) BibAuthor *firstAuthorOrEditor;
-@property (nonatomic, readonly) BibAuthor *secondAuthorOrEditor;
-@property (nonatomic, readonly) BibAuthor *thirdAuthorOrEditor;
-@property (nonatomic, readonly) BibAuthor *lastAuthorOrEditor;
+@property (nonatomic, nullable, readonly) BibAuthor *firstAuthorOrEditor;
+@property (nonatomic, nullable, readonly) BibAuthor *secondAuthorOrEditor;
+@property (nonatomic, nullable, readonly) BibAuthor *thirdAuthorOrEditor;
+@property (nonatomic, nullable, readonly) BibAuthor *lastAuthorOrEditor;
/*!
@method crossrefParent
@@ -407,7 +409,7 @@
@discussion (discussion)
*/
-@property (nonatomic, readonly) BibItem *crossrefParent;
+@property (nonatomic, nullable, readonly) BibItem *crossrefParent;
/*!
@method title
@@ -443,7 +445,7 @@
@discussion (discussion)
*/
-@property (nonatomic, readonly) NSDate *date;
+@property (nonatomic, nullable, readonly) NSDate *date;
/*!
@method dateInheriting:
@@ -452,10 +454,10 @@
@discussion (discussion)
*/
-- (NSDate *)dateInheriting:(BOOL)inherit;
+- (nullable NSDate *)dateInheriting:(BOOL)inherit;
-@property (nonatomic, readonly) NSDate *dateAdded;
-@property (nonatomic, readonly) NSDate *dateModified;
+@property (nonatomic, nullable, readonly) NSDate *dateAdded;
+@property (nonatomic, nullable, readonly) NSDate *dateModified;
- (void)markNewWithDate:(NSDate *)date description:(NSString *)dateDescription;
@@ -466,7 +468,7 @@
@abstract Basic setter for the publication type, with undo. Sets up
the fields if necessary.
@discussion -
*/
-- (void)setPubType:(NSString *)newType withModDate:(NSDate *)date;
+- (void)setPubType:(NSString *)newType withModDate:(nullable NSDate *)date;
/*!
@method pubType
@abstract Returns the publication type.
@@ -481,7 +483,7 @@
*/
@property (nonatomic) NSUInteger rating;
-@property (nonatomic, strong) NSColor *color;
+@property (nonatomic, nullable, strong) NSColor *color;
/*!
@method setField:toRatingValue:
@@ -574,7 +576,7 @@
@param field (description)
@param boolValue (description)
*/
-- (void)setField:(NSString *)field toStringValue:(NSString *)value;
+- (void)setField:(NSString *)field toStringValue:(nullable NSString *)value;
- (NSArray *)citationValueOfField:(NSString *)field;
@@ -596,7 +598,7 @@
*/
@property (nonatomic, readonly) NSString *suggestedCiteKey;
-- (BOOL)isValidCiteKey:(NSString *)proposedCiteKey;
+- (BOOL)isValidCiteKey:(nullable NSString *)proposedCiteKey;
@property (nonatomic, readonly) BOOL hasEmptyOrDefaultCiteKey;
@@ -609,7 +611,7 @@
@discussion -
@result 0: no problem, 1: crossref to self, 2: crossref to item with
crossref, 3: self is crossreffed
*/
-- (BDSKCrossrefError)canSetCrossref:(NSString *)aCrossref;
+- (BDSKCrossrefError)canSetCrossref:(nullable NSString *)aCrossref;
/*
@method canSetCiteKey:
@@ -617,7 +619,7 @@
@discussion -
@result 0: no problem, 1: crossref to self, 2: crossref to item with
crossref, 3: self is crossreffed
*/
-- (BDSKCrossrefError)canSetCiteKey:(NSString *)aCiteKey;
+- (BDSKCrossrefError)canSetCiteKey:(nullable NSString *)aCiteKey;
/*!
@method setCiteKey:withModDate:
@@ -624,7 +626,7 @@
@abstract basic setter for the cite key, with notification and undo.
@discussion -
*/
-- (void)setCiteKey:(NSString *)newCiteKey withModDate:(NSDate *)date;
+- (void)setCiteKey:(NSString *)newCiteKey withModDate:(nullable NSDate *)date;
/*!
@method citeKey
@@ -635,8 +637,8 @@
@property (nonatomic, copy) NSDictionary *pubFields;
-- (void)setField: (NSString *)key toValue: (NSString *)value;
-- (void)setField: (NSString *)key toValue: (NSString *)value
withModDate:(NSDate *)date;
+- (void)setField: (NSString *)key toValue: (nullable NSString *)value;
+- (void)setField: (NSString *)key toValue: (nullable NSString *)value
withModDate:(nullable NSDate *)date;
- (void)replaceValueOfFieldByCopy:(NSString *)key;
@@ -685,7 +687,7 @@
- (NSString *)bibTeXStringWithOptions:(BDSKBibTeXOption)options;
-- (NSData *)bibTeXDataWithOptions:(BDSKBibTeXOption)options
relativeToPath:(NSString *)basePath encoding:(NSStringEncoding)encoding
error:(NSError **)outError;
+- (NSData *)bibTeXDataWithOptions:(BDSKBibTeXOption)options
relativeToPath:(nullable NSString *)basePath
encoding:(NSStringEncoding)encoding error:(NSError **)outError;
@property (nonatomic, readonly) NSString *RISStringValue;
@property (nonatomic, readonly) NSString *referStringValue;
@@ -713,12 +715,12 @@
@property (nonatomic, readonly) id authors;
@property (nonatomic, readonly) id editors;
@property (nonatomic, readonly) id authorsOrEditors;
-@property (nonatomic, readonly) id keywords;
+@property (nonatomic, nullable, readonly) id keywords;
@property (nonatomic) NSInteger itemIndex;
-@property (nonatomic, readonly) NSDate *currentDate;
-@property (nonatomic, readonly) NSString *textSkimNotes;
-@property (nonatomic, readonly) NSAttributedString *richTextSkimNotes;
-@property (nonatomic, readonly) NSAttributedString *linkedText;
+@property (nonatomic, nullable, readonly) NSDate *currentDate;
+@property (nonatomic, nullable, readonly) NSString *textSkimNotes;
+@property (nonatomic, nullable, readonly) NSAttributedString
*richTextSkimNotes;
+@property (nonatomic, nullable, readonly) NSAttributedString *linkedText;
/*!
@method URLForField:
@@ -727,7 +729,7 @@
@param field (description)
@result (description)
*/
-- (NSURL *)URLForField:(NSString *)field;
+- (nullable NSURL *)URLForField:(NSString *)field;
/*!
@method remoteURL
@@ -735,7 +737,7 @@
@discussion (comprehensive description)
@result (description)
*/
-@property (nonatomic, readonly) NSURL *remoteURL;
+@property (nonatomic, nullable, readonly) NSURL *remoteURL;
/*!
@method remoteURLForField:
@@ -745,7 +747,7 @@
@param field the field name linking the local file.
@result (description)
*/
-- (NSURL *)remoteURLForField:(NSString *)field;
+- (nullable NSURL *)remoteURLForField:(NSString *)field;
/*!
@method localUrlURL
@@ -753,7 +755,7 @@
@discussion (comprehensive description)
@result (description)
*/
-@property (nonatomic, readonly) NSURL *localURL;
+@property (nonatomic, nullable, readonly) NSURL *localURL;
/*!
@method localUrlPath
@@ -761,18 +763,18 @@
@discussion -
@result a complete path with no tildes, or nil if an error occurred.
*/
-@property (nonatomic, readonly) NSString *localUrlPath;
+@property (nonatomic, nullable, readonly) NSString *localUrlPath;
// NSURL equivalents of the localFilePath... methods
-- (NSURL *)localFileURLForField:(NSString *)field;
+- (nullable NSURL *)localFileURLForField:(NSString *)field;
-- (void)setField:(NSString *)field toURLValue:(NSURL *)aURL;
-- (void)setField:(NSString *)field toURLValue:(NSURL *)aURL basePath:(NSString
*)basePath;
+- (void)setField:(NSString *)field toURLValue:(nullable NSURL *)aURL;
+- (void)setField:(NSString *)field toURLValue:(nullable NSURL *)aURL
basePath:(nullable NSString *)basePath;
@property (nonatomic, readonly) BDSKFieldCollection *URLFields;
- (NSString *)fieldValueForFileURL:(NSURL *)aURL withFormat:(NSInteger)format;
-- (NSString *)fieldValueForFileURL:(NSURL *)aURL withFormat:(NSInteger)format
basePath:(NSString *)basePath;
+- (NSString *)fieldValueForFileURL:(NSURL *)aURL withFormat:(NSInteger)format
basePath:(nullable NSString *)basePath;
- (void)downloadURLForField:(NSString *)field
options:(BDSKDownloadOption)options;
- (void)downloadLinkedFile:(BDSKLinkedFile *)linkedFile
options:(BDSKDownloadOption)options;
@@ -797,7 +799,7 @@
@property (nonatomic) CGFloat searchScore;
-@property (nonatomic, readonly) NSString *skimNotesForLocalURL;
+@property (nonatomic, nullable, readonly) NSString *skimNotesForLocalURL;
@property (nonatomic, readonly) NSURL *bdskURL;
@@ -808,10 +810,10 @@
@interface BibItem (BDSKAttachmentItem)
-+ (BibItem *)itemWithFileURL:(NSURL *)fileURL owner:(id<BDSKOwner>)anOwner;
-+ (BibItem *)itemWithURL:(NSURL *)aURL title:(NSString *)aTitle
owner:(id<BDSKOwner>)anOwner;
++ (BibItem *)itemWithFileURL:(NSURL *)fileURL owner:(nullable
id<BDSKOwner>)anOwner;
++ (BibItem *)itemWithURL:(NSURL *)aURL title:(nullable NSString *)aTitle
owner:(nullable id<BDSKOwner>)anOwner;
-+ (BibItem *)itemFromPasteboard:(NSPasteboard *)pboard
owner:(id<BDSKOwner>)anOwner;
++ (nullable BibItem *)itemFromPasteboard:(NSPasteboard *)pboard
owner:(nullable id<BDSKOwner>)anOwner;
+ (BOOL)canReadItemFromPasteboard:(NSPasteboard *)pboard;
@end
@@ -819,3 +821,5 @@
extern const CFSetCallBacks kBDSKBibItemEqualitySetCallBacks;
extern const CFSetCallBacks kBDSKBibItemEquivalenceSetCallBacks;
+
+NS_ASSUME_NONNULL_END
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit