Debian Codegraph @

qt5/dbusaddons/fcitxqtformattedpreedit.h

raw
1 /***************************************************************************
2 * Copyright (C) 2012~2012 by CSSlayer *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
18 ***************************************************************************/
19
20 #ifndef FCITX_QT_FORMATTED_PREEDIT_H
21 #define FCITX_QT_FORMATTED_PREEDIT_H
22
23 #include "fcitxqtdbusaddons_export.h"
24
25 #include <QtCore/QMetaType>
26 #include <QtDBus/QDBusArgument>
27
28 class FCITXQTDBUSADDONS_EXPORT FcitxQtFormattedPreedit {
29 public:
30 const QString &string() const;
31 qint32 format() const;
32 void setString(const QString &str);
33 void setFormat(qint32 format);
34
35 static void registerMetaType();
36
37 bool operator==(const FcitxQtFormattedPreedit &preedit) const;
38
39 private:
40 QString m_string;
41 qint32 m_format;
42 };
43
44 typedef QList<FcitxQtFormattedPreedit> FcitxQtFormattedPreeditList;
45
46 QDBusArgument &operator<<(QDBusArgument &argument,
47 const FcitxQtFormattedPreedit &im);
48 const QDBusArgument &operator>>(const QDBusArgument &argument,
49 FcitxQtFormattedPreedit &im);
50
51 Q_DECLARE_METATYPE(FcitxQtFormattedPreedit)
52 Q_DECLARE_METATYPE(FcitxQtFormattedPreeditList)
53
54 #endif