00001 /* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */ 00002 00003 /* AbiSource Application Framework 00004 * Copyright (C) 1998 AbiSource, Inc. 00005 * Copyright (C) 2001,2003 Hubert Figuiere 00006 * Copyright (C) 2004 Francis James Franklin 00007 * 00008 * This program is free software; you can redistribute it and/or 00009 * modify it under the terms of the GNU General Public License 00010 * as published by the Free Software Foundation; either version 2 00011 * of the License, or (at your option) any later version. 00012 * 00013 * This program is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU General Public License 00019 * along with this program; if not, write to the Free Software 00020 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00021 * 02110-1301 USA. 00022 */ 00023 00024 #ifndef XAP_COCOADIALOG_INSERT_SYMBOL_H 00025 #define XAP_COCOADIALOG_INSERT_SYMBOL_H 00026 00027 #import <Cocoa/Cocoa.h> 00028 00029 #include "xap_Dlg_Insert_Symbol.h" 00030 00031 #import "xap_CocoaDialog_Utilities.h" 00032 00033 class XAP_CocoaFrame; 00034 class XAP_CocoaDialog_Insert_Symbol; 00035 00036 /*****************************************************************/ 00037 00038 @interface XAP_CocoaDlg_Insert_SymbolController 00039 : NSWindowController <XAP_CocoaDialogProtocol, NSTableViewDelegate, NSTableViewDataSource> 00040 { 00041 IBOutlet NSButton * oAdd; 00042 IBOutlet NSButton * oPreview; 00043 IBOutlet NSButton * oRemapGlyphs; 00044 00045 IBOutlet NSPopUpButton * oFont; 00046 IBOutlet NSPopUpButton * oFontFamily; 00047 00048 IBOutlet NSTableView * oSymbolTable; 00049 00050 NSMutableArray * m_FontList; 00051 NSFont * m_CurrentFont; 00052 NSString * m_CurrentFontName; 00053 NSString * m_OffsetString[14]; 00054 NSString * m_SymbolString[224]; 00055 NSString * m_Remap_String[224]; 00056 UT_sint32 m_SymbolWidth[224]; 00057 00058 int m_Symbol_lo; 00059 int m_Symbol_hi; 00060 00061 BOOL m_bRemapGlyphs; 00062 00063 XAP_CocoaDialog_Insert_Symbol * _xap; 00064 } 00065 - (IBAction)aSingleClick:(id)sender; 00066 - (IBAction)aDoubleClick:(id)sender; 00067 - (IBAction)aAdd:(id)sender; 00068 - (IBAction)aFont:(id)sender; 00069 - (IBAction)aFontFamily:(id)sender; 00070 - (IBAction)aRemapGlyphs:(id)sender; 00071 00072 - (id)initFromNib; 00073 - (void)dealloc; 00074 - (void)setXAPOwner:(XAP_Dialog *)owner; 00075 - (void)discardXAP; 00076 - (void)windowDidLoad; 00077 - (void)windowWillClose:(NSNotification *)aNotification; 00078 - (void)windowToFront; 00079 00080 - (void)fontFamilyDidChange; 00081 - (void)recalculateSymbolWidths; 00082 00083 /* NSTableViewDataSource methods 00084 */ 00085 - (int)numberOfRowsInTableView:(NSTableView *)aTableView; 00086 - (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex; 00087 00088 /* NSTableView delegate methods 00089 */ 00090 - (void)tableView:(NSTableView *)aTableView willDisplayCell:(id)aCell forTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex; 00091 - (BOOL)tableView:(NSTableView *)aTableView shouldSelectRow:(int)rowIndex; 00092 @end 00093 00094 00095 class XAP_CocoaDialog_Insert_Symbol : public XAP_Dialog_Insert_Symbol 00096 { 00097 public: 00098 static XAP_Dialog * static_constructor(XAP_DialogFactory *, XAP_Dialog_Id dlgid); 00099 00100 XAP_CocoaDialog_Insert_Symbol(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id dlgid); 00101 00102 virtual ~XAP_CocoaDialog_Insert_Symbol(void); 00103 00104 virtual void runModal(XAP_Frame * pFrame); 00105 virtual void runModeless(XAP_Frame * pFrame); 00106 virtual void notifyActiveFrame(XAP_Frame * pFrame); 00107 virtual void notifyCloseFrame(XAP_Frame * ) { }; 00108 virtual void activate(void); 00109 virtual void destroy(void); 00110 00111 void insertSymbol(const char * fontFamilyName, UT_UCS4Char symbol); 00112 void windowClosed(void); 00113 00114 private: 00115 XAP_CocoaDlg_Insert_SymbolController * m_dlg; 00116 }; 00117 00118 #endif /* XAP_COCOADIALOG_INSERT_SYMBOL_H */