2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_TEXTVIEW_H
4 #define _GTKMM_TEXTVIEW_H
10 /* Copyright(C) 2002 The gtkmm Development Team
12 * This library is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Library General Public
14 * License as published by the Free Software Foundation; either
15 * version 2 of the License, or(at your option) any later version.
17 * This library is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Library General Public License for more details.
22 * You should have received a copy of the GNU Library General Public
23 * License along with this library; if not, write to the Free
24 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27 #include <gtkmm/container.h>
28 #include <gtkmm/textbuffer.h>
29 #include <gtkmm/textmark.h>
30 #include <gtkmm/menu.h>
31 #include <gtkmm/adjustment.h>
34 #ifndef DOXYGEN_SHOULD_SKIP_THIS
35 typedef struct _GtkTextView GtkTextView;
36 typedef struct _GtkTextViewClass GtkTextViewClass;
37 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
41 { class TextView_Class; } // namespace Gtk
46 /** @addtogroup gtkmmEnums Enums and Flags */
65 #ifndef DOXYGEN_SHOULD_SKIP_THIS
70 class Value<Gtk::TextWindowType> : public Glib::Value_Enum<Gtk::TextWindowType>
73 static GType value_type() G_GNUC_CONST;
77 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
84 /** @defgroup TextView TextView Classes
85 * These classes are used with the Gtk::TextView widget.
88 /** Multi-line text editing widget. It displays a Gtk::TextBuffer.
95 class TextView : public Container
98 #ifndef DOXYGEN_SHOULD_SKIP_THIS
99 typedef TextView CppObjectType;
100 typedef TextView_Class CppClassType;
101 typedef GtkTextView BaseObjectType;
102 typedef GtkTextViewClass BaseClassType;
103 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
107 #ifndef DOXYGEN_SHOULD_SKIP_THIS
110 friend class TextView_Class;
111 static CppClassType textview_class_;
114 TextView(const TextView&);
115 TextView& operator=(const TextView&);
118 explicit TextView(const Glib::ConstructParams& construct_params);
119 explicit TextView(GtkTextView* castitem);
121 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
124 #ifndef DOXYGEN_SHOULD_SKIP_THIS
125 static GType get_type() G_GNUC_CONST;
126 static GType get_base_type() G_GNUC_CONST;
129 ///Provides access to the underlying C GtkObject.
130 GtkTextView* gobj() { return reinterpret_cast<GtkTextView*>(gobject_); }
132 ///Provides access to the underlying C GtkObject.
133 const GtkTextView* gobj() const { return reinterpret_cast<GtkTextView*>(gobject_); }
137 //C++ methods used to invoke GTK+ virtual functions:
140 //GTK+ Virtual Functions (override these to change behaviour):
142 //Default Signal Handlers::
143 virtual void on_set_scroll_adjustments(Adjustment* hadjustment, Adjustment* vadjustment);
144 virtual void on_populate_popup(Menu* menu);
145 virtual void on_set_anchor();
146 virtual void on_insert_at_cursor(const Glib::ustring& str);
153 explicit TextView(const Glib::RefPtr<TextBuffer>& buffer);
156 /** Sets @a buffer as the buffer being displayed by @a text_view . The previous
157 * buffer displayed by the text view is unreferenced, and a reference is
158 * added to @a buffer . If you owned a reference to @a buffer before passing it
159 * to this function, you must remove that reference yourself; Gtk::TextView
160 * will not "adopt" it.
161 * @param buffer A Gtk::TextBuffer.
163 void set_buffer(const Glib::RefPtr<TextBuffer>& buffer);
165 /** Returns the Gtk::TextBuffer being displayed by this text view.
166 * The reference count on the buffer is not incremented; the caller
167 * of this function won't own a new reference.
168 * @return A Gtk::TextBuffer.
170 Glib::RefPtr<TextBuffer> get_buffer();
172 /** Returns the Gtk::TextBuffer being displayed by this text view.
173 * The reference count on the buffer is not incremented; the caller
174 * of this function won't own a new reference.
175 * @return A Gtk::TextBuffer.
177 Glib::RefPtr<const TextBuffer> get_buffer() const;
179 #ifndef GTKMM_DISABLE_DEPRECATED
180 /** @deprecated Use scroll_to().
182 bool scroll_to_iter(TextBuffer::iterator& iter, double within_margin);
184 /** @deprecated Use scroll_to().
186 void scroll_to_mark(const Glib::RefPtr<TextBuffer::Mark>& mark, double within_margin);
188 /** @deprecated Use scroll_to()
190 void scroll_mark_onscreen(const Glib::RefPtr<TextBuffer::Mark>& mark);
192 #endif //GTKMM_DISABLE_DEPRECATED
194 /** Scrolls the TextView so that @a iter is on the screen, by scrolling the minimal distance to get the mark onscreen,
195 * possibly not scrolling at all. The effective screen for purposes of this function is reduced by a margin of size
197 * @note This function uses the currently-computed height of the lines in the text buffer. Note that line heights are computed
198 * in an idle handler; so this function may not have the desired effect if it's called before the height computations. To avoid
199 * oddness, consider using gtk_text_view_scroll_to_mark() which saves a point to be scrolled to after line validation.
201 * @param iter An iterator pointing to the position that should be made visible by scrolling.
202 * @param within_margin margin as a [0.0,0.5] fraction of screen size.
203 * @result true if scrolling occurred.
205 bool scroll_to(TextBuffer::iterator& iter, double within_margin = 0);
207 /** Scrolls the TextView so that @a iter is on the screen, in the position indicated by xalign and yalign,
208 * possibly not scrolling at all. The effective screen for purposes of this function is reduced by a margin of size
210 * @note This function uses the currently-computed height of the lines in the text buffer. Note that line heights are computed
211 * in an idle handler; so this function may not have the desired effect if it's called before the height computations. To avoid
212 * oddness, consider using gtk_text_view_scroll_to_mark() which saves a point to be scrolled to after line validation.
214 * @param iter An iterator pointing to the position that should be made visible by scrolling.
215 * @param within_margin margin as a [0.0,0.5] fraction of screen size.
216 * @param xalign horizontal alignment of mark within visible area. An alignment of 0.0 indicates left, 1.0 indicates right, 0.5 means center.
217 * @param yalign vertical alignment of mark within visible area. An alignment of 0.0 indicates top, 1.0 indicates bottom, 0.5 means center.
218 * @result true if scrolling occurred.
220 bool scroll_to(TextBuffer::iterator& iter, double within_margin, double xalign, double yalign);
223 /** Scrolls text_view so that @a mark is on the screen, by scrolling the minimal distance to get the mark onscreen,
224 * possibly not scrolling at all. The effective screen for purposes of this function is reduced by a margin of size
227 * @param mark An mark pointing to the position that should be made visible by scrolling.
228 * @param within_margin margin as a [0.0,0.5] fraction of screen size.
230 void scroll_to(const Glib::RefPtr<TextBuffer::Mark>& mark, double within_margin = 0);
232 /** Scrolls the TextView so that @a iter is on the screen, in the position indicated by xalign and yalign,
233 * possibly not scrolling at all. The effective screen for purposes of this function is reduced by a margin of size
236 * @param mark An mark pointing to the position that should be made visible by scrolling.
237 * @param within_margin margin as a [0.0,0.5] fraction of screen size.
238 * @param xalign horizontal alignment of mark within visible area. An alignment of 0.0 indicates left, 1.0 indicates right, 0.5 means center.
239 * @param yalign vertical alignment of mark within visible area. An alignment of 0.0 indicates top, 1.0 indicates bottom, 0.5 means center.
241 void scroll_to(const Glib::RefPtr<TextBuffer::Mark>& mark, double within_margin, double xalign, double yalign);
244 //It does not do anything more than the default scroll_to(mark).
247 /** Moves a mark within the buffer so that it's
248 * located within the currently-visible text area.
249 * @param mark A Gtk::TextMark.
250 * @return <tt>true</tt> if the mark moved (wasn't already onscreen).
252 bool move_mark_onscreen(const Glib::RefPtr<TextBuffer::Mark>& mark);
254 /** Moves the cursor to the currently visible region of the
255 * buffer, it it isn't there already.
256 * @return <tt>true</tt> if the cursor had to be moved.
258 bool place_cursor_onscreen();
261 /** Fills @a visible_rect with the currently-visible
262 * region of the buffer, in buffer coordinates. Convert to window coordinates
263 * with buffer_to_window_coords().
264 * @param visible_rect Rectangle to fill.
266 void get_visible_rect(Gdk::Rectangle& visible_rect) const;
268 /** Toggles whether the insertion point is displayed. A buffer with no editable
269 * text probably shouldn't have a visible cursor, so you may want to turn
271 * @param setting Whether to show the insertion cursor.
273 void set_cursor_visible(bool setting = true);
275 /** Find out whether the cursor is being displayed.
276 * @return Whether the insertion mark is visible.
278 bool get_cursor_visible() const;
281 /** Gets a rectangle which roughly contains the character at @a iter .
282 * The rectangle position is in buffer coordinates; use
283 * buffer_to_window_coords() to convert these
284 * coordinates to coordinates for one of the windows in the text view.
285 * @param iter A Gtk::TextIter.
286 * @param location Bounds of the character at @a iter .
288 void get_iter_location(const TextBuffer::iterator& iter, Gdk::Rectangle& location) const;
290 /** Retrieves the iterator at buffer coordinates @a x and @a y . Buffer
291 * coordinates are coordinates for the entire buffer, not just the
292 * currently-displayed portion. If you have coordinates from an
293 * event, you have to convert those to buffer coordinates with
294 * window_to_buffer_coords().
295 * @param iter A Gtk::TextIter.
296 * @param x X position, in buffer coordinates.
297 * @param y Y position, in buffer coordinates.
299 void get_iter_at_location(TextBuffer::iterator& iter, int x, int y) const;
301 /** Retrieves the iterator pointing to the character at buffer
302 * coordinates @a x and @a y . Buffer coordinates are coordinates for
303 * the entire buffer, not just the currently-displayed portion.
304 * If you have coordinates from an event, you have to convert
305 * those to buffer coordinates with
306 * window_to_buffer_coords().
308 * Note that this is diffferent from get_iter_at_location(),
309 * which returns cursor locations, i.e. positions <em>between</em>
313 * @param iter A Gtk::TextIter.
314 * @param x X position, in buffer coordinates.
315 * @param y Y position, in buffer coordinates.
317 void get_iter_at_position(TextBuffer::iterator& iter, int& trailing, int x, int y) const;
319 /** Gets the y coordinate of the top of the line containing @a iter ,
320 * and the height of the line. The coordinate is a buffer coordinate;
321 * convert to window coordinates with buffer_to_window_coords().
322 * @param iter A Gtk::TextIter.
323 * @param y Return location for a y coordinate.
324 * @param height Return location for a height.
326 void get_line_yrange(const TextBuffer::iterator& iter, int& y, int& height) const;
329 /** Gets the Gtk::TextIter at the start of the line containing
330 * the coordinate @a y . @a y is in buffer coordinates, convert from
331 * window coordinates with window_to_buffer_coords().
332 * If non-<tt>0</tt>, @a line_top will be filled with the coordinate of the top
334 * @param target_iter A Gtk::TextIter.
335 * @param y A y coordinate.
336 * @param line_top Return location for top coordinate of the line.
338 void get_line_at_y(TextBuffer::iterator& target_iter, int y, int& line_top) const;
341 /** Converts coordinate ( @a buffer_x , @a buffer_y ) to coordinates for the window
342 * @a win , and stores the result in ( @a window_x , @a window_y ).
344 * Note that you can't convert coordinates for a nonexisting window (see
345 * set_border_window_size()).
346 * @param win A Gtk::TextWindowType except Gtk::TEXT_WINDOW_PRIVATE.
347 * @param buffer_x Buffer x coordinate.
348 * @param buffer_y Buffer y coordinate.
349 * @param window_x Window x coordinate return location.
350 * @param window_y Window y coordinate return location.
352 void buffer_to_window_coords(TextWindowType win,
353 int buffer_x, int buffer_y,
354 int& window_x, int& window_y) const;
356 /** Converts coordinates on the window identified by @a win to buffer
357 * coordinates, storing the result in ( @a buffer_x , @a buffer_y ).
359 * Note that you can't convert coordinates for a nonexisting window (see
360 * set_border_window_size()).
361 * @param win A Gtk::TextWindowType except Gtk::TEXT_WINDOW_PRIVATE.
362 * @param window_x Window x coordinate.
363 * @param window_y Window y coordinate.
364 * @param buffer_x Buffer x coordinate return location.
365 * @param buffer_y Buffer y coordinate return location.
367 void window_to_buffer_coords(TextWindowType win,
368 int window_x, int window_y,
369 int& buffer_x, int& buffer_y) const;
372 /** Retrieves the Gdk::Window corresponding to an area of the text view;
373 * possible windows include the overall widget window, child windows
374 * on the left, right, top, bottom, and the window that displays the
375 * text buffer. Windows are <tt>0</tt> and nonexistent if their width or
376 * height is 0, and are nonexistent before the widget has been
378 * @param win Window to get.
379 * @return A Gdk::Window, or <tt>0</tt>.
381 Glib::RefPtr<Gdk::Window> get_window(TextWindowType win);
383 /** Retrieves the Gdk::Window corresponding to an area of the text view;
384 * possible windows include the overall widget window, child windows
385 * on the left, right, top, bottom, and the window that displays the
386 * text buffer. Windows are <tt>0</tt> and nonexistent if their width or
387 * height is 0, and are nonexistent before the widget has been
389 * @param win Window to get.
390 * @return A Gdk::Window, or <tt>0</tt>.
392 Glib::RefPtr<const Gdk::Window> get_window(TextWindowType win) const;
394 /** Usually used to find out which window an event corresponds to.
395 * If you connect to an event signal on @a text_view , this function
396 * should be called on <tt>event->window</tt> to
397 * see which window it was.
398 * @param window A window type.
399 * @return The window type.
401 TextWindowType get_window_type(const Glib::RefPtr<Gdk::Window>& window);
404 /** Sets the width of Gtk::TEXT_WINDOW_LEFT or Gtk::TEXT_WINDOW_RIGHT,
405 * or the height of Gtk::TEXT_WINDOW_TOP or Gtk::TEXT_WINDOW_BOTTOM.
406 * Automatically destroys the corresponding window if the size is set
407 * to 0, and creates the window if the size is set to non-zero. This
408 * function can only be used for the "border windows," it doesn't work
409 * with Gtk::TEXT_WINDOW_WIDGET, Gtk::TEXT_WINDOW_TEXT, or
410 * Gtk::TEXT_WINDOW_PRIVATE.
411 * @param type Window to affect.
412 * @param size Width or height of the window.
414 void set_border_window_size(TextWindowType type, int size);
416 /** Gets the width of the specified border window. See
417 * set_border_window_size().
418 * @param type Window to return size from.
419 * @return Width of window.
421 int get_border_window_size(TextWindowType type) const;
424 /** Moves the given @a iter forward by one display (wrapped) line. A
425 * display line is different from a paragraph. Paragraphs are
426 * separated by newlines or other paragraph separator characters.
427 * Display lines are created by line-wrapping a paragraph. If
428 * wrapping is turned off, display lines and paragraphs will be the
429 * same. Display lines are divided differently for each view, since
430 * they depend on the view's width; paragraphs are the same in all
431 * views, since they depend on the contents of the Gtk::TextBuffer.
432 * @param iter A Gtk::TextIter.
433 * @return <tt>true</tt> if @a iter was moved and is not on the end iterator.
435 bool forward_display_line(TextBuffer::iterator& iter);
437 /** Moves the given @a iter backward by one display (wrapped) line. A
438 * display line is different from a paragraph. Paragraphs are
439 * separated by newlines or other paragraph separator characters.
440 * Display lines are created by line-wrapping a paragraph. If
441 * wrapping is turned off, display lines and paragraphs will be the
442 * same. Display lines are divided differently for each view, since
443 * they depend on the view's width; paragraphs are the same in all
444 * views, since they depend on the contents of the Gtk::TextBuffer.
445 * @param iter A Gtk::TextIter.
446 * @return <tt>true</tt> if @a iter was moved and is not on the end iterator.
448 bool backward_display_line(TextBuffer::iterator& iter);
450 /** Moves the given @a iter forward to the next display line end. A
451 * display line is different from a paragraph. Paragraphs are
452 * separated by newlines or other paragraph separator characters.
453 * Display lines are created by line-wrapping a paragraph. If
454 * wrapping is turned off, display lines and paragraphs will be the
455 * same. Display lines are divided differently for each view, since
456 * they depend on the view's width; paragraphs are the same in all
457 * views, since they depend on the contents of the Gtk::TextBuffer.
458 * @param iter A Gtk::TextIter.
459 * @return <tt>true</tt> if @a iter was moved and is not on the end iterator.
461 bool forward_display_line_end(TextBuffer::iterator& iter);
463 /** Moves the given @a iter backward to the next display line start. A
464 * display line is different from a paragraph. Paragraphs are
465 * separated by newlines or other paragraph separator characters.
466 * Display lines are created by line-wrapping a paragraph. If
467 * wrapping is turned off, display lines and paragraphs will be the
468 * same. Display lines are divided differently for each view, since
469 * they depend on the view's width; paragraphs are the same in all
470 * views, since they depend on the contents of the Gtk::TextBuffer.
471 * @param iter A Gtk::TextIter.
472 * @return <tt>true</tt> if @a iter was moved and is not on the end iterator.
474 bool backward_display_line_start(TextBuffer::iterator& iter);
476 /** Determines whether @a iter is at the start of a display line.
477 * See forward_display_line() for an explanation of
478 * display lines vs. paragraphs.
479 * @param iter A Gtk::TextIter.
480 * @return <tt>true</tt> if @a iter begins a wrapped line.
482 bool starts_display_line(const TextBuffer::iterator& iter);
484 /** Move the iterator a given number of characters visually, treating
485 * it as the strong cursor position. If @a count is positive, then the
486 * new strong cursor position will be @a count positions to the right of
487 * the old cursor position. If @a count is negative then the new strong
488 * cursor position will be @a count positions to the left of the old
491 * In the presence of bidirection text, the correspondence
492 * between logical and visual order will depend on the direction
493 * of the current run, and there may be jumps when the cursor
494 * is moved off of the end of a run.
495 * @param iter A Gtk::TextIter.
496 * @param count Number of characters to move (negative moves left, positive moves right).
497 * @return <tt>true</tt> if @a iter moved and is not on the end iterator.
499 bool move_visually(TextBuffer::iterator& iter, int count);
502 /** Adds a child widget in the text buffer, at the given @a anchor .
503 * @param child A Gtk::Widget.
504 * @param anchor A Gtk::TextChildAnchor in the Gtk::TextBuffer for @a text_view .
506 void add_child_at_anchor(Widget& child, const Glib::RefPtr<TextBuffer::ChildAnchor>& anchor);
509 /** Adds a child at fixed coordinates in one of the text widget's
510 * windows. The window must have nonzero size (see
511 * set_border_window_size()). Note that the child
512 * coordinates are given relative to the Gdk::Window in question, and
513 * that these coordinates have no sane relationship to scrolling. When
514 * placing a child in Gtk::TEXT_WINDOW_WIDGET, scrolling is
515 * irrelevant, the child floats above all scrollable areas. But when
516 * placing a child in one of the scrollable windows (border windows or
517 * text window), you'll need to compute the child's correct position
518 * in buffer coordinates any time scrolling occurs or buffer changes
519 * occur, and then call move_child() to update the
520 * child's position. Unfortunately there's no good way to detect that
521 * scrolling has occurred, using the current API; a possible hack
522 * would be to update all child positions when the scroll adjustments
523 * change or the text buffer changes. See bug 64518 on
524 * bugzilla.gnome.org for status of fixing this issue.
525 * @param child A Gtk::Widget.
526 * @param which_window Which window the child should appear in.
527 * @param xpos X position of child in window coordinates.
528 * @param ypos Y position of child in window coordinates.
530 void add_child_in_window(Widget& child, TextWindowType which_window,
534 /** Updates the position of a child, as for add_child_in_window().
535 * @param child Child widget already added to the text view.
536 * @param xpos New X position in window coordinates.
537 * @param ypos New Y position in window coordinates.
539 void move_child(Widget& child, int xpos,int ypos);
542 /** Sets the line wrapping for the view.
543 * @param wrap_mode A Gtk::WrapMode.
545 void set_wrap_mode(WrapMode wrap_mode);
547 /** Gets the line wrapping for the view.
548 * @return The line wrap setting.
550 WrapMode get_wrap_mode() const;
552 /** Sets the default editability of the Gtk::TextView. You can override
553 * this default setting with tags in the buffer, using the "editable"
555 * @param setting Whether it's editable.
557 void set_editable(bool setting = true);
559 /** Returns the default editability of the Gtk::TextView. Tags in the
560 * buffer may override this setting for some ranges of text.
561 * @return Whether text is editable by default.
563 bool get_editable() const;
565 /** Sets the default number of blank pixels above paragraphs in @a text_view .
566 * Tags in the buffer for @a text_view may override the defaults.
567 * @param pixels_above_lines Pixels above paragraphs.
569 void set_pixels_above_lines(int pixels_above_lines);
571 /** Gets the default number of pixels to put above paragraphs.
572 * @return Default number of pixels above paragraphs.
574 int get_pixels_above_lines() const;
576 /** Sets the default number of pixels of blank space
577 * to put below paragraphs in @a text_view . May be overridden
578 * by tags applied to @a text_view 's buffer.
579 * @param pixels_below_lines Pixels below paragraphs.
581 void set_pixels_below_lines(int pixels_below_lines);
583 /** Gets the value set by set_pixels_below_lines().
584 * @return Default number of blank pixels below paragraphs.
586 int get_pixels_below_lines() const;
588 /** Sets the default number of pixels of blank space to leave between
589 * display/wrapped lines within a paragraph. May be overridden by
590 * tags in @a text_view 's buffer.
591 * @param pixels_inside_wrap Default number of pixels between wrapped lines.
593 void set_pixels_inside_wrap(int pixels_inside_wrap);
595 /** Gets the value set by set_pixels_inside_wrap().
596 * @return Default number of pixels of blank space between wrapped lines.
598 int get_pixels_inside_wrap() const;
600 /** Sets the default justification of text in @a text_view .
601 * Tags in the view's buffer may override the default.
602 * @param justification Justification.
604 void set_justification(Justification justification);
606 /** Gets the default justification of paragraphs in @a text_view .
607 * Tags in the buffer may override the default.
608 * @return Default justification.
610 Justification get_justification() const;
612 /** Sets the default left margin for text in @a text_view .
613 * Tags in the buffer may override the default.
614 * @param left_margin Left margin in pixels.
616 void set_left_margin(int left_margin);
618 /** Gets the default left margin size of paragraphs in the @a text_view .
619 * Tags in the buffer may override the default.
620 * @return Left margin in pixels.
622 int get_left_margin() const;
624 /** Sets the default right margin for text in the text view.
625 * Tags in the buffer may override the default.
626 * @param right_margin Right margin in pixels.
628 void set_right_margin(int right_margin);
630 /** Gets the default right margin for text in @a text_view . Tags
631 * in the buffer may override the default.
632 * @return Right margin in pixels.
634 int get_right_margin() const;
636 /** Sets the default indentation for paragraphs in @a text_view .
637 * Tags in the buffer may override the default.
638 * @param indent Indentation in pixels.
640 void set_indent(int indent);
642 /** Gets the default indentation of paragraphs in @a text_view .
643 * Tags in the view's buffer may override the default.
644 * The indentation may be negative.
645 * @return Number of pixels of indentation.
647 int get_indent() const;
649 /** Sets the default tab stops for paragraphs in @a text_view .
650 * Tags in the buffer may override the default.
651 * @param tabs Tabs as a Pango::TabArray.
653 void set_tabs(Pango::TabArray& tabs);
655 /** Gets the default tabs for @a text_view . Tags in the buffer may
656 * override the defaults. The returned array will be <tt>0</tt> if
657 * "standard" (8-space) tabs are used.
658 * @return Copy of default tab array, or <tt>0</tt> if "standard" tabs are used.
660 Pango::TabArray get_tabs() const;
662 /** Obtains a copy of the default text attributes. These are the
663 * attributes used for text unless a tag overrides them.
664 * You'd typically pass the default attributes in to
665 * Gtk::TextIter::get_attributes() in order to get the
666 * attributes in effect at a given text position.
667 * @return A new #Gtk::TextAttributes.
669 TextAttributes get_default_attributes() const;
672 /** Changes the Gtk::TextView overwrite mode.
675 * @param overwrite <tt>true</tt> to turn on overwrite mode, <tt>false</tt> to turn it off.
677 void set_overwrite(bool overwrite = true);
679 /** Returns whether the Gtk::TextView is in overwrite mode or not.
680 * @return Whether @a text_view is in overwrite mode or not.
684 bool get_overwrite() const;
687 /** Sets the behavior of the text widget when the Tab key is pressed. If @a accepts_tab
688 * is <tt>true</tt> a tab character is inserted. If @a accepts_tab is <tt>false</tt> the keyboard focus
689 * is moved to the next widget in the focus chain.
692 * @param accepts_tab <tt>true</tt> if pressing the Tab key should insert a tab character, <tt>false</tt>, if pressing the Tab key should move the keyboard focus.
694 void set_accepts_tab(bool accepts_tab = true);
696 /** Returns whether pressing the Tab key inserts a tab characters.
698 * @return <tt>true</tt> if pressing the Tab key inserts a tab character, <tt>false</tt> if pressing the Tab key moves the keyboard focus.
702 bool get_accepts_tab() const;
705 Glib::SignalProxy2< void,Adjustment*,Adjustment* > signal_set_scroll_adjustments();
708 Glib::SignalProxy1< void,Menu* > signal_populate_popup();
711 Glib::SignalProxy0< void > signal_set_anchor();
714 Glib::SignalProxy1< void,const Glib::ustring& > signal_insert_at_cursor();
717 //Keybinding signals:
720 /** Pixels of blank space above paragraphs.
722 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
723 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
724 * the value of the property changes.
726 Glib::PropertyProxy<int> property_pixels_above_lines() ;
728 /** Pixels of blank space above paragraphs.
730 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
731 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
732 * the value of the property changes.
734 Glib::PropertyProxy_ReadOnly<int> property_pixels_above_lines() const;
736 /** Pixels of blank space below paragraphs.
738 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
739 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
740 * the value of the property changes.
742 Glib::PropertyProxy<int> property_pixels_below_lines() ;
744 /** Pixels of blank space below paragraphs.
746 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
747 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
748 * the value of the property changes.
750 Glib::PropertyProxy_ReadOnly<int> property_pixels_below_lines() const;
752 /** Pixels of blank space between wrapped lines in a paragraph.
754 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
755 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
756 * the value of the property changes.
758 Glib::PropertyProxy<int> property_pixels_inside_wrap() ;
760 /** Pixels of blank space between wrapped lines in a paragraph.
762 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
763 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
764 * the value of the property changes.
766 Glib::PropertyProxy_ReadOnly<int> property_pixels_inside_wrap() const;
768 /** Whether the text can be modified by the user.
770 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
771 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
772 * the value of the property changes.
774 Glib::PropertyProxy<bool> property_editable() ;
776 /** Whether the text can be modified by the user.
778 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
779 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
780 * the value of the property changes.
782 Glib::PropertyProxy_ReadOnly<bool> property_editable() const;
784 /** Whether to wrap lines never
786 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
787 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
788 * the value of the property changes.
790 Glib::PropertyProxy<WrapMode> property_wrap_mode() ;
792 /** Whether to wrap lines never
794 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
795 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
796 * the value of the property changes.
798 Glib::PropertyProxy_ReadOnly<WrapMode> property_wrap_mode() const;
802 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
803 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
804 * the value of the property changes.
806 Glib::PropertyProxy<Justification> property_justification() ;
810 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
811 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
812 * the value of the property changes.
814 Glib::PropertyProxy_ReadOnly<Justification> property_justification() const;
816 /** Width of the left margin in pixels.
818 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
819 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
820 * the value of the property changes.
822 Glib::PropertyProxy<int> property_left_margin() ;
824 /** Width of the left margin in pixels.
826 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
827 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
828 * the value of the property changes.
830 Glib::PropertyProxy_ReadOnly<int> property_left_margin() const;
832 /** Width of the right margin in pixels.
834 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
835 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
836 * the value of the property changes.
838 Glib::PropertyProxy<int> property_right_margin() ;
840 /** Width of the right margin in pixels.
842 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
843 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
844 * the value of the property changes.
846 Glib::PropertyProxy_ReadOnly<int> property_right_margin() const;
848 /** Amount to indent the paragraph
850 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
851 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
852 * the value of the property changes.
854 Glib::PropertyProxy<int> property_indent() ;
856 /** Amount to indent the paragraph
858 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
859 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
860 * the value of the property changes.
862 Glib::PropertyProxy_ReadOnly<int> property_indent() const;
864 /** Custom tabs for this text.
866 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
867 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
868 * the value of the property changes.
870 Glib::PropertyProxy<Pango::TabArray> property_tabs() ;
872 /** Custom tabs for this text.
874 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
875 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
876 * the value of the property changes.
878 Glib::PropertyProxy_ReadOnly<Pango::TabArray> property_tabs() const;
880 /** If the insertion cursor is shown.
882 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
883 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
884 * the value of the property changes.
886 Glib::PropertyProxy<bool> property_cursor_visible() ;
888 /** If the insertion cursor is shown.
890 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
891 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
892 * the value of the property changes.
894 Glib::PropertyProxy_ReadOnly<bool> property_cursor_visible() const;
896 /** The buffer which is displayed.
898 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
899 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
900 * the value of the property changes.
902 Glib::PropertyProxy< Glib::RefPtr<TextBuffer> > property_buffer() ;
904 /** The buffer which is displayed.
906 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
907 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
908 * the value of the property changes.
910 Glib::PropertyProxy_ReadOnly< Glib::RefPtr<TextBuffer> > property_buffer() const;
912 /** Whether entered text overwrites existing contents.
914 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
915 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
916 * the value of the property changes.
918 Glib::PropertyProxy<bool> property_overwrite() ;
920 /** Whether entered text overwrites existing contents.
922 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
923 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
924 * the value of the property changes.
926 Glib::PropertyProxy_ReadOnly<bool> property_overwrite() const;
928 /** Whether Tab will result in a tab character being entered.
930 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
931 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
932 * the value of the property changes.
934 Glib::PropertyProxy<bool> property_accepts_tab() ;
936 /** Whether Tab will result in a tab character being entered.
938 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
939 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
940 * the value of the property changes.
942 Glib::PropertyProxy_ReadOnly<bool> property_accepts_tab() const;
947 } /* namespace Gtk */
952 /** @relates Gtk::TextView
953 * @param object The C instance
954 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
955 * @result A C++ instance that wraps this C instance.
957 Gtk::TextView* wrap(GtkTextView* object, bool take_copy = false);
959 #endif /* _GTKMM_TEXTVIEW_H */