XesamGSession

XesamGSession

Synopsis




                    XesamGSession;
XesamGSession*      xesam_g_session_new                 (void);
XesamGSession*      xesam_g_session_new_for_server      (const gchar *bus_name,
                                                         const gchar *object_path);
DBusGProxy*         xesam_g_session_get_proxy           (XesamGSession *session);
gchar*              xesam_g_session_get_id              (XesamGSession *session);
gboolean            xesam_g_session_is_ready            (XesamGSession *session);
gboolean            xesam_g_session_is_closed           (XesamGSession *session);
void                xesam_g_session_close               (XesamGSession *session);
void                xesam_g_session_sync_property       (XesamGSession *session,
                                                         gchar *property);
XesamGSearch*       xesam_g_session_new_search          (XesamGSession *session,
                                                         XesamGQuery *query);
XesamGSearch*       xesam_g_session_new_search_from_text
                                                        (XesamGSession *session,
                                                         gchar *search_text);

Object Hierarchy


  GObject
   +----XesamGSession

Properties


  "hit-fields"               GStrv                 : Read / Write
  "hit-fields-extended"      GStrv                 : Read / Write
  "hit-snippet-length"       gint                  : Read / Write
  "search-live"              gboolean              : Read / Write
  "sort-order"               gchararray            : Read / Write
  "sort-primary"             gchararray            : Read / Write
  "sort-secondary"           gchararray            : Read / Write
  "vendor-display"           gchararray            : Read
  "vendor-extensions"        GStrv                 : Read
  "vendor-id"                gchararray            : Read
  "vendor-maxhits"           guint                 : Read
  "vendor-ontology-contents" GStrv                 : Read
  "vendor-ontology-fields"   GStrv                 : Read
  "vendor-ontology-sources"  GStrv                 : Read
  "vendor-version"           guint                 : Read
  "vendor-xesam"             guint                 : Read

Signals


  "closed"                                         : Run Last
  "ready"                                          : Run Last

Description

Details

XesamGSession

typedef struct _XesamGSession XesamGSession;


xesam_g_session_new ()

XesamGSession*      xesam_g_session_new                 (void);

Return a new session on the default XESAM interface. Returns NULL if there is an error connecting to the DBus session bus.

Returns : A newly created XesamGSession or NULL if there is an error connecting to DBus session bus.

xesam_g_session_new_for_server ()

XesamGSession*      xesam_g_session_new_for_server      (const gchar *bus_name,
                                                         const gchar *object_path);

Create a new session on a custom bus name and object path.

FIXME: This method might better be replaced with one taking a DBusGProxy. That way we can reuse the proxy among several sessions.

bus_name : DBus name for the server to connect to
object_path : DBus object path the search engine lives on
Returns : NULL if failing to connect to session bus

xesam_g_session_get_proxy ()

DBusGProxy*         xesam_g_session_get_proxy           (XesamGSession *session);

FIXME: Should this method be removed? It is the only place we expose dbus.

session : The session to get the DBusGProxy object for.
Returns : Proxy used by the session.

xesam_g_session_get_id ()

gchar*              xesam_g_session_get_id              (XesamGSession *session);

Each session is identified on the server via a session id. Use this method to get it.

session : The session to retrieve the unique id for
Returns : The unique id for the session

xesam_g_session_is_ready ()

gboolean            xesam_g_session_is_ready            (XesamGSession *session);

Check whether a session is ready to spawn searches and/or get and set properties.

session : The session to check for readiness
Returns : TRUE ifg and only if the session has received a session id from the server.

xesam_g_session_is_closed ()

gboolean            xesam_g_session_is_closed           (XesamGSession *session);

Check if a session has been closed.

session : The session to check
Returns : TRUE if and only if the session has been closed by a call to xesam_g_session_close.

xesam_g_session_close ()

void                xesam_g_session_close               (XesamGSession *session);

Close a session. Spawning searches and setting/getting properties on a closed session is illegal.

session : Session to close

