1 <!-- ##### SECTION Title ##### -->
4 <!-- ##### SECTION Short_Description ##### -->
5 Performs commands, such as cut/copy/paste
7 <!-- ##### SECTION Long_Description ##### -->
9 An #EphyCommandManager is an interface to an #EphyEmbed which is used to perform
10 commands, such as cut/copy/paste. To perform any command, use
11 ephy_command_manager_do_command(). To test the availability of a command, use
12 ephy_command_manager_can_do_command(). The availability of commands depends on
13 the selection and actions previously performed in the #EphyEmbed. For instance,
14 %cmd_copy is only available if text has been selected; %cmd_undo is only
15 available if the user has a text input focused and has typed or erased some of
20 <title>Copying selected text in an #EphyEmbed
</title>
21 <programlisting>#<![CDATA[include
<ephy-embed.h
>]]
>
22 #<![CDATA[include
<ephy-command-manager.h
>
25 copy_selected_text (EphyEmbed *embed)
27 EphyCommandManager *manager;
29 manager = EPHY_COMMAND_MANAGER (embed);
30 g_return_if_fail (EPHY_IS_COMMAND_MANAGER (manager));
32 if (!ephy_command_manager_can_do_command (manager,
"cmd_copy")) return;
34 ephy_command_manager_do_command (manager,
"cmd_copy");
40 The #EphyCommandManager interface can perform any command which is defined in
41 Mozilla. However, for purposes of abstraction, only a certain subset of commands
44 <variablelist><title>Available Commands
</title>
45 <varlistentry><term>cmd_copy
</term>
46 <listitem><para>Copies selected text
</para></listitem>
48 <varlistentry><term>cmd_cut
</term>
49 <listitem><para>Cuts selected text.
</para></listitem>
51 <varlistentry><term>cmd_paste
</term>
52 <listitem><para>Pastes text from the clipboard (for example, into a text entry)
55 <varlistentry><term>cmd_undo
</term>
56 <listitem><para>Undoes the last action (for example, typing text into a text
57 entry
</para></listitem>
59 <varlistentry><term>cmd_redo
</term>
60 <listitem><para>Redoes previously %undo
<!-- -->ne actions (for example, in a
61 text entry)
</para></listitem>
65 <!-- ##### SECTION See_Also ##### -->
70 <!-- ##### SECTION Stability_Level ##### -->
73 <!-- ##### STRUCT EphyCommandManager ##### -->
79 <!-- ##### SIGNAL EphyCommandManager::command-changed ##### -->
84 @ephycommandmanager: the object which received the signal.
87 <!-- ##### STRUCT EphyCommandManagerIface ##### -->
97 <!-- ##### FUNCTION ephy_command_manager_do_command ##### -->
106 <!-- ##### FUNCTION ephy_command_manager_can_do_command ##### -->