1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 """Interface implemented by classes wishing to provide application
17 resources."""
18
19 from muntjac.terminal.resource import IResource
20
21
23 """This interface must be implemented by classes wishing to provide
24 Application resources.
25
26 C{IApplicationResource} are a set of named resources (pictures, sounds,
27 etc) associated with some specific application. Having named application
28 resources provides a convenient method for having inter-theme common
29 resources for an application.
30
31 @author: Vaadin Ltd.
32 @author: Richard Lincoln
33 @version: 1.1.2
34 """
35
36 DEFAULT_CACHETIME = 1000 * 60 * 60 * 24
37
39 """Gets resource as stream."""
40 raise NotImplementedError
41
42
44 """Gets the application of the resource."""
45 raise NotImplementedError
46
47
49 """Gets the virtual filename for this resource.
50
51 @return: the file name associated to this resource.
52 """
53 raise NotImplementedError
54
55
57 """Gets the length of cache expiration time.
58
59 This gives the adapter the possibility cache streams sent to the
60 client. The caching may be made in adapter or at the client if the
61 client supports caching. Default is C{DEFAULT_CACHETIME}.
62
63 @return: Cache time in milliseconds
64 """
65 raise NotImplementedError
66
67
69 """Gets the size of the download buffer used for this resource.
70
71 If the buffer size is 0, the buffer size is decided by the terminal
72 adapter. The default value is 0.
73
74 @return: the size of the buffer in bytes.
75 """
76 raise NotImplementedError
77