Add files

This commit is contained in:
Gregory John Casamento 2019-11-10 18:43:12 -05:00
parent 6b6a11aaa7
commit 73bcd161cc
10 changed files with 524 additions and 0 deletions

View file

@ -0,0 +1,74 @@
/* Definition of class NSExtensionContext
Copyright (C) 2019 Free Software Foundation, Inc.
By: Gregory Casamento <greg.casamento@gmail.com>
Date: Sun Nov 10 03:59:38 EST 2019
This file is part of the GNUstep Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
*/
#ifndef _NSExtensionContext_h_GNUSTEP_BASE_INCLUDE
#define _NSExtensionContext_h_GNUSTEP_BASE_INCLUDE
#include <Foundation/NSObject.h>
#if OS_API_VERSION(MAC_OS_X_VERSION_10_10, GS_API_LATEST)
#if defined(__cplusplus)
extern "C" {
#endif
DEFINE_BLOCK_TYPE(GSExtensionContextReturningItemsCompletionHandler, void, BOOL);
DEFINE_BLOCK_TYPE(GSOpenURLCompletionHandler, void, BOOL);
@class NSError, NSArray, NSURL;
@interface NSExtensionContext : NSObject
{
NSArray *_inputItems;
}
- (void) setInputItems: (NSArray *)inputItems;
- (NSArray *) inputItems;
- (void)completeRequestReturningItems: (NSArray *)items completionHandler: (GSExtensionContextReturningItemsCompletionHandler)completionHandler;
- (void)cancelRequestWithError:(NSError *)error;
- (void)openURL: (NSURL *)URL completionHandler: (GSOpenURLCompletionHandler)completionHandler;
@end
GS_EXPORT NSString* const NSExtensionItemsAndErrorsKey;
GS_EXPORT NSString* const NSExtensionHostWillEnterForegroundNotification;
GS_EXPORT NSString* const NSExtensionHostDidEnterBackgroundNotification;
GS_EXPORT NSString* const NSExtensionHostWillResignActiveNotification;
GS_EXPORT NSString* const NSExtensionHostDidBecomeActiveNotification;
#if defined(__cplusplus)
}
#endif
#endif /* GS_API_MACOSX */
#endif /* _NSExtensionContext_h_GNUSTEP_BASE_INCLUDE */

View file

@ -0,0 +1,73 @@
/* Definition of class NSExtensionItem
Copyright (C) 2019 Free Software Foundation, Inc.
By: Gregory Casamento <greg.casamento@gmail.com>
Date: Sun Nov 10 03:59:46 EST 2019
This file is part of the GNUstep Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
*/
#ifndef _NSExtensionItem_h_GNUSTEP_BASE_INCLUDE
#define _NSExtensionItem_h_GNUSTEP_BASE_INCLUDE
#include <Foundation/NSObject.h>
#if OS_API_VERSION(MAC_OS_X_VERSION_10_10, GS_API_LATEST)
#if defined(__cplusplus)
extern "C" {
#endif
@class NSAttributedString, NSArray, NSDictionary;
@interface NSExtensionItem : NSObject
{
NSAttributedString *_attributedTitle;
NSAttributedString *_attributedContentText;
NSArray *_attachments;
NSDictionary *_userInfo;
}
- (NSAttributedString *) attributedTitle;
- (void) setAttributedTitle: (NSAttributedString *)string;
- (NSAttributedString *) attributedContentText;
- (void) setAttributedContentText: (NSAttributedString *)string;
- (NSArray *) attachments;
- (void) setAttachments: (NSArray *)attachments;
- (NSDictionary *) userInfo;
- (void) setUserInfo: (NSDictionary *) userInfo;
@end
GS_EXPORT NSString * const NSExtensionItemAttributedTitleKey;
GS_EXPORT NSString * const NSExtensionItemAttributedContentTextKey;
GS_EXPORT NSString * const NSExtensionItemAttachmentsKey;
#if defined(__cplusplus)
}
#endif
#endif /* GS_API_MACOSX */
#endif /* _NSExtensionItem_h_GNUSTEP_BASE_INCLUDE */

View file

@ -0,0 +1,47 @@
/* Definition of class NSExtensionRequestHandling
Copyright (C) 2019 Free Software Foundation, Inc.
By: heron
Date: Sun Nov 10 04:00:05 EST 2019
This file is part of the GNUstep Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
*/
#ifndef _NSExtensionRequestHandling_h_GNUSTEP_BASE_INCLUDE
#define _NSExtensionRequestHandling_h_GNUSTEP_BASE_INCLUDE
#include <Foundation/NSObject.h>
#if OS_API_VERSION(MAC_OS_X_VERSION_10_0, GS_API_LATEST)
#if defined(__cplusplus)
extern "C" {
#endif
@interface NSExtensionRequestHandling : NSObject
@end
#if defined(__cplusplus)
}
#endif
#endif /* GS_API_MACOSX */
#endif /* _NSExtensionRequestHandling_h_GNUSTEP_BASE_INCLUDE */

View file

@ -0,0 +1,47 @@
/* Definition of class NSItemProvider
Copyright (C) 2019 Free Software Foundation, Inc.
By: heron
Date: Sun Nov 10 04:00:17 EST 2019
This file is part of the GNUstep Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
*/
#ifndef _NSItemProvider_h_GNUSTEP_BASE_INCLUDE
#define _NSItemProvider_h_GNUSTEP_BASE_INCLUDE
#include <Foundation/NSObject.h>
#if OS_API_VERSION(MAC_OS_X_VERSION_10_0, GS_API_LATEST)
#if defined(__cplusplus)
extern "C" {
#endif
@interface NSItemProvider : NSObject
@end
#if defined(__cplusplus)
}
#endif
#endif /* GS_API_MACOSX */
#endif /* _NSItemProvider_h_GNUSTEP_BASE_INCLUDE */

