Galago - desktop presence framework

galago-service.h File Reference

Galago Service API. More...

#include <libgalago/galago-account.h>
#include <libgalago/galago-object.h>
#include <libgalago/galago-signals.h>

Go to the source code of this file.


Common Service Definitions

#define GALAGO_SERVICE_ID_AIM   "aim"
#define GALAGO_SERVICE_ID_GADUGADU   "gadugadu"
#define GALAGO_SERVICE_ID_GROUPWISE   "groupwise"
#define GALAGO_SERVICE_ID_ICQ   "icq"
#define GALAGO_SERVICE_ID_IRC   "irc"
#define GALAGO_SERVICE_ID_JABBER   "jabber"
#define GALAGO_SERVICE_ID_MSN   "msn"
#define GALAGO_SERVICE_ID_NAPSTER   "napster"
#define GALAGO_SERVICE_ID_SILC   "silc"
#define GALAGO_SERVICE_ID_TREPIA   "trepia"
#define GALAGO_SERVICE_ID_YAHOO   "yahoo"
#define GALAGO_SERVICE_ID_ZEPHYR   "zephyr"

Service API

GalagoObjectClassgalago_service_get_class (void)
 Returns the class for a GalagoService.
GalagoServicegalago_service_new (const char *id, const char *name, galago_bool native, GalagoServiceFlags flags)
 Creates a service.
const char * galago_service_get_id (const GalagoService *service)
 Returns a service's ID.
const char * galago_service_get_name (const GalagoService *service)
 Returns a service's name.
galago_bool galago_service_is_native (const GalagoService *service)
 Returns whether or not a service is native to the local application.
GalagoServiceFlags galago_service_get_flags (const GalagoService *service)
 Returns a service's flags.
GalagoAccountgalago_service_get_account (const GalagoService *service, const char *username, galago_bool query)
 Returns the account with the specified username from a service.
const GalagoListgalago_service_get_accounts (const GalagoService *service, galago_bool query)
 Returns a list of all accounts in the service.
void galago_service_add_account (GalagoService *service, GalagoAccount *account)
 Adds an account to a service.
void galago_service_remove_account (GalagoService *service, GalagoAccount *account)
 Removes an account from a service.
const char * galago_service_normalize (const GalagoService *service, const char *username)
 Normalizes an account username based on the service's normalization flags.

Defines

#define GALAGO_CLASS_SERVICE   (galago_service_get_class())
#define GALAGO_DBUS_SERVICE_INTERFACE   "org.freedesktop.Galago.Service"
#define GALAGO_IS_SERVICE(obj)   (GALAGO_IS_OBJECT(obj) && galago_object_check_cast((obj), GALAGO_CLASS_SERVICE))

Typedefs

typedef _GalagoService GalagoService
typedef _GalagoServiceClass GalagoServiceClass
typedef _GalagoServicePrivate GalagoServicePrivate

Enumerations

enum  GalagoServiceFlags { GALAGO_PRESERVE_SPACES = 0x01, GALAGO_PRESERVE_CASE = 0x02, GALAGO_STRIP_SLASH = 0x04 }

Detailed Description

Galago Service API.

Copyright:
(C) 2004-2005 Christian Hammond
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Definition in file galago-service.h.


Enumeration Type Documentation

enum GalagoServiceFlags
 

Enumeration values:
GALAGO_PRESERVE_SPACES  Preserve spaces during normalization.
GALAGO_PRESERVE_CASE  Preserve case during normalization.
GALAGO_STRIP_SLASH  Strip a slash and everything after it during normalization.

Definition at line 31 of file galago-service.h.


Function Documentation

void galago_service_add_account GalagoService service,
GalagoAccount account
 

Adds an account to a service.

This is used internally. You don't need to call this.

Parameters:
service The service.
account The account to add.

GalagoAccount* galago_service_get_account const GalagoService service,
const char *  username,
galago_bool  query
 

Returns the account with the specified username from a service.

Parameters:
service The service.
username The account's username.
query TRUE if a remote query should be done if there is no local account found, or FALSE.
Returns:
The account, if found, or NULL.

const GalagoList* galago_service_get_accounts const GalagoService service,
galago_bool  query
 

Returns a list of all accounts in the service.

Parameters:
service The service.
query TRUE if a remote query should be done if there is no local account found, or FALSE.
Returns:
A list of all accounts in the service.

GalagoObjectClass* galago_service_get_class void   ) 
 

Returns the class for a GalagoService.

Returns:
The GalagoService class.

GalagoServiceFlags galago_service_get_flags const GalagoService service  ) 
 

Returns a service's flags.

Parameters:
service The service.
Returns:
The flags.

const char* galago_service_get_id const GalagoService service  ) 
 

Returns a service's ID.

Parameters:
service The service.
Returns:
The service's ID.

const char* galago_service_get_name const GalagoService service  ) 
 

Returns a service's name.

Parameters:
service The service.
Returns:
The service's name.

galago_bool galago_service_is_native const GalagoService service  ) 
 

Returns whether or not a service is native to the local application.

Parameters:
service The service.
Returns:
TRUE if the service is native to the local application, or FALSE if it came from another feed.

GalagoService* galago_service_new const char *  id,
const char *  name,
galago_bool  native,
GalagoServiceFlags  flags
 

Creates a service.

If native is TRUE, this service, and all accounts beneath it, will be native. Native services and accounts are fed through the local feed(s). Non-native services are a result of queries or watches.

Parameters:
id The service ID.
name The service name.
native TRUE if this service belongs to the local feed.
flags Service flags.
Returns:
The service.

const char* galago_service_normalize const GalagoService service,
const char *  username
 

Normalizes an account username based on the service's normalization flags.

The returned string is stored internally in a status buffer. If you need the string for long, make sure to strdup() it.

Parameters:
service The service.
username The username to normalize.
Returns:
The string, stored in a static buffer.

void galago_service_remove_account GalagoService service,
GalagoAccount account
 

Removes an account from a service.

This is used internally. You don't need to call this.

Parameters:
service The service.
account The account to remove.