HKSyntaxDefinition.h

00001 /*
00002     HKSyntaxDefinition.h
00003 
00004     Interface declaration of the HKSyntaxDefinition class for the
00005     HighlighterKit framework.
00006 
00007     Copyright (C) 2005, 2006, 2007, 2008  Saso Kiselkov
00008 
00009     This library is free software; you can redistribute it and/or
00010     modify it under the terms of the GNU Lesser General Public
00011     License as published by the Free Software Foundation; either
00012     version 2.1 of the License, or (at your option) any later version.
00013 
00014     This library is distributed in the hope that it will be useful,
00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017     Lesser General Public License for more details.
00018 
00019     You should have received a copy of the GNU Lesser General Public
00020     License along with this library; if not, write to the Free Software
00021     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00022 */
00023 
00024 #import <Foundation/NSObject.h>
00025 
00026 #import "HKTextPattern.h"
00027 
00028 @class NSColor, NSArray;
00029 
00030 @interface HKSyntaxDefinition : NSObject
00031 {
00032   HKTextPattern ** contextBeginnings;
00033   char contextBeginningChars;
00034 
00035   HKTextPattern *** contextSkips;
00036   char ** contextSkipChars;
00037 
00038   HKTextPattern ** contextEndings;
00039   NSArray * contextGraphics;
00040 
00041   // First indirection is context number, second is keyword
00042   // number, third is the keyword itself. Both lists are NULL pointer
00043   // terminated.
00044   HKTextPattern *** keywords;
00045 
00046   NSArray * keywordGraphics;
00047 }
00048 
00049 + (NSString *) findSyntaxFileForType: (NSString *) type;
00050 + (HKSyntaxDefinition *) syntaxDefinitionForType: (NSString *) type;
00051 
00052 - initWithContextList: (NSArray *) contexts;
00053 
00054 // Obtaining context starting, ending and skips
00055 - (HKTextPattern **) contextBeginnings;
00056 - (const char *) contextBeginningCharacters;
00057 - (unsigned int) numberOfContextBeginningCharacters;
00058 
00059 - (const char *) contextSkipCharactersForContext: (unsigned int) ctxt;
00060 - (unsigned int) numberOfContextSkipCharactersForContext: (unsigned int) ctxt;
00061 
00062 - (HKTextPattern **) contextSkipsForContext: (unsigned int) ctxt;
00063 - (HKTextPattern *) contextEndingForContext: (unsigned int) ctxt;
00064 
00065 // Inquiring about graphical attributes of contexts
00066 - (NSColor *) foregroundColorForContext: (unsigned int) context;
00067 - (NSColor *) backgroundColorForContext: (unsigned int) context;
00068 - (BOOL) isItalicFontForContext: (unsigned int) context;
00069 - (BOOL) isBoldFontForContext: (unsigned int) context;
00070 
00071 // Obtaining keyword patterns
00072 - (HKTextPattern **) keywordsInContext: (unsigned int) context;
00073 
00074 // Inquiring about graphical attributes of keywords
00075 - (NSColor *) foregroundColorForKeyword: (unsigned int) keyword
00076                               inContext: (unsigned int) context;
00077 - (NSColor *) backgroundColorForKeyword: (unsigned int) keyword
00078                               inContext: (unsigned int) context;
00079 - (BOOL) isItalicFontForKeyword: (unsigned int) keyword
00080                       inContext: (unsigned int) context;
00081 - (BOOL) isBoldFontForKeyword: (unsigned int) keyword
00082                     inContext: (unsigned int) context;
00083 
00084 @end

Generated on Thu Nov 25 10:47:42 2010 for HighlighterKit by  doxygen 1.5.5