1 /**************************************************************************** 2 ** 3 ** DQt - D bindings for the Qt Toolkit 4 ** 5 ** GNU Lesser General Public License Usage 6 ** This file may be used under the terms of the GNU Lesser 7 ** General Public License version 3 as published by the Free Software 8 ** Foundation and appearing in the file LICENSE.LGPL3 included in the 9 ** packaging of this file. Please review the following information to 10 ** ensure the GNU Lesser General Public License version 3 requirements 11 ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. 12 ** 13 ****************************************************************************/ 14 module qt.gui.inputmethod; 15 extern(C++): 16 17 import qt.config; 18 import qt.core.locale; 19 import qt.core.namespace; 20 import qt.core.object; 21 import qt.core.rect; 22 import qt.core.variant; 23 import qt.gui.transform; 24 import qt.helpers; 25 26 extern(C++, class) struct QInputMethodPrivate; 27 /+ class QWindow; 28 class QRectF; 29 class QTransform; +/ 30 class /+ Q_GUI_EXPORT +/ QInputMethod : QObject 31 { 32 mixin(Q_OBJECT); 33 /+ Q_DECLARE_PRIVATE(QInputMethod) +/ 34 /+ Q_PROPERTY(QRectF cursorRectangle READ cursorRectangle NOTIFY cursorRectangleChanged) 35 Q_PROPERTY(QRectF anchorRectangle READ anchorRectangle NOTIFY anchorRectangleChanged) 36 Q_PROPERTY(QRectF keyboardRectangle READ keyboardRectangle NOTIFY keyboardRectangleChanged) 37 Q_PROPERTY(QRectF inputItemClipRectangle READ inputItemClipRectangle NOTIFY inputItemClipRectangleChanged) 38 Q_PROPERTY(bool visible READ isVisible NOTIFY visibleChanged) 39 Q_PROPERTY(bool animating READ isAnimating NOTIFY animatingChanged) 40 Q_PROPERTY(QLocale locale READ locale NOTIFY localeChanged) 41 Q_PROPERTY(Qt::LayoutDirection inputDirection READ inputDirection NOTIFY inputDirectionChanged) +/ 42 43 public: 44 final QTransform inputItemTransform() const; 45 final void setInputItemTransform(ref const(QTransform) transform); 46 47 final QRectF inputItemRectangle() const; 48 final void setInputItemRectangle(ref const(QRectF) rect); 49 50 // in window coordinates 51 final QRectF cursorRectangle() const; // ### what if we have rotations for the item? 52 final QRectF anchorRectangle() const; // ### ditto 53 54 // keyboard geometry in window coords 55 final QRectF keyboardRectangle() const; 56 57 final QRectF inputItemClipRectangle() const; 58 59 enum Action { 60 Click, 61 ContextMenu 62 } 63 /+ Q_ENUM(Action) +/ 64 65 final bool isVisible() const; 66 final void setVisible(bool visible); 67 68 final bool isAnimating() const; 69 70 final QLocale locale() const; 71 final /+ Qt:: +/qt.core.namespace.LayoutDirection inputDirection() const; 72 73 static QVariant queryFocusObject(/+ Qt:: +/qt.core.namespace.InputMethodQuery query, QVariant argument); // ### Qt 6: QVariant by const-ref 74 75 public /+ Q_SLOTS +/: 76 @QSlot final void show(); 77 @QSlot final void hide(); 78 79 @QSlot final void update(/+ Qt:: +/qt.core.namespace.InputMethodQueries queries); 80 @QSlot final void reset(); 81 @QSlot final void commit(); 82 83 @QSlot final void invokeAction(Action a, int cursorPosition); 84 85 /+ Q_SIGNALS +/public: 86 @QSignal final void cursorRectangleChanged(); 87 @QSignal final void anchorRectangleChanged(); 88 @QSignal final void keyboardRectangleChanged(); 89 @QSignal final void inputItemClipRectangleChanged(); 90 @QSignal final void visibleChanged(); 91 @QSignal final void animatingChanged(); 92 @QSignal final void localeChanged(); 93 @QSignal final void inputDirectionChanged(/+ Qt:: +/qt.core.namespace.LayoutDirection newDirection); 94 95 private: 96 /+ friend class QGuiApplication; +/ 97 /+ friend class QGuiApplicationPrivate; +/ 98 /+ friend class QPlatformInputContext; +/ 99 this(); 100 ~this(); 101 } 102