summaryrefslogtreecommitdiff
path: root/fpcsrc/packages/cocoaint/src/foundation/NSURLCache.inc
blob: c1992ae1d5e4996cd1c212a9d3cde65bcadbde06 (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
{ Parsed from Foundation.framework NSURLCache.h }

{$ifdef TYPES}
{$ifndef NSURLCACHE_PAS_T}
{$define NSURLCACHE_PAS_T}

{ Constants }

const
  NSURLCacheStorageAllowed = 0;
  NSURLCacheStorageAllowedInMemoryOnly = 1;
  NSURLCacheStorageNotAllowed = 2;

{ Types }
type
  NSURLCacheStoragePolicy = NSUInteger;
  NSURLCacheStoragePolicyPtr = ^NSURLCacheStoragePolicy;

{$endif}
{$endif}

{$ifdef RECORDS}
{$ifndef NSURLCACHE_PAS_R}
{$define NSURLCACHE_PAS_R}

{$endif}
{$endif}

{$ifdef FUNCTIONS}
{$ifndef NSURLCACHE_PAS_F}
{$define NSURLCACHE_PAS_F}

{$endif}
{$endif}

{$ifdef EXTERNAL_SYMBOLS}
{$ifndef NSURLCACHE_PAS_S}
{$define NSURLCACHE_PAS_S}

{$endif}
{$endif}

{$ifdef FORWARD}
  NSCachedURLResponse = objcclass;
  NSCachedURLResponsePointer = ^NSCachedURLResponse;
  NSCachedURLResponsePtr = NSCachedURLResponsePointer;
  NSURLCache = objcclass;
  NSURLCachePointer = ^NSURLCache;
  NSURLCachePtr = NSURLCachePointer;

{$endif}

{$ifdef CLASSES}
{$ifndef NSURLCACHE_PAS_C}
{$define NSURLCACHE_PAS_C}

{ NSCachedURLResponse }
  NSCachedURLResponse = objcclass external (NSObject, NSCodingProtocol, NSCopyingProtocol)
  private
    _internal: NSCachedURLResponseInternal;
    
  public
    function initWithResponse_data(response_: NSURLResponse; data_: NSData): id; message 'initWithResponse:data:';
    function initWithResponse_data_userInfo_storagePolicy(response_: NSURLResponse; data_: NSData; userInfo_: NSDictionary; storagePolicy_: NSURLCacheStoragePolicy): id; message 'initWithResponse:data:userInfo:storagePolicy:';
    function response: NSURLResponse; message 'response';
    function data: NSData; message 'data';
    function userInfo: NSDictionary; message 'userInfo';
    function storagePolicy: NSURLCacheStoragePolicy; message 'storagePolicy';

    { Adopted Protocols }
    procedure encodeWithCoder(aCoder: NSCoder);
    function initWithCoder(aDecoder: NSCoder): id;
    function copyWithZone(zone_: NSZonePtr): id;
  end;

{ NSURLCache }
  NSURLCache = objcclass external (NSObject)
  private
    _internal: NSURLCacheInternal;
    
  public
    class function sharedURLCache: NSURLCache; message 'sharedURLCache';
    class procedure setSharedURLCache(cache: NSURLCache); message 'setSharedURLCache:';
    function initWithMemoryCapacity_diskCapacity_diskPath(memoryCapacity_: NSUInteger; diskCapacity_: NSUInteger; path: NSString): id; message 'initWithMemoryCapacity:diskCapacity:diskPath:';
    function cachedResponseForRequest(request: NSURLRequest): NSCachedURLResponse; message 'cachedResponseForRequest:';
    procedure storeCachedResponse_forRequest(cachedResponse: NSCachedURLResponse; request: NSURLRequest); message 'storeCachedResponse:forRequest:';
    procedure removeCachedResponseForRequest(request: NSURLRequest); message 'removeCachedResponseForRequest:';
    procedure removeAllCachedResponses; message 'removeAllCachedResponses';
    function memoryCapacity: NSUInteger; message 'memoryCapacity';
    function diskCapacity: NSUInteger; message 'diskCapacity';
    procedure setMemoryCapacity(memoryCapacity_: NSUInteger); message 'setMemoryCapacity:';
    procedure setDiskCapacity(diskCapacity_: NSUInteger); message 'setDiskCapacity:';
    function currentMemoryUsage: NSUInteger; message 'currentMemoryUsage';
    function currentDiskUsage: NSUInteger; message 'currentDiskUsage';
  end;

{$endif}
{$endif}