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 #ifndef SCIDOC_UTIL_H 20 #define SCIDOC_UTIL_H 21 22 class SciDoc; 23 class Settings; 24 25 class SciDocUtils { 26 public: 27 static void CharAdded(SciDoc*sci, long line, long pos, int ch, Settings*prefs, SciDoc*recording); 28 static void AdjustIndent(SciDoc*sci, char ch, Settings*prefs, SciDoc*recording); 29 static void OpenSelected(FXMainWindow*tw, SciDoc*sci); 30 static bool InsertFile(SciDoc *sci, const FXString &filename); 31 static void SetSciDocPrefs(SciDoc*sci, Settings*prefs); 32 static void CycleSplitter(SciDoc*sci, Settings*prefs); 33 static void Cut(SciDoc*sci); 34 static void Copy(SciDoc*sci); 35 static void Paste(SciDoc*sci); 36 static void Indent(SciDoc*sci, bool forward, bool single_space, int indent_width); 37 static SciDoc* NewSci(FXComposite*p, FXObject*trg, Settings*prefs); 38 static void DoneSci(SciDoc*sci, SciDoc*recording); 39 static void SetScintillaSelector(FXSelector sel); 40 static void SetMacroRecordSelector(FXSelector sel); 41 static FXString Filename(SciDoc*sci); 42 static bool SaveToFile(SciDoc*sci, const char*filename, bool as_itself=true); 43 static bool Reload(SciDoc*sci); 44 static bool Dirty(SciDoc*sci); 45 static void SetFocus(SciDoc*sci); 46 static void KillFocus(SciDoc*sci); 47 static FXival ID(SciDoc*sci); 48 static void NeedBackup(SciDoc*sci, bool need); 49 static void CopyText(SciDoc*sci, const FXString &txt); 50 static const FXString GetLastError(SciDoc*sci); 51 }; 52 53 #endif 54 55