xesam_g_session_sync_property ()

void                xesam_g_session_sync_property       (XesamGSession *session,
                                                         gchar *property);

Asynchronously update the cached value of a session property. When the requested property has been retrieved a notification will be emitted for this property.

To guarantee that get_property will not block call this method on the desired property and wait for the matching notification.

session : Session on which to synchronize a property
property : Name of the property to synchronize

xesam_g_session_new_search ()

XesamGSearch*       xesam_g_session_new_search          (XesamGSession *session,
                                                         XesamGQuery *query);

Create a new XesamGSearch from a XesamGQuery.

session : Session to spawn a search on
query : Query the search should match
Returns : A newly created search object.

xesam_g_session_new_search_from_text ()

XesamGSearch*       xesam_g_session_new_search_from_text
                                                        (XesamGSession *session,
                                                         gchar *search_text);

Create a new XesamGSearch from a string composed in the XESAM User Search Language.

This method is suitable for use on raw user input.

session : Session to spawn search on
search_text : A string encoded in the XESAM User Search Language.
Returns : A newly created search object

Property Details

The "hit-fields" property

  "hit-fields"               GStrv                 : Read / Write

Fields to return for each hit.


The "hit-fields-extended" property

  "hit-fields-extended"      GStrv                 : Read / Write

Extra fields fetched on request.


The "hit-snippet-length" property

  "hit-snippet-length"       gint                  : Read / Write

Length of hit summaries in characters.

Allowed values: [0,1000]

Default value: 200


The "search-live" property

  "search-live"              gboolean              : Read / Write

If TRUE any XesamGSearch spawned on this session will continue to monitor the query and notify about changes via the relevant signal on the search object.

The XesamGSearch objects will only use the XesamGSearch::hits-modified and XesamGSearch::hit-removed signals if this property is TRUE.

Default value: FALSE


The "sort-order" property

  "sort-order"               gchararray            : Read / Write

The order in whic to sort results.

Default value: "descending"


The "sort-primary" property

  "sort-primary"             gchararray            : Read / Write

Name of field to sort hits after.

Default value: "xesam:score"


The "sort-secondary" property

  "sort-secondary"           gchararray            : Read / Write

Name of field used to sort if primary sort keys equal.

Default value: ""


The "vendor-display" property

  "vendor-display"           gchararray            : Read

A short string describing the vendor suitable for display.

Default value: "Unknown"


The "vendor-extensions" property

  "vendor-extensions"        GStrv                 : Read

A list of all xesam query language extensions supported by the search engine.


The "vendor-id" property

  "vendor-id"                gchararray            : Read

A string uniquely identofying the search engine vendor.

Default value: "Unknown"


The "vendor-maxhits" property

  "vendor-maxhits"           guint                 : Read

The max number of hits retrievable from the search engine. The actual number of hits might be bigger than this.

Default value: 1


The "vendor-ontology-contents" property

  "vendor-ontology-contents" GStrv                 : Read

A list of all content types supported by the search engine.


The "vendor-ontology-fields" property

  "vendor-ontology-fields"   GStrv                 : Read

A list of all field names supported by the search engine.


The "vendor-ontology-sources" property

  "vendor-ontology-sources"  GStrv                 : Read

A list of all source types supported by the search engine.


The "vendor-version" property

  "vendor-version"           guint                 : Read

Integer representation of the vendors version number.

Default value: 0


The "vendor-xesam" property

  "vendor-xesam"             guint                 : Read

The XESAM search specification version number implemented by the search engine.

Default value: 1

Signal Details

The "closed" signal

void                user_function                      (XesamGSession *xesamgsession,
                                                        gpointer       user_data)          : Run Last

xesamgsession : the object which received the signal.
user_data : user data set when the signal handler was connected.

The "ready" signal

void                user_function                      (XesamGSession *xesamgsession,
                                                        gpointer       user_data)          : Run Last

xesamgsession : the object which received the signal.
user_data : user data set when the signal handler was connected.