Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

httext.h

Go to the documentation of this file.
00001 /* 
00002  *      HT Editor
00003  *      httext.h
00004  *
00005  *      Copyright (C) 1999-2002 Stefan Weyergraf (stefan@weyergraf.de)
00006  *
00007  *      This program is free software; you can redistribute it and/or modify
00008  *      it under the terms of the GNU General Public License version 2 as
00009  *      published by the Free Software Foundation.
00010  *
00011  *      This program is distributed in the hope that it will be useful,
00012  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *      GNU General Public License for more details.
00015  *
00016  *      You should have received a copy of the GNU General Public License
00017  *      along with this program; if not, write to the Free Software
00018  *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00019  */
00020 
00021 #ifndef __HTTEXT_H__
00022 #define __HTTEXT_H__
00023 
00024 #include "htformat.h"
00025 #include "formats.h"
00026 
00027 #define TEXT_DESC "text"
00028 
00029 extern format_viewer_if httext_if;
00030 
00031 /*
00032  *      CLASS ht_text_viewer
00033  */
00034 
00035 class ht_text_viewer2: public ht_uformat_viewer {
00036 public:
00037 /* overwritten */
00038         virtual void handlemsg(htmsg *msg);
00039 };
00040 
00041 /*
00042  *      CLASS ht_text_sub
00043  */
00044  
00045 class ht_text_sub: public ht_linear_sub {
00046 protected:
00047 /* new */
00048                         UINT find_linelen_backwd(byte *buf, UINT maxbuflen, FILEOFS ofs, int *le_len);
00049                         UINT find_linelen_forwd(byte *buf, UINT maxbuflen, FILEOFS ofs, int *le_len);
00050         virtual byte *match_lineend_forwd(byte *buf, UINT buflen, int *le_len);
00051         virtual byte *match_lineend_backwd(byte *buf, UINT buflen, int *le_len);
00052 public:
00053                         void init(ht_streamfile *file, FILEOFS offset, int size);
00054         virtual void done();
00055 /* overwritten */
00056         virtual bool convert_ofs_to_id(const FILEOFS offset, LINE_ID *line_id);
00057         virtual bool convert_id_to_ofs(const LINE_ID line_id, FILEOFS *offset);
00058         virtual void first_line_id(LINE_ID *line_id);
00059         virtual bool getline(char *line, const LINE_ID line_id);
00060         virtual void last_line_id(LINE_ID *line_id);
00061         virtual int next_line_id(LINE_ID *line_id, int n);
00062         virtual int prev_line_id(LINE_ID *line_id, int n);
00063 };
00064 
00065 #endif /* !__HTTEXT_H__ */
00066 

Generated on Fri May 7 21:15:37 2004 by doxygen 1.3.5