text-edit.h revision f7d872affb918a763e1f4237a2af23911a2baa21
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle * @brief Text-edit
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle * Lauris Kaplinski <lauris@ximian.com>
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle * bulia byak <buliabyak@users.sf.net>
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle * Johan Engelen <goejendaagh@zonnet.nl>
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle * John Smith
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle * Kris De Gussem <Kris.DeGussem@gmail.com>
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle * Tavmjong Bah
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle * Copyright (C) 1999-2013 Authors
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle * Copyright (C) 2000-2001 Ximian, Inc.
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle * Released under GNU GPL, read the file 'COPYING' for more information
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle * The TextEdit class defines the Text and font dialog.
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle * The Text and font dialog allows you to set the font family, style and size
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle * and shows a preview of the result. The dialogs layout settings include
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle * horizontal and vertical alignment and inter line distance.
21dcdac963f79c098a5ea1a2c5c5e109429c9786Brendan Miller * Helper function which returns a new instance of the dialog.
0365e5e502b10b8712ae1fc77b744025f6ac1900chad.kienle * getInstance is needed by the dialog manager (Inkscape::UI::Dialog::DialogManager).
0365e5e502b10b8712ae1fc77b744025f6ac1900chad.kienle static TextEdit &getInstance() { return *new TextEdit(); }
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle * Callback for pressing the default button.
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle * Callback for pressing the apply button.
9a25d0f810bf910b9320f3d33279eec8b54c03a9Chad Kienle * Called whenever something 'changes' on canvas.
0365e5e502b10b8712ae1fc77b744025f6ac1900chad.kienle * onReadSelection gets the currently selected item from the canvas and sets all the controls in this dialog to the correct state.
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle * @param dostyle Indicates whether the modification of the user includes a style change.
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle * @param content Indicates whether the modification of the user includes a style change. Actually refers to the question if we do want to show the content? (Parameter currently not used)
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle void onReadSelection (gboolean style, gboolean content);
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle static void onLineSpacingChange (GtkComboBox* widget, gpointer data);
470b8b61c1e994020f9a8611860732b7532a859bBrendan Mmiller * Callback invoked when the user modifies the text of the selected text object.
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle * onTextChange is responsible for initiating the commands after the user
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle * modified the text in the selected object. The UI of the dialog is
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle * updated. The subfunction setPreviewText updates the preview label.
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle * @param text_buffer pointer to GtkTextBuffer with the text of the selected text object
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle * @param self pointer to the current instance of the dialog.
39a2b1613dd6d8f45a32a9efda82fd0aead4cf43Brendan Mmiller static void onTextChange (GtkTextBuffer *text_buffer, TextEdit *self);
39a2b1613dd6d8f45a32a9efda82fd0aead4cf43Brendan Mmiller * Callback invoked when the user modifies the font through the dialog or the tools control bar.
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle * onFontChange updates the dialog UI. The subfunction setPreviewText updates the preview label.
9a25d0f810bf910b9320f3d33279eec8b54c03a9Chad Kienle * @param fontsel pointer to SPFontSelector (currently not used).
9a25d0f810bf910b9320f3d33279eec8b54c03a9Chad Kienle * @param fontspec for the text to be previewed.
9a25d0f810bf910b9320f3d33279eec8b54c03a9Chad Kienle * @param self pointer to the current instance of the dialog.
9a25d0f810bf910b9320f3d33279eec8b54c03a9Chad Kienle static void onFontChange (SPFontSelector *fontsel, gchar* fontspec, TextEdit *self);
9a25d0f810bf910b9320f3d33279eec8b54c03a9Chad Kienle * Callback invoked when the user modifies the startOffset of text on a path.
49ca89f51e0242b83f998f16a269dc1982460f02Chad Kienle * @param text_buffer pointer to the GtkTextBuffer with the text of the selected text object.
49ca89f51e0242b83f998f16a269dc1982460f02Chad Kienle * @param self pointer to the current instance of the dialog.
49ca89f51e0242b83f998f16a269dc1982460f02Chad Kienle static void onStartOffsetChange(GtkTextBuffer *text_buffer, TextEdit *self);
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle * Get the selected text off the main canvas.
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle * @return SPItem pointer to the selected text object
49ca89f51e0242b83f998f16a269dc1982460f02Chad Kienle * Count the number of text objects in the selection on the canvas.
49ca89f51e0242b83f998f16a269dc1982460f02Chad Kienle unsigned getSelectedTextCount (void);
9a25d0f810bf910b9320f3d33279eec8b54c03a9Chad Kienle * Helper function to create markup from a fontspec and display in the preview label.
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle * @param fontspec for the text to be previewed
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle * @param phrase text to be shown
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle void setPreviewText (Glib::ustring font_spec, Glib::ustring phrase);
ad0b283113c3f11ac1877df97d5d0fae899b56caBrendan Mmiller * Helper function to style radio buttons with icons, tooltips.
ad0b283113c3f11ac1877df97d5d0fae899b56caBrendan Mmiller * styleButton is used when creating the dialog.
b84068e6021ec8a830c26c4494f6e335d1f9c0efBrendan Miller * @param button pointer to the button which is created
ad0b283113c3f11ac1877df97d5d0fae899b56caBrendan Mmiller * @param tooltip pointer to its tooltip string
2312a9d8e5342846988edcd629e1ac56a8b5d4a9Brendan Mmiller * @param iconname string identifying the icon to be shown
2312a9d8e5342846988edcd629e1ac56a8b5d4a9Brendan Mmiller * @param group_button group to which the radio button belongs to
2312a9d8e5342846988edcd629e1ac56a8b5d4a9Brendan Mmiller void styleButton(Gtk::RadioButton *button, gchar const *tooltip, gchar const *iconname, Gtk::RadioButton *group_button );
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle * Can be invoked for setting the desktop. Currently not used.
9a25d0f810bf910b9320f3d33279eec8b54c03a9Chad Kienle * Is invoked by the desktop tracker when the desktop changes.
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle * @see DesktopTracker
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle * All the dialogs widgets
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle GtkWidget *text_view; // TODO - Convert this to a Gtk::TextView, but GtkSpell doesn't seem to work with it
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle} //namespace Dialog
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle} //namespace UI
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle} //namespace Inkscape
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle#endif // INKSCAPE_UI_DIALOG_TEXT_EDIT_H
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle Local Variables:
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle c-file-style:"stroustrup"
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle indent-tabs-mode:nil
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle fill-column:99
d1ca2a638584eac08f1e7197086f6c903d6d553eChad Kienle// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :