KTextAddons

types.h
1/*
2SPDX-FileCopyrightText: 2024 Joshua Goins <josh@redstrate.com>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include <QQmlEngine>
10
11#include <TextEmoticonsCore/EmojiModelManager>
12#include <TextEmoticonsCore/EmojiProxyModel>
13#include <TextEmoticonsCore/UnicodeEmoticonManager>
14
15struct UnicodeEmoticonManagerForeign {
16 Q_GADGET
17 QML_ELEMENT
18 QML_SINGLETON
19 QML_NAMED_ELEMENT(UnicodeEmoticonManager)
21
22public:
24 {
25 auto inst = TextEmoticonsCore::UnicodeEmoticonManager::self();
26 QJSEngine::setObjectOwnership(inst, QJSEngine::ObjectOwnership::CppOwnership);
27 return inst;
28 }
29};
30
31struct EmojiProxyModelForeign {
32 Q_GADGET
33 QML_ELEMENT
34 QML_NAMED_ELEMENT(EmojiProxyModel)
36};
37
38struct EmojiModelManagerForeign {
39 Q_GADGET
40 QML_ELEMENT
41 QML_SINGLETON
42 QML_NAMED_ELEMENT(EmojiModelManager)
44
45public:
47 {
48 auto inst = TextEmoticonsCore::EmojiModelManager::self();
49 QJSEngine::setObjectOwnership(inst, QJSEngine::ObjectOwnership::CppOwnership);
50 return inst;
51 }
52};
The EmojiModelManager class.
The EmojiProxyModel class.
void setObjectOwnership(QObject *object, ObjectOwnership ownership)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 27 2024 11:48:29 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.