00001 #ifndef textviewer_included_h 00002 #define textviewer_included_h 00003 // 00004 // Copyright 2002, Lowell Boggs Jr. 00005 // 00006 // This file or directory, containing source code for a computer program, 00007 // is Copyrighted by Lowell Boggs, Jr. 987 Regency Drive, Lewisville 00008 // TX (USA), 75067. You may use, copy, modify, and distribute this 00009 // source file without charge or obligation so long as you agree to 00010 // the following: 00011 // 00012 // 1. You must indemnify Lowell Boggs against any and all financial 00013 // obligations caused by its use, misuse, function, or malfunction. 00014 // Further, you acknowledge that there is no warranty of any kind, 00015 // whatsoever. 00016 // 00017 // 2. You agree not to attempt to patent any portion of this original 00018 // work -- though you may attempt to patent your own extensions to 00019 // it if you so choose. 00020 // 00021 // 3. You keep this copyright notice with the file and all copies 00022 // of the file and do not change it anyway except language translation. 00023 // 00024 // You are responsible for enforcing your own compliance with these 00025 // conditions and may not use this source file if you cannot agree to the 00026 // above terms and conditions. 00027 // 00028 // Warning: not all files in this directory structure are covered by the 00029 // same copyright. Some of them are part of the GNU source distribution 00030 // and you must obey the GPL copyright for those files. 00031 00034 00035 00036 #include <cxxtls/viewer.h> 00037 #include <cxxtls/file.h> 00038 00039 namespace cxxtls 00040 { 00041 00042 00043 class TextViewer 00044 : public Viewer 00051 { 00052 private: 00053 00054 void ensure_cursor_visible(viewport*); 00057 00058 00059 public: 00060 00061 struct impl; 00062 00063 std::auto_ptr<impl> impl_; 00064 00065 TextViewer(ViewerManager*vm, FileName f); 00066 ~TextViewer(); 00067 00068 virtual void operator() ( CursorWindow::viewport * vp, 00069 int cmd 00070 ); 00072 00073 virtual bool handle_event( CursorWindow::input_event const * e, 00074 CursorWindow::viewport * vp 00075 ); 00077 00078 virtual void help(); 00079 00080 00081 00082 static Viewer* app(ViewerManager*vm, std::string &fullname); 00088 00089 static std::string app_name; 00093 00094 std::string const& application_name() const { return app_name; } 00099 00100 std::string description() const; 00103 00104 }; 00105 } // namespace cxxtls 00106 #endif