Code

GSoC C++-ificiation merge and cleanup.
[inkscape.git] / src / ege-select-one-action.h
index 787a2c171dbb9e291a393979e7f054b2759c18a8..36943b9787b404a39a118a2eb208d41d9e263035 100644 (file)
@@ -20,7 +20,7 @@
  *
  * The Initial Developer of the Original Code is
  * Jon A. Cruz.
- * Portions created by the Initial Developer are Copyright (C) 2007
+ * Portions created by the Initial Developer are Copyright (C) 2010
  * the Initial Developer. All Rights Reserved.
  *
  * Contributor(s):
  *
  * ***** END LICENSE BLOCK ***** */
 
+/** \file
+ * GtkAction subclass that represents a set of values the user may select
+ *  one from at a given time.
+ * This can manifest as a popup menu, a ComboBox, a set of toggle buttons,
+ *  etc.
+ */
+
 /* Note: this file should be kept compilable as both .cpp and .c */
 
 #include <glib.h>
@@ -60,40 +67,178 @@ typedef struct _EgeSelectOneAction      EgeSelectOneAction;
 typedef struct _EgeSelectOneActionClass EgeSelectOneActionClass;
 typedef struct _EgeSelectOneActionPrivate EgeSelectOneActionPrivate;
 
+/**
+ * Instance structure of EgeSelectOneAction.
+ */
 struct _EgeSelectOneAction
 {
+    /** Parent instance structure. */
     GtkAction action;
+
+    /** Pointer to private instance data. */
     EgeSelectOneActionPrivate *private_data;
 };
 
+/**
+ * Class structure of EgeSelectOneAction.
+ */
 struct _EgeSelectOneActionClass
 {
+    /** Parent class structure. */
     GtkActionClass parent_class;
+
     void (*changed) (EgeSelectOneAction* action);
 };
 
+/** Standard Gtk type function */
 GType ege_select_one_action_get_type( void );
 
+/**
+ * Creates a new EgeSelectOneAction instance.
+ * This is a GtkAction subclass that represents a set of values the user
+ *  may select one from at a given time.
+ * This can manifest as a popup menu, a ComboBox, a set of toggle buttons,
+ *  etc.
+ *
+ * @param name Functional name for the action.
+ * @param label Display label for the action.
+ * @param tooltip Tooltip for the action.
+ * @param stock_id Icon id to use.
+ * @param model the source of choices to present.
+ */
 EgeSelectOneAction* ege_select_one_action_new( const gchar *name,
                                                const gchar *label,
                                                const gchar *tooltip,
                                                const gchar *stock_id,
                                                GtkTreeModel* model );
 
+GtkTreeModel *ege_select_one_action_get_model(EgeSelectOneAction* action );
+
+/**
+ * Returns the index of the currently selected item.
+ *
+ * @param action The action to fetch the selected index for.
+ */
 gint ege_select_one_action_get_active( EgeSelectOneAction* action );
+
+/**
+ * Returns the text of the currently selected item.
+ *
+ * @param action The action to fetch the text for.
+ * @return the selected text. The caller is responsible to call g_free() on it when done.
+ */
+gchar *ege_select_one_action_get_active_text( EgeSelectOneAction* action );
+
+/**
+ * Sets the text of the currently selected item.
+ *
+ * @param action The action to fetch the text for.
+ * @param text the text to set.
+ */
+void ege_select_one_action_set_active_text( EgeSelectOneAction* action, gchar const *text );
+
+/**
+ * Sets the  currently selected item.
+ *
+ * @param action The action to fetch the selected index for.
+ * @param val index of the item to make selected.
+ */
 void ege_select_one_action_set_active( EgeSelectOneAction* action, gint val );
 
+//void ege_select_one_action_set_sensitive( EgeSelectOneAction *action, gint val, gboolean sensitive );
+
+/**
+ * Update sensitive parameters.
+ * @param action The action to update.
+ */
+void ege_select_one_action_update_sensitive( EgeSelectOneAction *action );
+
+/**
+ * Returns the column used for the display label.
+ *
+ * @param action The action to fetch the label column for.
+ */
 gint ege_select_one_action_get_label_column( EgeSelectOneAction* action );
+
+/**
+ * Sets the column used for the display label.
+ *
+ * @param action The action to set the label column for.
+ * @param col column to use.
+ */
 void ege_select_one_action_set_label_column( EgeSelectOneAction* action, gint col );
 
+
+/**
+ * Returns the column used for the display icon.
+ *
+ * @param action The action to fetch the icon column for.
+ */
 gint ege_select_one_action_get_icon_column( EgeSelectOneAction* action );
+
+/**
+ * Sets the column used for the display icon.
+ *
+ * @param action The action to set the icon column for.
+ * @param col column to use.
+ */
 void ege_select_one_action_set_icon_column( EgeSelectOneAction* action, gint col );
 
+gint ege_select_one_action_get_icon_size( EgeSelectOneAction* action );
+
+void ege_select_one_action_set_icon_size( EgeSelectOneAction* action, gint size );
+
+
+/**
+ * Returns the column used for the tooltip.
+ *
+ * @param action The action to fetch the tooltip column for.
+ */
 gint ege_select_one_action_get_tooltip_column( EgeSelectOneAction* action );
+
+/**
+ * Sets the column used for the tooltip.
+ *
+ * @param action The action to set the tooltip column for.
+ * @param col column to use.
+ */
 void ege_select_one_action_set_tooltip_column( EgeSelectOneAction* action, gint col );
 
+
+/**
+ * Returns the column used for tracking sensitivity.
+ *
+ * @param action The action to fetch the sensitive column for.
+ */
+gint ege_select_one_action_get_sensitive_column( EgeSelectOneAction* action );
+
+/**
+ * Sets the column used for sensitivity (if any).
+ *
+ * @param action The action to set the sensitive column for.
+ * @param col column to use.
+ */
+void ege_select_one_action_set_sensitive_column( EgeSelectOneAction* action, gint col );
+
+
+/**
+ * Sets a hint to be used in determining the display form.
+ * This is the XForms style 'appearance' hint: "full", "compact", "minimal".
+ *
+ * @param action The action to set the tooltip column for.
+ * @param val The value of the appearance hint.
+ */
 void ege_select_one_action_set_appearance( EgeSelectOneAction* action, gchar const* val );
 
+/**
+ * Sets to allow or disallow free entry additions to the list.
+ * The default is "closed" selections that do not allow additions/edits.
+ * This is the XForms functional 'selection' attribute: "open", "closed".
+ *
+ * @param action The action to set the tooltip column for.
+ * @param val The value of the selection attribute.
+ */
+void ege_select_one_action_set_selection( EgeSelectOneAction *action, gchar const* val );
 
 /* bit of a work-around */
 void ege_select_one_action_set_radio_action_type( EgeSelectOneAction* action, GType radioActionType );