9a2db99146adc6bc4568d154f3bf1995d385851d
[platform/core/uifw/at-spi2-atk.git] / cspi / spi_streamablecontent.c
1 #include <cspi/spi-private.h>
2
3 /**
4  * AccessibleStreamableContent_ref:
5  * @obj: a pointer to the #AccessibleStreamableContent implementor on which to
6  *       operate.
7  *
8  * Increment the reference count for an #AccessibleStreamableContent object.
9  *
10  **/
11 void
12 AccessibleStreamableContent_ref (AccessibleStreamableContent *obj)
13 {
14   cspi_object_ref (obj);
15 }
16
17 /**
18  * AccessibleStreamableContent_unref:
19  * @obj: a pointer to the #AccessibleStreamableContent implementor
20  *       on which to operate. 
21  *
22  * Decrement the reference count for an #AccessibleStreamableContent object.
23  *
24  **/
25 void
26 AccessibleStreamableContent_unref (AccessibleStreamableContent *obj)
27 {
28   cspi_object_unref (obj);
29 }
30
31 /**
32  * AccessibleStreamableContent_getContentTypes:
33  * @obj: a pointer to the #AccessibleStreamableContent implementor on which to operate.
34  *
35  * Get a list of strings containing the content mimetypes available from an
36  *       #AccessibleStreamableContent implementor.
37  *
38  * Returns: an array of strings, terminated by a NULL string, specifying the
39  *       mimetypes for which the streamed content is available.
40  *
41  **/
42 char **
43 AccessibleStreamableContent_getContentTypes (AccessibleStreamableContent *obj)
44 {
45   char **content_types = malloc (sizeof (char *));
46   content_types [0] = NULL;
47
48   /* TODO: connect this to the correct libspi implementation code */
49   return content_types;
50 }
51
52 /**
53  * AccessibleStreamableContent_open:
54  * @obj: a pointer to the #AccessibleStreamableContent implementor on which to operate.
55  * @content_type: a string specifying the content type to retrieve (should match one
56  * of the return strings from #AccessibleStreamableContent_getContentTypes ()).
57  *
58  * Open a streaming connection to an AccessibleStreamableContent implementor,
59  *       of a particular content type
60  *
61  * Returns: #TRUE if successful, #FALSE if unsuccessful.
62  *
63  **/
64 SPIBoolean
65 AccessibleStreamableContent_open (AccessibleStreamableContent *obj,
66                                   const char *content_type)
67 {
68   /* TODO: connect this to the correct libspi implementation code */
69   return FALSE;
70 }
71
72 /**
73  * AccessibleStreamableContent_seek:
74  * @obj: a pointer to the #AccessibleStreamableContent implementor on which to operate.
75  * @offset: a long int specifying the offset into the stream.
76  * @seek_type: an enum indicating the seek offset type, may be SEEK_SET,
77  *            SEEK_CUR, SEEK_END (as in the lseek() libc command).
78  *
79  * Cause the current streamable content connection (obtained via
80  *     #AccessibleStreamableContent_open()) to seek to a particular offset in the
81  *     stream.
82  *
83  * Returns: #TRUE if successful, #FALSE if unsuccessful.
84  *
85  **/
86 SPIBoolean
87 AccessibleStreamableContent_seek (AccessibleStreamableContent *obj,
88                                   long int offset,
89                                   unsigned int seek_type)
90 {
91   /* TODO: connect this to the correct libspi implementation code */
92   return FALSE;
93 }
94
95 /**
96  * AccessibleStreamableContent_read:
97  * @obj: a pointer to the #AccessibleStreamableContent implementor on which to operate.
98  * @buff: a pointer to a buffer into which the resulting bytes read from the stream
99  *        are to be written.
100  * @nbytes: a long integer indicating the number of bytes to read/write.
101  * @read_type: currently unused, specifies behavior of reads for streamed content
102  *        if blocking is not allowed, etc.
103  *
104  * Copy (read) bytes from the currently open streamable content connection
105  *     to a buffer.
106  *
107  * Returns: an integer indicating the number of bytes read, or -1 on error.
108  *
109  **/
110 SPIBoolean
111 AccessibleStreamableContent_read (AccessibleStreamableContent *obj,
112                                   void *buff,
113                                   long int nbytes,
114                                   unsigned int read_type)
115 {
116   /* TODO: connect this to the correct libspi implementation code */
117   return -1;
118 }
119