2
// Generated by gtkmmproc -- DO NOT MODIFY!
3
#ifndef _GTKMM_TEXTVIEW_H
4
#define _GTKMM_TEXTVIEW_H
6
#include <gtkmmconfig.h>
11
/* $Id: textview.hg,v 1.10 2006/04/12 11:11:25 murrayc Exp $ */
13
/* Copyright(C) 2002 The gtkmm Development Team
15
* This library is free software; you can redistribute it and/or
16
* modify it under the terms of the GNU Lesser General Public
17
* License as published by the Free Software Foundation; either
18
* version 2.1 of the License, or(at your option) any later version.
20
* This library is distributed in the hope that it will be useful,
21
* but WITHOUT ANY WARRANTY; without even the implied warranty of
22
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23
* Lesser General Public License for more details.
25
* You should have received a copy of the GNU Lesser General Public
26
* License along with this library; if not, write to the Free
27
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
30
// This is for including the config header before any code (such as
31
// the #ifndef GTKMM_DISABLE_DEPRECATED in deprecated classes) is generated:
34
#include <gtkmm/container.h>
35
#include <gtkmm/textbuffer.h>
36
#include <gtkmm/textmark.h>
37
#include <gtkmm/menu.h>
38
#include <gtkmm/adjustment.h>
41
#ifndef DOXYGEN_SHOULD_SKIP_THIS
42
typedef struct _GtkTextView GtkTextView;
43
typedef struct _GtkTextViewClass GtkTextViewClass;
44
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
48
{ class TextView_Class; } // namespace Gtk
53
/** @addtogroup gtkmmEnums gtkmm Enums and Flags */
72
#ifndef DOXYGEN_SHOULD_SKIP_THIS
77
class Value<Gtk::TextWindowType> : public Glib::Value_Enum<Gtk::TextWindowType>
80
static GType value_type() G_GNUC_CONST;
84
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
91
/** @defgroup TextView TextView Classes
92
* These classes are used with the Gtk::TextView widget.
95
/** Multi-line text editing widget. It displays a Gtk::TextBuffer.
97
* The TextView widget looks like this:
98
* @image html textview1.png
101
* @ingroup Containers
105
class TextView : public Container
108
#ifndef DOXYGEN_SHOULD_SKIP_THIS
109
typedef TextView CppObjectType;
110
typedef TextView_Class CppClassType;
111
typedef GtkTextView BaseObjectType;
112
typedef GtkTextViewClass BaseClassType;
113
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
117
#ifndef DOXYGEN_SHOULD_SKIP_THIS
120
friend class TextView_Class;
121
static CppClassType textview_class_;
124
TextView(const TextView&);
125
TextView& operator=(const TextView&);
128
explicit TextView(const Glib::ConstructParams& construct_params);
129
explicit TextView(GtkTextView* castitem);
131
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
134
#ifndef DOXYGEN_SHOULD_SKIP_THIS
135
static GType get_type() G_GNUC_CONST;
138
static GType get_base_type() G_GNUC_CONST;
141
///Provides access to the underlying C GtkObject.
142
GtkTextView* gobj() { return reinterpret_cast<GtkTextView*>(gobject_); }
144
///Provides access to the underlying C GtkObject.
145
const GtkTextView* gobj() const { return reinterpret_cast<GtkTextView*>(gobject_); }
149
//C++ methods used to invoke GTK+ virtual functions:
152
//GTK+ Virtual Functions (override these to change behaviour):
154
//Default Signal Handlers::
155
virtual void on_set_scroll_adjustments(Adjustment* hadjustment, Adjustment* vadjustment);
156
virtual void on_populate_popup(Menu* menu);
157
virtual void on_set_anchor();
158
virtual void on_insert_at_cursor(const Glib::ustring& str);
165
explicit TextView(const Glib::RefPtr<TextBuffer>& buffer);
168
/** Sets @a buffer as the buffer being displayed by @a text_view. The previous
169
* buffer displayed by the text view is unreferenced, and a reference is
170
* added to @a buffer. If you owned a reference to @a buffer before passing it
171
* to this function, you must remove that reference yourself; Gtk::TextView
172
* will not "adopt" it.
173
* @param buffer A Gtk::TextBuffer.
175
void set_buffer(const Glib::RefPtr<TextBuffer>& buffer);
177
/** Returns the Gtk::TextBuffer being displayed by this text view.
178
* The reference count on the buffer is not incremented; the caller
179
* of this function won't own a new reference.
180
* @return A Gtk::TextBuffer.
182
Glib::RefPtr<TextBuffer> get_buffer();
184
/** Returns the Gtk::TextBuffer being displayed by this text view.
185
* The reference count on the buffer is not incremented; the caller
186
* of this function won't own a new reference.
187
* @return A Gtk::TextBuffer.
189
Glib::RefPtr<const TextBuffer> get_buffer() const;
191
#ifndef GTKMM_DISABLE_DEPRECATED
193
/** @deprecated Use scroll_to().
195
bool scroll_to_iter(TextBuffer::iterator& iter, double within_margin);
197
/** @deprecated Use scroll_to().
199
void scroll_to_mark(const Glib::RefPtr<TextBuffer::Mark>& mark, double within_margin);
201
/** @deprecated Use scroll_to()
203
void scroll_mark_onscreen(const Glib::RefPtr<TextBuffer::Mark>& mark);
204
#endif // GTKMM_DISABLE_DEPRECATED
207
/** Scrolls the TextView so that @a iter is on the screen, by scrolling the minimal distance to get the mark onscreen,
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
* @result true if scrolling occurred.
218
bool scroll_to(TextBuffer::iterator& iter, double within_margin = 0);
220
/** Scrolls the TextView so that @a iter is on the screen, in the position indicated by xalign and yalign,
221
* possibly not scrolling at all. The effective screen for purposes of this function is reduced by a margin of size
223
* @note This function uses the currently-computed height of the lines in the text buffer. Note that line heights are computed
224
* in an idle handler; so this function may not have the desired effect if it's called before the height computations. To avoid
225
* oddness, consider using gtk_text_view_scroll_to_mark() which saves a point to be scrolled to after line validation.
227
* @param iter An iterator 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.
229
* @param xalign horizontal alignment of mark within visible area. An alignment of 0.0 indicates left, 1.0 indicates right, 0.5 means center.
230
* @param yalign vertical alignment of mark within visible area. An alignment of 0.0 indicates top, 1.0 indicates bottom, 0.5 means center.
231
* @result true if scrolling occurred.
233
bool scroll_to(TextBuffer::iterator& iter, double within_margin, double xalign, double yalign);
236
/** Scrolls text_view so that @a mark is on the screen, by scrolling the minimal distance to get the mark onscreen,
237
* possibly not scrolling at all. The effective screen for purposes of this function is reduced by a margin of size
240
* @param mark An mark pointing to the position that should be made visible by scrolling.
241
* @param within_margin margin as a [0.0,0.5] fraction of screen size.
243
void scroll_to(const Glib::RefPtr<TextBuffer::Mark>& mark, double within_margin = 0);
245
/** Scrolls the TextView so that @a iter is on the screen, in the position indicated by xalign and yalign,
246
* possibly not scrolling at all. The effective screen for purposes of this function is reduced by a margin of size
249
* @param mark An mark pointing to the position that should be made visible by scrolling.
250
* @param within_margin margin as a [0.0,0.5] fraction of screen size.
251
* @param xalign horizontal alignment of mark within visible area. An alignment of 0.0 indicates left, 1.0 indicates right, 0.5 means center.
252
* @param yalign vertical alignment of mark within visible area. An alignment of 0.0 indicates top, 1.0 indicates bottom, 0.5 means center.
254
void scroll_to(const Glib::RefPtr<TextBuffer::Mark>& mark, double within_margin, double xalign, double yalign);
257
//It does not do anything more than the default scroll_to(mark).
260
/** Moves a mark within the buffer so that it's
261
* located within the currently-visible text area.
262
* @param mark A Gtk::TextMark.
263
* @return <tt>true</tt> if the mark moved (wasn't already onscreen).
265
bool move_mark_onscreen(const Glib::RefPtr<TextBuffer::Mark>& mark);
267
/** Moves the cursor to the currently visible region of the
268
* buffer, it it isn't there already.
269
* @return <tt>true</tt> if the cursor had to be moved.
271
bool place_cursor_onscreen();
274
/** Fills @a visible_rect with the currently-visible
275
* region of the buffer, in buffer coordinates. Convert to window coordinates
276
* with buffer_to_window_coords().
277
* @param visible_rect Rectangle to fill.
279
void get_visible_rect(Gdk::Rectangle& visible_rect) const;
281
/** Toggles whether the insertion point is displayed. A buffer with no editable
282
* text probably shouldn't have a visible cursor, so you may want to turn
284
* @param setting Whether to show the insertion cursor.
286
void set_cursor_visible(bool setting = true);
288
/** Find out whether the cursor is being displayed.
289
* @return Whether the insertion mark is visible.
291
bool get_cursor_visible() const;
294
/** Gets a rectangle which roughly contains the character at @a iter.
295
* The rectangle position is in buffer coordinates; use
296
* buffer_to_window_coords() to convert these
297
* coordinates to coordinates for one of the windows in the text view.
298
* @param iter A Gtk::TextIter.
299
* @param location Bounds of the character at @a iter.
301
void get_iter_location(const TextBuffer::iterator& iter, Gdk::Rectangle& location) const;
303
/** Retrieves the iterator at buffer coordinates @a x and @a y. Buffer
304
* coordinates are coordinates for the entire buffer, not just the
305
* currently-displayed portion. If you have coordinates from an
306
* event, you have to convert those to buffer coordinates with
307
* window_to_buffer_coords().
308
* @param iter A Gtk::TextIter.
309
* @param x X position, in buffer coordinates.
310
* @param y Y position, in buffer coordinates.
312
void get_iter_at_location(TextBuffer::iterator& iter, int x, int y) const;
314
/** Retrieves the iterator pointing to the character at buffer
315
* coordinates @a x and @a y. Buffer coordinates are coordinates for
316
* the entire buffer, not just the currently-displayed portion.
317
* If you have coordinates from an event, you have to convert
318
* those to buffer coordinates with
319
* window_to_buffer_coords().
321
* Note that this is different from get_iter_at_location(),
322
* which returns cursor locations, i.e. positions <em>between</em>
326
* @param iter A Gtk::TextIter.
327
* @param trailing If non-<tt>0</tt>, location to store an integer indicating where
328
* in the grapheme the user clicked. It will either be
329
* zero, or the number of characters in the grapheme.
330
* 0 represents the trailing edge of the grapheme.
331
* @param x X position, in buffer coordinates.
332
* @param y Y position, in buffer coordinates.
334
void get_iter_at_position(TextBuffer::iterator& iter, int& trailing, int x, int y) const;
336
/** Gets the y coordinate of the top of the line containing @a iter,
337
* and the height of the line. The coordinate is a buffer coordinate;
338
* convert to window coordinates with buffer_to_window_coords().
339
* @param iter A Gtk::TextIter.
340
* @param y Return location for a y coordinate.
341
* @param height Return location for a height.
343
void get_line_yrange(const TextBuffer::iterator& iter, int& y, int& height) const;
346
/** Gets the Gtk::TextIter at the start of the line containing
347
* the coordinate @a y. @a y is in buffer coordinates, convert from
348
* window coordinates with window_to_buffer_coords().
349
* If non-<tt>0</tt>, @a line_top will be filled with the coordinate of the top
351
* @param target_iter A Gtk::TextIter.
352
* @param y A y coordinate.
353
* @param line_top Return location for top coordinate of the line.
355
void get_line_at_y(TextBuffer::iterator& target_iter, int y, int& line_top) const;
358
/** Converts coordinate ( @a buffer_x, @a buffer_y) to coordinates for the window
359
* @a win, and stores the result in ( @a window_x, @a window_y).
361
* Note that you can't convert coordinates for a nonexisting window (see
362
* set_border_window_size()).
363
* @param win A Gtk::TextWindowType except Gtk::TEXT_WINDOW_PRIVATE.
364
* @param buffer_x Buffer x coordinate.
365
* @param buffer_y Buffer y coordinate.
366
* @param window_x Window x coordinate return location or <tt>0</tt>.
367
* @param window_y Window y coordinate return location or <tt>0</tt>.
369
void buffer_to_window_coords(TextWindowType win, int buffer_x, int buffer_y, int& window_x, int& window_y) const;
371
/** Converts coordinates on the window identified by @a win to buffer
372
* coordinates, storing the result in ( @a buffer_x, @a buffer_y).
374
* Note that you can't convert coordinates for a nonexisting window (see
375
* set_border_window_size()).
376
* @param win A Gtk::TextWindowType except Gtk::TEXT_WINDOW_PRIVATE.
377
* @param window_x Window x coordinate.
378
* @param window_y Window y coordinate.
379
* @param buffer_x Buffer x coordinate return location or <tt>0</tt>.
380
* @param buffer_y Buffer y coordinate return location or <tt>0</tt>.
382
void window_to_buffer_coords(TextWindowType win, int window_x, int window_y, int& buffer_x, int& buffer_y) const;
385
/** Gets the horizontal-scrolling Gtk::Adjustment.
388
* @return Pointer to the horizontal Gtk::Adjustment.
390
Gtk::Adjustment* get_hadjustment();
392
/** Gets the horizontal-scrolling Gtk::Adjustment.
395
* @return Pointer to the horizontal Gtk::Adjustment.
397
const Gtk::Adjustment* get_hadjustment() const;
399
/** Gets the vertical-scrolling Gtk::Adjustment.
402
* @return Pointer to the vertical Gtk::Adjustment.
404
Gtk::Adjustment* get_vadjustment();
406
/** Gets the vertical-scrolling Gtk::Adjustment.
409
* @return Pointer to the vertical Gtk::Adjustment.
411
const Gtk::Adjustment* get_vadjustment() const;
414
/** Retrieves the Gdk::Window corresponding to an area of the text view;
415
* possible windows include the overall widget window, child windows
416
* on the left, right, top, bottom, and the window that displays the
417
* text buffer. Windows are <tt>0</tt> and nonexistent if their width or
418
* height is 0, and are nonexistent before the widget has been
420
* @param win Window to get.
421
* @return A Gdk::Window, or <tt>0</tt>.
423
Glib::RefPtr<Gdk::Window> get_window(TextWindowType win);
425
/** Retrieves the Gdk::Window corresponding to an area of the text view;
426
* possible windows include the overall widget window, child windows
427
* on the left, right, top, bottom, and the window that displays the
428
* text buffer. Windows are <tt>0</tt> and nonexistent if their width or
429
* height is 0, and are nonexistent before the widget has been
431
* @param win Window to get.
432
* @return A Gdk::Window, or <tt>0</tt>.
434
Glib::RefPtr<const Gdk::Window> get_window(TextWindowType win) const;
436
/** Usually used to find out which window an event corresponds to.
437
* If you connect to an event signal on @a text_view, this function
438
* should be called on <tt>event->window</tt> to
439
* see which window it was.
440
* @param window A window type.
441
* @return The window type.
443
TextWindowType get_window_type(const Glib::RefPtr<Gdk::Window>& window);
446
/** Sets the width of Gtk::TEXT_WINDOW_LEFT or Gtk::TEXT_WINDOW_RIGHT,
447
* or the height of Gtk::TEXT_WINDOW_TOP or Gtk::TEXT_WINDOW_BOTTOM.
448
* Automatically destroys the corresponding window if the size is set
449
* to 0, and creates the window if the size is set to non-zero. This
450
* function can only be used for the "border windows," it doesn't work
451
* with Gtk::TEXT_WINDOW_WIDGET, Gtk::TEXT_WINDOW_TEXT, or
452
* Gtk::TEXT_WINDOW_PRIVATE.
453
* @param type Window to affect.
454
* @param size Width or height of the window.
456
void set_border_window_size(TextWindowType type, int size);
458
/** Gets the width of the specified border window. See
459
* set_border_window_size().
460
* @param type Window to return size from.
461
* @return Width of window.
463
int get_border_window_size(TextWindowType type) const;
466
/** Moves the given @a iter forward by one display (wrapped) line.
467
* A display line is different from a paragraph. Paragraphs are
468
* separated by newlines or other paragraph separator characters.
469
* Display lines are created by line-wrapping a paragraph. If
470
* wrapping is turned off, display lines and paragraphs will be the
471
* same. Display lines are divided differently for each view, since
472
* they depend on the view's width; paragraphs are the same in all
473
* views, since they depend on the contents of the Gtk::TextBuffer.
474
* @param iter A Gtk::TextIter.
475
* @return <tt>true</tt> if @a iter was moved and is not on the end iterator.
477
bool forward_display_line(TextBuffer::iterator& iter);
479
/** Moves the given @a iter backward by one display (wrapped) line.
480
* A display line is different from a paragraph. Paragraphs are
481
* separated by newlines or other paragraph separator characters.
482
* Display lines are created by line-wrapping a paragraph. If
483
* wrapping is turned off, display lines and paragraphs will be the
484
* same. Display lines are divided differently for each view, since
485
* they depend on the view's width; paragraphs are the same in all
486
* views, since they depend on the contents of the Gtk::TextBuffer.
487
* @param iter A Gtk::TextIter.
488
* @return <tt>true</tt> if @a iter was moved and is not on the end iterator.
490
bool backward_display_line(TextBuffer::iterator& iter);
492
/** Moves the given @a iter forward to the next display line end.
493
* A display line is different from a paragraph. Paragraphs are
494
* separated by newlines or other paragraph separator characters.
495
* Display lines are created by line-wrapping a paragraph. If
496
* wrapping is turned off, display lines and paragraphs will be the
497
* same. Display lines are divided differently for each view, since
498
* they depend on the view's width; paragraphs are the same in all
499
* views, since they depend on the contents of the Gtk::TextBuffer.
500
* @param iter A Gtk::TextIter.
501
* @return <tt>true</tt> if @a iter was moved and is not on the end iterator.
503
bool forward_display_line_end(TextBuffer::iterator& iter);
505
/** Moves the given @a iter backward to the next display line start.
506
* A display line is different from a paragraph. Paragraphs are
507
* separated by newlines or other paragraph separator characters.
508
* Display lines are created by line-wrapping a paragraph. If
509
* wrapping is turned off, display lines and paragraphs will be the
510
* same. Display lines are divided differently for each view, since
511
* they depend on the view's width; paragraphs are the same in all
512
* views, since they depend on the contents of the Gtk::TextBuffer.
513
* @param iter A Gtk::TextIter.
514
* @return <tt>true</tt> if @a iter was moved and is not on the end iterator.
516
bool backward_display_line_start(TextBuffer::iterator& iter);
518
/** Determines whether @a iter is at the start of a display line.
519
* See forward_display_line() for an explanation of
520
* display lines vs. paragraphs.
521
* @param iter A Gtk::TextIter.
522
* @return <tt>true</tt> if @a iter begins a wrapped line.
524
bool starts_display_line(const TextBuffer::iterator& iter);
526
/** Move the iterator a given number of characters visually, treating
527
* it as the strong cursor position. If @a count is positive, then the
528
* new strong cursor position will be @a count positions to the right of
529
* the old cursor position. If @a count is negative then the new strong
530
* cursor position will be @a count positions to the left of the old
533
* In the presence of bi-directional text, the correspondence
534
* between logical and visual order will depend on the direction
535
* of the current run, and there may be jumps when the cursor
536
* is moved off of the end of a run.
537
* @param iter A Gtk::TextIter.
538
* @param count Number of characters to move (negative moves left,
539
* positive moves right).
540
* @return <tt>true</tt> if @a iter moved and is not on the end iterator.
542
bool move_visually(TextBuffer::iterator& iter, int count);
545
/** Allow the Gtk::TextView input method to internally handle key press
546
* and release events. If this function returns <tt>true</tt>, then no further
547
* processing should be done for this key event. See
548
* gtk_im_context_filter_keypress().
550
* Note that you are expected to call this function from your handler
551
* when overriding key event handling. This is needed in the case when
552
* you need to insert your own key handling between the input method
553
* and the default key event handling of the Gtk::TextView.
556
* static <tt>bool</tt>
557
* gtk_foo_bar_key_press_event (GtkWidget *widget,
558
* GdkEventKey *event)
560
* if ((key->keyval == GDK_Return || key->keyval == GDK_KP_Enter))
562
* if (gtk_text_view_im_context_filter_keypress (GTK_TEXT_VIEW (view), event))
563
* return <tt>true</tt>;
566
* / * Do some stuff * /
568
* return GTK_WIDGET_CLASS (gtk_foo_bar_parent_class)->key_press_event (widget, event);
573
* @param event The key event.
574
* @return <tt>true</tt> if the input method handled the key event.
576
bool im_context_filter_keypress(GdkEventKey* event);
578
/** Reset the input method context of the text view if needed.
580
* This can be necessary in the case where modifying the buffer
581
* would confuse on-going input method behavior.
585
void reset_im_context();
588
/** Adds a child widget in the text buffer, at the given @a anchor.
589
* @param child A Gtk::Widget.
590
* @param anchor A Gtk::TextChildAnchor in the Gtk::TextBuffer for @a text_view.
592
void add_child_at_anchor(Widget& child, const Glib::RefPtr<TextBuffer::ChildAnchor>& anchor);
595
/** Adds a child at fixed coordinates in one of the text widget's
596
* windows. The window must have nonzero size (see
597
* set_border_window_size()). Note that the child
598
* coordinates are given relative to the Gdk::Window in question, and
599
* that these coordinates have no sane relationship to scrolling. When
600
* placing a child in Gtk::TEXT_WINDOW_WIDGET, scrolling is
601
* irrelevant, the child floats above all scrollable areas. But when
602
* placing a child in one of the scrollable windows (border windows or
603
* text window), you'll need to compute the child's correct position
604
* in buffer coordinates any time scrolling occurs or buffer changes
605
* occur, and then call move_child() to update the
606
* child's position. Unfortunately there's no good way to detect that
607
* scrolling has occurred, using the current API; a possible hack
608
* would be to update all child positions when the scroll adjustments
609
* change or the text buffer changes. See bug 64518 on
610
* bugzilla.gnome.org for status of fixing this issue.
611
* @param child A Gtk::Widget.
612
* @param which_window Which window the child should appear in.
613
* @param xpos X position of child in window coordinates.
614
* @param ypos Y position of child in window coordinates.
616
void add_child_in_window(Widget& child, TextWindowType which_window, int xpos, int ypos);
619
/** Updates the position of a child, as for add_child_in_window().
620
* @param child Child widget already added to the text view.
621
* @param xpos New X position in window coordinates.
622
* @param ypos New Y position in window coordinates.
624
void move_child(Widget& child, int xpos, int ypos);
627
/** Sets the line wrapping for the view.
628
* @param wrap_mode A Gtk::WrapMode.
630
void set_wrap_mode(WrapMode wrap_mode);
632
/** Gets the line wrapping for the view.
633
* @return The line wrap setting.
635
WrapMode get_wrap_mode() const;
637
/** Sets the default editability of the Gtk::TextView. You can override
638
* this default setting with tags in the buffer, using the "editable"
640
* @param setting Whether it's editable.
642
void set_editable(bool setting = true);
644
/** Returns the default editability of the Gtk::TextView. Tags in the
645
* buffer may override this setting for some ranges of text.
646
* @return Whether text is editable by default.
648
bool get_editable() const;
650
/** Sets the default number of blank pixels above paragraphs in @a text_view.
651
* Tags in the buffer for @a text_view may override the defaults.
652
* @param pixels_above_lines Pixels above paragraphs.
654
void set_pixels_above_lines(int pixels_above_lines);
656
/** Gets the default number of pixels to put above paragraphs.
657
* @return Default number of pixels above paragraphs.
659
int get_pixels_above_lines() const;
661
/** Sets the default number of pixels of blank space
662
* to put below paragraphs in @a text_view. May be overridden
663
* by tags applied to @a text_view's buffer.
664
* @param pixels_below_lines Pixels below paragraphs.
666
void set_pixels_below_lines(int pixels_below_lines);
668
/** Gets the value set by set_pixels_below_lines().
669
* @return Default number of blank pixels below paragraphs.
671
int get_pixels_below_lines() const;
673
/** Sets the default number of pixels of blank space to leave between
674
* display/wrapped lines within a paragraph. May be overridden by
675
* tags in @a text_view's buffer.
676
* @param pixels_inside_wrap Default number of pixels between wrapped lines.
678
void set_pixels_inside_wrap(int pixels_inside_wrap);
680
/** Gets the value set by set_pixels_inside_wrap().
681
* @return Default number of pixels of blank space between wrapped lines.
683
int get_pixels_inside_wrap() const;
685
/** Sets the default justification of text in @a text_view.
686
* Tags in the view's buffer may override the default.
687
* @param justification Justification.
689
void set_justification(Justification justification);
691
/** Gets the default justification of paragraphs in @a text_view.
692
* Tags in the buffer may override the default.
693
* @return Default justification.
695
Justification get_justification() const;
697
/** Sets the default left margin for text in @a text_view.
698
* Tags in the buffer may override the default.
699
* @param left_margin Left margin in pixels.
701
void set_left_margin(int left_margin);
703
/** Gets the default left margin size of paragraphs in the @a text_view.
704
* Tags in the buffer may override the default.
705
* @return Left margin in pixels.
707
int get_left_margin() const;
709
/** Sets the default right margin for text in the text view.
710
* Tags in the buffer may override the default.
711
* @param right_margin Right margin in pixels.
713
void set_right_margin(int right_margin);
715
/** Gets the default right margin for text in @a text_view. Tags
716
* in the buffer may override the default.
717
* @return Right margin in pixels.
719
int get_right_margin() const;
721
/** Sets the default indentation for paragraphs in @a text_view.
722
* Tags in the buffer may override the default.
723
* @param indent Indentation in pixels.
725
void set_indent(int indent);
727
/** Gets the default indentation of paragraphs in @a text_view.
728
* Tags in the view's buffer may override the default.
729
* The indentation may be negative.
730
* @return Number of pixels of indentation.
732
int get_indent() const;
734
/** Sets the default tab stops for paragraphs in @a text_view.
735
* Tags in the buffer may override the default.
736
* @param tabs Tabs as a Pango::TabArray.
738
void set_tabs(Pango::TabArray& tabs);
740
/** Gets the default tabs for @a text_view. Tags in the buffer may
741
* override the defaults. The returned array will be empty if
742
* "standard" (8-space) tabs are used.
743
* @return Copy of default tab array, or an empty array if "standard" tabs are used.
745
Pango::TabArray get_tabs() const;
747
/** Obtains a copy of the default text attributes. These are the
748
* attributes used for text unless a tag overrides them.
749
* You'd typically pass the default attributes in to
750
* Gtk::TextIter::get_attributes() in order to get the
751
* attributes in effect at a given text position.
752
* @return A new #Gtk::TextAttributes.
754
TextAttributes get_default_attributes() const;
757
/** Changes the Gtk::TextView overwrite mode.
760
* @param overwrite <tt>true</tt> to turn on overwrite mode, <tt>false</tt> to turn it off.
762
void set_overwrite(bool overwrite = true);
764
/** Returns whether the Gtk::TextView is in overwrite mode or not.
767
* @return Whether @a text_view is in overwrite mode or not.
769
bool get_overwrite() const;
772
/** Sets the behavior of the text widget when the Tab key is pressed.
773
* If @a accepts_tab is <tt>true</tt>, a tab character is inserted. If @a accepts_tab
774
* is <tt>false</tt> the keyboard focus is moved to the next widget in the focus
778
* @param accepts_tab <tt>true</tt> if pressing the Tab key should insert a tab
779
* character, <tt>false</tt>, if pressing the Tab key should move the
782
void set_accepts_tab(bool accepts_tab = true);
784
/** Returns whether pressing the Tab key inserts a tab characters.
788
* @return <tt>true</tt> if pressing the Tab key inserts a tab character,
789
* <tt>false</tt> if pressing the Tab key moves the keyboard focus.
791
bool get_accepts_tab() const;
796
* <tt>void on_my_%set_scroll_adjustments(Adjustment* hadjustment, Adjustment* vadjustment)</tt>
799
Glib::SignalProxy2< void,Adjustment*,Adjustment* > signal_set_scroll_adjustments();
804
* <tt>void on_my_%populate_popup(Menu* menu)</tt>
807
Glib::SignalProxy1< void,Menu* > signal_populate_popup();
812
* <tt>void on_my_%set_anchor()</tt>
815
Glib::SignalProxy0< void > signal_set_anchor();
820
* <tt>void on_my_%insert_at_cursor(const Glib::ustring& str)</tt>
823
Glib::SignalProxy1< void,const Glib::ustring& > signal_insert_at_cursor();
826
//Keybinding signals:
829
#ifdef GLIBMM_PROPERTIES_ENABLED
830
/** Pixels of blank space above paragraphs.
832
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
833
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
834
* the value of the property changes.
836
Glib::PropertyProxy<int> property_pixels_above_lines() ;
837
#endif //#GLIBMM_PROPERTIES_ENABLED
839
#ifdef GLIBMM_PROPERTIES_ENABLED
840
/** Pixels of blank space above paragraphs.
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_pixels_above_lines() const;
847
#endif //#GLIBMM_PROPERTIES_ENABLED
849
#ifdef GLIBMM_PROPERTIES_ENABLED
850
/** Pixels of blank space below paragraphs.
852
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
853
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
854
* the value of the property changes.
856
Glib::PropertyProxy<int> property_pixels_below_lines() ;
857
#endif //#GLIBMM_PROPERTIES_ENABLED
859
#ifdef GLIBMM_PROPERTIES_ENABLED
860
/** Pixels of blank space below paragraphs.
862
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
863
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
864
* the value of the property changes.
866
Glib::PropertyProxy_ReadOnly<int> property_pixels_below_lines() const;
867
#endif //#GLIBMM_PROPERTIES_ENABLED
869
#ifdef GLIBMM_PROPERTIES_ENABLED
870
/** Pixels of blank space between wrapped lines in a paragraph.
872
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
873
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
874
* the value of the property changes.
876
Glib::PropertyProxy<int> property_pixels_inside_wrap() ;
877
#endif //#GLIBMM_PROPERTIES_ENABLED
879
#ifdef GLIBMM_PROPERTIES_ENABLED
880
/** Pixels of blank space between wrapped lines in a paragraph.
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_ReadOnly<int> property_pixels_inside_wrap() const;
887
#endif //#GLIBMM_PROPERTIES_ENABLED
889
#ifdef GLIBMM_PROPERTIES_ENABLED
890
/** Whether the text can be modified by the user.
892
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
893
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
894
* the value of the property changes.
896
Glib::PropertyProxy<bool> property_editable() ;
897
#endif //#GLIBMM_PROPERTIES_ENABLED
899
#ifdef GLIBMM_PROPERTIES_ENABLED
900
/** Whether the text can be modified by the user.
902
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
903
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
904
* the value of the property changes.
906
Glib::PropertyProxy_ReadOnly<bool> property_editable() const;
907
#endif //#GLIBMM_PROPERTIES_ENABLED
909
#ifdef GLIBMM_PROPERTIES_ENABLED
910
/** Whether to wrap lines never, at word boundaries, or at character boundaries.
912
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
913
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
914
* the value of the property changes.
916
Glib::PropertyProxy<WrapMode> property_wrap_mode() ;
917
#endif //#GLIBMM_PROPERTIES_ENABLED
919
#ifdef GLIBMM_PROPERTIES_ENABLED
920
/** Whether to wrap lines never, at word boundaries, or at character boundaries.
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<WrapMode> property_wrap_mode() const;
927
#endif //#GLIBMM_PROPERTIES_ENABLED
929
#ifdef GLIBMM_PROPERTIES_ENABLED
930
/** Left, right, or center justification.
932
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
933
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
934
* the value of the property changes.
936
Glib::PropertyProxy<Justification> property_justification() ;
937
#endif //#GLIBMM_PROPERTIES_ENABLED
939
#ifdef GLIBMM_PROPERTIES_ENABLED
940
/** Left, right, or center justification.
942
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
943
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
944
* the value of the property changes.
946
Glib::PropertyProxy_ReadOnly<Justification> property_justification() const;
947
#endif //#GLIBMM_PROPERTIES_ENABLED
949
#ifdef GLIBMM_PROPERTIES_ENABLED
950
/** Width of the left margin in pixels.
952
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
953
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
954
* the value of the property changes.
956
Glib::PropertyProxy<int> property_left_margin() ;
957
#endif //#GLIBMM_PROPERTIES_ENABLED
959
#ifdef GLIBMM_PROPERTIES_ENABLED
960
/** Width of the left margin in pixels.
962
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
963
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
964
* the value of the property changes.
966
Glib::PropertyProxy_ReadOnly<int> property_left_margin() const;
967
#endif //#GLIBMM_PROPERTIES_ENABLED
969
#ifdef GLIBMM_PROPERTIES_ENABLED
970
/** Width of the right margin in pixels.
972
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
973
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
974
* the value of the property changes.
976
Glib::PropertyProxy<int> property_right_margin() ;
977
#endif //#GLIBMM_PROPERTIES_ENABLED
979
#ifdef GLIBMM_PROPERTIES_ENABLED
980
/** Width of the right margin in pixels.
982
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
983
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
984
* the value of the property changes.
986
Glib::PropertyProxy_ReadOnly<int> property_right_margin() const;
987
#endif //#GLIBMM_PROPERTIES_ENABLED
989
#ifdef GLIBMM_PROPERTIES_ENABLED
990
/** Amount to indent the paragraph, in pixels.
992
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
993
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
994
* the value of the property changes.
996
Glib::PropertyProxy<int> property_indent() ;
997
#endif //#GLIBMM_PROPERTIES_ENABLED
999
#ifdef GLIBMM_PROPERTIES_ENABLED
1000
/** Amount to indent the paragraph, in pixels.
1002
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1003
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1004
* the value of the property changes.
1006
Glib::PropertyProxy_ReadOnly<int> property_indent() const;
1007
#endif //#GLIBMM_PROPERTIES_ENABLED
1009
#ifdef GLIBMM_PROPERTIES_ENABLED
1010
/** Custom tabs for this text.
1012
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1013
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1014
* the value of the property changes.
1016
Glib::PropertyProxy<Pango::TabArray> property_tabs() ;
1017
#endif //#GLIBMM_PROPERTIES_ENABLED
1019
#ifdef GLIBMM_PROPERTIES_ENABLED
1020
/** Custom tabs for this text.
1022
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1023
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1024
* the value of the property changes.
1026
Glib::PropertyProxy_ReadOnly<Pango::TabArray> property_tabs() const;
1027
#endif //#GLIBMM_PROPERTIES_ENABLED
1029
#ifdef GLIBMM_PROPERTIES_ENABLED
1030
/** If the insertion cursor is shown.
1032
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1033
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1034
* the value of the property changes.
1036
Glib::PropertyProxy<bool> property_cursor_visible() ;
1037
#endif //#GLIBMM_PROPERTIES_ENABLED
1039
#ifdef GLIBMM_PROPERTIES_ENABLED
1040
/** If the insertion cursor is shown.
1042
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1043
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1044
* the value of the property changes.
1046
Glib::PropertyProxy_ReadOnly<bool> property_cursor_visible() const;
1047
#endif //#GLIBMM_PROPERTIES_ENABLED
1049
#ifdef GLIBMM_PROPERTIES_ENABLED
1050
/** The buffer which is displayed.
1052
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1053
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1054
* the value of the property changes.
1056
Glib::PropertyProxy< Glib::RefPtr<TextBuffer> > property_buffer() ;
1057
#endif //#GLIBMM_PROPERTIES_ENABLED
1059
#ifdef GLIBMM_PROPERTIES_ENABLED
1060
/** The buffer which is displayed.
1062
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1063
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1064
* the value of the property changes.
1066
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<TextBuffer> > property_buffer() const;
1067
#endif //#GLIBMM_PROPERTIES_ENABLED
1069
#ifdef GLIBMM_PROPERTIES_ENABLED
1070
/** Whether entered text overwrites existing contents.
1072
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1073
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1074
* the value of the property changes.
1076
Glib::PropertyProxy<bool> property_overwrite() ;
1077
#endif //#GLIBMM_PROPERTIES_ENABLED
1079
#ifdef GLIBMM_PROPERTIES_ENABLED
1080
/** Whether entered text overwrites existing contents.
1082
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1083
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1084
* the value of the property changes.
1086
Glib::PropertyProxy_ReadOnly<bool> property_overwrite() const;
1087
#endif //#GLIBMM_PROPERTIES_ENABLED
1089
#ifdef GLIBMM_PROPERTIES_ENABLED
1090
/** Whether Tab will result in a tab character being entered.
1092
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1093
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1094
* the value of the property changes.
1096
Glib::PropertyProxy<bool> property_accepts_tab() ;
1097
#endif //#GLIBMM_PROPERTIES_ENABLED
1099
#ifdef GLIBMM_PROPERTIES_ENABLED
1100
/** Whether Tab will result in a tab character being entered.
1102
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1103
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1104
* the value of the property changes.
1106
Glib::PropertyProxy_ReadOnly<bool> property_accepts_tab() const;
1107
#endif //#GLIBMM_PROPERTIES_ENABLED
1109
#ifdef GLIBMM_PROPERTIES_ENABLED
1110
/** Which IM module should be used.
1112
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1113
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1114
* the value of the property changes.
1116
Glib::PropertyProxy<Glib::ustring> property_im_module() ;
1117
#endif //#GLIBMM_PROPERTIES_ENABLED
1119
#ifdef GLIBMM_PROPERTIES_ENABLED
1120
/** Which IM module should be used.
1122
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1123
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1124
* the value of the property changes.
1126
Glib::PropertyProxy_ReadOnly<Glib::ustring> property_im_module() const;
1127
#endif //#GLIBMM_PROPERTIES_ENABLED
1132
} /* namespace Gtk */
1137
/** A Glib::wrap() method for this object.
1139
* @param object The C instance.
1140
* @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
1141
* @result A C++ instance that wraps this C instance.
1143
* @relates Gtk::TextView
1145
Gtk::TextView* wrap(GtkTextView* object, bool take_copy = false);
1149
#endif /* _GTKMM_TEXTVIEW_H */