View file

@ -0,0 +1,47 @@
/* Definition of class NSItemProviderReadingWriting
Copyright (C) 2019 Free Software Foundation, Inc.
By: heron
Date: Sun Nov 10 04:00:24 EST 2019
This file is part of the GNUstep Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
*/
#ifndef _NSItemProviderReadingWriting_h_GNUSTEP_BASE_INCLUDE
#define _NSItemProviderReadingWriting_h_GNUSTEP_BASE_INCLUDE
#include <Foundation/NSObject.h>
#if OS_API_VERSION(MAC_OS_X_VERSION_10_0, GS_API_LATEST)
#if defined(__cplusplus)
extern "C" {
#endif
@interface NSItemProviderReadingWriting : NSObject
@end
#if defined(__cplusplus)
}
#endif
#endif /* GS_API_MACOSX */
#endif /* _NSItemProviderReadingWriting_h_GNUSTEP_BASE_INCLUDE */

View file

@ -0,0 +1,65 @@
/* Implementation of class NSExtensionContext
Copyright (C) 2019 Free Software Foundation, Inc.
By: heron
Date: Sun Nov 10 03:59:38 EST 2019
This file is part of the GNUstep Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
*/
#include <Foundation/NSExtensionContext.h>
#include <Foundation/NSError.h>
#include <Foundation/NSArray.h>
#include <Foundation/NSURL.h>
@implementation NSExtensionContext
- (void) setInputItems: (NSArray *)inputItems
{
ASSIGNCOPY(_inputItems, inputItems);
}
- (NSArray *) inputItems
{
return _inputItems;
}
- (void)completeRequestReturningItems: (NSArray *)items completionHandler: (GSExtensionContextReturningItemsCompletionHandler)completionHandler
{
}
- (void)cancelRequestWithError:(NSError *)error
{
}
- (void)openURL: (NSURL *)URL completionHandler: (GSOpenURLCompletionHandler)completionHandler
{
}
@end
NSString* const NSExtensionItemsAndErrorsKey = @"NSExtensionItemsAndErrorsKey";
NSString* const NSExtensionHostWillEnterForegroundNotification = @"NSExtensionHostWillEnterForegroundNotification";
NSString* const NSExtensionHostDidEnterBackgroundNotification = @"NSExtensionHostDidEnterBackgroundNotification";
NSString* const NSExtensionHostWillResignActiveNotification = @"NSExtensionHostWillResignActiveNotification";
NSString* const NSExtensionHostDidBecomeActiveNotification = @"NSExtensionHostDidBecomeActiveNotification";

81
Source/NSExtensionItem.m Normal file
View file

@ -0,0 +1,81 @@
/* Implementation of class NSExtensionItem
Copyright (C) 2019 Free Software Foundation, Inc.
By: heron
Date: Sun Nov 10 03:59:46 EST 2019
This file is part of the GNUstep Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
*/
#include <Foundation/NSExtensionItem.h>
#include <Foundation/NSAttributedString.h>
#include <Foundation/NSDictionary.h>
#include <Foundation/NSArray.h>
@implementation NSExtensionItem
- (NSAttributedString *) attributedTitle
{
return _attributedTitle;
}
- (void) setAttributedTitle: (NSAttributedString *)string
{
ASSIGNCOPY(_attributedTitle, string);
}
- (NSAttributedString *) attributedContentText
{
return _attributedContentText;
}
- (void) setAttributedContentText: (NSAttributedString *)string
{
ASSIGNCOPY(_attributedContentText, string);
}
- (NSArray *) attachments
{
return _attachments;
}
- (void) setAttachments: (NSArray *)attachments
{
ASSIGNCOPY(_attachments, attachments);
}
- (NSDictionary *) userInfo
{
return _userInfo;
}
- (void) setUserInfo: (NSDictionary *) userInfo
{
ASSIGNCOPY(_userInfo, userInfo);
}
@end
NSString * const NSExtensionItemAttributedTitleKey = @"NSExtensionItemAttributedTitleKey";
NSString * const NSExtensionItemAttributedContentTextKey = @"NSExtensionItemAttributedContentTextKey";
NSString * const NSExtensionItemAttachmentsKey = @"NSExtensionItemAttachmentsKey";

View file

@ -0,0 +1,30 @@
/* Implementation of class NSExtensionRequestHandling
Copyright (C) 2019 Free Software Foundation, Inc.
By: heron
Date: Sun Nov 10 04:00:05 EST 2019
This file is part of the GNUstep Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
*/
#include <Foundation/NSExtensionRequestHandling.h>
@implementation NSExtensionRequestHandling
@end

30
Source/NSItemProvider.m Normal file
View file

@ -0,0 +1,30 @@
/* Implementation of class NSItemProvider
Copyright (C) 2019 Free Software Foundation, Inc.
By: heron
Date: Sun Nov 10 04:00:17 EST 2019
This file is part of the GNUstep Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
*/
#include <Foundation/NSItemProvider.h>
@implementation NSItemProvider
@end

View file

@ -0,0 +1,30 @@
/* Implementation of class NSItemProviderReadingWriting
Copyright (C) 2019 Free Software Foundation, Inc.
By: heron
Date: Sun Nov 10 04:00:24 EST 2019
This file is part of the GNUstep Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
*/
#include <Foundation/NSItemProviderReadingWriting.h>
@implementation NSItemProviderReadingWriting
@end