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
displaymanager.h
Go to the documentation of this file.
1// Copyright (C) 2025 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QARKUI_DISPLAY_MANAGER_H
5#define QARKUI_DISPLAY_MANAGER_H
6
7#include <QtCore/private/qcore_ohos_p.h>
8#include <QtCore/private/qohoscommon_p.h>
9#include <QtCore/qglobal.h>
10#include <qohosdisplayinfo.h>
11
12QT_BEGIN_NAMESPACE
13
14namespace QArkUi {
15
17{
18public:
19 using JsDisplayId = QOhosDisplayInfo::JsDisplayId;
20
26
27 static std::shared_ptr<QOhosDisplayManager> create(QOhosJsState &jsState, CreateInfo createInfo);
28
30
31private:
32 QOhosDisplayManager(QOhosJsState &jsState, CreateInfo createInfo);
33
34 void registerDisplayCallbackListener(
35 QNapi::Object displayModule, const std::string &eventName,
36 QOhosConsumer<QOhosJsState &, QOhosDisplayInfo::JsDisplayId> handleFunction);
37 bool tryRegisterDisplay(QOhosJsState &jsState, JsDisplayId displayId);
38 void rebuildRegisteredDisplayList(QOhosJsState &jsState);
39
40 std::vector<QOhosDisplayInfo> m_registeredDisplayInfos;
41 std::vector<std::shared_ptr<void>> m_destroyNotifiers;
42 std::map<JsDisplayId, std::shared_ptr<void>> m_perDisplayDestroyNotifiers;
43 QOhosConsumer<QOhosJsState &, JsDisplayId, QRectF> m_availableAreaChangedCb;
44};
45
46QPoint mapFromDisplayToGlobal(const QPoint &displayOffset, QOhosDisplayInfo::JsDisplayId jsDisplayId);
47
48}
49
50QT_END_NAMESPACE
51
52#endif
std::vector< QOhosDisplayInfo > getRegisteredDisplayInfos()
static std::shared_ptr< QOhosDisplayManager > create(QOhosJsState &jsState, CreateInfo createInfo)
QOhosDisplayInfo::JsDisplayId JsDisplayId
QPoint mapFromDisplayToGlobal(const QPoint &displayOffset, QOhosDisplayInfo::JsDisplayId jsDisplayId)
Combined button and popup list for selecting options.
QOhosConsumer< QOhosJsState &, JsDisplayId, QRectF > displayAvailableAreaChangedCb