Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • api-redesign
  • main
  • 0.10.0
  • 0.10.1
  • 0.10.2
  • 0.7.0
  • 0.8.0
  • 0.8.1
  • 0.9.0
  • 0.9.1
  • 0.9.2
11 results

Target

Select target project
  • justJanne/libquassel
1 result
Select Git revision
  • api-redesign
  • main
  • 0.10.0
  • 0.10.1
  • 0.10.2
  • 0.7.0
  • 0.8.0
  • 0.8.1
  • 0.9.0
  • 0.9.1
  • 0.9.2
11 results
Show changes
Showing
with 18 additions and 2132 deletions
/*
* libquassel
* Copyright (c) 2021 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*/
package de.justjanne.libquassel.protocol.syncables.stubs
import de.justjanne.libquassel.annotations.ProtocolSide
import de.justjanne.libquassel.annotations.SyncedCall
import de.justjanne.libquassel.annotations.SyncedObject
import de.justjanne.libquassel.protocol.models.types.QtType
import de.justjanne.libquassel.protocol.syncables.StatefulSyncableStub
import de.justjanne.libquassel.protocol.variant.QVariantList
import de.justjanne.libquassel.protocol.variant.QVariantMap
import de.justjanne.libquassel.protocol.variant.qVariant
@SyncedObject("BufferViewManager")
interface BufferViewManagerStub : StatefulSyncableStub {
@SyncedCall(target = ProtocolSide.CLIENT)
fun addBufferViewConfig(bufferViewConfigId: Int) {
sync(
target = ProtocolSide.CLIENT,
"addBufferViewConfig",
qVariant(bufferViewConfigId, QtType.Int),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun newBufferViewConfig(bufferViewConfigId: Int) {
addBufferViewConfig(bufferViewConfigId)
}
@SyncedCall(target = ProtocolSide.CORE)
fun requestCreateBufferView(properties: QVariantMap) {
sync(
target = ProtocolSide.CORE,
"requestCreateBufferView",
qVariant(properties, QtType.QVariantMap),
)
}
@SyncedCall(target = ProtocolSide.CORE)
fun requestCreateBufferViews(properties: QVariantList) {
sync(
target = ProtocolSide.CORE,
"requestCreateBufferViews",
qVariant(properties, QtType.QVariantList),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun deleteBufferViewConfig(bufferViewConfigId: Int) {
sync(
target = ProtocolSide.CLIENT,
"deleteBufferViewConfig",
qVariant(bufferViewConfigId, QtType.Int),
)
}
@SyncedCall(target = ProtocolSide.CORE)
fun requestDeleteBufferView(bufferViewConfigId: Int) {
sync(
target = ProtocolSide.CORE,
"requestDeleteBufferView",
qVariant(bufferViewConfigId, QtType.Int),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
override fun update(properties: QVariantMap) = super.update(properties)
@SyncedCall(target = ProtocolSide.CORE)
override fun requestUpdate(properties: QVariantMap) = super.requestUpdate(properties)
}
/*
* libquassel
* Copyright (c) 2021 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*/
package de.justjanne.libquassel.protocol.syncables.stubs
import de.justjanne.libquassel.annotations.ProtocolSide
import de.justjanne.libquassel.annotations.SyncedCall
import de.justjanne.libquassel.annotations.SyncedObject
import de.justjanne.libquassel.protocol.models.types.QtType
import de.justjanne.libquassel.protocol.syncables.StatefulSyncableStub
import de.justjanne.libquassel.protocol.variant.QVariantMap
import de.justjanne.libquassel.protocol.variant.qVariant
import java.nio.ByteBuffer
@SyncedObject("CertManager")
interface CertManagerStub : StatefulSyncableStub {
@SyncedCall(target = ProtocolSide.CLIENT)
fun setSslCert(encoded: ByteBuffer) {
sync(
target = ProtocolSide.CLIENT,
"setSslCert",
qVariant(encoded, QtType.QByteArray),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setSslKey(encoded: ByteBuffer) {
sync(
target = ProtocolSide.CLIENT,
"setSslKey",
qVariant(encoded, QtType.QByteArray),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
override fun update(properties: QVariantMap) = super.update(properties)
@SyncedCall(target = ProtocolSide.CORE)
override fun requestUpdate(properties: QVariantMap) = super.requestUpdate(properties)
}
/*
* libquassel
* Copyright (c) 2021 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*/
package de.justjanne.libquassel.protocol.syncables.stubs
import de.justjanne.libquassel.annotations.ProtocolSide
import de.justjanne.libquassel.annotations.SyncedCall
import de.justjanne.libquassel.annotations.SyncedObject
import de.justjanne.libquassel.protocol.models.types.QtType
import de.justjanne.libquassel.protocol.syncables.StatefulSyncableStub
import de.justjanne.libquassel.protocol.variant.QVariantMap
import de.justjanne.libquassel.protocol.variant.qVariant
@SyncedObject("CoreInfo")
interface CoreInfoStub : StatefulSyncableStub {
@SyncedCall(target = ProtocolSide.CLIENT)
fun setCoreData(data: QVariantMap) {
sync(
target = ProtocolSide.CLIENT,
"setCoreData",
qVariant(data, QtType.QVariantMap),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
override fun update(properties: QVariantMap) = super.update(properties)
@SyncedCall(target = ProtocolSide.CORE)
override fun requestUpdate(properties: QVariantMap) = super.requestUpdate(properties)
}
/*
* libquassel
* Copyright (c) 2021 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*/
package de.justjanne.libquassel.protocol.syncables.stubs
import de.justjanne.libquassel.annotations.ProtocolSide
import de.justjanne.libquassel.annotations.SyncedCall
import de.justjanne.libquassel.annotations.SyncedObject
import de.justjanne.libquassel.protocol.models.dcc.DccIpDetectionMode
import de.justjanne.libquassel.protocol.models.dcc.DccPortSelectionMode
import de.justjanne.libquassel.protocol.models.types.QtType
import de.justjanne.libquassel.protocol.models.types.QuasselType
import de.justjanne.libquassel.protocol.syncables.StatefulSyncableStub
import de.justjanne.libquassel.protocol.variant.QVariantMap
import de.justjanne.libquassel.protocol.variant.qVariant
import java.net.InetAddress
@SyncedObject("DccConfig")
interface DccConfigStub : StatefulSyncableStub {
@SyncedCall(target = ProtocolSide.CLIENT)
fun setDccEnabled(enabled: Boolean) {
sync(
target = ProtocolSide.CLIENT,
"setDccEnabled",
qVariant(enabled, QtType.Bool),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setOutgoingIp(outgoingIp: InetAddress) {
sync(
target = ProtocolSide.CLIENT,
"setOutgoingIp",
qVariant(outgoingIp, QuasselType.QHostAddress),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setIpDetectionMode(ipDetectionMode: DccIpDetectionMode) {
sync(
target = ProtocolSide.CLIENT,
"setIpDetectionMode",
qVariant(ipDetectionMode, QuasselType.DccConfigIpDetectionMode),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setPortSelectionMode(portSelectionMode: DccPortSelectionMode) {
sync(
target = ProtocolSide.CLIENT,
"setPortSelectionMode",
qVariant(portSelectionMode, QuasselType.DccConfigPortSelectionMode),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setMinPort(port: UShort) {
sync(
target = ProtocolSide.CLIENT,
"setMinPort",
qVariant(port, QtType.UShort),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setMaxPort(port: UShort) {
sync(
target = ProtocolSide.CLIENT,
"setMaxPort",
qVariant(port, QtType.UShort),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setChunkSize(chunkSize: Int) {
sync(
target = ProtocolSide.CLIENT,
"setChunkSize",
qVariant(chunkSize, QtType.Int),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setSendTimeout(timeout: Int) {
sync(
target = ProtocolSide.CLIENT,
"setSendTimeout",
qVariant(timeout, QtType.Int),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setUsePassiveDcc(use: Boolean) {
sync(
target = ProtocolSide.CLIENT,
"setUsePassiveDcc",
qVariant(use, QtType.Bool),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setUseFastSend(use: Boolean) {
sync(
target = ProtocolSide.CLIENT,
"setUseFastSend",
qVariant(use, QtType.Bool),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
override fun update(properties: QVariantMap) = super.update(properties)
@SyncedCall(target = ProtocolSide.CORE)
override fun requestUpdate(properties: QVariantMap) = super.requestUpdate(properties)
}
/*
* libquassel
* Copyright (c) 2021 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*/
package de.justjanne.libquassel.protocol.syncables.stubs
import de.justjanne.libquassel.annotations.ProtocolSide
import de.justjanne.libquassel.annotations.SyncedCall
import de.justjanne.libquassel.annotations.SyncedObject
import de.justjanne.libquassel.protocol.models.types.QtType
import de.justjanne.libquassel.protocol.syncables.StatefulSyncableStub
import de.justjanne.libquassel.protocol.variant.QVariantMap
import de.justjanne.libquassel.protocol.variant.qVariant
@SyncedObject("HighlightRuleManager")
interface HighlightRuleManagerStub : StatefulSyncableStub {
@SyncedCall(target = ProtocolSide.CORE)
fun requestRemoveHighlightRule(highlightRule: Int) {
sync(
target = ProtocolSide.CORE,
"requestRemoveHighlightRule",
qVariant(highlightRule, QtType.Int),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun removeHighlightRule(highlightRule: Int) {
sync(
target = ProtocolSide.CLIENT,
"removeHighlightRule",
qVariant(highlightRule, QtType.Int),
)
}
@SyncedCall(target = ProtocolSide.CORE)
fun requestToggleHighlightRule(highlightRule: Int) {
sync(
target = ProtocolSide.CORE,
"requestToggleHighlightRule",
qVariant(highlightRule, QtType.Int),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun toggleHighlightRule(highlightRule: Int) {
sync(
target = ProtocolSide.CLIENT,
"toggleHighlightRule",
qVariant(highlightRule, QtType.Int),
)
}
@SyncedCall(target = ProtocolSide.CORE)
fun requestAddHighlightRule(
id: Int,
content: String?,
isRegEx: Boolean,
isCaseSensitive: Boolean,
isEnabled: Boolean,
isInverse: Boolean,
sender: String?,
channel: String?
) {
sync(
target = ProtocolSide.CORE,
"requestToggleHighlightRule",
qVariant(id, QtType.Int),
qVariant(content, QtType.QString),
qVariant(isRegEx, QtType.Bool),
qVariant(isCaseSensitive, QtType.Bool),
qVariant(isEnabled, QtType.Bool),
qVariant(isInverse, QtType.Bool),
qVariant(sender, QtType.QString),
qVariant(channel, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun addHighlightRule(
id: Int,
content: String?,
isRegEx: Boolean,
isCaseSensitive: Boolean,
isEnabled: Boolean,
isInverse: Boolean,
sender: String?,
channel: String?
) {
sync(
target = ProtocolSide.CLIENT,
"addHighlightRule",
qVariant(id, QtType.Int),
qVariant(content, QtType.QString),
qVariant(isRegEx, QtType.Bool),
qVariant(isCaseSensitive, QtType.Bool),
qVariant(isEnabled, QtType.Bool),
qVariant(isInverse, QtType.Bool),
qVariant(sender, QtType.QString),
qVariant(channel, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CORE)
fun requestSetHighlightNick(highlightNick: Int) {
sync(
target = ProtocolSide.CORE,
"requestSetHighlightNick",
qVariant(highlightNick, QtType.Int),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setHighlightNick(highlightNick: Int) {
sync(
target = ProtocolSide.CLIENT,
"setHighlightNick",
qVariant(highlightNick, QtType.Int),
)
}
@SyncedCall(target = ProtocolSide.CORE)
fun requestSetNicksCaseSensitive(nicksCaseSensitive: Boolean) {
sync(
target = ProtocolSide.CORE,
"requestSetNicksCaseSensitive",
qVariant(nicksCaseSensitive, QtType.Bool),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setNicksCaseSensitive(nicksCaseSensitive: Boolean) {
sync(
target = ProtocolSide.CLIENT,
"setNicksCaseSensitive",
qVariant(nicksCaseSensitive, QtType.Bool),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
override fun update(properties: QVariantMap) = super.update(properties)
@SyncedCall(target = ProtocolSide.CORE)
override fun requestUpdate(properties: QVariantMap) = super.requestUpdate(properties)
}
/*
* libquassel
* Copyright (c) 2021 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*/
package de.justjanne.libquassel.protocol.syncables.stubs
import de.justjanne.libquassel.annotations.ProtocolSide
import de.justjanne.libquassel.annotations.SyncedCall
import de.justjanne.libquassel.annotations.SyncedObject
import de.justjanne.libquassel.protocol.models.QStringList
import de.justjanne.libquassel.protocol.models.ids.IdentityId
import de.justjanne.libquassel.protocol.models.types.QtType
import de.justjanne.libquassel.protocol.models.types.QuasselType
import de.justjanne.libquassel.protocol.syncables.StatefulSyncableStub
import de.justjanne.libquassel.protocol.variant.QVariantMap
import de.justjanne.libquassel.protocol.variant.qVariant
@SyncedObject("Identity")
interface IdentityStub : StatefulSyncableStub {
@SyncedCall(target = ProtocolSide.CLIENT)
fun setAutoAwayEnabled(enabled: Boolean) {
sync(
target = ProtocolSide.CLIENT,
"setAutoAwayEnabled",
qVariant(enabled, QtType.Bool),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setAutoAwayReason(reason: String?) {
sync(
target = ProtocolSide.CLIENT,
"setAutoAwayReason",
qVariant(reason, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setAutoAwayReasonEnabled(enabled: Boolean) {
sync(
target = ProtocolSide.CLIENT,
"setAutoAwayReasonEnabled",
qVariant(enabled, QtType.Bool),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setAutoAwayTime(time: Int) {
sync(
target = ProtocolSide.CLIENT,
"setAutoAwayTime",
qVariant(time, QtType.Int),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setAwayNick(awayNick: String?) {
sync(
target = ProtocolSide.CLIENT,
"setAwayNick",
qVariant(awayNick, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setAwayNickEnabled(enabled: Boolean) {
sync(
target = ProtocolSide.CLIENT,
"setAwayNickEnabled",
qVariant(enabled, QtType.Bool),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setAwayReason(awayReason: String?) {
sync(
target = ProtocolSide.CLIENT,
"setAwayReason",
qVariant(awayReason, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setAwayReasonEnabled(enabled: Boolean) {
sync(
target = ProtocolSide.CLIENT,
"setAwayReasonEnabled",
qVariant(enabled, QtType.Bool),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setDetachAwayEnabled(enabled: Boolean) {
sync(
target = ProtocolSide.CLIENT,
"setDetachAwayEnabled",
qVariant(enabled, QtType.Bool),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setDetachAwayReason(reason: String?) {
sync(
target = ProtocolSide.CLIENT,
"setDetachAwayReason",
qVariant(reason, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setDetachAwayReasonEnabled(enabled: Boolean) {
sync(
target = ProtocolSide.CLIENT,
"setDetachAwayReasonEnabled",
qVariant(enabled, QtType.Bool),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setId(id: IdentityId) {
sync(
target = ProtocolSide.CLIENT,
"setId",
qVariant(id, QuasselType.IdentityId),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setIdent(ident: String?) {
sync(
target = ProtocolSide.CLIENT,
"setIdent",
qVariant(ident, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setIdentityName(name: String?) {
sync(
target = ProtocolSide.CLIENT,
"setIdentityName",
qVariant(name, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setKickReason(reason: String?) {
sync(
target = ProtocolSide.CLIENT,
"setKickReason",
qVariant(reason, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setNicks(nicks: QStringList) {
sync(
target = ProtocolSide.CLIENT,
"setNicks",
qVariant(nicks, QtType.QStringList),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setPartReason(reason: String?) {
sync(
target = ProtocolSide.CLIENT,
"setPartReason",
qVariant(reason, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setQuitReason(reason: String?) {
sync(
target = ProtocolSide.CLIENT,
"setQuitReason",
qVariant(reason, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setRealName(realName: String?) {
sync(
target = ProtocolSide.CLIENT,
"setRealName",
qVariant(realName, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
override fun update(properties: QVariantMap) = super.update(properties)
@SyncedCall(target = ProtocolSide.CORE)
override fun requestUpdate(properties: QVariantMap) = super.requestUpdate(properties)
}
/*
* libquassel
* Copyright (c) 2021 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*/
package de.justjanne.libquassel.protocol.syncables.stubs
import de.justjanne.libquassel.annotations.ProtocolSide
import de.justjanne.libquassel.annotations.SyncedCall
import de.justjanne.libquassel.annotations.SyncedObject
import de.justjanne.libquassel.protocol.models.types.QtType
import de.justjanne.libquassel.protocol.syncables.StatefulSyncableStub
import de.justjanne.libquassel.protocol.variant.QVariantMap
import de.justjanne.libquassel.protocol.variant.qVariant
@SyncedObject(name = "IgnoreListManager")
interface IgnoreListManagerStub : StatefulSyncableStub {
@SyncedCall(target = ProtocolSide.CLIENT)
fun addIgnoreListItem(
type: Int,
ignoreRule: String?,
isRegEx: Boolean,
strictness: Int,
scope: Int,
scopeRule: String?,
isActive: Boolean
) {
sync(
target = ProtocolSide.CLIENT,
"addIgnoreListItem",
qVariant(type, QtType.Int),
qVariant(ignoreRule, QtType.QString),
qVariant(isRegEx, QtType.Bool),
qVariant(strictness, QtType.Int),
qVariant(scope, QtType.Int),
qVariant(scopeRule, QtType.QString),
qVariant(isActive, QtType.Bool),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun removeIgnoreListItem(ignoreRule: String?) {
sync(
target = ProtocolSide.CLIENT,
"removeIgnoreListItem",
qVariant(ignoreRule, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CORE)
fun requestAddIgnoreListItem(
type: Int,
ignoreRule: String?,
isRegEx: Boolean,
strictness: Int,
scope: Int,
scopeRule: String?,
isActive: Boolean
) {
sync(
target = ProtocolSide.CORE,
"requestAddIgnoreListItem",
qVariant(type, QtType.Int),
qVariant(ignoreRule, QtType.QString),
qVariant(isRegEx, QtType.Bool),
qVariant(strictness, QtType.Int),
qVariant(scope, QtType.Int),
qVariant(scopeRule, QtType.QString),
qVariant(isActive, QtType.Bool),
)
}
@SyncedCall(target = ProtocolSide.CORE)
fun requestRemoveIgnoreListItem(ignoreRule: String?) {
sync(
target = ProtocolSide.CORE,
"requestRemoveIgnoreListItem",
qVariant(ignoreRule, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CORE)
fun requestToggleIgnoreRule(ignoreRule: String?) {
sync(
target = ProtocolSide.CORE,
"requestToggleIgnoreRule",
qVariant(ignoreRule, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun toggleIgnoreRule(ignoreRule: String?) {
sync(
target = ProtocolSide.CLIENT,
"requestToggleIgnoreRule",
qVariant(ignoreRule, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
override fun update(properties: QVariantMap) = super.update(properties)
@SyncedCall(target = ProtocolSide.CORE)
override fun requestUpdate(properties: QVariantMap) = super.requestUpdate(properties)
}
/*
* libquassel
* Copyright (c) 2021 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*/
package de.justjanne.libquassel.protocol.syncables.stubs
import de.justjanne.libquassel.annotations.ProtocolSide
import de.justjanne.libquassel.annotations.SyncedCall
import de.justjanne.libquassel.annotations.SyncedObject
import de.justjanne.libquassel.protocol.models.QStringList
import de.justjanne.libquassel.protocol.models.types.QtType
import de.justjanne.libquassel.protocol.syncables.StatefulSyncableStub
import de.justjanne.libquassel.protocol.variant.QVariantMap
import de.justjanne.libquassel.protocol.variant.qVariant
@SyncedObject("IrcChannel")
interface IrcChannelStub : StatefulSyncableStub {
@SyncedCall(target = ProtocolSide.CLIENT)
fun addChannelMode(mode: Char, value: String? = null) {
sync(
target = ProtocolSide.CLIENT,
"addChannelMode",
qVariant(mode, QtType.QChar),
qVariant(value, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun addUserMode(nick: String, mode: String? = null) {
sync(
target = ProtocolSide.CLIENT,
"addUserMode",
qVariant(nick, QtType.QString),
qVariant(mode, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun joinIrcUsers(nicks: QStringList, modes: QStringList) {
sync(
target = ProtocolSide.CLIENT,
"joinIrcUsers",
qVariant(nicks, QtType.QStringList),
qVariant(modes, QtType.QStringList),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun part(nick: String) {
sync(
target = ProtocolSide.CLIENT,
"part",
qVariant(nick, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun removeChannelMode(mode: Char, value: String? = null) {
sync(
target = ProtocolSide.CLIENT,
"removeChannelMode",
qVariant(mode, QtType.QChar),
qVariant(value, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun removeUserMode(nick: String, mode: String? = null) {
sync(
target = ProtocolSide.CLIENT,
"removeUserMode",
qVariant(nick, QtType.QString),
qVariant(mode, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setEncrypted(encrypted: Boolean) {
sync(
target = ProtocolSide.CLIENT,
"setEncrypted",
qVariant(encrypted, QtType.Bool),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setPassword(password: String) {
sync(
target = ProtocolSide.CLIENT,
"setPassword",
qVariant(password, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setTopic(topic: String) {
sync(
target = ProtocolSide.CLIENT,
"setTopic",
qVariant(topic, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setUserModes(nick: String, modes: String? = null) {
sync(
target = ProtocolSide.CLIENT,
"setUserModes",
qVariant(nick, QtType.QString),
qVariant(modes, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
override fun update(properties: QVariantMap) = super.update(properties)
@SyncedCall(target = ProtocolSide.CORE)
override fun requestUpdate(properties: QVariantMap) = super.requestUpdate(properties)
}
/*
* libquassel
* Copyright (c) 2021 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*/
package de.justjanne.libquassel.protocol.syncables.stubs
import de.justjanne.libquassel.annotations.ProtocolSide
import de.justjanne.libquassel.annotations.SyncedCall
import de.justjanne.libquassel.annotations.SyncedObject
import de.justjanne.libquassel.protocol.models.QStringList
import de.justjanne.libquassel.protocol.models.ids.NetworkId
import de.justjanne.libquassel.protocol.models.types.QtType
import de.justjanne.libquassel.protocol.models.types.QuasselType
import de.justjanne.libquassel.protocol.syncables.SyncableStub
import de.justjanne.libquassel.protocol.variant.QVariantList
import de.justjanne.libquassel.protocol.variant.qVariant
@SyncedObject("IrcListHelper")
interface IrcListHelperStub : SyncableStub {
@SyncedCall(target = ProtocolSide.CORE)
fun requestChannelList(netId: NetworkId, channelFilters: QStringList): QVariantList {
sync(
target = ProtocolSide.CORE,
"requestChannelList",
qVariant(netId, QuasselType.NetworkId),
qVariant(channelFilters, QtType.QStringList),
)
return emptyList()
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun receiveChannelList(netId: NetworkId, channelFilters: QStringList, channels: QVariantList) {
sync(
target = ProtocolSide.CLIENT,
"receiveChannelList",
qVariant(netId, QuasselType.NetworkId),
qVariant(channelFilters, QtType.QStringList),
qVariant(channels, QtType.QVariantList),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun reportError(error: String?) {
sync(
target = ProtocolSide.CLIENT,
"reportError",
qVariant(error, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun reportFinishedList(netId: NetworkId) {
sync(
target = ProtocolSide.CLIENT,
"reportFinishedList",
qVariant(netId, QuasselType.NetworkId),
)
}
}
/*
* libquassel
* Copyright (c) 2021 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*/
package de.justjanne.libquassel.protocol.syncables.stubs
import de.justjanne.libquassel.annotations.ProtocolSide
import de.justjanne.libquassel.annotations.SyncedCall
import de.justjanne.libquassel.annotations.SyncedObject
import de.justjanne.libquassel.protocol.models.types.QtType
import de.justjanne.libquassel.protocol.syncables.StatefulSyncableStub
import de.justjanne.libquassel.protocol.variant.QVariantMap
import de.justjanne.libquassel.protocol.variant.qVariant
import org.threeten.bp.temporal.Temporal
@SyncedObject("IrcUser")
interface IrcUserStub : StatefulSyncableStub {
@SyncedCall(target = ProtocolSide.CLIENT)
fun addUserModes(modes: String) {
sync(
target = ProtocolSide.CLIENT,
"addUserModes",
qVariant(modes, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun joinChannel(channelname: String) {
sync(
target = ProtocolSide.CLIENT,
"joinChannel",
qVariant(channelname, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun partChannel(channelname: String) {
sync(
target = ProtocolSide.CLIENT,
"partChannel",
qVariant(channelname, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun quit() {
sync(
target = ProtocolSide.CLIENT,
"quit",
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun removeUserModes(modes: String) {
sync(
target = ProtocolSide.CLIENT,
"removeUserModes",
qVariant(modes, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setAccount(account: String) {
sync(
target = ProtocolSide.CLIENT,
"setAccount",
qVariant(account, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setAway(away: Boolean) {
sync(
target = ProtocolSide.CLIENT,
"setAway",
qVariant(away, QtType.Bool),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setAwayMessage(awayMessage: String) {
sync(
target = ProtocolSide.CLIENT,
"setAwayMessage",
qVariant(awayMessage, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setEncrypted(encrypted: Boolean) {
sync(
target = ProtocolSide.CLIENT,
"setEncrypted",
qVariant(encrypted, QtType.Bool),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setHost(host: String) {
sync(
target = ProtocolSide.CLIENT,
"setHost",
qVariant(host, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setIdleTime(idleTime: Temporal) {
sync(
target = ProtocolSide.CLIENT,
"setIdleTime",
qVariant(idleTime, QtType.QDateTime),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setIrcOperator(ircOperator: String) {
sync(
target = ProtocolSide.CLIENT,
"setIrcOperator",
qVariant(ircOperator, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setLastAwayMessage(lastAwayMessage: Int) {
sync(
target = ProtocolSide.CLIENT,
"setLastAwayMessage",
qVariant(lastAwayMessage, QtType.Int),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setLastAwayMessageTime(lastAwayMessageTime: Temporal) {
sync(
target = ProtocolSide.CLIENT,
"setLastAwayMessageTime",
qVariant(lastAwayMessageTime, QtType.QDateTime),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setLoginTime(loginTime: Temporal) {
sync(
target = ProtocolSide.CLIENT,
"setLoginTime",
qVariant(loginTime, QtType.QDateTime),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setNick(nick: String) {
sync(
target = ProtocolSide.CLIENT,
"setNick",
qVariant(nick, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setRealName(realName: String) {
sync(
target = ProtocolSide.CLIENT,
"setRealName",
qVariant(realName, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setServer(server: String) {
sync(
target = ProtocolSide.CLIENT,
"setServer",
qVariant(server, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setSuserHost(suserHost: String) {
sync(
target = ProtocolSide.CLIENT,
"setSuserHost",
qVariant(suserHost, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setUser(user: String) {
sync(
target = ProtocolSide.CLIENT,
"setUser",
qVariant(user, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setUserModes(modes: String) {
sync(
target = ProtocolSide.CLIENT,
"setUserModes",
qVariant(modes, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setWhoisServiceReply(whoisServiceReply: String) {
sync(
target = ProtocolSide.CLIENT,
"setWhoisServiceReply",
qVariant(whoisServiceReply, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun updateHostmask(mask: String) {
sync(
target = ProtocolSide.CLIENT,
"updateHostmask",
qVariant(mask, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
override fun update(properties: QVariantMap) = super.update(properties)
@SyncedCall(target = ProtocolSide.CORE)
override fun requestUpdate(properties: QVariantMap) = super.requestUpdate(properties)
}
/*
* libquassel
* Copyright (c) 2021 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*/
package de.justjanne.libquassel.protocol.syncables.stubs
import de.justjanne.libquassel.annotations.ProtocolSide
import de.justjanne.libquassel.annotations.SyncedCall
import de.justjanne.libquassel.annotations.SyncedObject
import de.justjanne.libquassel.protocol.models.types.QtType
import de.justjanne.libquassel.protocol.syncables.StatefulSyncableStub
import de.justjanne.libquassel.protocol.variant.QVariantMap
import de.justjanne.libquassel.protocol.variant.qVariant
@SyncedObject("NetworkConfig")
interface NetworkConfigStub : StatefulSyncableStub {
@SyncedCall(target = ProtocolSide.CORE)
fun requestSetAutoWhoDelay(delay: Int) {
sync(
target = ProtocolSide.CORE,
"requestSetAutoWhoDelay",
qVariant(delay, QtType.Int)
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setAutoWhoDelay(delay: Int) {
sync(
target = ProtocolSide.CLIENT,
"setAutoWhoDelay",
qVariant(delay, QtType.Int)
)
}
@SyncedCall(target = ProtocolSide.CORE)
fun requestSetAutoWhoEnabled(enabled: Boolean) {
sync(
target = ProtocolSide.CORE,
"requestSetAutoWhoEnabled",
qVariant(enabled, QtType.Bool)
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setAutoWhoEnabled(enabled: Boolean) {
sync(
target = ProtocolSide.CLIENT,
"setAutoWhoEnabled",
qVariant(enabled, QtType.Bool)
)
}
@SyncedCall(target = ProtocolSide.CORE)
fun requestSetAutoWhoInterval(interval: Int) {
sync(
target = ProtocolSide.CORE,
"requestSetAutoWhoInterval",
qVariant(interval, QtType.Int)
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setAutoWhoInterval(interval: Int) {
sync(
target = ProtocolSide.CLIENT,
"setAutoWhoInterval",
qVariant(interval, QtType.Int)
)
}
@SyncedCall(target = ProtocolSide.CORE)
fun requestSetAutoWhoNickLimit(limit: Int) {
sync(
target = ProtocolSide.CORE,
"requestSetAutoWhoNickLimit",
qVariant(limit, QtType.Int)
)
}
@SyncedCall(target = ProtocolSide.CORE)
fun setAutoWhoNickLimit(limit: Int) {
sync(
target = ProtocolSide.CORE,
"setAutoWhoNickLimit",
qVariant(limit, QtType.Int)
)
}
@SyncedCall(target = ProtocolSide.CORE)
fun requestSetMaxPingCount(count: Int) {
sync(
target = ProtocolSide.CORE,
"requestSetMaxPingCount",
qVariant(count, QtType.Int)
)
}
@SyncedCall(target = ProtocolSide.CORE)
fun setMaxPingCount(count: Int) {
sync(
target = ProtocolSide.CORE,
"setMaxPingCount",
qVariant(count, QtType.Int)
)
}
@SyncedCall(target = ProtocolSide.CORE)
fun requestSetPingInterval(interval: Int) {
sync(
target = ProtocolSide.CORE,
"requestSetPingInterval",
qVariant(interval, QtType.Int)
)
}
@SyncedCall(target = ProtocolSide.CORE)
fun setPingInterval(interval: Int) {
sync(
target = ProtocolSide.CORE,
"setPingInterval",
qVariant(interval, QtType.Int)
)
}
@SyncedCall(target = ProtocolSide.CORE)
fun requestSetPingTimeoutEnabled(enabled: Boolean) {
sync(
target = ProtocolSide.CORE,
"requestSetPingTimeoutEnabled",
qVariant(enabled, QtType.Bool)
)
}
@SyncedCall(target = ProtocolSide.CORE)
fun setPingTimeoutEnabled(enabled: Boolean) {
sync(
target = ProtocolSide.CORE,
"setPingTimeoutEnabled",
qVariant(enabled, QtType.Bool)
)
}
@SyncedCall(target = ProtocolSide.CORE)
fun requestSetStandardCtcp(enabled: Boolean) {
sync(
target = ProtocolSide.CORE,
"requestSetStandardCtcp",
qVariant(enabled, QtType.Bool)
)
}
@SyncedCall(target = ProtocolSide.CORE)
fun setStandardCtcp(enabled: Boolean) {
sync(
target = ProtocolSide.CORE,
"setStandardCtcp",
qVariant(enabled, QtType.Bool)
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
override fun update(properties: QVariantMap) = super.update(properties)
@SyncedCall(target = ProtocolSide.CORE)
override fun requestUpdate(properties: QVariantMap) = super.requestUpdate(properties)
}
/*
* libquassel
* Copyright (c) 2021 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*/
package de.justjanne.libquassel.protocol.syncables.stubs
import de.justjanne.libquassel.annotations.ProtocolSide
import de.justjanne.libquassel.annotations.SyncedCall
import de.justjanne.libquassel.annotations.SyncedObject
import de.justjanne.libquassel.protocol.models.QStringList
import de.justjanne.libquassel.protocol.models.ids.IdentityId
import de.justjanne.libquassel.protocol.models.network.NetworkInfo
import de.justjanne.libquassel.protocol.models.types.QtType
import de.justjanne.libquassel.protocol.models.types.QuasselType
import de.justjanne.libquassel.protocol.syncables.StatefulSyncableStub
import de.justjanne.libquassel.protocol.variant.QVariantList
import de.justjanne.libquassel.protocol.variant.QVariantMap
import de.justjanne.libquassel.protocol.variant.qVariant
import java.nio.ByteBuffer
@SyncedObject("Network")
interface NetworkStub : StatefulSyncableStub {
@SyncedCall(target = ProtocolSide.CLIENT)
fun setNetworkName(networkName: String) {
sync(
target = ProtocolSide.CLIENT,
"setNetworkName",
qVariant(networkName, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setCurrentServer(currentServer: String?) {
sync(
target = ProtocolSide.CLIENT,
"setCurrentServer",
qVariant(currentServer, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setMyNick(myNick: String?) {
sync(
target = ProtocolSide.CLIENT,
"setMyNick",
qVariant(myNick, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setLatency(latency: Int) {
sync(
target = ProtocolSide.CLIENT,
"setLatency",
qVariant(latency, QtType.Int),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setCodecForServer(codecForServer: ByteBuffer) {
sync(
target = ProtocolSide.CLIENT,
"setCodecForServer",
qVariant(codecForServer, QtType.QByteArray),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setCodecForEncoding(codecForEncoding: ByteBuffer) {
sync(
target = ProtocolSide.CLIENT,
"setCodecForEncoding",
qVariant(codecForEncoding, QtType.QByteArray),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setCodecForDecoding(codecForDecoding: ByteBuffer) {
sync(
target = ProtocolSide.CLIENT,
"setCodecForDecoding",
qVariant(codecForDecoding, QtType.QByteArray),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setIdentity(identityId: IdentityId) {
sync(
target = ProtocolSide.CLIENT,
"setIdentity",
qVariant(identityId, QuasselType.IdentityId),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setConnected(isConnected: Boolean) {
sync(
target = ProtocolSide.CLIENT,
"setConnected",
qVariant(isConnected, QtType.Bool),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setConnectionState(connectionState: Int) {
sync(
target = ProtocolSide.CLIENT,
"setConnectionState",
qVariant(connectionState, QtType.Int),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setUseRandomServer(useRandomServer: Boolean) {
sync(
target = ProtocolSide.CLIENT,
"setUseRandomServer",
qVariant(useRandomServer, QtType.Bool),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setPerform(perform: QStringList) {
sync(
target = ProtocolSide.CLIENT,
"setPerform",
qVariant(perform, QtType.QStringList),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setSkipCaps(skipCaps: QStringList) {
sync(
target = ProtocolSide.CLIENT,
"setSkipCaps",
qVariant(skipCaps, QtType.QStringList),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setUseAutoIdentify(useAutoIdentify: Boolean) {
sync(
target = ProtocolSide.CLIENT,
"setUseAutoIdentify",
qVariant(useAutoIdentify, QtType.Bool),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setAutoIdentifyService(autoIdentifyService: String) {
sync(
target = ProtocolSide.CLIENT,
"setAutoIdentifyService",
qVariant(autoIdentifyService, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setAutoIdentifyPassword(autoIdentifyPassword: String) {
sync(
target = ProtocolSide.CLIENT,
"setAutoIdentifyPassword",
qVariant(autoIdentifyPassword, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setUseSasl(useSasl: Boolean) {
sync(
target = ProtocolSide.CLIENT,
"setUseSasl",
qVariant(useSasl, QtType.Bool),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setSaslAccount(saslAccount: String) {
sync(
target = ProtocolSide.CLIENT,
"setSaslAccount",
qVariant(saslAccount, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setSaslPassword(saslPassword: String) {
sync(
target = ProtocolSide.CLIENT,
"setSaslPassword",
qVariant(saslPassword, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setUseAutoReconnect(useAutoReconnect: Boolean) {
sync(
target = ProtocolSide.CLIENT,
"setUseAutoReconnect",
qVariant(useAutoReconnect, QtType.Bool),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setAutoReconnectInterval(autoReconnectInterval: UInt) {
sync(
target = ProtocolSide.CLIENT,
"setAutoReconnectInterval",
qVariant(autoReconnectInterval, QtType.UInt),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setAutoReconnectRetries(autoReconnectRetries: UShort) {
sync(
target = ProtocolSide.CLIENT,
"setAutoReconnectRetries",
qVariant(autoReconnectRetries, QtType.UShort),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setUnlimitedReconnectRetries(unlimitedReconnectRetries: Boolean) {
sync(
target = ProtocolSide.CLIENT,
"setUnlimitedReconnectRetries",
qVariant(unlimitedReconnectRetries, QtType.Bool),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setRejoinChannels(rejoinChannels: Boolean) {
sync(
target = ProtocolSide.CLIENT,
"setRejoinChannels",
qVariant(rejoinChannels, QtType.Bool),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setUseCustomMessageRate(useCustomMessageRate: Boolean) {
sync(
target = ProtocolSide.CLIENT,
"setUseCustomMessageRate",
qVariant(useCustomMessageRate, QtType.Bool),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setMessageRateBurstSize(messageRateBurstSize: UInt) {
sync(
target = ProtocolSide.CLIENT,
"setMessageRateBurstSize",
qVariant(messageRateBurstSize, QtType.UInt),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setMessageRateDelay(messageRateDelay: UInt) {
sync(
target = ProtocolSide.CLIENT,
"setMessageRateDelay",
qVariant(messageRateDelay, QtType.UInt),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setUnlimitedMessageRate(unlimitedMessageRate: Boolean) {
sync(
target = ProtocolSide.CLIENT,
"setUnlimitedMessageRate",
qVariant(unlimitedMessageRate, QtType.Bool),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setServerList(serverList: QVariantList) {
sync(
target = ProtocolSide.CLIENT,
"setServerList",
qVariant(serverList, QtType.QVariantList),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun addSupport(param: String, value: String = "") {
sync(
target = ProtocolSide.CLIENT,
"addSupport",
qVariant(param, QtType.QString),
qVariant(value, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun removeSupport(param: String) {
sync(
target = ProtocolSide.CLIENT,
"removeSupport",
qVariant(param, QtType.QString)
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun addCap(capability: String, value: String = "") {
sync(
target = ProtocolSide.CLIENT,
"addCap",
qVariant(capability, QtType.QString),
qVariant(value, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun acknowledgeCap(capability: String) {
sync(
target = ProtocolSide.CLIENT,
"acknowledgeCap",
qVariant(capability, QtType.QString)
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun removeCap(capability: String) {
sync(
target = ProtocolSide.CLIENT,
"removeCap",
qVariant(capability, QtType.QString)
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun clearCaps() {
sync(
target = ProtocolSide.CLIENT,
"clearCaps"
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun addIrcUser(hostmask: String) {
sync(
target = ProtocolSide.CLIENT,
"addIrcUser",
qVariant(hostmask, QtType.QString),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun addIrcChannel(channel: String) {
sync(
target = ProtocolSide.CLIENT,
"addIrcChannel",
)
}
@SyncedCall(target = ProtocolSide.CORE)
fun requestConnect() {
sync(
target = ProtocolSide.CORE,
"requestConnect",
)
}
@SyncedCall(target = ProtocolSide.CORE)
fun requestDisconnect() {
sync(
target = ProtocolSide.CORE,
"requestDisconnect",
)
}
@SyncedCall(target = ProtocolSide.CORE)
fun requestSetNetworkInfo(info: NetworkInfo) {
sync(
target = ProtocolSide.CORE,
"requestSetNetworkInfo",
qVariant(info, QuasselType.NetworkInfo),
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
override fun update(properties: QVariantMap) = super.update(properties)
@SyncedCall(target = ProtocolSide.CORE)
override fun requestUpdate(properties: QVariantMap) = super.requestUpdate(properties)
}
/*
* libquassel
* Copyright (c) 2021 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*/
package de.justjanne.libquassel.protocol.syncables.stubs
import de.justjanne.libquassel.annotations.ProtocolSide
import de.justjanne.libquassel.annotations.SyncedCall
import de.justjanne.libquassel.annotations.SyncedObject
import de.justjanne.libquassel.protocol.models.BufferInfo
import de.justjanne.libquassel.protocol.models.Message
import de.justjanne.libquassel.protocol.models.ids.IdentityId
import de.justjanne.libquassel.protocol.models.ids.NetworkId
import de.justjanne.libquassel.protocol.models.network.NetworkInfo
import de.justjanne.libquassel.protocol.models.types.QtType
import de.justjanne.libquassel.protocol.models.types.QuasselType
import de.justjanne.libquassel.protocol.syncables.SyncableStub
import de.justjanne.libquassel.protocol.variant.QVariantMap
import de.justjanne.libquassel.protocol.variant.qVariant
import java.nio.ByteBuffer
@SyncedObject(name = "RpcHandler")
interface RpcHandlerStub : SyncableStub {
@SyncedCall(name = "__objectRenamed__", target = ProtocolSide.CLIENT)
fun objectRenamed(classname: ByteBuffer, newName: String?, oldName: String?) {
rpc(
target = ProtocolSide.CLIENT,
"__objectRenamed__",
qVariant(classname, QtType.QByteArray),
qVariant(newName, QtType.QString),
qVariant(oldName, QtType.QString)
)
}
@SyncedCall(name = "2displayMsg(Message)", target = ProtocolSide.CLIENT)
fun displayMsg(message: Message) {
rpc(
target = ProtocolSide.CLIENT,
"2displayMsg(Message)",
qVariant(message, QuasselType.Message)
)
}
@SyncedCall(name = "2displayStatusMsg(QString,QString)", target = ProtocolSide.CLIENT)
fun displayStatusMsg(net: String?, msg: String?) {
rpc(
target = ProtocolSide.CLIENT,
"2displayStatusMsg(QString,QString)",
qVariant(net, QtType.QString),
qVariant(msg, QtType.QString)
)
}
@SyncedCall(name = "2bufferInfoUpdated(BufferInfo)", target = ProtocolSide.CLIENT)
fun bufferInfoUpdated(bufferInfo: BufferInfo) {
rpc(
target = ProtocolSide.CLIENT,
"2bufferInfoUpdated(BufferInfo)",
qVariant(bufferInfo, QuasselType.BufferInfo)
)
}
@SyncedCall(name = "2identityCreated(Identity)", target = ProtocolSide.CLIENT)
fun identityCreated(identity: QVariantMap) {
rpc(
target = ProtocolSide.CLIENT,
"2identityCreated(Identity)",
qVariant(identity, QuasselType.Identity)
)
}
@SyncedCall(name = "2identityRemoved(IdentityId)", target = ProtocolSide.CLIENT)
fun identityRemoved(identityId: IdentityId) {
rpc(
target = ProtocolSide.CLIENT,
"2identityRemoved(IdentityId)",
qVariant(identityId, QuasselType.IdentityId)
)
}
@SyncedCall(name = "2networkCreated(NetworkId)", target = ProtocolSide.CLIENT)
fun networkCreated(networkId: NetworkId) {
rpc(
target = ProtocolSide.CLIENT,
"2networkCreated(NetworkId)",
qVariant(networkId, QuasselType.NetworkId)
)
}
@SyncedCall(name = "2networkRemoved(NetworkId)", target = ProtocolSide.CLIENT)
fun networkRemoved(networkId: NetworkId) {
rpc(
target = ProtocolSide.CLIENT,
"2networkRemoved(NetworkId)",
qVariant(networkId, QuasselType.NetworkId)
)
}
@SyncedCall(name = "2passwordChanged(PeerPtr,bool)", target = ProtocolSide.CLIENT)
fun passwordChanged(peer: ULong, success: Boolean) {
rpc(
target = ProtocolSide.CLIENT,
"2passwordChanged(PeerPtr,bool)",
qVariant(peer, QuasselType.PeerPtr),
qVariant(success, QtType.Bool)
)
}
@SyncedCall(name = "2disconnectFromCore()", target = ProtocolSide.CLIENT)
fun disconnectFromCore() {
rpc(
target = ProtocolSide.CLIENT,
"2disconnectFromCore()",
)
}
@SyncedCall(name = "2createIdentity(Identity,QVariantMap)", target = ProtocolSide.CORE)
fun createIdentity(identity: IdentityStub, additional: QVariantMap) {
rpc(
target = ProtocolSide.CORE,
"2createIdentity(Identity,QVariantMap)",
qVariant(identity, QuasselType.Identity),
qVariant(additional, QtType.QVariantMap),
)
}
@SyncedCall(name = "2removeIdentity(IdentityId)", target = ProtocolSide.CORE)
fun removeIdentity(identityId: IdentityId) {
rpc(
target = ProtocolSide.CORE,
"2removeIdentity(IdentityId)",
qVariant(identityId, QuasselType.IdentityId),
)
}
@SyncedCall(name = "2createNetwork(NetworkInfo,QStringList)", target = ProtocolSide.CORE)
fun createNetwork(networkInfo: NetworkInfo, channels: List<String>) {
rpc(
target = ProtocolSide.CORE,
"2createNetwork(NetworkInfo,QStringList)",
qVariant(networkInfo, QuasselType.NetworkInfo),
qVariant(channels, QtType.QStringList),
)
}
@SyncedCall(name = "2removeNetwork(NetworkId)", target = ProtocolSide.CORE)
fun removeNetwork(networkId: NetworkId) {
rpc(
target = ProtocolSide.CORE,
"2removeNetwork(NetworkId)",
qVariant(networkId, QuasselType.NetworkId),
)
}
@SyncedCall(name = "2changePassword(PeerPtr,QString,QString,QString)", target = ProtocolSide.CORE)
fun changePassword(peerPtr: ULong, user: String?, old: String?, new: String?) {
rpc(
target = ProtocolSide.CORE,
"2changePassword(PeerPtr,QString,QString,QString)",
qVariant(peerPtr, QuasselType.PeerPtr),
qVariant(user, QtType.QString),
qVariant(old, QtType.QString),
qVariant(new, QtType.QString)
)
}
@SyncedCall(name = "2kickClient(int)", target = ProtocolSide.CORE)
fun requestKickClient(id: Int) {
rpc(
target = ProtocolSide.CORE,
"2kickClient(int)",
qVariant(id, QtType.Int)
)
}
@SyncedCall(name = "2sendInput(BufferInfo,QString)", target = ProtocolSide.CORE)
fun sendInput(bufferInfo: BufferInfo, message: String?) {
rpc(
target = ProtocolSide.CORE,
"2sendInput(BufferInfo,QString)",
qVariant(bufferInfo, QuasselType.BufferInfo),
qVariant(message, QtType.QString)
)
}
}
/*
* libquassel
* Copyright (c) 2021 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*/
package de.justjanne.libquassel.protocol.syncables.stubs
import de.justjanne.libquassel.annotations.ProtocolSide
import de.justjanne.libquassel.annotations.SyncedCall
import de.justjanne.libquassel.annotations.SyncedObject
import de.justjanne.libquassel.protocol.models.dcc.TransferIdList
import de.justjanne.libquassel.protocol.models.types.QtType
import de.justjanne.libquassel.protocol.models.types.QuasselType
import de.justjanne.libquassel.protocol.syncables.StatefulSyncableStub
import de.justjanne.libquassel.protocol.variant.QVariantMap
import de.justjanne.libquassel.protocol.variant.qVariant
import java.util.UUID
@SyncedObject("TransferManager")
interface TransferManagerStub : StatefulSyncableStub {
@SyncedCall(target = ProtocolSide.CLIENT)
fun setTransferIds(transferIds: TransferIdList) {
sync(
target = ProtocolSide.CLIENT,
"setTransferIds",
qVariant(transferIds, QuasselType.TransferIdList)
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun onCoreTransferAdded(transferId: UUID) {
sync(
target = ProtocolSide.CLIENT,
"onCoreTransferAdded",
qVariant(transferId, QtType.Uuid)
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
override fun update(properties: QVariantMap) = super.update(properties)
@SyncedCall(target = ProtocolSide.CORE)
override fun requestUpdate(properties: QVariantMap) = super.requestUpdate(properties)
}
/*
* libquassel
* Copyright (c) 2021 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*/
package de.justjanne.libquassel.protocol.syncables.stubs
import de.justjanne.libquassel.annotations.ProtocolSide
import de.justjanne.libquassel.annotations.SyncedCall
import de.justjanne.libquassel.annotations.SyncedObject
import de.justjanne.libquassel.protocol.models.dcc.TransferDirection
import de.justjanne.libquassel.protocol.models.dcc.TransferStatus
import de.justjanne.libquassel.protocol.models.types.QtType
import de.justjanne.libquassel.protocol.models.types.QuasselType
import de.justjanne.libquassel.protocol.syncables.StatefulSyncableStub
import de.justjanne.libquassel.protocol.variant.QVariantMap
import de.justjanne.libquassel.protocol.variant.qVariant
import java.net.InetAddress
import java.nio.ByteBuffer
@SyncedObject("Transfer")
interface TransferStub : StatefulSyncableStub {
@SyncedCall(target = ProtocolSide.CLIENT)
fun accept(savePath: String) {
sync(
target = ProtocolSide.CLIENT,
"accept",
qVariant(savePath, QtType.QString)
)
}
@SyncedCall(target = ProtocolSide.CORE)
fun requestAccepted(peer: ULong = 0uL) {
sync(
target = ProtocolSide.CORE,
"requestAccepted",
qVariant(peer, QtType.ULong)
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun reject() {
sync(
target = ProtocolSide.CLIENT,
"reject"
)
}
@SyncedCall(target = ProtocolSide.CORE)
fun requestRejected(peer: ULong = 0uL) {
sync(
target = ProtocolSide.CORE,
"requestRejected",
qVariant(peer, QtType.ULong)
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setStatus(status: TransferStatus) {
sync(
target = ProtocolSide.CLIENT,
"setStatus",
qVariant(status, QuasselType.TransferStatus)
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setDirection(direction: TransferDirection) {
sync(
target = ProtocolSide.CLIENT,
"setDirection",
qVariant(direction, QuasselType.TransferDirection)
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setAddress(address: InetAddress) {
sync(
target = ProtocolSide.CLIENT,
"setAddress",
qVariant(address, QuasselType.QHostAddress)
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setPort(port: UShort) {
sync(
target = ProtocolSide.CLIENT,
"setPort",
qVariant(port, QtType.UShort)
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setFileName(fileName: String) {
sync(
target = ProtocolSide.CLIENT,
"setFileName",
qVariant(fileName, QtType.QString)
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setFileSize(fileSize: ULong) {
sync(
target = ProtocolSide.CLIENT,
"setFileSize",
qVariant(fileSize, QtType.ULong)
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setNick(nick: String) {
sync(
target = ProtocolSide.CLIENT,
"setNick",
qVariant(nick, QtType.QString)
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setError(errorString: String) {
sync(
target = ProtocolSide.CLIENT,
"setError",
qVariant(errorString, QtType.QString)
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun dataReceived(peer: ULong, data: ByteBuffer) {
sync(
target = ProtocolSide.CLIENT,
"dataReceived",
qVariant(peer, QuasselType.PeerPtr),
qVariant(data, QtType.QByteArray)
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun cleanUp() {
sync(
target = ProtocolSide.CLIENT,
"cleanUp",
)
}
@SyncedCall(target = ProtocolSide.CLIENT)
override fun update(properties: QVariantMap) = super.update(properties)
@SyncedCall(target = ProtocolSide.CORE)
override fun requestUpdate(properties: QVariantMap) = super.requestUpdate(properties)
}
......@@ -9,12 +9,11 @@
package de.justjanne.libquassel.protocol.util
import de.justjanne.libquassel.annotations.Generated
import de.justjanne.libquassel.protocol.util.expansion.Expansion
import java.util.function.Supplier
internal abstract class ParsingContext<T>(
internal val text: String
internal val text: String,
) {
protected abstract val matchers: List<Supplier<T?>>
......@@ -34,10 +33,9 @@ internal abstract class ParsingContext<T>(
return result
}
@Generated
protected inline fun match(
vararg patterns: String,
crossinline function: (String) -> Expansion
crossinline function: (String) -> Expansion,
) = Supplier {
for (pattern in patterns) {
if (text.startsWith(pattern, startIndex = position)) {
......@@ -48,10 +46,9 @@ internal abstract class ParsingContext<T>(
return@Supplier null
}
@Generated
protected inline fun match(
vararg patterns: Regex,
crossinline function: (String, List<String>) -> Expansion
crossinline function: (String, List<String>) -> Expansion,
) = Supplier {
for (pattern in patterns) {
val match = pattern.find(text, startIndex = position)
......
......@@ -13,5 +13,6 @@ import kotlinx.coroutines.flow.Flow
interface StateHolder<T> {
fun state(): T
fun flow(): Flow<T>
}
......@@ -17,12 +17,14 @@ import kotlinx.coroutines.flow.flowOf
@ExperimentalCoroutinesApi
@Suppress("NOTHING_TO_INLINE")
inline fun <T> Flow<StateHolder<T>?>.flatMap(): Flow<T?> =
flatMapLatest { it?.flow() ?: flowOf(null) }
inline fun <T> Flow<StateHolder<T>?>.flatMap(): Flow<T?> = flatMapLatest { it?.flow() ?: flowOf(null) }
@ExperimentalCoroutinesApi
inline fun <reified T> Flow<Iterable<StateHolder<T>>?>.combineLatest(): Flow<List<T>> =
flatMapLatest {
if (it != null) combine(it.map(StateHolder<T>::flow), ::listOf)
else flowOf(emptyList())
if (it != null) {
combine(it.map(StateHolder<T>::flow), ::listOf)
} else {
flowOf(emptyList())
}
}
......@@ -9,7 +9,10 @@
package de.justjanne.libquassel.protocol.util.collections
fun <T> List<T>.insert(value: T, pos: Int = size): List<T> {
fun <T> List<T>.insert(
value: T,
pos: Int = size,
): List<T> {
return if (pos <= 0) {
listOf(value) + this
} else if (pos >= size) {
......
......@@ -9,4 +9,7 @@
package de.justjanne.libquassel.protocol.util.collections
inline val <K, V> Map<K, V>.indices get() = 0 until size
fun <T> List<T>.move(
value: T,
pos: Int = size,
): List<T> = minus(value).insert(value, pos.coerceIn(0, size))