GoaProviderFactory

GoaProviderFactory — Abstract base class for provider factories

Synopsis

struct              GoaProviderFactory;
struct              GoaProviderFactoryClass;
#define             GOA_PROVIDER_FACTORY_EXTENSION_POINT_NAME
GoaProvider *       goa_provider_factory_get_provider   (GoaProviderFactory *factory,
                                                         const gchar *provider_name);
void                goa_provider_factory_get_providers  (GoaProviderFactory *factory,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);
gboolean            goa_provider_factory_get_providers_finish
                                                        (GoaProviderFactory *factory,
                                                         GList **out_providers,
                                                         GAsyncResult *result,
                                                         GError **error);

Object Hierarchy

  GObject
   +----GoaProviderFactory

Description

GoaProviderFactory implementations are used to dynamically create GoaProvider instances.

Details

struct GoaProviderFactory

struct GoaProviderFactory;

The GoaProviderFactory structure contains only private data and should only be accessed using the provided API.


struct GoaProviderFactoryClass

struct GoaProviderFactoryClass {
  GObjectClass parent_class;

  /* Mandatory to implement. */
  GoaProvider *(*get_provider)              (GoaProviderFactory    *factory,
                                             const gchar           *provider_name);

  /* The async method is mandatory to implement, but _finish has a default
   * implementation suitable for a GSimpleAsyncResult. */
  void         (*get_providers)             (GoaProviderFactory    *factory,
                                             GAsyncReadyCallback    callback,
                                             gpointer               user_data);
  gboolean     (*get_providers_finish)      (GoaProviderFactory    *factory,
                                             GList                **out_providers,
                                             GAsyncResult          *result,
                                             GError               **error);
};

Class structure for GoaProviderFactory.

GObjectClass parent_class;

The parent class.

get_provider ()

Virtual function for goa_provider_factory_get_provider().

get_providers ()

Virtual function for goa_provider_factory_get_providers().

get_providers_finish ()

Virtual function for goa_provider_factory_get_providers_finish().

GOA_PROVIDER_FACTORY_EXTENSION_POINT_NAME

#define GOA_PROVIDER_FACTORY_EXTENSION_POINT_NAME "goa-backend-provider-factory"

Extension point for GoaProviderFactory implementations.


goa_provider_factory_get_provider ()

GoaProvider *       goa_provider_factory_get_provider   (GoaProviderFactory *factory,
                                                         const gchar *provider_name);

Create a dynamic GoaProvider for the subclass-specific provider_name.

factory :

A GoaProviderFactory.

provider_name :

A provider type identifier (ie. IM protocol names in GoaTelepathyFactory)

Returns :

A GoaProvider (that must be freed with g_object_unref()) or NULL if not found. [transfer full]

goa_provider_factory_get_providers ()

void                goa_provider_factory_get_providers  (GoaProviderFactory *factory,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);

Get asynchronously a list of GoaProvider instances handled by factory.

When the result is ready, callback will be called in the the thread-default main loop this function was called from. You can then call goa_provider_factory_get_providers_finish() to get the result of the operation.

This is a virtual method that must be implemented by subclasses.

factory :

A GoaProviderFactory.

callback :

The function to call when the request is satisfied.

user_data :

Pointer to pass to callback.

goa_provider_factory_get_providers_finish ()

gboolean            goa_provider_factory_get_providers_finish
                                                        (GoaProviderFactory *factory,
                                                         GList **out_providers,
                                                         GAsyncResult *result,
                                                         GError **error);

Finishes an operation started with goa_provider_factory_get_providers()

This is a virtual method that subclasses may implement. The default implementation is suitable for GSimpleAsyncResult an implementation of goa_provider_factory_get_providers() using GSimpleAsyncResult.

factory :

A GoaProviderFactory.

out_providers :

Return location for a list of GoaProvider instances handled by factory. [out]

result :

A GAsyncResult obtained from the GAsyncReadyCallback passed to goa_provider_factory_get_providers().

error :

Return location for error or NULL.

Returns :

TRUE if the list was successfully retrieved, FALSE if error is set.