![]() |
![]() |
![]() |
MATE Dictionary Library Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties | Signals |
#define GDICT_CLIENT_CONTEXT_ERROR enum GdictClientContextError; GQuark gdict_client_context_error_quark (void
); struct GdictClientContext; struct GdictClientContextClass; GdictContext * gdict_client_context_new (const gchar *hostname
,gint port
); void gdict_client_context_set_hostname (GdictClientContext *context
,const gchar *hostname
); const gchar * gdict_client_context_get_hostname (GdictClientContext *context
); void gdict_client_context_set_port (GdictClientContext *context
,gint port
); guint gdict_client_context_get_port (GdictClientContext *context
); void gdict_client_context_set_client (GdictClientContext *context
,const gchar *client
); const gchar * gdict_client_context_get_client (GdictClientContext *context
);
"client-name" gchar* : Read / Write "hostname" gchar* : Read / Write "port" guint : Read / Write "status" GdictStatusCode : Read
GdictClientContext is an implementation of the GdictContext interface. It implements the Dictionary Protocol as defined by the RFC 2229 in order to connect to a dictionary server.
You should rarely instantiate this object directely: use an appropriate GdictSource instead.
typedef enum { GDICT_CLIENT_CONTEXT_ERROR_SOCKET, GDICT_CLIENT_CONTEXT_ERROR_LOOKUP, GDICT_CLIENT_CONTEXT_ERROR_NO_CONNECTION, GDICT_CLIENT_CONTEXT_ERROR_SERVER_DOWN } GdictClientContextError;
GdictClientContext error enumeration
struct GdictClientContextClass { /* signals monitoring the lifetime of the connection with * the dictionary server */ void (*connected) (GdictClientContext *context); void (*disconnected) (GdictClientContext *context); };
GdictContext * gdict_client_context_new (const gchar *hostname
,gint port
);
Creates a new GdictClientContext object for hostname
. Use this
object to connect and query the dictionary server using the Dictionary
Protocol as defined by RFC 2229.
|
the hostname of a dictionary server, or NULL for the
default server |
|
port to be used when connecting to the dictionary server, or -1 for the default port |
Returns : |
the newly created GdictClientContext object. You should
free it using g_object_unref() . |
void gdict_client_context_set_hostname (GdictClientContext *context
,const gchar *hostname
);
Sets hostname
as the hostname of the dictionary server to be used.
If hostname
is NULL
, the default dictionary server will be used.
|
a GdictClientContext |
|
the hostname of a Dictionary server, or NULL
|
const gchar * gdict_client_context_get_hostname (GdictClientContext *context
);
Gets the hostname of the dictionary server used by context
.
|
a GdictClientContext |
Returns : |
the hostname of a dictionary server. The returned string is owned by the GdictClientContext object and should never be modified or freed. |
void gdict_client_context_set_port (GdictClientContext *context
,gint port
);
Sets the port of the dictionary server to be used when connecting.
If port
is -1, the default port will be used.
|
a GdictClientContext |
|
port of the dictionary server to be used, or -1 |
guint gdict_client_context_get_port (GdictClientContext *context
);
Gets the port of the dictionary server used by context
.
|
a GdictClientContext |
Returns : |
the number of the port. |
void gdict_client_context_set_client (GdictClientContext *context
,const gchar *client
);
Sets client
as the client name to be used when advertising ourselves when
a connection the the dictionary server has been established.
If client
is NULL
, the default client name will be used.
|
a GdictClientContext |
|
the client name to use, or NULL
|
const gchar * gdict_client_context_get_client (GdictClientContext *context
);
Gets the client name used by context
. See gdict_client_context_set_client()
.
|
a GdictClientContext |
Returns : |
the client name. The returned string is owned by the GdictClientContext object and should never be modified or freed. |
"client-name"
property "client-name" gchar* : Read / Write
The name of the client using this context; it will be advertised when connecting to the dictionary server.
Default value: NULL
Since 1.0
"hostname"
property "hostname" gchar* : Read / Write
The hostname of the dictionary server to connect to.
Default value: NULL
Since 1.0
"port"
property "port" guint : Read / Write
The port of the dictionary server to connect to.
Allowed values: <= 65535
Default value: 2628
Since 1.0
"status"
property"status" GdictStatusCode : Read
The status code as returned by the dictionary server.
Default value: GDICT_STATUS_INVALID
Since 1.0
"connected"
signalvoid user_function (GdictClientContext *client,
gpointer user_data) : Run Last
Emitted when a GdictClientContext has successfully established a connection with a dictionary server.
|
the object which received the signal |
|
user data set when the signal handler was connected. |
Since 1.0
"disconnected"
signalvoid user_function (GdictClientContext *client,
gpointer user_data) : Run Last
Emitted when a GdictClientContext has disconnected from a dictionary server.
|
the object which received the signal |
|
user data set when the signal handler was connected. |
Since 1.0