Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 09:32:48

0001 /* ATK -  Accessibility Toolkit
0002  * Copyright 2001 Sun Microsystems Inc.
0003  *
0004  * This library is free software; you can redistribute it and/or
0005  * modify it under the terms of the GNU Library General Public
0006  * License as published by the Free Software Foundation; either
0007  * version 2 of the License, or (at your option) any later version.
0008  *
0009  * This library is distributed in the hope that it will be useful,
0010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0012  * Library General Public License for more details.
0013  *
0014  * You should have received a copy of the GNU Library General Public
0015  * License along with this library; if not, write to the
0016  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
0017  * Boston, MA 02111-1307, USA.
0018  */
0019 
0020 #ifndef __ATK_DOCUMENT_H__
0021 #define __ATK_DOCUMENT_H__
0022 
0023 #if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined(__ATK_H_INSIDE__) && !defined(ATK_COMPILATION)
0024 #error "Only <atk/atk.h> can be included directly."
0025 #endif
0026 
0027 #include <atk/atkobject.h>
0028 #include <atk/atkutil.h>
0029 
0030 G_BEGIN_DECLS
0031 
0032 /*
0033  * The AtkDocument interface should be supported by any object that is a container
0034  * for 'document content' as opposed to a collection of user interface elements.
0035  *
0036  */
0037 
0038 #define ATK_TYPE_DOCUMENT (atk_document_get_type ())
0039 #define ATK_IS_DOCUMENT(obj) G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_DOCUMENT)
0040 #define ATK_DOCUMENT(obj) G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_DOCUMENT, AtkDocument)
0041 #define ATK_DOCUMENT_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), ATK_TYPE_DOCUMENT, AtkDocumentIface))
0042 
0043 /**
0044  * AtkTextSelection:
0045  * @start_object: the AtkText containing the start of the selection.
0046  * @start_offset: the text offset of the beginning of the selection within
0047  *                @start_object.
0048  * @end_object: the AtkText containing the end of the selection.
0049  * @end_offset: the text offset of the end of the selection within @end_object.
0050  * @start_is_active: a gboolean indicating whether the start of the selection
0051  *                  is the active point.
0052  *
0053  * This structure represents a single  text selection within a document. This
0054  * selection is defined by two points in the content, where each one is defined
0055  * by an AtkObject supporting the AtkText interface and a character offset
0056  * relative to it.
0057  *
0058  * The end object must appear after the start object in the accessibility tree,
0059  * i.e. the end object must be reachable from the start object by navigating
0060  * forward (next, first child etc).
0061  *
0062  * This struct also contains a @start_is_active boolean, to communicate if the
0063  * start of the selection is the active point or not.
0064  *
0065  * The active point corresponds to the user's focus or point of interest. The
0066  * user moves the active point to expand or collapse the range. The anchor
0067  * point is the other point of the range and typically remains constant. In
0068  * most cases, anchor is the start of the range and active is the end. However,
0069  * when selecting backwards (e.g. pressing shift+left arrow in a text field),
0070  * the start of the range is the active point, as the user moves this to
0071  * manipulate the selection.
0072  *
0073  * Since: 2.52
0074  */
0075 typedef struct _AtkTextSelection AtkTextSelection;
0076 struct _AtkTextSelection
0077 {
0078   AtkObject *start_object;
0079   gint start_offset;
0080   AtkObject *end_object;
0081   gint end_offset;
0082   gboolean start_is_active;
0083 };
0084 
0085 #ifndef _TYPEDEF_ATK_DOCUMENT_
0086 #define _TYPEDEF_ATK_DOCUMENT_
0087 typedef struct _AtkDocument AtkDocument;
0088 #endif
0089 typedef struct _AtkDocumentIface AtkDocumentIface;
0090 
0091 /**
0092  * AtkDocumentIface:
0093  * @get_document_type: gets a string indicating the document
0094  *   type. This virtual function is deprecated since 2.12 and it
0095  *   should not be overriden.
0096  * @get_document: a #GObject instance that implements
0097  *   AtkDocumentIface. This virtual method is deprecated since 2.12
0098  *   and it should not be overriden.
0099  * @get_document_locale: gets locale. This virtual function is
0100  *   deprecated since 2.7.90 and it should not be overriden.
0101  * @get_document_attributes: gets an AtkAttributeSet which describes
0102  *   document-wide attributes as name-value pairs.
0103  * @get_document_attribute_value: returns a string value assocciated
0104  *   with the named attribute for this document, or NULL
0105  * @set_document_attribute: sets the value of an attribute. Returns
0106  *   TRUE on success, FALSE otherwise
0107  * @get_current_page_number: gets the current page number. Since 2.12
0108  * @get_page_count: gets the page count of the document. Since 2.12
0109  */
0110 struct _AtkDocumentIface
0111 {
0112   GTypeInterface parent;
0113   const gchar *(*get_document_type) (AtkDocument *document);
0114   gpointer (*get_document) (AtkDocument *document);
0115 
0116   const gchar *(*get_document_locale) (AtkDocument *document);
0117   AtkAttributeSet *(*get_document_attributes) (AtkDocument *document);
0118   const gchar *(*get_document_attribute_value) (AtkDocument *document,
0119                                                 const gchar *attribute_name);
0120   gboolean (*set_document_attribute) (AtkDocument *document,
0121                                       const gchar *attribute_name,
0122                                       const gchar *attribute_value);
0123   gint (*get_current_page_number) (AtkDocument *document);
0124   gint (*get_page_count) (AtkDocument *document);
0125   GArray *(*get_text_selections) (AtkDocument *document);
0126   gboolean (*set_text_selections) (AtkDocument *document, GArray *selections);
0127 };
0128 
0129 ATK_AVAILABLE_IN_ALL
0130 GType atk_document_get_type (void);
0131 
0132 ATK_DEPRECATED_IN_2_12
0133 const gchar *atk_document_get_document_type (AtkDocument *document);
0134 
0135 ATK_DEPRECATED_IN_2_12
0136 gpointer atk_document_get_document (AtkDocument *document);
0137 
0138 ATK_DEPRECATED_IN_2_8_FOR (atk_object_get_object_locale)
0139 const gchar *atk_document_get_locale (AtkDocument *document);
0140 
0141 ATK_AVAILABLE_IN_ALL
0142 AtkAttributeSet *atk_document_get_attributes (AtkDocument *document);
0143 ATK_AVAILABLE_IN_ALL
0144 const gchar *atk_document_get_attribute_value (AtkDocument *document,
0145                                                const gchar *attribute_name);
0146 ATK_AVAILABLE_IN_ALL
0147 gboolean atk_document_set_attribute_value (AtkDocument *document,
0148                                            const gchar *attribute_name,
0149                                            const gchar *attribute_value);
0150 ATK_AVAILABLE_IN_2_12
0151 gint atk_document_get_current_page_number (AtkDocument *document);
0152 ATK_AVAILABLE_IN_2_12
0153 gint atk_document_get_page_count (AtkDocument *document);
0154 
0155 G_END_DECLS
0156 
0157 ATK_AVAILABLE_IN_2_52
0158 GArray *atk_document_get_text_selections (AtkDocument *document);
0159 
0160 ATK_AVAILABLE_IN_2_52
0161 gboolean atk_document_set_text_selections (AtkDocument *document, GArray *selections);
0162 #endif /* __ATK_DOCUMENT_H__ */