summaryrefslogtreecommitdiffstats
path: root/macosx/HBFilePromiseProvider.m
blob: 5af547b7add4691c00303d395c247d1dba6828e3 (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 © 2021 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