/* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */ /* AbiSource Application Framework * Copyright (C) 2005 Francis James Franklin * * 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. */ #ifndef COCOAPLUGIN_ABIMAILMAN_DATASETCONTROLLER_H #define COCOAPLUGIN_ABIMAILMAN_DATASETCONTROLLER_H #import #import "xap_CocoaPlugin.h" @class AbiMailMan_Controller; @class AbiMailMan_DataSetController; @class AbiMailMan_Toolbar; @interface AbiMailMan_DataSetFieldSource : NSObject { IBOutlet AbiMailMan_DataSetController * oDataSetController; IBOutlet NSTableView * oFieldTable; IBOutlet NSButton * oNewField; IBOutlet NSButton * oInsertField; NSArray * m_FieldList; id m_Document; } - (id)init; - (void)dealloc; - (void)windowDidLoad; - (void)setFieldList:(NSArray *)fieldList; - (void)setDocument:(id )document; - (IBAction)aFieldTable:(id)sender; - (IBAction)aNewField:(id)sender; - (IBAction)aInsertField:(id)sender; /* NSTableView delegate method */ - (void)tableViewSelectionDidChange:(NSNotification *)aNotification; /* NSTableDataSource methods */ - (int)numberOfRowsInTableView:(NSTableView *)aTableView; - (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex; @end @interface AbiMailMan_DataSetController : NSWindowController { IBOutlet AbiMailMan_DataSetFieldSource * oDataSetFieldSource; IBOutlet NSTableView * oDataSetTable; IBOutlet NSTextField * oDocumentName; XAP_CocoaPlugin * m_AbiWord; id m_Document; AbiMailMan_Controller * m_Controller; AbiMailMan_Toolbar * m_Toolbar; NSMutableArray * m_DataSet; NSString * m_MailMergeSource; BOOL m_DataSetUntitled; BOOL m_DataSetEdited; } /* dataset is an NSMutableArray whose objects are NSMutableArray of NSString, the first row holding the * field names, the rest being records; dataset can be nil. */ - (id)initWithAbiWord:(XAP_CocoaPlugin *)AbiWord withController:(AbiMailMan_Controller *)controller withDataSet:(NSMutableArray *)dataset; - (void)dealloc; - (void)windowDidLoad; - (void)setDocument:(id )document; - (void)setMailMergeSource:(NSString *)path; - (void)setUntitledWithNumber:(unsigned)number; - (IBAction)aDataSetTable:(id)sender; - (IBAction)aSelectDocument:(id)sender; - (void)saveDataSet:(id)sender; - (void)updateDocumentFields:(id)sender; - (void)printDocument:(id)sender; - (BOOL)confirmDocument; - (BOOL)isDataSetUntitled; - (BOOL)isDataSetEdited; - (int)rowsSelected; - (int)columnsSelected; - (void)logEntry:(NSString *)aString forMethod:(NSString *)method; - (void)logError:(NSString *)aString forMethod:(NSString *)method; /* NSTableView delegate method */ - (void)tableViewSelectionDidChange:(NSNotification *)aNotification; /* NSTableDataSource methods */ - (int)numberOfRowsInTableView:(NSTableView *)aTableView; - (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex; @end #endif /* ! COCOAPLUGIN_ABIMAILMAN_DATASETCONTROLLER_H */