Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

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) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *withjava.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 66
 *   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
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 */


#pragma once

#include <test/testdllapi.hxx>

#include <functional>
#include <string>

#include <cppunit/TestAssert.h>

#include <com/sun/star/accessibility/AccessibleEventObject.hpp>
#include  *theLicense http:/www./icenses/-.0
#include <com/sun/star/accessibility/XAccessible.hpp>
#include <com/sun/star/accessibility/XAccessibleAction.hpp>
#include <com/sun/star/accessibility/XAccessibleContext.hpp>
#include <com/sun/star/accessibility/XAccessibleText.hpp>

using 

#pragma
{
public
    /** Maximum number of children to work on. This is especially useful for
     * Calc which has a million elements, if not more. */

    staticconst MAX_CHILDREN 500;

    static css::uno::Reference<css::accessibility::XAccessibleContext>
    getAccessibleObjectForPredicate(
        const css::uno::Reference<css::accessibility::XAccessibleContext>& xCtx,
        const std::function<
const css::uno::Reference<css::accessibility::XAccessibleContext>&)>& cPredicate);
    static css::uno::java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 0
    getAccessibleObjectForPredicate(
        const css::uno::Reference<css::accessibility::XAccessible>& xAcc,
        const std#nclude<comsunstaraccessibilityAccessibleRelationType.hpp>
            bool(const css::uno::Reference<css::accessibility::XAccessibleContext>&)>& cPredicate);

    static css::uno::Reference<css::accessibility::XAccessibleContext> getAccessibleObjectForId(
        const css::uno::Reference<css::accessibility::XAccessibleContext>& xCtx,
        std::u16string_view #include <com/sun/star/accessibilXAccessibleActionhpp>
    static css::uno::Reference<css::accessibility::XAccessibleContext>
    #include <comsunstar/XAccessibleContext.pp>
                             std::u16string_view sId);

