/* Copyright (C) 2014 * swift Project Community / Contributors * * This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level * directory of this distribution and at http://www.swift-project.org/license.html. No part of Swift Project, * including this file, may be copied, modified, propagated, or distributed except according to the terms * contained in the LICENSE file. */ #include "eveventhotkeyfunction.h" namespace BlackMisc { namespace Event { CEventHotkeyFunction::CEventHotkeyFunction(CHotkeyFunction func, bool argument) : m_hotkeyFunc(func), m_hotkeyFuncArgument(argument) { } // Hash uint CEventHotkeyFunction::getValueHash() const { return qHash(TupleConverter::toMetaTuple(*this)); } // Register metadata void CEventHotkeyFunction::registerMetadata() { qRegisterMetaType(); qDBusRegisterMetaType(); } /* * Convert to string */ QString CEventHotkeyFunction::convertToQString(bool i18n) const { QString s; s.append(m_eventOriginator.toQString(i18n)); s.append(" ").append(m_hotkeyFunc.toQString(i18n)); return s; } /* * metaTypeId */ int CEventHotkeyFunction::getMetaTypeId() const { return qMetaTypeId(); } /* * is a */ bool CEventHotkeyFunction::isA(int metaTypeId) const { if (metaTypeId == qMetaTypeId()) { return true; } return this->CValueObject::isA(metaTypeId); } /* * Compare */ int CEventHotkeyFunction::compareImpl(const CValueObject &otherBase) const { const auto &other = static_cast(otherBase); return compare(TupleConverter::toMetaTuple(*this), TupleConverter::toMetaTuple(other)); } /* * Marshall to DBus */ void CEventHotkeyFunction::marshallToDbus(QDBusArgument &argument) const { argument << TupleConverter::toMetaTuple(*this); } /* * Unmarshall from DBus */ void CEventHotkeyFunction::unmarshallFromDbus(const QDBusArgument &argument) { argument >> TupleConverter::toMetaTuple(*this); } } }