gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RTF Converter Bundle


From: Fred Kiefer
Subject: RTF Converter Bundle
Date: Sat, 18 Aug 2001 23:56:02 +0200

I just submitted some changes to make the RTF loader/writter ready to be
moved into a separate bundle. Now the interface is totally separated
from the implementation. For this I did define two new protocols in the
file GSTextConverter.h:

@protocol GSTextProducer
+ (NSData*) produceDataFrom: (NSAttributedString*) aText
         documentAttributes: (NSDictionary*)dict;
+ (NSFileWrapper*) produceFileFrom: (NSAttributedString*) aText
                documentAttributes: (NSDictionary*)dict;
@end

@protocol GSTextConsumer
+ (NSAttributedString*) parseData: (NSData *)aData 
               documentAttributes: (NSDictionary **)dict;
+ (NSAttributedString*) parseFile: (NSFileWrapper *)aFile 
               documentAttributes: (NSDictionary **)dict;
@end

One of this protocols should be implemented by any text converter, that
way we are able to write generic code in NSAttributedString.m for
different formats. The XXfile: method is here for formats that will
rather correspond to directories than to normal files, e.g. RTFD.

For the RTF loader/writer bundle and all future text converters we need
a new directory structure. I would recommend to put it into
gui/TextConverter/RTF and the others in parallel directories e.g.
gui/TextConverter/HTML. We could as well separate the loader and the
writer and for RTF even try to separate RTF from RTFD, but this will
lead to a lot of different bundles. 

As I never did write a bundle, I would be glad if anybody else could
take over the task to convert the make file for the RTF bundle and also
to adopt the class loading function in NSAttributedString. (This should
in the future be configurable by some default settings.) If nobody steps
up for this I will have to learn it myself.

Fred




reply via email to

[Prev in Thread] Current Thread [Next in Thread]