1 /******************************************************************************* 2 * * 3 * file.h -- Nirvana Editor File Header File * 4 * * 5 * Copyright 2004 The NEdit Developers * 6 * * 7 * This is free software; you can redistribute it and/or modify it under the * 8 * terms of the GNU General Public License as published by the Free Software * 9 * Foundation; either version 2 of the License, or (at your option) any later * 10 * version. In addition, you may distribute versions of this program linked to * 11 * Motif or Open Motif. See README for details. * 12 * * 13 * This software is distributed in the hope that it will be useful, but WITHOUT * 14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * 15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * 16 * more details. * 17 * * 18 * You should have received a copy of the GNU General Public License along with * 19 * software; if not, write to the Free Software Foundation, Inc., 59 Temple * 20 * Place, Suite 330, Boston, MA 02111-1307 USA * 21 * * 22 * Nirvana Text Editor * 23 * July 31, 2001 * 24 * * 25 *******************************************************************************/ 26 27 #ifndef NEDIT_FILE_H_INCLUDED 28 #define NEDIT_FILE_H_INCLUDED 29 30 #include "nedit.h" 31 32 #include <X11/Intrinsic.h> 33 34 /* flags for EditExistingFile */ 35 #define CREATE 1 36 #define SUPPRESS_CREATE_WARN 2 37 #define PREF_READ_ONLY 4 38 39 #define PROMPT_SBC_DIALOG_RESPONSE 0 40 #define YES_SBC_DIALOG_RESPONSE 1 41 #define NO_SBC_DIALOG_RESPONSE 2 42 43 WindowInfo *EditNewFile(WindowInfo *inWindow, char *geometry, int iconic, 44 const char *languageMode, const char *defaultPath); 45 WindowInfo *EditExistingFile(WindowInfo *inWindow, const char *name, 46 const char *path, int flags, char *geometry, int iconic, 47 const char *languageMode, int tabbed, int bgOpen); 48 void RevertToSaved(WindowInfo *window); 49 int SaveWindow(WindowInfo *window); 50 int SaveWindowAs(WindowInfo *window, const char *newName, int addWrap); 51 int CloseAllFilesAndWindows(void); 52 int CloseFileAndWindow(WindowInfo *window, int preResponse); 53 void PrintWindow(WindowInfo *window, int selectedOnly); 54 void PrintString(const char *string, int length, Widget parent, const char *jobName); 55 int WriteBackupFile(WindowInfo *window); 56 int IncludeFile(WindowInfo *window, const char *name); 57 int PromptForExistingFile(WindowInfo *window, char *prompt, char *fullname); 58 int PromptForNewFile(WindowInfo *window, char *prompt, char *fullname, 59 int *fileFormat, int *addWrap); 60 int CheckReadOnly(WindowInfo *window); 61 void RemoveBackupFile(WindowInfo *window); 62 void UniqueUntitledName(char *name); 63 void CheckForChangesToFile(WindowInfo *window); 64 65 #endif /* NEDIT_FILE_H_INCLUDED */ 66