aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPNarrowDownCompletion.h
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2009-05-24 10:26:56 +0000
committerBibiko <bibiko@eva.mpg.de>2009-05-24 10:26:56 +0000
commit5e2eb0be79f6f572724132f8be88069f8daac926 (patch)
treeff26ebbd4e397b5ecbe339ede00060e3669fcaa6 /Source/SPNarrowDownCompletion.h
parentbcb75ae5eef97aadaf14d45f2355f5310a12958f (diff)
downloadsequelpro-5e2eb0be79f6f572724132f8be88069f8daac926.tar.gz
sequelpro-5e2eb0be79f6f572724132f8be88069f8daac926.tar.bz2
sequelpro-5e2eb0be79f6f572724132f8be88069f8daac926.zip
• added class to support narrow-down completion in the Query Editor
- an image can be added - display and insert string can differ - fully customizable This class is based on TextMate's TMDIncrementalPopUp implementation (Dialog plugin) written by Joachim Mårtensson, Allan Odgaard, and H.-J. Bibiko. see license: http://svn.textmate.org/trunk/LICENSE
Diffstat (limited to 'Source/SPNarrowDownCompletion.h')
-rw-r--r--Source/SPNarrowDownCompletion.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/Source/SPNarrowDownCompletion.h b/Source/SPNarrowDownCompletion.h
new file mode 100644
index 00000000..baabb240
--- /dev/null
+++ b/Source/SPNarrowDownCompletion.h
@@ -0,0 +1,65 @@
+//
+// $Id: SPNarrowDownCompletion.h 744 2009-05-22 20:00:00Z bibiko $
+//
+// SPGrowlController.h
+// sequel-pro
+//
+// Created by Hans-J. Bibiko on May 14, 2009.
+//
+// This class is based on TextMate's TMDIncrementalPopUp implementation
+// (Dialog plugin) written by Joachim Mårtensson, Allan Odgaard, and H.-J. Bibiko.
+// see license: http://svn.textmate.org/trunk/LICENSE
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// More info at <http://code.google.com/p/sequel-pro/>
+
+#import <Cocoa/Cocoa.h>
+
+#define SP_NARROWDOWNLIST_MAX_ROWS 15
+
+#ifndef enumerate
+#define enumerate(container,var) for(NSEnumerator* _enumerator = [container objectEnumerator]; var = [_enumerator nextObject]; )
+#endif
+
+#ifndef sizeofA
+#define sizeofA(a) (sizeof(a)/sizeof(a[0]))
+#endif
+
+
+@interface SPNarrowDownCompletion : NSWindow {
+
+ NSArray* suggestions;
+ NSMutableString* mutablePrefix;
+ NSString* staticPrefix;
+ NSArray* filtered;
+ NSTableView* theTableView;
+ NSPoint caretPos;
+ BOOL isAbove;
+ BOOL closeMe;
+ BOOL caseSensitive;
+ NSFont *tableFont;
+ NSRange theCharRange;
+ id theView;
+
+ NSMutableCharacterSet* textualInputCharacters;
+
+}
+
+- (id)initWithItems:(NSArray*)someSuggestions alreadyTyped:(NSString*)aUserString staticPrefix:(NSString*)aStaticPrefix additionalWordCharacters:(NSString*)someAdditionalWordCharacters caseSensitive:(BOOL)isCaseSensitive charRange:(NSRange)initRange inView:(id)aView;
+- (void)setCaretPos:(NSPoint)aPos;
+- (void)insert_text:(NSString* )aString;
+
+@end