00001 /* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */ 00002 00003 /* AbiWord 00004 * Copyright (C) 2000 AbiSource, Inc. 00005 * Copyright (C) 2005 Francis James Franklin 00006 * 00007 * This program is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU General Public License 00009 * as published by the Free Software Foundation; either version 2 00010 * of the License, or (at your option) any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 00020 * 02111-1307, USA. 00021 */ 00022 00023 #ifndef AP_COCOADIALOG_MAILMERGE_H 00024 #define AP_COCOADIALOG_MAILMERGE_H 00025 00026 #import <Cocoa/Cocoa.h> 00027 00028 #include "xap_CocoaDialog_Utilities.h" 00029 00030 #include "ap_Dialog_MailMerge.h" 00031 00032 class XAP_CocoaFrame; 00033 00034 /*****************************************************************/ 00035 00036 @class AP_CocoaDialog_MailMerge_Controller; 00037 00038 class AP_CocoaDialog_MailMerge: public AP_Dialog_MailMerge 00039 { 00040 public: 00041 AP_CocoaDialog_MailMerge(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); 00042 00043 virtual ~AP_CocoaDialog_MailMerge(void); 00044 00045 virtual void runModeless(XAP_Frame * pFrame); 00046 00047 static XAP_Dialog * static_constructor(XAP_DialogFactory *, XAP_Dialog_Id id); 00048 00049 virtual void destroy(void); 00050 virtual void activate(void); 00051 00052 void eventInsert(NSString * field_name); 00053 00054 virtual void setFieldList(); 00055 00056 UT_uint32 fieldCount() const 00057 { 00058 return m_vecFields.size(); 00059 } 00060 const UT_UTF8String & field(UT_uint32 index) 00061 { 00062 return (*((const UT_UTF8String *) m_vecFields[index])); 00063 } 00064 00065 protected: 00066 AP_CocoaDialog_MailMerge_Controller * m_dlg; 00067 }; 00068 00069 @interface AP_CocoaDialog_MailMerge_Controller : NSWindowController <XAP_CocoaDialogProtocol> 00070 { 00071 IBOutlet NSTextField * oAvailableFields; 00072 00073 IBOutlet NSTableView * oFieldsTable; 00074 00075 IBOutlet NSForm * oFieldName; 00076 IBOutlet NSFormCell * oFieldNameCell; 00077 00078 IBOutlet NSButton * oOpenFile; 00079 IBOutlet NSButton * oClose; 00080 IBOutlet NSButton * oInsert; 00081 00082 NSMutableArray * m_AvailableFields; 00083 00084 AP_CocoaDialog_MailMerge * _xap; 00085 } 00086 - (void)dealloc; 00087 00088 - (void)windowToFront; 00089 00090 - (IBAction)aFieldsTable:(id)sender; 00091 - (IBAction)aFieldName:(id)sender; 00092 - (IBAction)aOpenFile:(id)sender; 00093 - (IBAction)aClose:(id)sender; 00094 - (IBAction)aInsert:(id)sender; 00095 00096 - (void)updateAvailableFields; 00097 00098 /* NSTableViewDataSource methods 00099 */ 00100 - (int)numberOfRowsInTableView:(NSTableView *)aTableView; 00101 - (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex; 00102 00103 /* NSTableView delegate methods 00104 */ 00105 - (void)tableViewSelectionDidChange:(NSNotification *)aNotification; 00106 - (void)tableView:(NSTableView *)aTableView willDisplayCell:(id)aCell forTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex; 00107 @end 00108 00109 #endif /* AP_COCOADIALOG_MAILMERGE_H */
1.7.1