Merged with trunk R1393.
[ardour.git] / tools / Spotlight Importer / GetMetadataForFile.c
1 #include <CoreFoundation/CoreFoundation.h>
2 #include <CoreServices/CoreServices.h> 
3
4 /* -----------------------------------------------------------------------------
5    Step 1
6    Set the UTI types the importer supports
7   
8    Modify the CFBundleDocumentTypes entry in Info.plist to contain
9    an array of Uniform Type Identifiers (UTI) for the LSItemContentTypes 
10    that your importer can handle
11   
12    ----------------------------------------------------------------------------- */
13
14 /* -----------------------------------------------------------------------------
15    Step 2 
16    Implement the GetMetadataForFile function
17   
18    Implement the GetMetadataForFile function below to scrape the relevant
19    metadata from your document and return it as a CFDictionary using standard keys
20    (defined in MDItem.h) whenever possible.
21    ----------------------------------------------------------------------------- */
22
23 /* -----------------------------------------------------------------------------
24    Step 3 (optional) 
25    If you have defined new attributes, update the schema.xml file
26   
27    Edit the schema.xml file to include the metadata keys that your importer returns.
28    Add them to the <allattrs> and <displayattrs> elements.
29   
30    Add any custom types that your importer requires to the <attributes> element
31   
32    <attribute name="com_mycompany_metadatakey" type="CFString" multivalued="true"/>
33   
34    ----------------------------------------------------------------------------- */
35
36
37
38 /* -----------------------------------------------------------------------------
39     Get metadata attributes from file
40    
41    This function's job is to extract useful information your file format supports
42    and return it as a dictionary
43    ----------------------------------------------------------------------------- */
44
45 Boolean GetMetadataForFile(void* thisInterface, 
46                            CFMutableDictionaryRef attributes, 
47                            CFStringRef contentTypeUTI,
48                            CFStringRef pathToFile)
49 {
50     /* Pull any available metadata from the file at the specified path */
51     /* Return the attribute keys and attribute values in the dict */
52     /* Return TRUE if successful, FALSE if there was no data provided */
53     
54     #warning To complete your importer please implement the function GetMetadataForFile in GetMetadataForFile.c
55     return FALSE;
56 }