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

htclipboard.h

Go to the documentation of this file.
00001 /*
00002  *      HT Editor
00003  *      htclipboard.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 __HTCLIPBOARD_H__
00022 #define __HTCLIPBOARD_H__
00023 
00024 #include "global.h"
00025 #include "stream.h"
00026 #include "htformat.h"
00027 
00028 /*
00029  *      CLASS ht_clipboard
00030  */
00031 
00032 class ht_clipboard: public ht_mem_file {
00033 public:
00034         ht_list *copy_history;
00035         dword select_start, select_len;
00036 
00037                         void init();
00038         virtual void done();
00039 /* overwritten */
00040         virtual UINT    write(const void *buf, UINT size);
00041 /* new */
00042                         void clear();
00043 };
00044 
00045 /*
00046  *      CLASS ht_clipboard_viewer
00047  */
00048 
00049 class ht_clipboard_viewer: public ht_uformat_viewer {
00050 protected:
00051         UINT lastwritecount;
00052         UINT lastentrycount;
00053 
00054                         void get_pindicator_str(char *buf);
00055                         void selection_changed();
00056 public:
00057                         void init(bounds *b, char *desc, int caps, ht_clipboard *clipboard, ht_format_group *format_group);
00058 /* overwritten */
00059         virtual void draw();
00060         virtual         void handlemsg(htmsg *msg);
00061         virtual void pselect_add(FILEOFS start, FILEOFS end);
00062         virtual void pselect_set(FILEOFS start, FILEOFS end);
00063 /* new */
00064                         void update_content();
00065 };
00066 
00067 /* clipboard functions */
00068 
00069 void clipboard_add_copy_history_entry(char *source, dword start, dword size, time_t time);
00070 int clipboard_copy(char *source_desc, void *buf, dword len);
00071 int clipboard_copy(char *source_desc, ht_streamfile *streamfile, dword offset, dword len);
00072 int clipboard_paste(void *buf, dword maxlen);
00073 int clipboard_paste(ht_streamfile *streamfile, dword offset);
00074 int clipboard_clear();
00075 dword clipboard_getsize();
00076 
00077 /*
00078  *      INIT
00079  */
00080 
00081 bool init_clipboard();
00082 
00083 /*
00084  *      DONE
00085  */
00086 
00087 void done_clipboard();
00088 
00089 extern ht_clipboard *clipboard;
00090 
00091 #endif /* __HTCLIPBOARD_H__ */

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