libseahorse Reference Manual | ||||
---|---|---|---|---|
Top | Description |
SeahorseContextSeahorseContext — This is where all the action in a Seahorse process comes together. |
Synopsis
#include <libseahorse/seahorse-context.h> SeahorseContextPrivate; struct SeahorseContext; void (*SeahorseObjectFunc) (struct _SeahorseObject *obj
,gpointer user_data
); #define SCTX_APP SeahorseContext * seahorse_context_for_app (void
); SeahorseContext * seahorse_context_new (guint flags
); void seahorse_context_destroy (SeahorseContext *sctx
); #define seahorse_context_is_daemon (ctx) void seahorse_context_add_source (SeahorseContext *sctx
,SeahorseSource *sksrc
); void seahorse_context_take_source (SeahorseContext *sctx
,SeahorseSource *sksrc
); void seahorse_context_remove_source (SeahorseContext *sctx
,SeahorseSource *sksrc
); SeahorseSource * seahorse_context_find_source (SeahorseContext *sctx
,GQuark ktype
,SeahorseLocation location
); GSList * seahorse_context_find_sources (SeahorseContext *sctx
,GQuark ktype
,SeahorseLocation location
); SeahorseSource * seahorse_context_remote_source (SeahorseContext *sctx
,const gchar *uri
); void seahorse_context_add_object (SeahorseContext *sctx
,struct _SeahorseObject *sobj
); void seahorse_context_take_object (SeahorseContext *sctx
,struct _SeahorseObject *sobj
); guint seahorse_context_get_count (SeahorseContext *sctx
); struct _SeahorseObject * seahorse_context_get_object (SeahorseContext *sctx
,SeahorseSource *sksrc
,GQuark id
); GList * seahorse_context_get_objects (SeahorseContext *sctx
,SeahorseSource *sksrc
); struct _SeahorseObject * seahorse_context_find_object (SeahorseContext *sctx
,GQuark id
,SeahorseLocation location
); GList * seahorse_context_find_objects (SeahorseContext *sctx
,GQuark ktype
,SeahorseUsage usage
,SeahorseLocation location
); GList * seahorse_context_find_objects_full (SeahorseContext *self
,struct _SeahorseObjectPredicate *skpred
); void seahorse_context_for_objects_full (SeahorseContext *self
,struct _SeahorseObjectPredicate *skpred
,SeahorseObjectFunc func
,gpointer user_data
); void seahorse_context_verify_objects (SeahorseContext *self
); void seahorse_context_remove_object (SeahorseContext *sctx
,struct _SeahorseObject *sobj
); SeahorseServiceDiscovery * seahorse_context_get_discovery (SeahorseContext *sctx
); struct _SeahorseObject * seahorse_context_get_default_key (SeahorseContext *sctx
); void seahorse_context_refresh_auto (SeahorseContext *sctx
); SeahorseOperation * seahorse_context_search_remote (SeahorseContext *sctx
,const gchar *search
); SeahorseOperation * seahorse_context_transfer_objects (SeahorseContext *sctx
,GList *objs
,SeahorseSource *to
); SeahorseOperation * seahorse_context_retrieve_objects (SeahorseContext *sctx
,GQuark ktype
,GSList *ids
,SeahorseSource *to
); GList * seahorse_context_discover_objects (SeahorseContext *sctx
,GQuark ktype
,GSList *ids
); struct _SeahorseObject * seahorse_context_object_from_dbus (SeahorseContext *sctx
,const gchar *dbusid
); gchar * seahorse_context_object_to_dbus (SeahorseContext *sctx
,struct _SeahorseObject *sobj
); gchar * seahorse_context_id_to_dbus (SeahorseContext *sctx
,GQuark id
); GQuark (*SeahorseCanonizeFunc) (const gchar *id
); GQuark seahorse_context_canonize_id (GQuark ktype
,const gchar *id
);
Details
struct SeahorseContext
struct SeahorseContext { GObject parent; gboolean is_daemon; };
This is where all the action in a Seahorse process comes together.
- Usually there's only one SeahorseContext per process created by passing
SEAHORSE_CONTEXT_APP
to seahorse_context_new()
, and accessed via
the SCTX_APP
macro.
- Retains the list of all valid struct _SeahorseObject objects.
- Has a collection of SeahorseSource objects which add objects to the
SeahorseContext.
Signals: added: A object was added to the context. removed: A object was removed from the context. changed: A object changed. destroy: The context was destroyed.
seahorse_context_for_app ()
SeahorseContext * seahorse_context_for_app (void
);
Returns : |
the application main context as SeahorseContext |
seahorse_context_new ()
SeahorseContext * seahorse_context_new (guint flags
);
Creates a new SeahorseContext. Flags: SEAHORSE_CONTEXT_DAEMON: internal daemon flag will be set SEAHORSE_CONTEXT_APP: will support DNS-SD discovery and remote key sources
|
Flags define the type of the context to create. |
Returns : |
The new context |
seahorse_context_destroy ()
void seahorse_context_destroy (SeahorseContext *sctx
);
Emits the destroy signal for sctx
.
|
SeahorseContext to destroy |
seahorse_context_add_source ()
void seahorse_context_add_source (SeahorseContext *sctx
,SeahorseSource *sksrc
);
Adds sksrc
to the sctx
. If sctx
is NULL it will use the application context.
It also adds a reference to the new added source.
|
A context to add a source to, can be NULL |
|
The source to add |
seahorse_context_take_source ()
void seahorse_context_take_source (SeahorseContext *sctx
,SeahorseSource *sksrc
);
Adds sksrc
to the sctx
. If sctx
is NULL it will use the application context.
|
A context to add a source to, can be NULL |
|
The source to add |
seahorse_context_remove_source ()
void seahorse_context_remove_source (SeahorseContext *sctx
,SeahorseSource *sksrc
);
Remove all objects from source sksrc
from the SeahorseContext sctx
|
Context to remove objects from |
|
The source to remove |
seahorse_context_find_source ()
SeahorseSource * seahorse_context_find_source (SeahorseContext *sctx
,GQuark ktype
,SeahorseLocation location
);
Finds a context where ktype
and location
match
|
A SeahorseContext |
|
A seahorse tag (SEAHORSE_TAG_INVALID is wildcard) |
|
A location (SEAHORSE_LOCATION_INVALID is wildcard) |
Returns : |
The context |
seahorse_context_find_sources ()
GSList * seahorse_context_find_sources (SeahorseContext *sctx
,GQuark ktype
,SeahorseLocation location
);
|
the context to work with |
|
the type of the key to match. Or SEAHORSE_TAG_INVALID |
|
the location to match. Or SEAHORSE_LOCATION_INVALID |
Returns : |
A list of seahorse sources matching ktype and location as GSList. Must
be freed with g_slist_free
|
seahorse_context_remote_source ()
SeahorseSource * seahorse_context_remote_source (SeahorseContext *sctx
,const gchar *uri
);
Add a remote source to the Context sctx
. If it already exists, the source
object will be returned.
|
the context to add the source to (can be NULL) |
|
An URI to add as remote source |
Returns : |
The SeahorseSource with this URI |
seahorse_context_add_object ()
void seahorse_context_add_object (SeahorseContext *sctx
,struct _SeahorseObject *sobj
);
Adds sobj
to sctx
. References sobj
|
The context to add the object to |
|
The object to add |
seahorse_context_take_object ()
void seahorse_context_take_object (SeahorseContext *sctx
,struct _SeahorseObject *sobj
);
Adds sobj
to sctx
. If a similar object exists, it will be overwritten.
Emits the "added" signal.
|
The SeahorseContext context to add an object to |
|
The SeahorseObject object to add |
seahorse_context_get_count ()
guint seahorse_context_get_count (SeahorseContext *sctx
);
|
The context. If NULL is passed it will take the application context |
Returns : |
The number of objects in this context |
seahorse_context_get_object ()
struct _SeahorseObject * seahorse_context_get_object (SeahorseContext *sctx
,SeahorseSource *sksrc
,GQuark id
);
Finds the object with the source sksrc
and id
in the context and returns it
|
The SeahorseContext to look in |
|
The source to match |
|
the id to match |
Returns : |
The matching object |
seahorse_context_get_objects ()
GList * seahorse_context_get_objects (SeahorseContext *sctx
,SeahorseSource *sksrc
);
Returns : |
A GList of objects from self that match the source source
|
seahorse_context_find_object ()
struct _SeahorseObject * seahorse_context_find_object (SeahorseContext *sctx
,GQuark id
,SeahorseLocation location
);
Finds the object with the id id
at location location
or better.
Local is better than remote...
|
The SeahorseContext to work with (can be NULL) |
|
The id to look for |
|
The location to look for (at least) |
Returns : |
the matching SeahorseObject or NULL if none is found |
seahorse_context_find_objects ()
GList * seahorse_context_find_objects (SeahorseContext *sctx
,GQuark ktype
,SeahorseUsage usage
,SeahorseLocation location
);
|
A SeahorseContext to look in (can be NULL) |
|
The tag to look for |
|
the usage (SeahorseUsage) |
|
the location to look for |
Returns : |
A list of matching objects |
seahorse_context_find_objects_full ()
GList * seahorse_context_find_objects_full (SeahorseContext *self
,struct _SeahorseObjectPredicate *skpred
);
Finds matching objects and adds them to the list
|
The SeahorseContext to match objects in |
Returns : |
a GList list containing the matching objects |
seahorse_context_for_objects_full ()
void seahorse_context_for_objects_full (SeahorseContext *self
,struct _SeahorseObjectPredicate *skpred
,SeahorseObjectFunc func
,gpointer user_data
);
Calls func
for every object in self
matching the criteria in pred
. user_data
is passed to this function
|
SeahorseContext to work with |
|
Function to call for matching objects |
|
Data to pass to this function |
seahorse_context_verify_objects ()
void seahorse_context_verify_objects (SeahorseContext *self
);
Verifies each key in the given context. An assertion handles failure.
|
A SeahorseContext to verify |
seahorse_context_remove_object ()
void seahorse_context_remove_object (SeahorseContext *sctx
,struct _SeahorseObject *sobj
);
Removes the object from the context
|
The SeahorseContext (can be NULL) |
|
The SeahorseObject to remove |
seahorse_context_get_discovery ()
SeahorseServiceDiscovery * seahorse_context_get_discovery
(SeahorseContext *sctx
);
Warning
seahorse_context_get_discovery
is deprecated and should not be used in newly-written code. No replacement
Gets the Service Discovery object for this context.
|
SeahorseContext object |
Returns : |
The Service Discovery object. |
seahorse_context_get_default_key ()
struct _SeahorseObject * seahorse_context_get_default_key
(SeahorseContext *sctx
);
Warning
seahorse_context_get_default_key
is deprecated and should not be used in newly-written code. No replacement
|
Current SeahorseContext |
Returns : |
the secret key that's the default key |
seahorse_context_refresh_auto ()
void seahorse_context_refresh_auto (SeahorseContext *sctx
);
Starts a new refresh operation and emits the "refreshing" signal
|
A SeahorseContext (can be NULL) |
seahorse_context_search_remote ()
SeahorseOperation * seahorse_context_search_remote (SeahorseContext *sctx
,const gchar *search
);
Searches for the key matching search
o the remote servers
|
A SeahorseContext (can be NULL) |
|
a keyword (name, email address...) to search for |
Returns : |
The created search operation |
seahorse_context_transfer_objects ()
SeahorseOperation * seahorse_context_transfer_objects (SeahorseContext *sctx
,GList *objs
,SeahorseSource *to
);
|
The SeahorseContext (can be NULL) |
|
a source to import to (can be NULL) |
Returns : |
A transfer operation |
seahorse_context_retrieve_objects ()
SeahorseOperation * seahorse_context_retrieve_objects (SeahorseContext *sctx
,GQuark ktype
,GSList *ids
,SeahorseSource *to
);
Copies remote objects to a local source
|
A SeahorsecContext |
|
The type of the keys to transfer |
|
The key ids to transfer |
|
A SeahorseSource. If NULL, it will use ktype to find a source |
Returns : |
A SeahorseOperation |
seahorse_context_discover_objects ()
GList * seahorse_context_discover_objects (SeahorseContext *sctx
,GQuark ktype
,GSList *ids
);
Downloads a list of keys from the keyserver
|
the context to work with (can be NULL) |
|
the type of key to discover |
Returns : |
The imported keys |
seahorse_context_object_from_dbus ()
struct _SeahorseObject * seahorse_context_object_from_dbus (SeahorseContext *sctx
,const gchar *dbusid
);
Finds an object basing on the key
|
A SeahorseContext |
Returns : |
The SeahorseObject found. NULL on not found. |
seahorse_context_object_to_dbus ()
gchar * seahorse_context_object_to_dbus (SeahorseContext *sctx
,struct _SeahorseObject *sobj
);
Translates an object to a string id
|
A seahorse context |
|
the object |
Returns : |
The string id of the object. Free with g_free |
seahorse_context_id_to_dbus ()
gchar * seahorse_context_id_to_dbus (SeahorseContext *sctx
,GQuark id
);
Translates an id to a dbus compatible string
|
ignored |
|
the id to translate |
Returns : |
A string, free with g_free |