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, 2009 Hubert Figuiere 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., 59 Temple Place - Suite 330, Boston, MA 00020 * 02111-1307, USA. 00021 */ 00022 00023 #ifndef XAP_COCOADIALOG_FILEOPENSAVEAS_H 00024 #define XAP_COCOADIALOG_FILEOPENSAVEAS_H 00025 00026 #import <Cocoa/Cocoa.h> 00027 00028 #include "xap_Dlg_FileOpenSaveAs.h" 00029 00030 class XAP_CocoaFrame; 00031 class XAP_CocoaDialog_FileOpenSaveAs; 00032 00033 00034 @interface XAP_OpenSavePanel_AccessoryController : NSObject 00035 { 00036 IBOutlet NSTextField * oFTLabel; 00037 IBOutlet NSPopUpButton * oFTPopUp; 00038 IBOutlet NSView * oFTAccessoryView; 00039 00040 XAP_CocoaDialog_FileOpenSaveAs * _xap; 00041 } 00042 00043 - (id)initWithXAP:(XAP_CocoaDialog_FileOpenSaveAs*)xap; 00044 00045 - (NSView *)fileTypeAccessoryView; 00046 - (void)setFileTypeLabel:(const std::string &)label; 00047 - (void)setSelectedFileType:(int)type; 00048 00049 - (void)removeItemsOfFileTypesMenu; 00050 - (void)addItemWithTitle:(NSString *)title fileType:(int)type; 00051 00052 - (IBAction)selectFileType:(id)sender; 00053 @end 00054 00055 /*****************************************************************/ 00056 00057 class XAP_CocoaDialog_FileOpenSaveAs : public XAP_Dialog_FileOpenSaveAs 00058 { 00059 public: 00060 XAP_CocoaDialog_FileOpenSaveAs(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id dlgid); 00061 virtual ~XAP_CocoaDialog_FileOpenSaveAs(void); 00062 00063 virtual void runModal(XAP_Frame * pFrame); 00064 00065 static XAP_Dialog * static_constructor(XAP_DialogFactory *, XAP_Dialog_Id dlgid); 00066 00067 void _setSelectedFileType (UT_sint32 type); 00068 00069 private: 00070 NSSavePanel * _makeOpenPanel(); 00071 NSSavePanel * _makeSavePanel(const std::string & label); 00072 00073 XAP_OpenSavePanel_AccessoryController * m_accessoryViewsController; 00074 XAP_CocoaFrame * m_pCocoaFrame; 00075 00076 NSSavePanel * m_panel; 00077 NSMutableArray * m_fileTypes; 00078 00079 const char * m_szFileTypeDescription; 00080 UT_uint32 m_szFileTypeCount; 00081 00082 bool m_bPanelActive; 00083 bool m_bOpenPanel; 00084 bool m_bIgnoreCancel; 00085 }; 00086 00087 #endif /* XAP_COCOADIALOG_FILEOPENSAVEAS_H */
1.7.1