| 1 |
/* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */ |
| 2 |
|
| 3 |
/* AbiSource Application Framework |
| 4 |
* Copyright (C) 1998 AbiSource, Inc. |
| 5 |
* Copyright (C) 2001,2003 Hubert Figuiere |
| 6 |
* Copyright (C) 2004 Francis James Franklin |
| 7 |
* |
| 8 |
* This program is free software; you can redistribute it and/or |
| 9 |
* modify it under the terms of the GNU General Public License |
| 10 |
* as published by the Free Software Foundation; either version 2 |
| 11 |
* of the License, or (at your option) any later version. |
| 12 |
* |
| 13 |
* This program is distributed in the hope that it will be useful, |
| 14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 |
* GNU General Public License for more details. |
| 17 |
* |
| 18 |
* You should have received a copy of the GNU General Public License |
| 19 |
* along with this program; if not, write to the Free Software |
| 20 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
| 21 |
* 02110-1301 USA. |
| 22 |
*/ |
| 23 |
|
| 24 |
#ifndef XAP_COCOADIALOG_INSERT_SYMBOL_H |
| 25 |
#define XAP_COCOADIALOG_INSERT_SYMBOL_H |
| 26 |
|
| 27 |
#import <Cocoa/Cocoa.h> |
| 28 |
|
| 29 |
#include "xap_Dlg_Insert_Symbol.h" |
| 30 |
|
| 31 |
#import "xap_CocoaDialog_Utilities.h" |
| 32 |
|
| 33 |
class XAP_CocoaFrame; |
| 34 |
class XAP_CocoaDialog_Insert_Symbol; |
| 35 |
|
| 36 |
/*****************************************************************/ |
| 37 |
|
| 38 |
@interface XAP_CocoaDlg_Insert_SymbolController : NSWindowController <XAP_CocoaDialogProtocol> |
| 39 |
{ |
| 40 |
IBOutlet NSButton * oAdd; |
| 41 |
IBOutlet NSButton * oPreview; |
| 42 |
IBOutlet NSButton * oRemapGlyphs; |
| 43 |
|
| 44 |
IBOutlet NSPopUpButton * oFont; |
| 45 |
IBOutlet NSPopUpButton * oFontFamily; |
| 46 |
|
| 47 |
IBOutlet NSTableView * oSymbolTable; |
| 48 |
|
| 49 |
NSMutableArray * m_FontList; |
| 50 |
NSFont * m_CurrentFont; |
| 51 |
NSString * m_CurrentFontName; |
| 52 |
NSString * m_OffsetString[14]; |
| 53 |
NSString * m_SymbolString[224]; |
| 54 |
NSString * m_Remap_String[224]; |
| 55 |
UT_sint32 m_SymbolWidth[224]; |
| 56 |
|
| 57 |
int m_Symbol_lo; |
| 58 |
int m_Symbol_hi; |
| 59 |
|
| 60 |
BOOL m_bRemapGlyphs; |
| 61 |
|
| 62 |
XAP_CocoaDialog_Insert_Symbol * _xap; |
| 63 |
} |
| 64 |
- (IBAction)aSingleClick:(id)sender; |
| 65 |
- (IBAction)aDoubleClick:(id)sender; |
| 66 |
- (IBAction)aAdd:(id)sender; |
| 67 |
- (IBAction)aFont:(id)sender; |
| 68 |
- (IBAction)aFontFamily:(id)sender; |
| 69 |
- (IBAction)aRemapGlyphs:(id)sender; |
| 70 |
|
| 71 |
- (id)initFromNib; |
| 72 |
- (void)dealloc; |
| 73 |
- (void)setXAPOwner:(XAP_Dialog *)owner; |
| 74 |
- (void)discardXAP; |
| 75 |
- (void)windowDidLoad; |
| 76 |
- (void)windowWillClose:(NSNotification *)aNotification; |
| 77 |
- (void)windowToFront; |
| 78 |
|
| 79 |
- (void)fontFamilyDidChange; |
| 80 |
- (void)recalculateSymbolWidths; |
| 81 |
|
| 82 |
/* NSTableViewDataSource methods |
| 83 |
*/ |
| 84 |
- (int)numberOfRowsInTableView:(NSTableView *)aTableView; |
| 85 |
- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex; |
| 86 |
|
| 87 |
/* NSTableView delegate methods |
| 88 |
*/ |
| 89 |
- (void)tableView:(NSTableView *)aTableView willDisplayCell:(id)aCell forTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex; |
| 90 |
- (BOOL)tableView:(NSTableView *)aTableView shouldSelectRow:(int)rowIndex; |
| 91 |
@end |
| 92 |
|
| 93 |
|
| 94 |
class XAP_CocoaDialog_Insert_Symbol : public XAP_Dialog_Insert_Symbol |
| 95 |
{ |
| 96 |
public: |
| 97 |
static XAP_Dialog * static_constructor(XAP_DialogFactory *, XAP_Dialog_Id dlgid); |
| 98 |
|
| 99 |
XAP_CocoaDialog_Insert_Symbol(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id dlgid); |
| 100 |
|
| 101 |
virtual ~XAP_CocoaDialog_Insert_Symbol(void); |
| 102 |
|
| 103 |
virtual void runModal(XAP_Frame * pFrame); |
| 104 |
virtual void runModeless(XAP_Frame * pFrame); |
| 105 |
virtual void notifyActiveFrame(XAP_Frame * pFrame); |
| 106 |
virtual void notifyCloseFrame(XAP_Frame * ) { }; |
| 107 |
virtual void activate(void); |
| 108 |
virtual void destroy(void); |
| 109 |
|
| 110 |
void insertSymbol(const char * fontFamilyName, UT_UCS4Char symbol); |
| 111 |
void windowClosed(void); |
| 112 |
|
| 113 |
private: |
| 114 |
XAP_CocoaDlg_Insert_SymbolController * m_dlg; |
| 115 |
}; |
| 116 |
|
| 117 |
#endif /* XAP_COCOADIALOG_INSERT_SYMBOL_H */ |