Unity 8
InputMethodManager.h
1 /*
2  * Copyright (C) 2019 UBports Foundation.
3  * Author(s) Marius Gripsgard <marius@ubports.com>
4  *
5  * This program is free software: you can redistribute it and/or modify it under
6  * the terms of the GNU Lesser General Public License version 3, as published by
7  * the Free Software Foundation.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
11  * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #pragma once
19 
20 #include <QLoggingCategory>
21 #include <QObject>
22 
23 #include "WindowManagerGlobal.h"
24 
25 Q_DECLARE_LOGGING_CATEGORY(INPUTMETHODMANAGER)
26 
27 class Window;
28 
29 namespace unity {
30  namespace shell {
31  namespace application {
32  class MirSurfaceInterface;
33  }
34  }
35 }
36 
37 class WINDOWMANAGERQML_EXPORT InputMethodManager : public QObject
38 {
39  Q_OBJECT
40  Q_PROPERTY(unity::shell::application::MirSurfaceInterface* surface READ surface NOTIFY surfaceChanged)
41 
42 public:
43  InputMethodManager();
44  static InputMethodManager* instance();
45 
46  void setWindow(Window* window);
47 
48 Q_SIGNALS:
49  void surfaceChanged(unity::shell::application::MirSurfaceInterface* inputMethodSurface);
50 
51 private:
52  unity::shell::application::MirSurfaceInterface* surface() const;
53 
54  Window* m_inputMethodWindow{nullptr};
55 };
A slightly higher concept than MirSurface.
Definition: Window.h:47