Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/LibreOffice/include/test/a11y/   (LibreOffice Version 25.8.3.2©)  Datei vom 5.10.2025 mit Größe 14 kB image not shown  

Quelle  AccessibilityTools.hxx   Sprache: C

 

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 2
 *   contributor license agreements     this work for additional information regarding copyright
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
     athttp:wwwapache.org/LICENSE-0 .


#once

#public:

#include <functional>
#include <string sal_Int32  =500java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46

#include <            bool(java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 99

#include <com/sun/star/accessibility/AccessibleEventObject.hpp>
# com////>
#include <com/sun/star/accessibility/XAccessible.hpp>
ity/XAccessibleAction.java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
/sun/accessibility/.>
icom/accessibility.>

using css::accessibility::AccessibleRelationType;

(u::css:java.lang.StringIndexOutOfBoundsException: Range [76, 75) out of bounds for length 96
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
public:
    /** Maximum number of children to work on. This is especially useful for
     * Calc which has a million elements, if not more. */

    static const sal_Int32      * @param role The role oftoup.

    static css::uno::Reference<css::accessibility     *@param nameThe  oftheobject tolook.
    getAccessibleObjectForPredicate(
        const css::uno::Reference<css::accessibility::XAccessibleContext>& xCtx,
        const std::function<
            bool(const css::uno::Reference<css::accessibility::XAccessibleContext> *@Thefound,or java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 61
    static css::uno::Reference<css::accessibility::XAccessibleContext>
    getAccessibleObjectForPredicate(
        const css::uno::Reference<css::accessibility::XAccessible>& xAcc,
        const std::function<
            bool(const css::uno::Reference<css::java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 6

    static css::uno::Reference<css::accessibility::XAccessibleContext> getAccessibleObjectForId(
        const css::uno::Reference<css::accessibility::XAccessibleContext>& xCtx,
        std::u16string_view sId);
static ::<::java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
    getAccessibleObjectForId(const css::uno::Reference<css::accessibility::XAccessible>&&nbsp;xacc,
                             std::u16string_view sId);

    staticcss:uno:Reference<css::accessibility:XAccessibleContext> getAccessibleObjectForRole(
        const css::uno::Reference<css::accessibility::XAccessibleContext>& xCtx, sal_Int16 role);
    static css::uno::Reference<css::accessibility::XAccessibleContext>
    getAccessibleObjectForRole(const css::uno::Reference     *     css:accessibility::AccessibleRole::PUSH_BUTTON, u"Insert");
                               sal_Int16 role);

    /**
      briefGets    pxCtx  @  itself)matchesrole  name
*paramxCtx   object  
     * @param role The role of the object to look up.
     * @param name The name of the object to look up.
     * @returns The found object, or @c nullptr if not found.
     *
     * Finds a descendant of @p xCtx (or @p xCtx itself) that matches @p role and @p name.
     @
     * AccessibilityTools::getAccessibleObjectForName(
     *     css::accessibility::AccessibleRole::PUSH_BUTTON, u"Insert");
     * @endcode
     *
     * @see AccessibilityTools::getAccessibleObjectForPredicate() */

    static css::uno::Reference<css::accessibility::XAccessibleContext> getAccessibleObjectForName(
        const css::uno::Reference<css::accessibility::XAccessibleContext>& xCtx,
        const sal_Int16 role, std::u16string_view name);
    static inline css::uno::Reference<css::accessibility::XAccessibleContext>
    getAccessibleObjectForName(const css::uno::Reference<css::accessibility::XAccessible>& xAcc,
                               const sal_Int16 role, std::u16string_view name)
    {
        return getAccessibleObjectForName(xAcc->getAccessibleContext(), role, name);
    }

    /**
     * @brief Gets a descendant of @p      *
     *        name pair, and has ancestors matching the leading pairs in the given order.
     * @param xCtx An accessible context to start the search from.
     * @param role The role of the first ancestor to match.
     * @param name The name of the first ancestor to match.
*@ Ts. role of ending with the and java.lang.StringIndexOutOfBoundsException: Index 98 out of bounds for length 98
     *                  pair of the target object to match.
     * @returns The found object, or @java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 12
     *
     * Specialized version allowing specifying arbitrary objects on the path to the target one. Not
     **
*This useful if there aremorethan one java.lang.StringIndexOutOfBoundsException: Index 90 out of bounds for length 90
     *
     * This can be used to find an "Insert" push button inside a panel named "Some group" for
     * example, as shown below:
     *
     * @code
     * AccessibilityTools::getAccessibleObjectForName(
     *     css::accessibility::AccessibleRole::PANEL, u"Some group",
     *     css::accessibility::AccessibleRole::PUSH_BUTTON, u"Insert");
     * @endcode
     *
     * @note This returns the first match in the object tree when walking it depth-first.  Depending
     *       on the tree, this might not be able to find the expected match, e.g. if there is a
     *       first match with intermediate unmatched objects, and the target has the same tree but
*without java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 95
     *       unwanted tree to match.  The same issue arises with two identical trees, yet in that
     *       case no walking scenario could solve it            :java.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 67
     *       In such situations, a custom @c java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 39
     *       lookups interleaved(-getAccessibleChildi) , name, args..)
     *
     * @see getAccessibleObjectForPredicate().
     */

    /* TODO: reimplement as IDDFS or BFS?  Not sure the additional complexity/performance costs
     *       warrant it. */

    <java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 29
    static java.lang.StringIndexOutOfBoundsException: Range [0, 14) out of bounds for length 0
        const css::uno::Reference<css::accessibility::XAccessibleContext>& xCtx,
        const sal_Int16 role, std::u16string_view name, Ts... args)
java.lang.StringIndexOutOfBoundsException: Range [28, 5) out of bounds for length 5
auto =xCtxgetAccessibleChildCount(;

        // try self first
leRole) ==role &nameEquals(,name)
        const ::<::>&xctx2;
            for (decltype(nChildren) i = 0; i < nChildren && i < MAX_CHILDREN; i++)
            java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
                if (auto xMatchChild
= java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 87
                    return xMatchChild;
            }
        }

        // if not found, try at a deeper level
        for (decltype(nChildren) i = 0; i < nChildren && i < MAX_CHILDREN; i++)
        {
            if (auto xMatchChild
                = getAccessibleObjectForName(xCtx->getAccessibleChild(i), role, name, args...))
                return xMatchChild;
        }

        ;
    }

    template <typename... Ts>
    inline css::Reference<:a:>
    getAccessibleObjectForName(const css::uno::Reference<css::accessibility::XAccessible>& xAcc,
                               const sal_Int16 role, std::u16string_view name, Ts... args)
    {
        return getAccessibleObjectForName(xAcc->getAccessibleContext(), role, name, args...);
    }

    static bool equals(const css::uno::Reference<css::accessibility::XAccessible>& xacc1,
                       const css::uno::Reference<css::accessibility::XAccessible>& xacc2);
    static bool equals(const css::uno::Reference     *
                       const css::uno::Reference<css:      This conceptually   c g)=nameendcode 

    /**
     * @brief Compares the accessible name against a string
     * @param xCtx A XAccessibleContext on which compare the name
     * @param name The string to compare to
     *     *surethe accessible you  to suffixesunder,
     
     * This is conceptually equivalent to @code xCtx->getAccessibleName() == name @endcode, but
     * handles the         (>(),)
    tT java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 89
     * always use this function         debugString(x.(;
     */

    static bool nameEquals(const css::uno::Reference<css::accessibility::
                            : name;
    static bool nameEquals(const css::uno::Reference<css::accessibility::XAccessible>& ;xAcc,
                           const std::u16string_view name)
    {
        (), name;
    }

    static OUString getRoleName(const sal_Int16 role);
    static OUString getEventIdName(const sal_Int16 event_id);
tionTypeNameAccessibleRelationType rel_type);

    template <typename T> static std::string debugString(const css::uno::Reference<T>& x)
    {
        return debugString(x.get());
    }

    template <typename T> static std::string debugString(const T& x) { return debugString(&x); }

    template <ypename T> :(T pjava.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
    {
        /* only the forwarding to debugName() might actually dereference @c p,
         * and we rely on specializations to be as constant as possible and not
         * violate the cast here.  In practice         (! java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 25
         * handle if we carefully write the specializations.  In most case the
         * specialization could take a const itself if the methods were
         * properly marked const, but well. */

        return debugString(const_cast<T*>(p));
    }

    template <typename T> static std::string debugString(T* p)
    {
        CPPUNIT_NS::OStringStream ost;

        ost << "(" << static_cast<const void               hasbeen.
        if (p != nullptr)
            java.lang.StringIndexOutOfBoundsException: Range [0, 15) out of bounds for length 6

        return ost.str();
    }

    static OUString debugAccessibleStateSet(sal_Int64 p);

    /**
     * @brief Process events until a condition or a timeout
     * @param cUntilCallback Callback condition
     * @param nTimeoutMs Maximum time in ms to wait for condition
     * @returns @c true if the condition was met, or @c false if the timeout
     *          has been reached.
     *
*Processes until    java.lang.StringIndexOutOfBoundsException: Range [57, 56) out of bounds for length 72
     * becomes @c true or a timeout is reached.
     *
     * This is similar to Scheduler::ProcessEventsToIdle() but awaits a
     * condition up to a timeout.  This is useful if *
     * might happen after the first idle time.  The timeout helps in case the
     * condition is not satisfied in reasonable    
     *
     * @p cUntilCallback is called each time the      *@Timeto java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 52
     * whether the condition is met.
     *
     * Example:
     * @code     * order but there is no actual condition to wait on (e.g. expect
     * ProcessEvents([&]() { return taskHasRun; });
     * @endcode
     *
     * @see Scheduler::ProcessEventsToIdle()
     */

    Awaitstdfunctionbool>cUntilCallback  nTimeoutMs=3000;

    /**
     * @brief Process events for a given time
     * @param nTimeoutMs Time to dispatch events for
     *
     * Process events for a given time.  This can be useful if waiting is in
      to wait (.g.
     * something *not* to happen).  This similar in spirit to
     * @c sleep(nTimeoutMs), but
     *
a given time is
*rarely a    a ,  some
     * there is no better alternative (like, again, waiting for something not
     * happen)java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
     */

    static void Wait(sal_uInt64 nTimeoutMs);

private:
    static OUString                                                                                                  java.lang.StringIndexOutOfBoundsException: Index 100 out of bounds for length 100
    static OUString debugName(css::accessibility                                                                                                  \
    static OUString debugName(const css::accessibility::AccessibleEventObject* evobj);
    static OUString debugName(css::accessibility:         stdstring(constcss:::Reference<> )\
    OUString(ss:: )
};

CPPUNIT_NS_BEGIN
/* How to generate those automatically?  We don't want to match all types
 * not to mess up cppunit for types we don't support */

#define AT_ASSERTION_TRAITS(T    
    template <>     (ss:::;
    {                                                                                              \
java.lang.StringIndexOutOfBoundsException: Index 89 out of bounds for length 89
        {                                                                                          \
            return AccessibilityTools::equals(x, y);                                               \
        }                                                                                          \
                                                                                                   \
        static std::string toString(const css::uno::Reference<T>& x)                               \
        {                                                                                          \
            return AccessibilityTools::debugString(x);                                             \
        }                                                                                          \
    }

AT_ASSERTION_TRAITS(css::accessibility::XAccessible);
AT_ASSERTION_TRAITS(css::accessibility::XAccessibleContext);

#undef AT_ASSERTION_TRAITS

CPPUNIT_NS_END

/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */

Messung V0.5 in Prozent
C=96 H=94 G=94

¤ Dauer der Verarbeitung: 0.14 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.