• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

ap_CocoaDialog_MailMerge.h

Go to the documentation of this file.
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., 51 Franklin Street, Fifth Floor, Boston, MA
00020  * 02110-1301 USA.
00021  */
00022 
00023 #ifndef AP_COCOADIALOG_MAILMERGE_H
00024 #define AP_COCOADIALOG_MAILMERGE_H
00025 
00026 #include <string>
00027 
00028 #import <Cocoa/Cocoa.h>
00029 
00030 #include "xap_CocoaDialog_Utilities.h"
00031 
00032 #include "ap_Dialog_MailMerge.h"
00033 
00034 class XAP_CocoaFrame;
00035 
00036 /*****************************************************************/
00037 
00038 @class AP_CocoaDialog_MailMerge_Controller;
00039 
00040 class AP_CocoaDialog_MailMerge: public AP_Dialog_MailMerge
00041 {
00042 public:
00043     AP_CocoaDialog_MailMerge(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id);
00044 
00045     virtual ~AP_CocoaDialog_MailMerge(void);
00046 
00047     virtual void            runModeless(XAP_Frame * pFrame);
00048 
00049     static XAP_Dialog *     static_constructor(XAP_DialogFactory *, XAP_Dialog_Id id);
00050 
00051     virtual void            destroy(void);
00052     virtual void            activate(void);
00053 
00054     void                    eventInsert(NSString * field_name);
00055 
00056     virtual void            setFieldList();
00057 
00058     UT_uint32 fieldCount() const
00059     {
00060         return m_vecFields.size();
00061     }
00062     const std::string & field(UT_uint32 index)
00063     {
00064         return m_vecFields[index];
00065     }
00066 
00067 protected:
00068     AP_CocoaDialog_MailMerge_Controller *   m_dlg;
00069 };
00070 
00071 @interface AP_CocoaDialog_MailMerge_Controller
00072     : NSWindowController <XAP_CocoaDialogProtocol, NSTableViewDataSource, NSTableViewDelegate>
00073 {
00074     IBOutlet NSTextField *  oAvailableFields;
00075 
00076     IBOutlet NSTableView *  oFieldsTable;
00077 
00078     IBOutlet NSForm *       oFieldName;
00079     IBOutlet NSFormCell *   oFieldNameCell;
00080 
00081     IBOutlet NSButton *     oOpenFile;
00082     IBOutlet NSButton *     oClose;
00083     IBOutlet NSButton *     oInsert;
00084 
00085     NSMutableArray *        m_AvailableFields;
00086 
00087     AP_CocoaDialog_MailMerge *  _xap;
00088 }
00089 - (void)dealloc;
00090 
00091 - (void)windowToFront;
00092 
00093 - (IBAction)aFieldsTable:(id)sender;
00094 - (IBAction)aFieldName:(id)sender;
00095 - (IBAction)aOpenFile:(id)sender;
00096 - (IBAction)aClose:(id)sender;
00097 - (IBAction)aInsert:(id)sender;
00098 
00099 - (void)updateAvailableFields;
00100 
00101 /* NSTableViewDataSource methods
00102  */
00103 - (int)numberOfRowsInTableView:(NSTableView *)aTableView;
00104 - (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex;
00105 
00106 /* NSTableView delegate methods
00107  */
00108 - (void)tableViewSelectionDidChange:(NSNotification *)aNotification;
00109 - (void)tableView:(NSTableView *)aTableView willDisplayCell:(id)aCell forTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex;
00110 @end
00111 
00112 #endif /* AP_COCOADIALOG_MAILMERGE_H */

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1