Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

  1. #ifndef __MGTK_EDITOR_H
  2. #define __MGTK_EDITOR_H
  3.  
  4. #include<mgtk/widget.h>
  5. #include<mgtk/slider.h>
  6.  
  7. class GClipboard
  8. {
  9. public:
  10.  typedef enum {
  11.      CL_EMPTY=0,
  12.      CL_BINARY=1,
  13.      CL_IMAGE=2,
  14.      CL_TEXT=3,
  15.  } clip_data_type_t;
  16.  GClipboard();
  17.  virtual ~GClipboard();
  18.  virtual void * GetData();
  19.  virtual clip_data_type_t GetDataType();
  20.  virtual unsigned long GetDataSize();
  21.  virtual void SetClipData(clip_data_type_t type,void * ptr,unsigned long size);
  22.  virtual void Empty();
  23. private:
  24.  void * buf_location;
  25.  unsigned long size;
  26.  clip_data_type_t data_type;
  27. };
  28.  
  29. #define INVALID_EDITOR_OFFSET   0xffffffff
  30.  
  31. class GEditorCore
  32. {
  33. public:
  34.  GEditorCore(unsigned long SizeLim);
  35.  virtual ~GEditorCore();
  36.  virtual int ExpandBuffer(int delta);
  37.  virtual void Delete(unsigned long offset,unsigned long size);
  38.  virtual void Cut(unsigned long offset,unsigned long size,
  39.      GClipboard * Clip);
  40.  virtual void Copy(unsigned long offset,unsigned long size,
  41.      GClipboard * Clip);
  42.  virtual void Paste(unsigned long offset,GClipboard * Clip);
  43.  virtual unsigned long Search(unsigned long from_off,char * keyword,int name_len);
  44.  virtual int Replace(unsigned long from_off,char * keyword,char * replace_to,
  45.      int kword_len,int rt_len,bool ReplaceAll);
  46.  virtual unsigned long GetTextSize();
  47.  virtual char * GetTextBuffer();
  48.  virtual void Empty();
  49.  virtual bool IsEmpty();
  50.  virtual void SetCaseSensitive(bool);
  51.  virtual void InsertCharAt(unsigned long off,char c);
  52. private:
  53.  char * text_buffer;
  54.  unsigned long text_size,buffer_size,size_limit;
  55.  bool case_sensitive;
  56. };
  57.  
  58. #endif
  59.