X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fat-spi2-atk.git;a=blobdiff_plain;f=cspi%2Fspi_text.c;h=13a9be40af8b8dbacc7c63efa23c1818bce34f66;hp=c63c1162f87ae75787fe486a77d199ed7ec732d6;hb=5d01be6ec7d2cb2e662c695bd4c28c50ac3f2dab;hpb=1a21cefeaa962de986a3533824611c8bc5c9cc97 diff --git a/cspi/spi_text.c b/cspi/spi_text.c index c63c116..13a9be4 100644 --- a/cspi/spi_text.c +++ b/cspi/spi_text.c @@ -267,6 +267,47 @@ AccessibleText_getAttributes (AccessibleText *obj, } /** + * AccessibleText_getDefaultAttributes: + * @obj: a pointer to the #AccessibleText object to query. + * + * Get the default attributes applied to an #AccessibleText + * object. + * The text attributes correspond to CSS attributes where possible, + * keys and values are delimited from one another via ":", and + * the delimiter between key/value pairs is ";". Thus + * "font-size:10;foreground-color:0,0,0" would be a valid + * return string. The combination of this attribute set and + * the attributes reported by #AccessibleText_getAttributes + * describes the entire set of text attributes over a range. + * + * @Since: AT-SPI 1.4 + * + * Returns: a text string describing the default attributes + * applied to a text object, (exclusive of explicitly-set + * attributes), encoded as UTF-8. + **/ +char * +AccessibleText_getDefaultAttributes (AccessibleText *obj) +{ + char *retval; + + if (obj == NULL) + { + return NULL; + } + + retval = Accessibility_Text_getDefaultAttributes (CSPI_OBJREF (obj), + cspi_ev ()); + + if (!cspi_check_ev ("getAttributes")) + { + retval = NULL; + } + + return retval; +} + +/** * AccessibleText_setCaretOffset: * @obj: a pointer to the #AccessibleText object on which to operate. * @newOffset: the offset to which the text caret is to be moved. @@ -604,6 +645,7 @@ AccessibleText_getOffsetAtPoint (AccessibleText *obj, * * Get the bounding box for text within a range in an #AccessibleText object. * + * @Since: AT-SPI 1.2 **/ void AccessibleText_getRangeExtents (AccessibleText *obj, @@ -664,6 +706,8 @@ AccessibleText_getRangeExtents (AccessibleText *obj, * Get the ranges of text from an #AccessibleText object which lie within the * bounds defined by (@x, @y) and (@x+@width, @y+@height). * + * @Since: AT-SPI 1.2 + * * Returns: a null-terminated list of pointers to AccessibleTextRange structs * detailing the bounded text. **/ @@ -701,6 +745,8 @@ AccessibleText_getBoundedRanges (AccessibleText *obj, * Free the memory used by a list of AccessibleTextRange structs. * The argument passed in should be an array of pointers * AccessibleTextRange structs. + * + * @Since: AT-SPI 1.2 **/ void AccessibleTextRange_freeRanges (AccessibleTextRange **ranges) @@ -866,4 +912,94 @@ AccessibleText_setSelection (AccessibleText *obj, } +/** + * AccessibleText_getAttributeRun: + * @obj: a pointer to the #AccessibleText object to query. + * @offset: a long integer indicating the offset from which the attribute + * search is based. + * @startOffset: a #long indicating the start of the desired text range. + * @endOffset: a #long indicating the first character past the desired range. + * @includeDefaults: a #bool if False, the call should only return those + * attributes which are explicitly set on the current attribute + * run, omitting any attributes which are inherited from the + * default values. + * + * @Since: AT-SPI 1.7 + * + * Returns: the AttributeSet defined at offset, optionally including the 'default' attributes. + **/ + +AccessibleAttributeSet * +AccessibleText_getAttributeRun (AccessibleText *obj, + long int offset, + long int *startOffset, + long int *endOffset, + long int includeDefaults){ + + CORBA_long retStartOffset, retEndOffset; + AccessibleAttributeSet *retval; + Accessibility_AttributeSet *attributes; + + if (obj == NULL) + { + *startOffset = *endOffset = -1; + return NULL; + } + attributes = Accessibility_Text_getAttributeRun (CSPI_OBJREF (obj), + offset, + &retStartOffset, + &retEndOffset, + (includeDefaults)? TRUE : FALSE, + cspi_ev ()); + + if (!cspi_check_ev ("getAttributeRun")) + { + *startOffset = *endOffset = -1; + retval = NULL; + } + else + { + *startOffset = retStartOffset; + *endOffset = retEndOffset; + } + + retval = _cspi_attribute_set_from_sequence (attributes); + + return retval; + +} + +/** + * AccessibleText_getDefaultAttributeSet: + * @obj: a pointer to the #AccessibleText object to query. + * + * + * @Since: AT-SPI 1.7 + * + * Returns: an AttributeSet containing the text attributes + * which apply to all text in the object by virtue of the + * default settings of the document, view, or user agent; e.g. + * those attributes which are implied rather than explicitly + * applied to the text object. For instance, an object whose + * entire text content has been explicitly marked as 'bold' + * will report the 'bold' attribute via getAttributeRun(), + * whereas an object whose text weight is inspecified may + * report the default or implied text weight in the default AttributeSet. + * + **/ + +AccessibleAttributeSet * +AccessibleText_getDefaultAttributeSet (AccessibleText *obj){ + AccessibleAttributeSet *retval; + Accessibility_AttributeSet *attributes; + + cspi_return_val_if_fail (obj != NULL, NULL); + + attributes = Accessibility_Text_getDefaultAttributeSet (CSPI_OBJREF (obj), cspi_ev ()); + cspi_return_val_if_ev ("getDefaultAttributeSet", NULL); + + retval = _cspi_attribute_set_from_sequence (attributes); + retval = NULL; + return retval; +}