How about a new method IA2::nRelationsOfType?

So I think you'd do something like the following:

- IEnumVARIANT* pEV = NULL
- long n = IA2::nRelationsOfType(IA2_RELATION_EMBEDS)
- long nFeteched = 0
- allocate an array of n VARIANTs
- IA2::relationsOfType(IA2_RELATION_EMBEDS, &pEV)
- pEV->Next(n, &theArray, &nFetched)

Note that the realtionsOfType [out] parameter is IEnumVARIANT**; the
prototype at
https://wiki.mozilla.org/Accessibility/IA2_1.3#Relations
is missing a *.

Pete

On 3/2/12 1:58 AM, Alexander Surkov wrote:
>> If I understand correctly, that would require a separate call to fetch each
>> relation, which might not be desirable in some cases and also defeats the
>> point of IEnumVARIANT. (If we're going to do that, we may as well have the
>> function take an additional parameter specifying the index of the relation
>> to fetch and return NULL when there are no more.)
> Nah you pass the desired amount of relations into
> IA2_EnumVariant::Next(). If you want one relation then you pass 1, if
> you want all then you pass int32_max or - 1 if you want. This could
> look like
>
> interface IA2EnumVariant : public IUknown
> {
>   HRESULT Next(
>     [in] long nItemLimit,
>     [out, size_is(nItems*)] IUnknown*** items,
>     [out, long] long* nItems)
> }
>
> Alex.
>
> On Fri, Mar 2, 2012 at 4:20 PM, James Teh <[email protected]> wrote:
>> On 2/03/2012 3:42 PM, Alexander Surkov wrote:
>>> If we add relations count as out argument then we get rid the idea of
>>> lazy relations calculation. Iirc that was a primary reason of
>>> IEnumVariant usage but I missed the point that IEnumVariant requires
>>> the AT client to allocate the memory. So I think we should introduce
>>> interface similar to IEnumVariant where the server allocates the
>>> memory. That'll be similar to IAccessibleTable2 approach.
>> If I understand correctly, that would require a separate call to fetch each
>> relation, which might not be desirable in some cases and also defeats the
>> point of IEnumVARIANT. (If we're going to do that, we may as well have the
>> function take an additional parameter specifying the index of the relation
>> to fetch and return NULL when there are no more.)
>>
>> What about a boolean specifying whether the count is desired? Alternatively,
>> the count could be an in, out parameter which doesn't return the count if
>> it's NULL, though I'm not sure if that is particularly elegant.
>>
>>
>> Jamie
>>
>> --
>> James Teh
>> Director, NV Access Limited
>> Email: [email protected]
>> Web site: http://www.nvaccess.org/
>> Phone: +61 7 5667 8372
>> _______________________________________________
>> Accessibility-ia2 mailing list
>> [email protected]
>> https://lists.linuxfoundation.org/mailman/listinfo/accessibility-ia2
> _______________________________________________
> Accessibility-ia2 mailing list
> [email protected]
> https://lists.linuxfoundation.org/mailman/listinfo/accessibility-ia2
>

-- 
*Pete Brunet*
                                                                
a11ysoft - Accessibility Architecture and Development
(512) 467-4706 (work), (512) 689-4155 (cell)
Skype: pete.brunet
IM: ptbrunet (AOL, Google), [email protected] (MSN)
http://www.a11ysoft.com/about/
Ionosphere: WS4G
_______________________________________________
Accessibility-ia2 mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/accessibility-ia2

Reply via email to