1
/***************************************************************************
2
* Copyright (C) 2011~2012 by CSSlayer *
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. *
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. *
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
***************************************************************************/
21
#include <QDBusArgument>
22
#include <QDBusMetaType>
25
#include "fcitxqtinputmethoditem.h"
27
bool FcitxQtInputMethodItem::enabled() const
31
const QString& FcitxQtInputMethodItem::langCode() const
35
const QString& FcitxQtInputMethodItem::name() const
39
const QString& FcitxQtInputMethodItem::uniqueName() const
43
void FcitxQtInputMethodItem::setEnabled(bool enable)
47
void FcitxQtInputMethodItem::setLangCode(const QString& lang)
51
void FcitxQtInputMethodItem::setName(const QString& name)
55
void FcitxQtInputMethodItem::setUniqueName(const QString& name)
60
void FcitxQtInputMethodItem::registerMetaType()
62
qRegisterMetaType<FcitxQtInputMethodItem>("FcitxQtInputMethodItem");
63
qDBusRegisterMetaType<FcitxQtInputMethodItem>();
64
qRegisterMetaType<FcitxQtInputMethodItemList>("FcitxQtInputMethodItemList");
65
qDBusRegisterMetaType<FcitxQtInputMethodItemList>();
69
QDBusArgument& operator<<(QDBusArgument& argument, const FcitxQtInputMethodItem& im)
71
argument.beginStructure();
72
argument << im.name();
73
argument << im.uniqueName();
74
argument << im.langCode();
75
argument << im.enabled();
76
argument.endStructure();
81
const QDBusArgument& operator>>(const QDBusArgument& argument, FcitxQtInputMethodItem& im)
87
argument.beginStructure();
88
argument >> name >> uniqueName >> langCode >> enabled;
89
argument.endStructure();
91
im.setUniqueName(uniqueName);
92
im.setLangCode(langCode);
93
im.setEnabled(enabled);