other-licenses/atk-1.0/atk/atkstreamablecontent.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/other-licenses/atk-1.0/atk/atkstreamablecontent.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,107 @@
     1.4 +/* ATK -  Accessibility Toolkit
     1.5 + * Copyright 2001 Sun Microsystems Inc.
     1.6 + *
     1.7 + * This library is free software; you can redistribute it and/or
     1.8 + * modify it under the terms of the GNU Library General Public
     1.9 + * License as published by the Free Software Foundation; either
    1.10 + * version 2 of the License, or (at your option) any later version.
    1.11 + *
    1.12 + * This library is distributed in the hope that it will be useful,
    1.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.15 + * Library General Public License for more details.
    1.16 + *
    1.17 + * You should have received a copy of the GNU Library General Public
    1.18 + * License along with this library; if not, write to the
    1.19 + * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    1.20 + * Boston, MA 02111-1307, USA.
    1.21 + */
    1.22 +
    1.23 +#ifndef __ATK_STREAMABLE_CONTENT_H__
    1.24 +#define __ATK_STREAMABLE_CONTENT_H__
    1.25 +
    1.26 +#include <atk/atkobject.h>
    1.27 +
    1.28 +#ifdef __cplusplus
    1.29 +extern "C" {
    1.30 +#endif /* __cplusplus */
    1.31 +
    1.32 +#define ATK_TYPE_STREAMABLE_CONTENT           (atk_streamable_content_get_type ())
    1.33 +#define ATK_IS_STREAMABLE_CONTENT(obj)        G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_STREAMABLE_CONTENT)
    1.34 +#define ATK_STREAMABLE_CONTENT(obj)           G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_STREAMABLE_CONTENT, AtkStreamableContent)
    1.35 +#define ATK_STREAMABLE_CONTENT_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), ATK_TYPE_STREAMABLE_CONTENT, AtkStreamableContentIface))
    1.36 +
    1.37 +#ifndef _TYPEDEF_ATK_STREAMABLE_CONTENT
    1.38 +#define _TYPEDEF_ATK_STREAMABLE_CONTENT
    1.39 +typedef struct _AtkStreamableContent AtkStreamableContent;
    1.40 +#endif
    1.41 +typedef struct _AtkStreamableContentIface AtkStreamableContentIface;
    1.42 +
    1.43 +struct _AtkStreamableContentIface
    1.44 +{
    1.45 +  GTypeInterface parent;
    1.46 +
    1.47 +  /*
    1.48 +   * Get the number of mime types supported by this object
    1.49 +   */
    1.50 +  gint                      (* get_n_mime_types)  (AtkStreamableContent     *streamable);
    1.51 +  /*
    1.52 +   * Gets the specified mime type supported by this object.
    1.53 +   * The mime types are 0-based so the first mime type is 
    1.54 +   * at index 0, the second at index 1 and so on.  The mime-type
    1.55 +   * at index 0 should be considered the "default" data type for the stream.
    1.56 +   *
    1.57 +   * This assumes that the strings for the mime types are stored in the
    1.58 +   * AtkStreamableContent. Alternatively the G_CONST_RETURN could be removed
    1.59 +   * and the caller would be responsible for calling g_free() on the
    1.60 +   * returned value.
    1.61 +   */
    1.62 +  G_CONST_RETURN gchar*     (* get_mime_type)     (AtkStreamableContent     *streamable,
    1.63 +                                                   gint                     i);
    1.64 +  /*
    1.65 +   * One possible implementation for this method is that it constructs the
    1.66 +   * content appropriate for the mime type and then creates a temporary
    1.67 +   * file containing the content, opens the file and then calls
    1.68 +   * g_io_channel_unix_new_fd().
    1.69 +   */
    1.70 +  GIOChannel*               (* get_stream)        (AtkStreamableContent     *streamable,
    1.71 +                                                   const gchar              *mime_type);
    1.72 +
    1.73 +/*
    1.74 + * Returns a string representing a URI in IETF standard format
    1.75 + * (see http://www.ietf.org/rfc/rfc2396.txt) from which the object's content
    1.76 + * may be streamed in the specified mime-type.
    1.77 + * If mime_type is NULL, the URI for the default (and possibly only) mime-type is
    1.78 + * returned.
    1.79 + *
    1.80 + * returns NULL if the mime-type is not supported, or if no URI can be 
    1.81 + * constructed.  Note that it is possible for get_uri to return NULL but for
    1.82 + * get_stream to work nonetheless, since not all GIOChannels connect to URIs.
    1.83 + */
    1.84 +    G_CONST_RETURN  gchar*  (* get_uri)           (AtkStreamableContent     *streamable,
    1.85 +                                                   const gchar              *mime_type);
    1.86 +
    1.87 +
    1.88 +  AtkFunction               pad1;
    1.89 +  AtkFunction               pad2;
    1.90 +  AtkFunction               pad3;
    1.91 +};
    1.92 +GType                  atk_streamable_content_get_type (void);
    1.93 +
    1.94 +gint                   atk_streamable_content_get_n_mime_types (AtkStreamableContent     *streamable);
    1.95 +                                                       
    1.96 +G_CONST_RETURN gchar*  atk_streamable_content_get_mime_type    (AtkStreamableContent     *streamable,
    1.97 +                                                                gint                     i);
    1.98 +GIOChannel*             atk_streamable_content_get_stream       (AtkStreamableContent     *streamable,
    1.99 +                                                                 const gchar              *mime_type);
   1.100 +
   1.101 +gchar*                  atk_streamable_content_get_uri          (AtkStreamableContent     *streamable,
   1.102 +                                                                 const gchar              *mime_type);
   1.103 +
   1.104 +
   1.105 +#ifdef __cplusplus
   1.106 +}
   1.107 +#endif /* __cplusplus */
   1.108 +
   1.109 +
   1.110 +#endif /* __ATK_STREAMABLE_CONTENT_H__ */

mercurial