aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTableStructure.h
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2010-05-27 20:13:17 +0000
committerstuconnolly <stuart02@gmail.com>2010-05-27 20:13:17 +0000
commit31ea7d44be9602679c57e0209689c261409aa384 (patch)
tree447b6f849450b6f3caac67b626b96aa9d223b115 /Source/SPTableStructure.h
parentd62541cf4992bd6b4e1d0f3bee58e8a6367c5e48 (diff)
downloadsequelpro-31ea7d44be9602679c57e0209689c261409aa384.tar.gz
sequelpro-31ea7d44be9602679c57e0209689c261409aa384.tar.bz2
sequelpro-31ea7d44be9602679c57e0209689c261409aa384.zip
Rename TableSource to SPTableStructure.
Diffstat (limited to 'Source/SPTableStructure.h')
-rw-r--r--Source/SPTableStructure.h109
1 files changed, 109 insertions, 0 deletions
diff --git a/Source/SPTableStructure.h b/Source/SPTableStructure.h
new file mode 100644
index 00000000..f43a5257
--- /dev/null
+++ b/Source/SPTableStructure.h
@@ -0,0 +1,109 @@
+//
+// $Id$
+//
+// SPTableStructure.h
+// sequel-pro
+//
+// Created by lorenz textor (lorenz@textor.ch) on Wed May 01 2002.
+// Copyright (c) 2002-2003 Lorenz Textor. All rights reserved.
+//
+// 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>
+#import <MCPKit/MCPKit.h>
+
+@interface SPTableStructure : NSObject
+{
+ IBOutlet id tablesListInstance;
+ IBOutlet id tableDataInstance;
+ IBOutlet id tableDocumentInstance;
+ IBOutlet id tableInfoInstance;
+ IBOutlet id extendedTableInfoInstance;
+
+ IBOutlet id indexSheet;
+ IBOutlet id keySheet;
+ IBOutlet id resetAutoIncrementSheet;
+ IBOutlet id resetAutoIncrementValue;
+ IBOutlet id resetAutoIncrementLine;
+ IBOutlet id tableSourceView;
+ IBOutlet id indexView;
+ IBOutlet id addFieldButton;
+ IBOutlet id copyFieldButton;
+ IBOutlet id removeFieldButton;
+ IBOutlet id reloadFieldsButton;
+ IBOutlet id addIndexButton;
+ IBOutlet id removeIndexButton;
+ IBOutlet id reloadIndexesButton;
+ IBOutlet id indexTypeField;
+ IBOutlet id indexNameField;
+ IBOutlet id indexedColumnsField;
+ IBOutlet id chooseKeyButton;
+ IBOutlet id structureGrabber;
+ IBOutlet id editTableButton;
+
+ MCPConnection *mySQLConnection;
+ MCPResult *tableSourceResult;
+ MCPResult *indexResult;
+
+ NSString *selectedTable;
+ NSMutableArray *tableFields, *indexes;
+ NSMutableDictionary *oldRow, *enumFields;
+ NSDictionary *defaultValues;
+ BOOL isEditingRow, isEditingNewRow, isSavingRow, alertSheetOpened;
+ NSInteger currentlyEditingRow;
+ NSUserDefaults *prefs;
+}
+
+// Table methods
+- (void)loadTable:(NSString *)aTable;
+- (IBAction)reloadTable:(id)sender;
+- (void) setTableDetails:(NSDictionary *)tableDetails;
+
+// Edit methods
+- (IBAction)addField:(id)sender;
+- (IBAction)copyField:(id)sender;
+- (IBAction)removeField:(id)sender;
+- (IBAction)removeIndex:(id)sender;
+- (IBAction)resetAutoIncrement:(id)sender;
+
+// Index sheet methods
+- (IBAction)openIndexSheet:(id)sender;
+- (IBAction)closeSheet:(id)sender;
+- (IBAction)chooseIndexType:(id)sender;
+- (void)closeAlertSheet;
+
+// Key sheet methods
+- (IBAction)closeKeySheet:(id)sender;
+
+// Additional methods
+- (void)setConnection:(MCPConnection *)theConnection;
+- (NSArray *)fetchResultAsArray:(MCPResult *)theResult;
+- (BOOL)saveRowOnDeselect;
+- (BOOL)addRowToDB;
+- (void)setAutoIncrementTo:(NSString*)valueAsString;
+
+// Getter methods
+- (NSString *)defaultValueForField:(NSString *)field;
+- (NSArray *)fieldNames;
+- (NSDictionary *)enumFields;
+- (NSDictionary *)tableSourceForPrinting;
+
+// Task interaction
+- (void)startDocumentTaskForTab:(NSNotification *)aNotification;
+- (void)endDocumentTaskForTab:(NSNotification *)aNotification;
+
+@end