summaryrefslogtreecommitdiffstats
path: root/macosx/HBFilePromiseProvider.m
blob: b4c9e356e3394c3ba9bc29173e0cf5aae04a1a4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//
//  HBFilePromiseProvider.m
//  HandBrake
//
//  Created by Damiano Galassi on 09/01/2020.
//  Copyright © 2020 HandBrake. All rights reserved.
//

#import "HBFilePromiseProvider.h"

@implementation HBFilePromiseProvider

- (NSArray<NSPasteboardType> *)writableTypesForPasteboard:(NSPasteboard *)pasteboard
{
    NSMutableArray<NSPasteboardType> *types = [[super writableTypesForPasteboard:pasteboard] mutableCopy];
    [types addObject:kHandBrakeInternalPBoardType];
    return types;
}

- (NSPasteboardWritingOptions)writingOptionsForType:(NSPasteboardType)type pasteboard:(NSPasteboard *)pasteboard
{
    if ([type isEqualToString:kHandBrakeInternalPBoardType])
    {
        return 0;
    }

    return [super writingOptionsForType:type pasteboard:pasteboard];
}

- (id)pasteboardPropertyListForType:(NSPasteboardType)type
{
    if ([type isEqualToString:kHandBrakeInternalPBoardType])
    {
        return kHandBrakeInternalPBoardType;
    }

    return [super pasteboardPropertyListForType:type];
}

@end