Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qandroidplatformscreen.h
Go to the documentation of this file.
1// Copyright (C) 2014 BogDan Vatra <bogdan@kde.org>
2// Copyright (C) 2016 The Qt Company Ltd.
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
5#ifndef QANDROIDPLATFORMSCREEN_H
6#define QANDROIDPLATFORMSCREEN_H
7
8#include <QList>
9#include <QPainter>
10#include <QTimer>
11#include <QWaitCondition>
12#include <QtCore/QJniObject>
13#include <qpa/qplatformscreen.h>
14#include <QtGui/qscreen_platform.h>
15
16QT_BEGIN_NAMESPACE
17
18class QAndroidPlatformWindow;
19
21 public QPlatformScreen,
23{
25public:
28
29 QRect geometry() const override { return QRect(QPoint(), m_size); }
30 QRect availableGeometry() const override { return m_availableGeometry; }
31 int depth() const override { return m_depth; }
32 QImage::Format format() const override { return m_format; }
33 QSizeF physicalSize() const override { return m_physicalSize; }
34
35 QString name() const override { return m_name; }
36 QList<Mode> modes() const override { return m_modes; }
37 int currentMode() const override { return m_currentMode; }
38 int preferredMode() const override { return m_currentMode; }
39 qreal refreshRate() const override { return m_refreshRate; }
40 inline QWindow *topVisibleWindow() const;
41 QWindow *topLevelAt(const QPoint & p) const override;
42
43 void addWindow(QAndroidPlatformWindow *window);
44 void removeWindow(QAndroidPlatformWindow *window);
45 void raise(QAndroidPlatformWindow *window);
46 void lower(QAndroidPlatformWindow *window);
48 int displayId() const override;
49
51 static QSize sizeForDisplayId(int displayId);
52
53public slots:
54 void setPhysicalSize(const QSize &size);
55 void setPhysicalSizeFromPixels(const QSize &size);
56 void setAvailableGeometry(const QRect &rect);
57 void setSize(const QSize &size);
58 void setRefreshRate(qreal refreshRate);
59 void setOrientation(Qt::ScreenOrientation orientation);
60
61protected:
72 int m_displayId = -1;
73 int m_xdpi;
74 int m_ydpi;
75
76private:
77 QDpi logicalDpi() const override;
78 QDpi logicalBaseDpi() const override;
79 Qt::ScreenOrientation orientation() const override;
80 Qt::ScreenOrientation nativeOrientation() const override;
81 void applicationStateChanged(Qt::ApplicationState);
82private:
83 QSize m_size;
84};
85
86QT_END_NAMESPACE
87#endif
jboolean setSelection(jint start, jint end)
bool isValid() const override
Returns input context validity.
jint getCursorCapsMode(jint reqModes)
QString getSelectedText(jint flags)
bool isAnimating() const override
This function can be reimplemented to return true whenever input method is animating shown or hidden.
QString getTextAfterCursor(jint length, jint flags)
void reportFullscreenMode(jboolean enabled)
QRectF keyboardRect() const override
This function can be reimplemented to return virtual keyboard rectangle in currently active window co...
void reset() override
Method to be called when input method needs to be reset.
void hideInputPanel() override
Request to hide input panel.
void setFocusObject(QObject *object) override
This virtual method gets called to notify updated focus to object.
jboolean setComposingRegion(jint start, jint end)
static QAndroidInputContext * androidInputContext()
void update(Qt::InputMethodQueries queries) override
Notification on editor updates.
QString getTextBeforeCursor(jint length, jint flags)
void sendShortcut(const QKeySequence &)
void invokeAction(QInputMethod::Action action, int cursorPosition) override
Called when the word currently being composed in the input item is tapped by the user.
jboolean deleteSurroundingText(jint leftLength, jint rightLength)
void handleLocationChanged(int handleId, int x, int y)
void showInputPanel() override
Request to show input panel.
const ExtractedText & getExtractedText(jint hintMaxChars, jint hintMaxLines, jint flags)
bool isInputPanelVisible() const override
Returns input panel visibility status.
QPlatformFontDatabase * fontDatabase() const override
Accessor for the platform integration's fontdatabase.
void initialize() override
Performs initialization steps that depend on having an event dispatcher available.
QPlatformInputContext * inputContext() const override
Returns the platforms input context.
QStringList themeNames() const override
QPlatformNativeInterface * nativeInterface() const override
void setScreenSize(int width, int height)
void setPhysicalSize(int width, int height)
bool hasCapability(QPlatformIntegration::Capability cap) const override
void setTouchDevice(QPointingDevice *touchDevice)
QPlatformClipboard * clipboard() const override
Accessor for the platform integration's clipboard.
static void updateColorScheme(Qt::ColorScheme colorScheme)
Qt::WindowState defaultWindowState(Qt::WindowFlags flags) const override
QAndroidPlatformIntegration(const QStringList &paramList)
QAbstractEventDispatcher * createEventDispatcher() const override
Factory function for the GUI event dispatcher.
QVariant styleHint(StyleHint hint) const override
static void setScreenOrientation(Qt::ScreenOrientation currentOrientation, Qt::ScreenOrientation nativeOrientation)
QPlatformServices * services() const override
void customEvent(QEvent *event) override
This event handler can be reimplemented in a subclass to receive custom events.
void * nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) override
void * nativeResourceForIntegration(const QByteArray &resource) override
std::shared_ptr< AndroidStyle > m_androidStyle
Qt::ScreenOrientation orientation() const override
Reimplement this function in subclass to return the current orientation of the screen,...
QSizeF physicalSize() const override
Reimplement this function in subclass to return the physical size of the screen, in millimeters.
QString name() const override
int currentMode() const override
Reimplement this function in subclass to return the index of the current mode from the modes list.
void setPhysicalSizeFromPixels(const QSize &size)
static QRect & defaultAvailableGeometry()
QList< QAndroidPlatformWindow * > WindowStackType
QDpi logicalBaseDpi() const override
Reimplement to return the base logical DPI for the platform.
QDpi logicalDpi() const override
Reimplement this function in subclass to return the logical horizontal and vertical dots per inch met...
QRect geometry() const override
Reimplement in subclass to return the pixel geometry of the screen.
int preferredMode() const override
Reimplement this function in subclass to return the preferred mode index from the modes list.
void setOrientation(Qt::ScreenOrientation orientation)
QRect availableGeometry() const override
Reimplement in subclass to return the pixel geometry of the available space This normally is the desk...
static QSize sizeForDisplayId(int displayId)
Qt::ScreenOrientation nativeOrientation() const override
Reimplement this function in subclass to return the native orientation of the screen,...
QImage::Format format() const override
Reimplement in subclass to return the image format which corresponds to the screen format.
void setSize(const QSize &size)
void setRefreshRate(qreal refreshRate)
QList< Mode > modes() const override
Reimplement this function in subclass to return the list of modes for this screen.
qreal refreshRate() const override
Reimplement this function in subclass to return the vertical refresh rate of the screen,...
int depth() const override
Reimplement in subclass to return current depth of the screen.