* Boston, MA 02111-1307, USA.
*/
+#include <libgdaex.h>
+
#include "gtkformdecoder.h"
enum
{
- PROP_0
+ PROP_0,
+ PROP_GDAEX,
+ PROP_SQL
};
static void gtk_form_decoder_class_init (GtkFormDecoderClass *klass);
static void gtk_form_decoder_init (GtkFormDecoder *decoder);
+static void gtk_form_decoder_decode (GtkFormDecoder *decoder);
+
static void gtk_form_decoder_size_request (GtkWidget *widget,
GtkRequisition *requisition);
static void gtk_form_decoder_size_allocate (GtkWidget *widget,
GtkWidget *txt_decoded;
GtkWidget *btn_browse;
GtkWidget *lbl_key;
+
+ GdaEx *gdaex;
+ gchar *sql;
};
G_DEFINE_TYPE (GtkFormDecoder, gtk_form_decoder, GTK_TYPE_BIN)
widget_class->size_request = gtk_form_decoder_size_request;
widget_class->size_allocate = gtk_form_decoder_size_allocate;
+ g_object_class_install_property (object_class, PROP_GDAEX,
+ g_param_spec_object ("gdaex",
+ "GdaEx object",
+ "GdaEx object",
+ TYPE_GDAEX,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_SQL,
+ g_param_spec_string ("sql",
+ "Sql string",
+ "Sql string",
+ NULL,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+
/**
* GtkFormDecoder::btn_browse_clicked:
* @gtk_form_decoder:
return w;
}
+void
+gtk_form_decoder_set_key (GtkFormDecoder *decoder, const gchar *key)
+{
+ GtkFormDecoderPrivate *priv;
+
+ g_return_if_fail (GTK_IS_FORM_DECODER (decoder));
+
+ priv = GTK_FORM_DECODER_GET_PRIVATE (decoder);
+
+ gtk_label_set_text (GTK_LABEL (priv->lbl_key), key);
+ gtk_form_decoder_decode (decoder);
+}
+
gchar
*gtk_form_decoder_get_key (GtkFormDecoder *decoder)
{
}
/* PRIVATE */
+static void
+gtk_form_decoder_decode (GtkFormDecoder *decoder)
+{
+ GtkFormDecoderPrivate *priv;
+
+ g_return_if_fail (GTK_IS_FORM_DECODER (decoder));
+
+ priv = GTK_FORM_DECODER_GET_PRIVATE (decoder);
+
+}
/* CALLBACKS */
static void
switch (property_id)
{
+ case PROP_GDAEX:
+ priv->gdaex = g_value_get_object (value);
+ break;
+
+ case PROP_SQL:
+ priv->sql = g_strstrip (g_value_dup_string (value));
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
switch (property_id)
{
+ case PROP_GDAEX:
+ g_value_set_object (value, priv->gdaex);
+ break;
+
+ case PROP_SQL:
+ g_value_set_string (value, priv->sql);
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;