1 /* 2 FXiTe - The Free eXtensIble Text Editor 3 Copyright (c) 2009-2012 Jeffrey Pohlmeyer <yetanothergeek@gmail.com> 4 5 This program is free software; you can redistribute it and/or modify it 6 under the terms of the GNU General Public License version 3 as 7 published by the Free Software Foundation. 8 9 This software is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 GNU General Public License for more details. 13 14 You should have received a copy of the GNU General Public License 15 along with this program; if not, write to the Free Software 16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 */ 18 19 20 class BackupMgr; 21 22 class FileDialogs: public FXObject { 23 FXDECLARE(FileDialogs); FileDialogs()24 FileDialogs() {} 25 private: 26 void *user_data; 27 FXSelector message; 28 FXObject *target; 29 30 typedef void (*ExportFunc) (SciDoc*sci, FILE *fp); 31 bool Export(SciDoc*sci, 32 const char*title, const char*patts, const char*ext, ExportFunc func, const char*filename=NULL); 33 public: 34 bool TryClose(SciDoc*sci, const char *alt); 35 bool SaveFile(SciDoc*sci, const FXString &filename, bool as_itself=true); 36 bool SaveFileAs(SciDoc*sci, bool as_itself=true, const FXString &suggestion=FXString::null); 37 bool ExportPdf(SciDoc*sci, const char* filename=NULL); 38 bool ExportHtml(SciDoc*sci, const char* filename=NULL); 39 bool GetOpenFilenames(SciDoc*sci, FXString* &filenames, bool multi=true); 40 bool GetOpenTagFilename(SciDoc*sci, FXString &filename); 41 bool AskReload(SciDoc*sci); 42 bool AskReloadForExternalChanges(SciDoc*sci); 43 bool AskSaveMissingFile(SciDoc*sci); 44 bool AskSaveModifiedCommand(SciDoc*sci, const FXString &script); getUserData()45 void *getUserData() { return user_data; } setUserData(void * p)46 void setUserData(void*p) { user_data=p; } 47 static void SetWorkingDirectory(FXWindow*w); 48 static bool FileExistsOrConfirmCreate(FXMainWindow*w, const FXString &fn); setSelector(FXSelector sel)49 void setSelector(FXSelector sel) { message=sel; } 50 FileDialogs(FXObject*tgt, FXSelector sel); 51 #ifdef WIN32 52 static bool ReadShortcut(FXWindow*w, FXString &filename); 53 #endif 54 }; 55 56