| 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, 2009 Hubert Figuiere |
| 6 |
* |
| 7 |
* This program is free software; you can redistribute it and/or |
| 8 |
* modify it under the terms of the GNU General Public License |
| 9 |
* as published by the Free Software Foundation; either version 2 |
| 10 |
* of the License, or (at your option) any later version. |
| 11 |
* |
| 12 |
* This program is distributed in the hope that it will be useful, |
| 13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 |
* GNU General Public License for more details. |
| 16 |
* |
| 17 |
* You should have received a copy of the GNU General Public License |
| 18 |
* along with this program; if not, write to the Free Software |
| 19 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
| 20 |
* 02110-1301 USA. |
| 21 |
*/ |
| 22 |
|
| 23 |
#ifndef XAP_COCOADIALOG_FILEOPENSAVEAS_H |
| 24 |
#define XAP_COCOADIALOG_FILEOPENSAVEAS_H |
| 25 |
|
| 26 |
#import <Cocoa/Cocoa.h> |
| 27 |
|
| 28 |
#include "xap_Dlg_FileOpenSaveAs.h" |
| 29 |
|
| 30 |
class XAP_CocoaFrame; |
| 31 |
class XAP_CocoaDialog_FileOpenSaveAs; |
| 32 |
|
| 33 |
|
| 34 |
@interface XAP_OpenSavePanel_AccessoryController : NSObject |
| 35 |
{ |
| 36 |
IBOutlet NSTextField * oFTLabel; |
| 37 |
IBOutlet NSPopUpButton * oFTPopUp; |
| 38 |
IBOutlet NSView * oFTAccessoryView; |
| 39 |
|
| 40 |
XAP_CocoaDialog_FileOpenSaveAs * _xap; |
| 41 |
} |
| 42 |
|
| 43 |
- (id)initWithXAP:(XAP_CocoaDialog_FileOpenSaveAs*)xap; |
| 44 |
|
| 45 |
- (NSView *)fileTypeAccessoryView; |
| 46 |
- (void)setFileTypeLabel:(const std::string &)label; |
| 47 |
- (void)setSelectedFileType:(int)type; |
| 48 |
|
| 49 |
- (void)removeItemsOfFileTypesMenu; |
| 50 |
- (void)addItemWithTitle:(NSString *)title fileType:(int)type; |
| 51 |
|
| 52 |
- (IBAction)selectFileType:(id)sender; |
| 53 |
@end |
| 54 |
|
| 55 |
/*****************************************************************/ |
| 56 |
|
| 57 |
class XAP_CocoaDialog_FileOpenSaveAs : public XAP_Dialog_FileOpenSaveAs |
| 58 |
{ |
| 59 |
public: |
| 60 |
XAP_CocoaDialog_FileOpenSaveAs(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id dlgid); |
| 61 |
virtual ~XAP_CocoaDialog_FileOpenSaveAs(void); |
| 62 |
|
| 63 |
virtual void runModal(XAP_Frame * pFrame); |
| 64 |
|
| 65 |
static XAP_Dialog * static_constructor(XAP_DialogFactory *, XAP_Dialog_Id dlgid); |
| 66 |
|
| 67 |
void _setSelectedFileType (UT_sint32 type); |
| 68 |
|
| 69 |
private: |
| 70 |
NSSavePanel * _makeOpenPanel(); |
| 71 |
NSSavePanel * _makeSavePanel(const std::string & label); |
| 72 |
|
| 73 |
XAP_OpenSavePanel_AccessoryController * m_accessoryViewsController; |
| 74 |
XAP_CocoaFrame * m_pCocoaFrame; |
| 75 |
|
| 76 |
NSSavePanel * m_panel; |
| 77 |
NSMutableArray * m_fileTypes; |
| 78 |
|
| 79 |
const char * m_szFileTypeDescription; |
| 80 |
UT_uint32 m_szFileTypeCount; |
| 81 |
|
| 82 |
bool m_bPanelActive; |
| 83 |
bool m_bOpenPanel; |
| 84 |
bool m_bIgnoreCancel; |
| 85 |
}; |
| 86 |
|
| 87 |
#endif /* XAP_COCOADIALOG_FILEOPENSAVEAS_H */ |