Back to index

texmacs  1.0.7.15
edit_select.hpp
Go to the documentation of this file.
00001 
00002 /******************************************************************************
00003 * MODULE     : select.hpp
00004 * DESCRIPTION: for selection handling in TeXmacs
00005 * COPYRIGHT  : (C) 1999  Joris van der Hoeven
00006 *******************************************************************************
00007 * This software falls under the GNU general public license version 3 or later.
00008 * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
00009 * in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
00010 ******************************************************************************/
00011 
00012 #ifndef EDIT_SELECT_H
00013 #define EDIT_SELECT_H
00014 #include "editor.hpp"
00015 
00016 #define DIRECT 0
00017 #define CENTER 1
00018 #define HORIZONTAL 2
00019 #define VERTICAL 3
00020 
00021 class edit_select_rep: virtual public editor_rep {
00022 protected:
00023   path   start_p, end_p;
00024   bool   selecting, shift_selecting;
00025   path   mid_p;
00026   string selection_import;
00027   string selection_export;
00028   path   focus_p;
00029   bool   focus_hold;
00030 
00031 protected:
00032   void get_selection (path& start, path& end);
00033   void set_selection (path start, path end);
00034   void raw_cut (path start, path end);
00035 
00036 public:
00037   edit_select_rep ();
00038   ~edit_select_rep ();
00039 
00040   path semantic_root (path p);
00041   bool semantic_active (path p);
00042   bool semantic_select (path p, path& q1, path& q2, int mode);
00043 
00044   void select (path p);
00045   void select (path start, path end);
00046   void select_all ();
00047   void select_line ();
00048   void select_from_cursor ();
00049   void select_from_cursor_if_active ();
00050   void select_from_keyboard (bool flag);
00051   void select_from_shift_keyboard ();
00052   void select_enlarge_text ();
00053   void select_enlarge ();
00054   void select_enlarge_environmental ();
00055 
00056   bool selection_active_any ();
00057   bool selection_active_normal ();
00058   bool selection_active_table (bool strict= true);
00059   bool selection_active_small ();
00060   bool selection_active_enlarging ();
00061 
00062   void selection_raw_set (string key, tree t);
00063   tree selection_raw_get (string key);
00064   void selection_correct (path i1, path i2, path& o1, path& o2);
00065   path selection_get_subtable (int& row1, int& col1, int& row2, int& col2);
00066   void selection_get (selection& sel);
00067   void selection_get (path& start, path& end);
00068   path selection_get_start ();
00069   path selection_get_end ();
00070   path selection_get_path ();
00071   path selection_get_cursor_path ();
00072   tree selection_get_env_value (string var);
00073   void selection_set (string key, tree t, bool persistant= false);
00074   void selection_set (tree t);
00075   void selection_set_start (path p= path());
00076   void selection_set_end (path p= path());
00077   void selection_set_paths (path start, path end);
00078   void selection_copy (string key= "primary");
00079   void selection_paste (string key= "primary");
00080   void selection_clear (string key= "primary");
00081   void selection_cancel ();
00082   void selection_set_import (string fm);
00083   void selection_set_export (string fm);
00084   string selection_get_import ();
00085   string selection_get_export ();
00086 
00087   tree selection_get ();
00088   void selection_cut (string key= "primary");
00089   tree selection_get_cut ();
00090   void selection_move ();
00091   void cut (path p);
00092   void cut (path start, path end);
00093   path manual_focus_get ();
00094   void manual_focus_set (path p, bool force);
00095   void manual_focus_release ();
00096   path focus_search (path p, bool skip_flag, bool up_flag);
00097   path focus_get (bool skip_flag);
00098 };
00099 
00100 #endif // defined EDIT_SELECT_H