2002-09-13 Michael Meeks <michael@ximian.com>
[platform/core/uifw/at-spi2-atk.git] / cspi / spi_streamablecontent.c
1 /*
2  * AT-SPI - Assistive Technology Service Provider Interface
3  * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
4  *
5  * Copyright 2001, 2002 Sun Microsystems Inc.,
6  * Copyright 2001, 2002 Ximian, Inc.
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License along with this library; if not, write to the
20  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23
24 #include <cspi/spi-private.h>
25
26 /**
27  * AccessibleStreamableContent_ref:
28  * @obj: a pointer to the #AccessibleStreamableContent implementor on which to
29  *       operate.
30  *
31  * Increment the reference count for an #AccessibleStreamableContent object.
32  *
33  **/
34 void
35 AccessibleStreamableContent_ref (AccessibleStreamableContent *obj)
36 {
37   cspi_object_ref (obj);
38 }
39
40 /**
41  * AccessibleStreamableContent_unref:
42  * @obj: a pointer to the #AccessibleStreamableContent implementor
43  *       on which to operate. 
44  *
45  * Decrement the reference count for an #AccessibleStreamableContent object.
46  *
47  **/
48 void
49 AccessibleStreamableContent_unref (AccessibleStreamableContent *obj)
50 {
51   cspi_object_unref (obj);
52 }
53
54 /**
55  * AccessibleStreamableContent_getContentTypes:
56  * @obj: a pointer to the #AccessibleStreamableContent implementor on which to operate.
57  *
58  * Get a list of strings containing the content mimetypes available from an
59  *       #AccessibleStreamableContent implementor.
60  *
61  * Returns: an array of strings, terminated by a NULL string, specifying the
62  *       mimetypes for which the streamed content is available.
63  *
64  **/
65 char **
66 AccessibleStreamableContent_getContentTypes (AccessibleStreamableContent *obj)
67 {
68   char **content_types = malloc (sizeof (char *));
69   content_types [0] = NULL;
70
71   /* TODO: connect this to the correct libspi implementation code */
72   return content_types;
73 }
74
75 /**
76  * AccessibleStreamableContent_open:
77  * @obj: a pointer to the #AccessibleStreamableContent implementor on which to operate.
78  * @content_type: a string specifying the content type to retrieve (should match one
79  * of the return strings from #AccessibleStreamableContent_getContentTypes ()).
80  *
81  * Open a streaming connection to an AccessibleStreamableContent implementor,
82  *       of a particular content type
83  *
84  * Returns: #TRUE if successful, #FALSE if unsuccessful.
85  *
86  **/
87 SPIBoolean
88 AccessibleStreamableContent_open (AccessibleStreamableContent *obj,
89                                   const char *content_type)
90 {
91   /* TODO: connect this to the correct libspi implementation code */
92   return FALSE;
93 }
94
95 /**
96  * AccessibleStreamableContent_seek:
97  * @obj: a pointer to the #AccessibleStreamableContent implementor on which to operate.
98  * @offset: a long int specifying the offset into the stream.
99  * @seek_type: an enum indicating the seek offset type, may be SEEK_SET,
100  *            SEEK_CUR, SEEK_END (as in the lseek() libc command).
101  *
102  * Cause the current streamable content connection (obtained via
103  *     #AccessibleStreamableContent_open()) to seek to a particular offset in the
104  *     stream.
105  *
106  * Returns: #TRUE if successful, #FALSE if unsuccessful.
107  *
108  **/
109 SPIBoolean
110 AccessibleStreamableContent_seek (AccessibleStreamableContent *obj,
111                                   long int offset,
112                                   unsigned int seek_type)
113 {
114   /* TODO: connect this to the correct libspi implementation code */
115   return FALSE;
116 }
117
118 /**
119  * AccessibleStreamableContent_read:
120  * @obj: a pointer to the #AccessibleStreamableContent implementor on which to operate.
121  * @buff: a pointer to a buffer into which the resulting bytes read from the stream
122  *        are to be written.
123  * @nbytes: a long integer indicating the number of bytes to read/write.
124  * @read_type: currently unused, specifies behavior of reads for streamed content
125  *        if blocking is not allowed, etc.
126  *
127  * Copy (read) bytes from the currently open streamable content connection
128  *     to a buffer.
129  *
130  * Returns: an integer indicating the number of bytes read, or -1 on error.
131  *
132  **/
133 SPIBoolean
134 AccessibleStreamableContent_read (AccessibleStreamableContent *obj,
135                                   void *buff,
136                                   long int nbytes,
137                                   unsigned int read_type)
138 {
139   /* TODO: connect this to the correct libspi implementation code */
140   return -1;
141 }
142