* configure.in:
[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  * @fp: a pointer to a FILE pointer into which is placed a file handle suitable for
58  *      reading the content, if possible.  Not all content types support file-handle
59  *      interaction, so check this parameter for NULL before use.
60  *
61  * Open a streaming connection to an AccessibleStreamableContent implementor,
62  *       of a particular content type
63  *
64  * Returns: #TRUE if successful, #FALSE if unsuccessful.
65  *
66  **/
67 SPIBoolean
68 AccessibleStreamableContent_open (AccessibleStreamableContent *obj,
69                                   const char *content_type)
70 {
71   /* TODO: connect this to the correct libspi implementation code */
72   return FALSE;
73 }
74
75 /**
76  * AccessibleStreamableContent_seek:
77  * @obj: a pointer to the #AccessibleStreamableContent implementor on which to operate.
78  * @offset: a long int specifying the offset into the stream.
79  * @seek_type: an enum indicating the seek offset type, may be SEEK_SET,
80  *            SEEK_CUR, SEEK_END (as in the lseek() libc command).
81  *
82  * Cause the current streamable content connection (obtained via
83  *     #AccessibleStreamableContent_open()) to seek to a particular offset in the
84  *     stream.
85  *
86  * Returns: #TRUE if successful, #FALSE if unsuccessful.
87  *
88  **/
89 SPIBoolean
90 AccessibleStreamableContent_seek (AccessibleStreamableContent *obj,
91                                   long int offset)
92 {
93   /* TODO: connect this to the correct libspi implementation code */
94   return FALSE;
95 }
96
97 /**
98  * AccessibleStreamableContent_read:
99  * @obj: a pointer to the #AccessibleStreamableContent implementor on which to operate.
100  * @buff: a pointer to a buffer into which the resulting bytes read from the stream
101  *        are to be written.
102  * @nbytes: a long integer indicating the number of bytes to read/write.
103  * @read_type: currently unused, specifies behavior of reads for streamed content
104  *        if blocking is not allowed, etc.
105  *
106  * Copy (read) bytes from the currently open streamable content connection
107  *     to a buffer.
108  *
109  * Returns: an integer indicating the number of bytes read, or -1 on error.
110  *
111  **/
112 SPIBoolean
113 AccessibleStreamableContent_read (AccessibleStreamableContent *obj,
114                                   void *buff,
115                                   long int nbytes,
116                                   unsigned int read_type)
117 {
118   /* TODO: connect this to the correct libspi implementation code */
119   return -1;
120 }
121