2022-01-27 14:23:39 +01:00
|
|
|
//
|
|
|
|
// NotificationTableViewCellDelegate.swift
|
|
|
|
// Mastodon
|
|
|
|
//
|
|
|
|
// Created by MainasuK on 2022-1-26.
|
|
|
|
//
|
|
|
|
|
|
|
|
import UIKit
|
|
|
|
import MastodonUI
|
|
|
|
import MetaTextKit
|
|
|
|
|
|
|
|
// sourcery: protocolName = "NotificationViewDelegate"
|
|
|
|
// sourcery: replaceOf = "notificationView(notificationView"
|
|
|
|
// sourcery: replaceWith = "delegate?.tableViewCell(self, notificationView: notificationView"
|
|
|
|
protocol NotificationViewContainerTableViewCell: UITableViewCell, AutoGenerateProtocolRelayDelegate {
|
|
|
|
var delegate: NotificationTableViewCellDelegate? { get }
|
|
|
|
var notificationView: NotificationView { get }
|
|
|
|
}
|
|
|
|
|
|
|
|
// MARK: - AutoGenerateProtocolDelegate
|
|
|
|
// sourcery: protocolName = "NotificationViewDelegate"
|
|
|
|
// sourcery: replaceOf = "notificationView(_"
|
|
|
|
// sourcery: replaceWith = "func tableViewCell(_ cell: UITableViewCell,"
|
|
|
|
protocol NotificationTableViewCellDelegate: AnyObject, AutoGenerateProtocolDelegate {
|
|
|
|
// sourcery:inline:NotificationTableViewCellDelegate.AutoGenerateProtocolDelegate
|
|
|
|
func tableViewCell(_ cell: UITableViewCell, notificationView: NotificationView, authorAvatarButtonDidPressed button: AvatarButton)
|
|
|
|
func tableViewCell(_ cell: UITableViewCell, notificationView: NotificationView, menuButton button: UIButton, didSelectAction action: MastodonMenu.Action)
|
|
|
|
func tableViewCell(_ cell: UITableViewCell, notificationView: NotificationView, statusView: StatusView, metaText: MetaText, didSelectMeta meta: Meta)
|
2022-02-11 12:27:14 +01:00
|
|
|
func tableViewCell(_ cell: UITableViewCell, notificationView: NotificationView, statusView: StatusView, spoilerOverlayViewDidPressed overlayView: SpoilerOverlayView)
|
2022-01-27 14:23:39 +01:00
|
|
|
func tableViewCell(_ cell: UITableViewCell, notificationView: NotificationView, statusView: StatusView, actionToolbarContainer: ActionToolbarContainer, buttonDidPressed button: UIButton, action: ActionToolbarContainer.Action)
|
|
|
|
func tableViewCell(_ cell: UITableViewCell, notificationView: NotificationView, quoteStatusView: StatusView, authorAvatarButtonDidPressed button: AvatarButton)
|
|
|
|
func tableViewCell(_ cell: UITableViewCell, notificationView: NotificationView, quoteStatusView: StatusView, metaText: MetaText, didSelectMeta meta: Meta)
|
2022-02-11 12:27:14 +01:00
|
|
|
func tableViewCell(_ cell: UITableViewCell, notificationView: NotificationView, quoteStatusView: StatusView, spoilerOverlayViewDidPressed overlayView: SpoilerOverlayView)
|
2022-02-10 13:01:52 +01:00
|
|
|
func tableViewCell(_ cell: UITableViewCell, notificationView: NotificationView, accessibilityActivate: Void)
|
2022-01-27 14:23:39 +01:00
|
|
|
// sourcery:end
|
|
|
|
}
|
|
|
|
|
|
|
|
// MARK: - AutoGenerateProtocolDelegate
|
|
|
|
// Protocol Extension
|
|
|
|
extension NotificationViewDelegate where Self: NotificationViewContainerTableViewCell {
|
|
|
|
// sourcery:inline:NotificationViewContainerTableViewCell.AutoGenerateProtocolRelayDelegate
|
|
|
|
func notificationView(_ notificationView: NotificationView, authorAvatarButtonDidPressed button: AvatarButton) {
|
|
|
|
delegate?.tableViewCell(self, notificationView: notificationView, authorAvatarButtonDidPressed: button)
|
|
|
|
}
|
|
|
|
|
|
|
|
func notificationView(_ notificationView: NotificationView, menuButton button: UIButton, didSelectAction action: MastodonMenu.Action) {
|
|
|
|
delegate?.tableViewCell(self, notificationView: notificationView, menuButton: button, didSelectAction: action)
|
|
|
|
}
|
|
|
|
|
|
|
|
func notificationView(_ notificationView: NotificationView, statusView: StatusView, metaText: MetaText, didSelectMeta meta: Meta) {
|
|
|
|
delegate?.tableViewCell(self, notificationView: notificationView, statusView: statusView, metaText: metaText, didSelectMeta: meta)
|
|
|
|
}
|
|
|
|
|
2022-02-11 12:27:14 +01:00
|
|
|
func notificationView(_ notificationView: NotificationView, statusView: StatusView, spoilerOverlayViewDidPressed overlayView: SpoilerOverlayView) {
|
|
|
|
delegate?.tableViewCell(self, notificationView: notificationView, statusView: statusView, spoilerOverlayViewDidPressed: overlayView)
|
|
|
|
}
|
|
|
|
|
2022-01-27 14:23:39 +01:00
|
|
|
func notificationView(_ notificationView: NotificationView, statusView: StatusView, actionToolbarContainer: ActionToolbarContainer, buttonDidPressed button: UIButton, action: ActionToolbarContainer.Action) {
|
|
|
|
delegate?.tableViewCell(self, notificationView: notificationView, statusView: statusView, actionToolbarContainer: actionToolbarContainer, buttonDidPressed: button, action: action)
|
|
|
|
}
|
|
|
|
|
|
|
|
func notificationView(_ notificationView: NotificationView, quoteStatusView: StatusView, authorAvatarButtonDidPressed button: AvatarButton) {
|
|
|
|
delegate?.tableViewCell(self, notificationView: notificationView, quoteStatusView: quoteStatusView, authorAvatarButtonDidPressed: button)
|
|
|
|
}
|
|
|
|
|
|
|
|
func notificationView(_ notificationView: NotificationView, quoteStatusView: StatusView, metaText: MetaText, didSelectMeta meta: Meta) {
|
|
|
|
delegate?.tableViewCell(self, notificationView: notificationView, quoteStatusView: quoteStatusView, metaText: metaText, didSelectMeta: meta)
|
|
|
|
}
|
2022-02-10 13:01:52 +01:00
|
|
|
|
2022-02-11 12:27:14 +01:00
|
|
|
func notificationView(_ notificationView: NotificationView, quoteStatusView: StatusView, spoilerOverlayViewDidPressed overlayView: SpoilerOverlayView) {
|
|
|
|
delegate?.tableViewCell(self, notificationView: notificationView, quoteStatusView: quoteStatusView, spoilerOverlayViewDidPressed: overlayView)
|
|
|
|
}
|
|
|
|
|
2022-02-10 13:01:52 +01:00
|
|
|
func notificationView(_ notificationView: NotificationView, accessibilityActivate: Void) {
|
|
|
|
delegate?.tableViewCell(self, notificationView: notificationView, accessibilityActivate: accessibilityActivate)
|
|
|
|
}
|
2022-01-27 14:23:39 +01:00
|
|
|
// sourcery:end
|
|
|
|
}
|