NSPDFInfo and NSPDFPanel skeletons

This commit is contained in:
Gregory John Casamento 2019-11-22 07:06:39 -05:00
parent 943a323002
commit fd19580d71
5 changed files with 172 additions and 3 deletions

View file

@ -26,15 +26,42 @@
#define _NSPDFInfo_h_GNUSTEP_GUI_INCLUDE
#include <Foundation/NSObject.h>
#include <Foundation/NSGeometry.h>
#include <AppKit/NSPrintInfo.h>
#if OS_API_VERSION(MAC_OS_X_VERSION_10_0, GS_API_LATEST)
#if OS_API_VERSION(MAC_OS_X_VERSION_10_9, GS_API_LATEST)
#if defined(__cplusplus)
extern "C" {
#endif
@interface NSPDFInfo : NSObject
@class NSURL, NSArray, NSMutableDictionary;
@interface NSPDFInfo : NSObject <NSCoding, NSCopying>
{
NSURL *_url;
BOOL _fileExtensionHidden;
NSArray *_tagNames;
NSSize _paperSize;
NSMutableDictionary *_attributes;
NSPaperOrientation _orientation;
}
- (NSURL *) URL;
- (BOOL) isFileExtensionHidden;
- (void) setFileExtensionHidden: (BOOL)flag;
- (NSArray *) tagNames;
- (NSPaperOrientation) orientation;
- (void) setOrientation: (NSPaperOrientation)or;
- (NSSize) paperSize;
- (void) setPaperSize: (NSSize)size;
- (NSMutableDictionary *) attributes;
@end
#if defined(__cplusplus)

View file

@ -27,14 +27,40 @@
#include <Foundation/NSObject.h>
#if OS_API_VERSION(MAC_OS_X_VERSION_10_0, GS_API_LATEST)
#if OS_API_VERSION(MAC_OS_X_VERSION_10_9, GS_API_LATEST)
#if defined(__cplusplus)
extern "C" {
#endif
@class NSString, NSPDFInfo, NSWindow, NSViewController;
enum {
NSPDFPanelShowsPaperSize = 1 << 2,
NSPDFPanelShowsOrientation = 1 << 3,
NSPDFPanelRequestsParentDirectory = 1 << 24,
};
typedef NSUInteger NSPDFPanelOptions;
DEFINE_BLOCK_TYPE(GSPDFPanelCompletionHandler, void, NSInteger);
@interface NSPDFPanel : NSObject
+ (NSPDFPanel *) panel;
- (NSViewController *) accessoryController;
- (void) setAccessoryController: (NSViewController *)accessoryView;
- (NSPDFPanelOptions) options;
- (void) setPDFPanelOptions: (NSPDFPanelOptions)opts;
- (NSString *) defaultFileName;
- (void) setDefaultFileName: (NSString *)fileName;
- (void) begineSheetWithPDFInfo: (NSPDFInfo *)pdfInfo
modalForWindow: (NSWindow *)window
completionHandler: (GSPDFPanelCompletionHandler)handler;
@end
#if defined(__cplusplus)

View file

@ -49,6 +49,11 @@ typedef enum _NSPrintingOrientation {
NSLandscapeOrientation
} NSPrintingOrientation;
typedef enum _NSPaperOrientation {
NSPaperOrientationPortrait,
NSPaperOrientationLandscape
} NSPaperOrientation;
typedef enum _NSPrintingPaginationMode {
NSAutoPagination,
NSFitPagination,

View file

@ -23,8 +23,77 @@
*/
#include <AppKit/NSPDFInfo.h>
#include <Foundation/NSArray.h>
#include <Foundation/NSDictionary.h>
@implementation NSPDFInfo
- (instancetype) initWithCoder: (NSCoder *)coder
{
return nil;
}
- (void) encodeWithCoder: (NSCoder *)coder
{
}
- (void) dealloc
{
RELEASE(_url);
RELEASE(_tagNames);
RELEASE(_attributes);
[super dealloc];
}
- (instancetype) copyWithZone: (NSZone *)zone
{
return nil;
}
- (NSURL *) URL
{
return _url;
}
- (BOOL) isFileExtensionHidden
{
return _fileExtensionHidden;
}
- (void) setFileExtensionHidden: (BOOL)flag
{
_fileExtensionHidden = flag;
}
- (NSArray *) tagNames
{
return _tagNames;
}
- (NSPaperOrientation) orientation
{
return _orientation;
}
- (void) setOrientation: (NSPaperOrientation)or
{
_orientation = or;
}
- (NSSize) paperSize;
{
return _paperSize;
}
- (void) setPaperSize: (NSSize)size
{
_paperSize = size;
}
- (NSMutableDictionary *) attributes
{
return _attributes;
}
@end

View file

@ -23,8 +23,50 @@
*/
#include <AppKit/NSPDFPanel.h>
#include <AppKit/NSPDFInfo.h>
#include <AppKit/NSWindow.h>
#include <AppKit/NSViewController.h>
#include <Foundation/NSString.h>
@implementation NSPDFPanel
+ (NSPDFPanel *) panel
{
return nil;
}
- (NSViewController *) accessoryController
{
return nil;
}
- (void) setAccessoryController: (NSViewController *)accessoryView
{
}
- (NSPDFPanelOptions) options
{
return 0;
}
- (void) setPDFPanelOptions: (NSPDFPanelOptions)opts
{
}
- (NSString *) defaultFileName
{
return nil;
}
- (void) setDefaultFileName: (NSString *)fileName
{
}
- (void) begineSheetWithPDFInfo: (NSPDFInfo *)pdfInfo
modalForWindow: (NSWindow *)window
completionHandler: (GSPDFPanelCompletionHandler)handler
{
}
@end