added Friend (a data container)
[hermes] / package / src / org / maemo / hermes / engine / provider.py
1 class Provider:
2     """The notional `Provider' which defines the interface which all service
3        providers for Hermes must meet. Implementations of this class are expected
4        to load their preferences on construction, display them through open_preferences
5        and pass them to the service object as necessary. 
6        
7        Copyright (c) Andrew Flegg <andrew@bleb.org> 2010.
8        Released under the Artistic Licence."""
9
10
11     # -----------------------------------------------------------------------
12     def get_name(self):
13         """Return the display name of this service. An icon, of with the lower-case,
14            all-alphabetic version of this name is expected to be provided."""
15            
16         return None
17     
18     
19     # -----------------------------------------------------------------------
20     def has_preferences(self):
21         """Whether or not this provider has any preferences. If it does not,
22            open_preferences must NOT be called; as the behaviour is undetermined."""
23            
24         return False
25     
26     
27     # -----------------------------------------------------------------------
28     def open_preferences(self, parent):
29         """Open the preferences for this provider as a child of the 'parent' widget."""
30         
31         pass
32
33     
34     # -----------------------------------------------------------------------
35     def service(self, gui_callback):
36         """Return the service backend. This must be a class which implements the
37            following methods:
38                * get_friends
39                * process_contact
40                * finalise
41         
42            See Service for more details."""
43            
44         return None