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., 59 Temple Place - Suite 330, Boston, MA 00021 * 02111-1307, 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 : NSWindowController <XAP_CocoaDialogProtocol> 00039 { 00040 IBOutlet NSButton * oAdd; 00041 IBOutlet NSButton * oPreview; 00042 IBOutlet NSButton * oRemapGlyphs; 00043 00044 IBOutlet NSPopUpButton * oFont; 00045 IBOutlet NSPopUpButton * oFontFamily; 00046 00047 IBOutlet NSTableView * oSymbolTable; 00048 00049 NSMutableArray * m_FontList; 00050 NSFont * m_CurrentFont; 00051 NSString * m_CurrentFontName; 00052 NSString * m_OffsetString[14]; 00053 NSString * m_SymbolString[224]; 00054 NSString * m_Remap_String[224]; 00055 UT_sint32 m_SymbolWidth[224]; 00056 00057 int m_Symbol_lo; 00058 int m_Symbol_hi; 00059 00060 BOOL m_bRemapGlyphs; 00061 00062 XAP_CocoaDialog_Insert_Symbol * _xap; 00063 } 00064 - (IBAction)aSingleClick:(id)sender; 00065 - (IBAction)aDoubleClick:(id)sender; 00066 - (IBAction)aAdd:(id)sender; 00067 - (IBAction)aFont:(id)sender; 00068 - (IBAction)aFontFamily:(id)sender; 00069 - (IBAction)aRemapGlyphs:(id)sender; 00070 00071 - (id)initFromNib; 00072 - (void)dealloc; 00073 - (void)setXAPOwner:(XAP_Dialog *)owner; 00074 - (void)discardXAP; 00075 - (void)windowDidLoad; 00076 - (void)windowWillClose:(NSNotification *)aNotification; 00077 - (void)windowToFront; 00078 00079 - (void)fontFamilyDidChange; 00080 - (void)recalculateSymbolWidths; 00081 00082 /* NSTableViewDataSource methods 00083 */ 00084 - (int)numberOfRowsInTableView:(NSTableView *)aTableView; 00085 - (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex; 00086 00087 /* NSTableView delegate methods 00088 */ 00089 - (void)tableView:(NSTableView *)aTableView willDisplayCell:(id)aCell forTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex; 00090 - (BOOL)tableView:(NSTableView *)aTableView shouldSelectRow:(int)rowIndex; 00091 @end 00092 00093 00094 class XAP_CocoaDialog_Insert_Symbol : public XAP_Dialog_Insert_Symbol 00095 { 00096 public: 00097 static XAP_Dialog * static_constructor(XAP_DialogFactory *, XAP_Dialog_Id dlgid); 00098 00099 XAP_CocoaDialog_Insert_Symbol(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id dlgid); 00100 00101 virtual ~XAP_CocoaDialog_Insert_Symbol(void); 00102 00103 virtual void runModal(XAP_Frame * pFrame); 00104 virtual void runModeless(XAP_Frame * pFrame); 00105 virtual void notifyActiveFrame(XAP_Frame * pFrame); 00106 virtual void notifyCloseFrame(XAP_Frame * ) { }; 00107 virtual void activate(void); 00108 virtual void destroy(void); 00109 00110 void insertSymbol(const char * fontFamilyName, UT_UCS4Char symbol); 00111 void windowClosed(void); 00112 00113 private: 00114 XAP_CocoaDlg_Insert_SymbolController * m_dlg; 00115 }; 00116 00117 #endif /* XAP_COCOADIALOG_INSERT_SYMBOL_H */
1.7.1