2
* Copyright (C) 2003 Stefan Kleine Stegemann
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU General Public License
6
* as published by the Free Software Foundation; either version 2
7
* of the License, or (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24
@interface Match(Private)
29
* Holds the informations about a match of a particular
35
* Desginated initializer.
37
- (id) initWithPosition: (DocumentPosition*)_position
38
context: (NSString*)_context
39
searchText: (NSString*)_searchText
41
if ((self = [super init]))
46
[self setPosition: _position];
47
[self setContext: _context];
48
[self setSearchText: _searchText];
55
* Initialize with empty properties.
59
return [self initWithPosition: nil context: nil searchText: nil];
65
[self setPosition: nil];
66
[self setContext: nil];
67
[self setSearchText: nil];
74
* Create an (autoreleased) match with the specified
77
+ (Match*) matchAt: (DocumentPosition*)_position
78
context: (NSString*)_context
79
searchText: (NSString*)_searchText
83
match = [[Match alloc] initWithPosition: _position
85
searchText: _searchText];
87
return [match autorelease];
92
* Returns the position in the document where this match
95
- (DocumentPosition*) position
102
* Set the position in the document where this match
105
- (void) setPosition: (DocumentPosition*)_position
108
position = _position;
114
* Return the context of this match. This is some text
115
* around the position where this match occured.
117
- (NSString*) context
124
* Set the context of this match. See context message for
127
- (void) setContext: (NSString*)_context;
130
context = [_context copy];
135
* Get the text that has been searched for when this
138
- (NSString*) searchText
145
* Set the text that has been searched for when this
148
- (void) setSearchText: (NSString*)_searchText
150
[searchText release];
151
searchText = [_searchText copy];