GFC Logo GFC Title Logo
Reference Manual
Main Page  |  Namespace List  |  Alphabetical List  |  Class List  |  File List

textiter.hh

Go to the documentation of this file.
00001 /* GFC-UI: GTK+ Foundation Classes (User Interface Library) 00002 * Copyright (C) 2002-2003 The GFC Development Team. 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU Library General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Library General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 */ 00018 00023 00024 #ifndef GFC_GTK_TEXT_ITER_HH 00025 #define GFC_GTK_TEXT_ITER_HH 00026 00027 #ifndef GFC_G_BOXED_HH 00028 #include <gfc/glib/boxed.hh> 00029 #endif 00030 00031 #ifndef GFC_G_PROPERTY_HH 00032 #include <gfc/glib/property.hh> 00033 #endif 00034 00035 #ifndef GTK_TEXT_ITER_H 00036 #include <gtk/gtktextiter.h> 00037 #endif 00038 00039 #ifndef _CPP_VECTOR 00040 #include <vector> 00041 #endif 00042 00043 namespace GFC { 00044 00045 namespace G { 00046 class Unichar; 00047 } 00048 00049 namespace Gdk { 00050 class Pixbuf; 00051 } 00052 00053 namespace Gtk { 00054 00055 class TextAttributes; 00056 class TextBuffer; 00057 class TextChildAnchor; 00058 class TextMark; 00059 class TextTag; 00060 00064 00065 enum TextSearchFlags 00066 { 00067 TEXT_SEARCH_VISIBLE_ONLY = GTK_TEXT_SEARCH_VISIBLE_ONLY, 00070 00071 TEXT_SEARCH_TEXT_ONLY = GTK_TEXT_SEARCH_TEXT_ONLY 00073 }; 00074 00076 00077 typedef unsigned int TextSearchFlagsField; 00078 00092 00093 class TextIter : public G::Boxed 00094 { 00095 public: 00096 typedef sigc::slot<bool, G::Unichar> TextCharPredicate; 00105 00108 00109 TextIter(); 00111 00112 explicit TextIter(GtkTextIter *iter); 00120 00121 TextIter(GtkTextIter *iter, bool copy); 00131 00132 TextIter(const TextIter& src); 00135 00136 ~TextIter(); 00138 00139 TextIter& operator=(const TextIter& src); 00142 00146 00147 GtkTextIter* gtk_text_iter() const; 00149 00150 operator GtkTextIter* () const; 00152 00153 TextBuffer* get_buffer() const; 00155 00156 int get_offset() const; 00160 00161 int get_line() const; 00164 00165 int get_line_offset() const; 00170 00171 int get_line_index() const; 00177 00178 int get_visible_line_offset() const; 00182 00183 int get_visible_line_index() const; 00187 00188 G::Unichar get_char() const; 00197 00198 G::Unichar operator*() const; 00207 00208 Gdk::Pixbuf* get_pixbuf() const; 00211 00212 bool get_marks(std::vector<TextMark*>& marks) const; 00220 00221 TextChildAnchor* get_child_anchor() const; 00224 00225 bool get_toggled_tags(std::vector<TextTag*>& tags, bool toggled_on) const; 00235 00236 bool begins_tag(const TextTag *tag = 0) const; 00245 00246 bool ends_tag(const TextTag *tag = 0) const; 00254 00255 bool toggles_tag(const TextTag *tag = 0) const; 00260 00261 bool has_tag(const TextTag& tag) const; 00265 00266 bool get_tags(std::vector<TextTag*>& tags) const; 00273 00274 bool editable(bool default_setting) const; 00288 00289 bool can_insert(bool default_editability) const; 00298 00299 bool starts_word() const; 00305 00306 bool ends_word() const; 00312 00313 bool inside_word() const; 00320 00321 bool starts_sentence() const; 00327 00328 bool ends_sentence() const; 00334 00335 bool inside_sentence() const; 00342 00343 bool starts_line() const; 00349 00350 bool ends_line() const; 00360 00361 bool is_cursor_position() const; 00365 00366 int get_chars_in_line() const; 00369 00370 int get_bytes_in_line() const; 00373 00374 bool get_attributes(TextAttributes& values) const; 00386 00387 PangoLanguage* get_language() const; 00394 00395 bool is_end() const; 00401 00402 bool is_start() const; 00406 00407 bool equal(const TextIter& other) const; 00415 00416 int compare(const TextIter& other) const; 00424 00425 bool in_range(const TextIter& start, const TextIter& end); 00431 00432 bool operator==(const TextIter& other) const; 00435 00436 bool operator!=(const TextIter& other) const; 00439 00440 bool operator<(const TextIter& other) const; 00443 00444 bool operator>(const TextIter& other) const; 00447 00448 bool operator<=(const TextIter& other) const; 00451 00452 bool operator>=(const TextIter& other) const; 00455 00457 00458 static String get_slice(const TextIter& start, const TextIter& end); 00470 00471 static String get_text(const TextIter& start, const TextIter& end); 00480 00481 static String get_visible_slice(const TextIter& start, const TextIter& end); 00489 00490 static String get_visible_text(const TextIter& start, const TextIter& end); 00498 00499 static void order(const TextIter& first, const TextIter& second); 00508 00511 00512 bool forward_char(); 00520 00521 bool backward_char(); 00527 00528 bool forward_chars(int count); 00537 00538 bool backward_chars(int count); 00547 00548 bool forward_line(); 00555 00556 bool backward_line(); 00565 00566 bool forward_lines(int count); 00576 00577 bool backward_lines(int count); 00587 00588 bool forward_word_end(); 00595 00596 bool backward_word_start(); 00603 00604 bool forward_word_ends(int count); 00608 00609 bool backward_word_starts(int count); 00613 00614 bool forward_visible_word_end(); 00621 00622 bool backward_visible_word_start(); 00629 00630 bool forward_visible_word_ends(int count); 00634 00635 bool backward_visible_word_starts(int count); 00639 00640 bool forward_sentence_end(); 00647 00648 bool backward_sentence_start(); 00655 00656 bool forward_sentence_ends(int count); 00662 00663 bool backward_sentence_starts(int count); 00669 00670 bool forward_cursor_position(); 00682 00683 bool backward_cursor_position(); 00686 00687 bool forward_cursor_positions(int count); 00691 00692 bool backward_cursor_positions(int count); 00696 00697 bool forward_visible_cursor_position(); 00701 00702 bool backward_visible_cursor_position(); 00706 00707 bool forward_visible_cursor_positions(int count); 00712 00713 bool backward_visible_cursor_positions(int count); 00718 00719 void set_offset(int char_offset); 00724 00725 void set_line(int line_number); 00731 00732 void set_line_offset(int char_on_line); 00739 00740 void set_line_index(int byte_on_line); 00746 00747 void set_visible_line_offset(int char_on_line); 00751 00752 void set_visible_line_index(int byte_on_line); 00756 00757 void forward_to_end(); 00761 00762 bool forward_to_line_end(); 00772 00773 bool forward_to_tag_toggle(const TextTag *tag = 0); 00783 00784 bool backward_to_tag_toggle(const TextTag *tag = 0); 00794 00795 bool forward_find_char(const TextCharPredicate& predicate, const TextIter *limit = 0); 00804 00805 bool backward_find_char(const TextCharPredicate& predicate, const TextIter *limit = 0); 00810 00811 bool forward_search(const char *str, const TextIter *limit = 0); 00812 bool forward_search(const String& str, const TextIter *limit = 0); 00823 00824 bool forward_search(const char *str, TextIter *match_start, TextIter *match_end, const TextIter *limit = 0); 00825 bool forward_search(const String& str, TextIter *match_start, TextIter *match_end, const TextIter *limit = 0); 00839 00840 bool forward_search(const char *str, TextSearchFlagsField flags, TextIter *match_start, TextIter *match_end, const TextIter *limit = 0); 00841 bool forward_search(const String& str, TextSearchFlagsField flags, TextIter *match_start, TextIter *match_end, const TextIter *limit = 0); 00860 00861 bool backward_search(const char * str, const TextIter *limit = 0); 00862 bool backward_search(const String& str, const TextIter *limit = 0); 00871 00872 bool backward_search(const char * str, TextIter *match_start, TextIter *match_end, const TextIter *limit = 0); 00873 bool backward_search(const String& str, TextIter *match_start, TextIter *match_end, const TextIter *limit = 0); 00884 00885 bool backward_search(const char *str, TextSearchFlagsField flags, TextIter *match_start, TextIter *match_end, const TextIter *limit = 0); 00886 bool backward_search(const String& str, TextSearchFlagsField flags, TextIter *match_start, TextIter *match_end, const TextIter *limit = 0); 00894 00895 TextIter operator+(int chars) const; 00900 00901 TextIter operator-(int chars) const; 00906 00907 TextIter& operator+=(int chars); 00911 00912 TextIter& operator-=(int chars); 00916 00917 TextIter& operator++(); 00919 00920 TextIter& operator--(); 00922 00923 TextIter operator++(int); 00925 00926 TextIter operator--(int); 00928 00930 }; 00931 00932 } // namespace Gtk 00933 00934 } // namespace GFC 00935 00936 #include <gfc/gtk/inline/textiter.inl> 00937 00938 #endif // GFC_GTK_TEXT_ITER_HH 00939

Generated on Tue Aug 24 00:34:32 2004 for GFC-UI by doxygen 1.3.8