Warning, file /libraries/libqaccessibilityclient/examples/accessibleapps/uiview.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*
0002     SPDX-FileCopyrightText: 2012 Sebastian Sauer <sebastian.sauer@kdab.com>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 #ifndef UIVIEW_H
0008 #define UIVIEW_H
0009 
0010 #include "qaccessibilityclient/accessibleobject.h"
0011 #include "qaccessibilityclient/registry.h"
0012 
0013 #include <QImage>
0014 #include <QPixmap>
0015 #include <QRect>
0016 #include <QScrollArea>
0017 
0018 namespace QAccessibleClient {
0019     class AccessibleObject;
0020 }
0021 
0022 class UiView;
0023 
0024 class UiWidget : public QWidget
0025 {
0026 public:
0027     UiWidget(UiView *view);
0028     void setAccessibleObject(const QAccessibleClient::AccessibleObject &acc);
0029     QSize sizeHint() const override;
0030 protected:
0031     QImage *m_image;
0032     QPixmap m_screen;
0033     QRect m_bounds;
0034     QAccessibleClient::AccessibleObject m_object;
0035     QMap<QAccessibleClient::AccessibleObject::Role, const char*> m_roleColors;
0036 
0037     void paintEvent(QPaintEvent *event) override;
0038 private:
0039     QPixmap grabScreen();
0040     QRect bounds(const QAccessibleClient::AccessibleObject &acc) const;
0041     void drawObject(QPainter *painter, const QAccessibleClient::AccessibleObject &acc, int depth = 0);
0042 };
0043 
0044 class UiView :public QScrollArea
0045 {
0046     Q_OBJECT
0047 public:
0048     UiView(QWidget *parent = nullptr);
0049     ~UiView() override;
0050 
0051     void setAccessibleObject(const QAccessibleClient::AccessibleObject &acc);
0052 
0053 private:
0054     UiWidget *m_uiWidget;
0055 
0056 };
0057 
0058 #endif