File indexing completed on 2025-01-26 03:28:31

0001 /*
0002     SPDX-FileCopyrightText: 2023 Montel Laurent <montel@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 #pragma once
0008 #include "libaccessibilityinspector_private_export.h"
0009 #include <QWidget>
0010 class QSplitter;
0011 class QTabWidget;
0012 class AccessibleTreeWidget;
0013 class PropertyTreeWidget;
0014 class EventsWidget;
0015 class UiView;
0016 class QSettings;
0017 namespace QAccessibleClient
0018 {
0019 class Registry;
0020 class AccessibleObject;
0021 }
0022 class LIBACCESSIBILITYINSPECTOR_TEST_EXPORT MainWidget : public QWidget
0023 {
0024     Q_OBJECT
0025 public:
0026     explicit MainWidget(QAccessibleClient::Registry *registry, QWidget *parent = nullptr);
0027     ~MainWidget() override;
0028 
0029     void copyValue();
0030     void resetModel();
0031 
0032     void saveSettings(QSettings &settings);
0033     void loadSettings(QSettings &settings);
0034 
0035     [[nodiscard]] bool followFocus() const;
0036     void setFollowFocus(bool newFollowFocus);
0037 
0038 private:
0039     void selectionChanged(const QModelIndex &current);
0040     void showClientCache();
0041 
0042     void added(const QAccessibleClient::AccessibleObject &object);
0043     void removed(const QAccessibleClient::AccessibleObject &object);
0044     void defunct(const QAccessibleClient::AccessibleObject &object);
0045 
0046     void windowCreated(const QAccessibleClient::AccessibleObject &object);
0047     void windowDestroyed(const QAccessibleClient::AccessibleObject &object);
0048     void windowClosed(const QAccessibleClient::AccessibleObject &object);
0049     void windowReparented(const QAccessibleClient::AccessibleObject &object);
0050     void windowMinimized(const QAccessibleClient::AccessibleObject &object);
0051     void windowMaximized(const QAccessibleClient::AccessibleObject &object);
0052     void windowRestored(const QAccessibleClient::AccessibleObject &object);
0053     void windowActivated(const QAccessibleClient::AccessibleObject &object);
0054     void windowDeactivated(const QAccessibleClient::AccessibleObject &object);
0055     void windowDesktopCreated(const QAccessibleClient::AccessibleObject &object);
0056     void windowDesktopDestroyed(const QAccessibleClient::AccessibleObject &object);
0057     void windowRaised(const QAccessibleClient::AccessibleObject &object);
0058     void windowLowered(const QAccessibleClient::AccessibleObject &object);
0059     void windowMoved(const QAccessibleClient::AccessibleObject &object);
0060     void windowResized(const QAccessibleClient::AccessibleObject &object);
0061     void windowShaded(const QAccessibleClient::AccessibleObject &object);
0062     void windowUnshaded(const QAccessibleClient::AccessibleObject &object);
0063 
0064     void stateChanged(const QAccessibleClient::AccessibleObject &object, const QString &state, bool active);
0065     void childAdded(const QAccessibleClient::AccessibleObject &object, int childIndex);
0066     void childRemoved(const QAccessibleClient::AccessibleObject &object, int childIndex);
0067     void visibleDataChanged(const QAccessibleClient::AccessibleObject &object);
0068     void selectionChanged2(const QAccessibleClient::AccessibleObject &object);
0069     void modelChanged(const QAccessibleClient::AccessibleObject &object);
0070 
0071     void focusChanged(const QAccessibleClient::AccessibleObject &object);
0072     void textCaretMoved(const QAccessibleClient::AccessibleObject &object, int pos);
0073     void textSelectionChanged(const QAccessibleClient::AccessibleObject &object);
0074 
0075     void textChanged(const QAccessibleClient::AccessibleObject &object, const QString &text, int startOffset, int endOffset);
0076     void textInserted(const QAccessibleClient::AccessibleObject &object, const QString &text, int startOffset, int endOffset);
0077     void textRemoved(const QAccessibleClient::AccessibleObject &object, const QString &text, int startOffset, int endOffset);
0078 
0079     void accessibleNameChanged(const QAccessibleClient::AccessibleObject &object);
0080     void accessibleDescriptionChanged(const QAccessibleClient::AccessibleObject &object);
0081 
0082     void addLog(const QAccessibleClient::AccessibleObject &object, const QString &eventName, const QString &text = QString());
0083 
0084     void updateDetails(const QAccessibleClient::AccessibleObject &object, bool force = false);
0085 
0086     void anchorClicked(const QUrl &url);
0087     bool mFollowFocus = false;
0088     QSplitter *const mSplitter;
0089     QTabWidget *const mTabWidget;
0090     AccessibleTreeWidget *const mAccessibleTreeWidget;
0091     PropertyTreeWidget *const mPropertyTreeWidget;
0092     EventsWidget *const mEventsWidget;
0093     UiView *const mUiview;
0094     QAccessibleClient::Registry *const mRegistry;
0095 };