1 /*
2    Copyright (C) 2013 Free Software Foundation, Inc.
3 
4    Author: German A. Arias <german@xelalug.org>
5    Date: 2013
6 
7    This file is part of the GNUstep GUI Library.
8 
9    This library is free software; you can redistribute it and/or
10    modify it under the terms of the GNU Lesser General Public
11    License as published by the Free Software Foundation; either
12    version 2 of the License, or (at your option) any later version.
13 
14    This library is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
17    Lesser General Public License for more details.
18 
19    You should have received a copy of the GNU Lesser General Public
20    License along with this library; see the file COPYING.LIB.
21    If not, see <http://www.gnu.org/licenses/> or write to the
22    Free Software Foundation, 51 Franklin Street, Fifth Floor,
23    Boston, MA 02110-1301, USA.
24 */
25 
26 #import <AppKit/NSPanel.h>
27 
28 @class GSAutocompleteView;
29 @class NSArray;
30 @class NSString;
31 @class NSNotification;
32 @class NSNotificationCenter;
33 @class NSTableColumn;
34 @class NSTableView;
35 @class NSTextView;
36 
37 @interface GSAutocompleteWindow : NSPanel
38 {
39   BOOL _stopped;
40   NSRange _range;
41   NSTextView *_textView;
42   GSAutocompleteView *_tableView;
43 
44   //Retained
45   NSString *_originalWord;
46   NSArray *_words;
47 }
48 
49 + (GSAutocompleteWindow *) defaultWindow;
50 
51 - (void) layout;
52 - (void) computePosition;
53 - (void) displayForTextView: (NSTextView *)textView;
54 - (NSArray *) words;
55 
56 - (void) runModalWindow;
57 - (void) runLoop;
58 - (void) onWindowEdited: (NSNotification *)notification;
59 
60 - (void) reloadData;
61 - (void) updateTextViewWithMovement: (NSInteger)movement isFinal: (BOOL)flag;
62 
63 - (void) clickItem: (id)sender;
64 - (void) moveUpSelection;
65 - (void) moveDownSelection;
66 
67 // Delegate
68 - (int) numberOfRowsInTableView: (NSTableView*)aTableView;
69 - (id) tableView: (NSTableView*)aTableView
70       objectValueForTableColumn: (NSTableColumn*)aTableColumn
71 	     row: (int)rowIndex;
72 @end
73