Swiftgram/submodules/InstantPageUI/Sources/InstantPageAnchorItem.swift
2022-12-17 00:17:31 +04:00

51 lines
1.7 KiB
Swift

import Foundation
import UIKit
import Postbox
import TelegramCore
import AsyncDisplayKit
import TelegramPresentationData
import TelegramUIPreferences
import AccountContext
import ContextUI
final class InstantPageAnchorItem: InstantPageItem {
let wantsNode: Bool = false
let separatesTiles: Bool = false
let medias: [InstantPageMedia] = []
let anchor: String
var frame: CGRect
init(frame: CGRect, anchor: String) {
self.frame = frame
self.anchor = anchor
}
func matchesAnchor(_ anchor: String) -> Bool {
return anchor == self.anchor
}
func drawInTile(context: CGContext) {
}
func node(context: AccountContext, strings: PresentationStrings, nameDisplayOrder: PresentationPersonNameOrder, theme: InstantPageTheme, sourceLocation: InstantPageSourceLocation, openMedia: @escaping (InstantPageMedia) -> Void, longPressMedia: @escaping (InstantPageMedia) -> Void, activatePinchPreview: ((PinchSourceContainerNode) -> Void)?, pinchPreviewFinished: ((InstantPageNode) -> Void)?, openPeer: @escaping (EnginePeer) -> Void, openUrl: @escaping (InstantPageUrlItem) -> Void, updateWebEmbedHeight: @escaping (CGFloat) -> Void, updateDetailsExpanded: @escaping (Bool) -> Void, currentExpandedDetails: [Int : Bool]?) -> InstantPageNode? {
return nil
}
func matchesNode(_ node: InstantPageNode) -> Bool {
return false
}
func linkSelectionRects(at point: CGPoint) -> [CGRect] {
return []
}
func distanceThresholdGroup() -> Int? {
return nil
}
func distanceThresholdWithGroupCount(_ count: Int) -> CGFloat {
return 0.0
}
}