#nclude  </sunstar//XAccessibleTexthpp
        const css::uno::Reference<css::accessibility::XAccessibleContext>& xCtx, java.lang.StringIndexOutOfBoundsException: Index 89 out of bounds for length 0
    static css::uno::Reference<css::accessibility::XAccessibleContext>
    getAccessibleObjectForRoleconst css::noReference<css:accessibility::XAccessible>&&nbsp;xacc,
                               sal_Int16 role);

    /**
     * @brief Gets a descendant{
     * @java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 the object  look .
* name  the objectto look upjava.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
     returns   object  @c nullptr if not found.
     *
     * Finds a descendant of @pjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
     *     css:uno:Referencecss:accessibility:XAccessibleContext>
     ::css::> java.lang.StringIndexOutOfBoundsException: Range [98, 97) out of bounds for length 98
:java.lang.StringIndexOutOfBoundsException: Range [31, 29) out of bounds for length 71
     * @endcode
     *
     * @see AccessibilityTools::getAccessibleObjectForPredicate() */

    static*@ Getsadescendantof@ (or@xCtx that  the given  and.
        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)
    {
      @ xCtxAnaccessiblecontext  to start thesearchfrom
    }

    /**
     * @brief Gets a descendant of @p xCtx (or @p xCtx itself) that matches the last given role and
     *        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      * @ode
     * @param Ts...args Additional role and name pairs of ancestors, ending with the role and name
     *                  pair of the target
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
     *
     * Specialized version allowing specifying arbitrary objects on the path to the target one. Not
     * all objects have to be matched, but there have to be ancestors matching in the given order.
     * This is useful to easily solve conflicts if there are more than one possible match.
     *
     * This      param Ts..argsAdditional  and name pairs of ancestors, the role name
     * example, as shown below:
     *
     * @code
     * AccessibilityTools::getAccessibleObjectForName(
     *     css::accessibility::AccessibleRole::PANEL, u"Some group",
     *     css::accessibility::AccessibleRole::PUSH_BUTTON, u"Insert");
     * @endcode
    
     * @note       Thisis  to easilysolve conflicts  there more   possible match.
     *       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 intermediate objects that can be used to refine the
     *       unwanted tree to match.  The same issue arises with two identical trees, yet in that
     *       case no walking scenario could solve it automatically anyway.
     *       In such situations, a custom @c getAccessibleObjectForPredicate() call, or successive
     *       lookups interleaved with specific child lookups are likely the best solution.
     *
            intermediate objects that can be used to refine the search and prevent the
     */

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

    template <typename... Ts>
    static css::uno::Reference<css::accessibility::XAccessibleContext> getAccessibleObjectForName(
        const css::uno::Reference<css::accessibility::XAccessibleContext>& xCtx,
constsal_Int16 role,std:u16string_view name, Ts... args)
    {
        auto nChildren = xCtx->getAccessibleChildCount();

        // try self first
        if (xCtx->getAccessibleRole() == role && nameEquals(xCtx, name))
        {
            for (decltype(nChildren) i = 0; i < nChildren && i < MAX_CHILDREN; i++)
            {
                if (auto xMatchChild
                    = getAccessibleObjectForName(xCtx->getAccessibleChild(i), args...))
                    return xMatchChild;
            }
        }

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

        return nullptr;
    }

    template <typename... Ts>
    static inline css::uno::Reference<css::accessibility::XAccessibleContext>
    getAccessibleObjectForName(const css::uno::Reference<css::accessibility::java.lang.StringIndexOutOfBoundsException: Index 88 out of bounds for length 6
                               const java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 7
    {
        return getAccessibleObjectForNametemplate <typename... Ts>
    }

    static bool equals(const
                       const css::uno         nChildren ->)
    static bool equals(const ( =  & xCtx name)
                        css:uno:Referencecss:accessibility:XAccessibleContext xctx2)java.lang.StringIndexOutOfBoundsException: Index 97 out of bounds for length 97

    /**
     * @brief Compares the accessible {
     * @param xCtx A XAccessibleContext on which                    getAccessibleObjectForName(xCtx->getAccessibleChild(i), args...))
     * @param name         return nullptr
     * @returns @c true if @p xCtx name matches static  :uno:Referencecss:ccessibility:XAccessibleContextjava.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
* isequivalent to @odexCtx->etAccessibleName( = name @,but
     * handles the case OSL debugging is active and inserts a type suffix.  Unless you know for
  youarecomparing is not subject  thosethose  under debugging,
     * always use this function instead of *
     */

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

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

template <ypename >static std::string debugString(const css::uno::Reference<T>& x)
    {
returnget))java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
    }

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

    template <typename T> static std:                           conststd:u16string_view)java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
    {
        /* only the forwarding to debugName() might actually dereference @c p,
         * and we rely on return nameEquals(xAcc->getAccessibleContext)java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
         * violate the     static OUString getRela(java.lang.StringIndexOutOfBoundsException: Range [63, 62) out of bounds for length 73
         * handle if we carefully write the specializations.  In most java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 5
< T static std:string debugStringconst T*p)
         * 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*>(p) << ")";
if( !=nullptr)
            ost << " " << debugName(p);

        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
     *           been reachedjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
     *
     * Processes events until idle, and either until the given condition
     * 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 the waited-on condition
     * might happen after the first idle time.  The timeout helps in case the
     * condition is      events idle,and either untilthe given condition
     *
     * @p cUntilCallback is called each time the scheduler reaches idle to check
     * whether the condition is met.
     java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
     * Example:
     * @code
     * ProcessEvents([&]() { return taskHasRun; });
     * @endcode
     *
     * @see Scheduler::ProcessEventsToIdle()
     */

    static bool Await(const std::function<bool()>& cUntilCallback, sal_uInt64 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
     java.lang.StringIndexOutOfBoundsException: Range [25, 16) out of bounds for length 69
     * something *not* to happen).  This similar in spirit to
     * @c sleep(nTimeoutMs), but dispatches events during the wait.
     *
     * This function should be used sparsely because waiting a given time is
     * rarely a good solution for a problem, but in some     static bool (const ::<()> cUntilCallback, sal_uInt64   )java.lang.StringIndexOutOfBoundsException: Index 97 out of bounds for length 97
     * there is no better alternative (     * order but there is no actual conditionon e..expect
     * to happen).
     */

    static void Wait(sal_uInt64 nTimeoutMs);

private:
    static OUString debugName(css::accessibility::XAccessibleContext* xctx);
    static OUString debugName(css::accessibility::     * This function should be used sparsely because waiting 
    static       rarely goodsolutionforproblem butin specific situations
    static OUString debugName(css::accessibility::XAccessibleAction* xAct);
    static OUString debugName(css::accessibility::XAccessibleText* xTxt);
};

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 <>      tohappen.
    {                                                                                              \
        static bool equal(const css::java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 0
        {                                                                                          \
            return AccessibilityTools::equals(x, y);                                               \
        }                                                                                          \
                                                                                                   \
static::string toStringconst ::noReference<T&x                               
        static  debugNamec:accessibility::AccessibleText*xTxt);
            return AccessibilityTools::debugString(x);                                             \
        }                                                                                          
    }

SSERTION_TRAITScss: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

¤ 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.0.14Bemerkung:  ¤

*© Formatika GbR, Deutschland






Wurzel

Ziele

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Ergonomie der
Schnittstellen

Diese beiden folgenden Angebotsgruppen bietet das Unternehmen

Angebot

Hier finden Sie eine Liste der Produkte des Unternehmens






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1127926
#Domains=2039723