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

vfsview.h

Go to the documentation of this file.
00001 /* 
00002  *      HT Editor
00003  *      vfsview.h
00004  *
00005  *      Copyright (C) 1999-2003 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 __VFSVIEW_H__
00022 #define __VFSVIEW_H__
00023 
00024 #include "htdialog.h"
00025 #include "vfs.h"
00026 
00027 /*
00028  *      class VfsListbox
00029  */
00030 
00031 struct vfs_extra {
00032         pstat_t stat;
00033         char *name;
00034 };
00035 
00036 #define VFSV_FORMAT_MAX_COLS            64
00037 #define VFSV_FORMAT_PROPERTIES          22
00038 
00039 #define VfsListboxData ht_itext_listbox_data
00040 
00041 class VfsListbox: public ht_itext_listbox {
00042 protected:
00043         ht_list *vfs_list;
00044         Vfs *cvfs;
00045         char cdir[VFS_DIR_MAX+1];
00046         char cproto[VFS_PROTO_MAX+1];
00047         
00048         int dfmt_cols;
00049         int dfmt_props;
00050         int dfmt_prop2colidx[VFSV_FORMAT_MAX_COLS];
00051         int dfmt_prop[VFSV_FORMAT_MAX_COLS];
00052         int dfmt_quickfind;
00053         
00054         ht_text *show_pos;
00055 
00056         virtual void            freeExtraData(void *extra_data);
00057                 void            renderEntry(char *buf, int bufsize, int dfmt, const char *filename, pstat_t stat);
00058                 void            reread();
00059                 void            setDisplayFormat(char *fmt);
00060         virtual bool            selectEntry(void *entry);
00061                 char *          translateProp(char *fmt, int *type);
00062 public:
00063                 void            init(bounds *b, ht_list *vfs_list, ht_text *show_pos);
00064         virtual void            done();
00065         /* overwritten */
00066         virtual void            config_changed();
00067         virtual int             cursorAdjust();
00068         virtual void            handlemsg(htmsg *msg);
00069         virtual void *          quickfind(char *s);
00070         virtual char *          quickfindCompletition(char *s);
00071         virtual void            update();
00072         /* new */
00073                 int             changeURL(const char *url);
00074                 int             changeDir(const char *dir);
00075                 const char *    getCurDir();
00076                 const char *    getCurProto();
00077                 Vfs *           getCurVfs();
00078 };
00079 
00080 /*
00081  *      class VfsListbox2
00082  */
00083 class VfsListbox2: public VfsListbox {
00084 public:
00085 
00086         virtual bool selectEntry(void *entry);
00087 };
00088 
00089 #endif /* __VFSVIEW_H__ */

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