Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Threema/Threema/Core/   (Social Medium ©)  Datei vom 26.9.2026 mit Größe 2 kB image not shown  

Quelle  ShortcutItemProvider.swift   Sprache: JAVA

 

import Foundation
import ThreemaMacros

/// Provides list of available shortcut items
///
/// To add a new shortcut item:
/// 1. Add a new case to the `ActionType` enum
/// 2. Add the new case to the `items(for:)` method
enum UIApplicationShortcutItemProvider {
    
    enum ActionType {
        case newMessage
        case myID
        case scanQrCode
        
        var localizedTitle: String {
            switch self {
            case .newMessage:
                #localize("application_shortcut_item_new_message")
            case .myID:
                #localize("application_shortcut_item_my_id")
            case .scanQrCode:
                #localize("scan_qr_code_sentence")
            }
        }
      
        var icon: String {
            switch self {
            case .newMessage:
                "square.and.pencil"
            case .myID:
                "person.crop.rectangle.fill"
            case .scanQrCode:
                "qrcode.viewfinder"
            }
        }
        
        var type: String {
            switch self {
            case .newMessage:
                "ch.threema.newmessage"
            case .myID:
                "ch.threema.myid"
            case .scanQrCode:
                "ch.threema.scanid"
            }
        }
        
        var item: UIApplicationShortcutItem {
            .init(
                type: type,
                localizedTitle: localizedTitle,
                localizedSubtitle: nil,
                icon: UIApplicationShortcutIcon(systemImageName: icon)
            )
        }
    }
    
    /// This method will return an array of shortcut items that are displayed on the home screen.
    ///
    /// - Parameter mdm: used for dynamic shortcut items
    /// - Returns: an array of shortcut items
    static func items(for mdm: MDMSetup) -> [UIApplicationShortcutItem] {
        var items: [ActionType] = [.newMessage, .myID]

        if !mdm.disableAddContact() {
            items.append(.scanQrCode)
        }
        
        return items.map(\.item)
    }
}

Messung
CHZG
869410093

¤ Dauer der Verarbeitung: 0.0 Sekunden  (vorverarbeitet am  2026-11-04) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover


Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.