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