2003-07-31 23:52:10 +00:00
|
|
|
/* -*-objc-*-
|
|
|
|
GSTextConverter.h
|
|
|
|
|
|
|
|
Define two protocols for text converter that will either read an external
|
|
|
|
format from a file or data object into an attributed string or write out
|
|
|
|
an attributed string in a format into a file or data object.
|
|
|
|
|
|
|
|
Copyright (C) 2001 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
Author: Fred Kiefer <FredKiefer@gmx.de>
|
|
|
|
Date: August 2001
|
|
|
|
|
|
|
|
This file is part of the GNUstep GUI Library.
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
2007-10-29 21:16:17 +00:00
|
|
|
modify it under the terms of the GNU Lesser General Public
|
2003-07-31 23:52:10 +00:00
|
|
|
License as published by the Free Software Foundation; either
|
2008-06-10 04:01:49 +00:00
|
|
|
version 2 of the License, or (at your option) any later version.
|
2007-10-29 21:16:17 +00:00
|
|
|
|
2003-07-31 23:52:10 +00:00
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2007-10-29 21:16:17 +00:00
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Lesser General Public License for more details.
|
2003-07-31 23:52:10 +00:00
|
|
|
|
2007-10-29 21:16:17 +00:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
2003-07-31 23:52:10 +00:00
|
|
|
License along with this library; see the file COPYING.LIB.
|
2007-10-29 21:16:17 +00:00
|
|
|
If not, see <http://www.gnu.org/licenses/> or write to the
|
|
|
|
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
|
|
|
Boston, MA 02110-1301, USA.
|
2003-07-31 23:52:10 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _GNUstep_H_GSTextConverter
|
|
|
|
#define _GNUstep_H_GSTextConverter
|
|
|
|
|
2010-04-07 08:59:43 +00:00
|
|
|
#import <Foundation/NSObject.h>
|
|
|
|
|
|
|
|
@class NSAttributedString;
|
|
|
|
@class NSData;
|
|
|
|
@class NSDictionary;
|
|
|
|
@class NSError;
|
|
|
|
@class NSString;
|
2003-07-31 23:52:10 +00:00
|
|
|
|
|
|
|
@protocol GSTextConverter
|
|
|
|
+ (Class) classForFormat: (NSString*)format
|
|
|
|
producer: (BOOL)producer;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@protocol GSTextProducer
|
|
|
|
+ (NSData*) produceDataFrom: (NSAttributedString*) aText
|
2009-09-19 14:55:57 +00:00
|
|
|
documentAttributes: (NSDictionary*)dict
|
|
|
|
error: (NSError **)error;
|
2003-07-31 23:52:10 +00:00
|
|
|
@end
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The 'class' argument must be NSAttributedString (or a subclass);
|
|
|
|
* the results of parsing will be saved into a newly created object of
|
|
|
|
* that class, which is then returned.
|
|
|
|
*/
|
|
|
|
@protocol GSTextConsumer
|
|
|
|
+ (NSAttributedString*) parseData: (NSData *)aData
|
2009-09-19 14:55:57 +00:00
|
|
|
options: (NSDictionary *)options
|
2003-07-31 23:52:10 +00:00
|
|
|
documentAttributes: (NSDictionary **)dict
|
2009-09-19 14:55:57 +00:00
|
|
|
error: (NSError **)error
|
2003-07-31 23:52:10 +00:00
|
|
|
class: (Class)class;
|
|
|
|
@end
|
|
|
|
|
|
|
|
#endif // _GNUstep_H_GSTextConverter
|