Updated Info.plist to declare:
[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    (DONE)
13    ----------------------------------------------------------------------------- */
14
15 /* -----------------------------------------------------------------------------
16    Step 2 
17    Implement the GetMetadataForFile function
18   
19    Implement the GetMetadataForFile function below to scrape the relevant
20    metadata from your document and return it as a CFDictionary using standard keys
21    (defined in MDItem.h) whenever possible.
22    ----------------------------------------------------------------------------- */
23
24 /* -----------------------------------------------------------------------------
25    Step 3 (optional) 
26    If you have defined new attributes, update the schema.xml file
27   
28    Edit the schema.xml file to include the metadata keys that your importer returns.
29    Add them to the <allattrs> and <displayattrs> elements.
30   
31    Add any custom types that your importer requires to the <attributes> element
32   
33    <attribute name="com_mycompany_metadatakey" type="CFString" multivalued="true"/>
34   
35    ----------------------------------------------------------------------------- */
36
37
38
39 /* -----------------------------------------------------------------------------
40     Get metadata attributes from file
41    
42    This function's job is to extract useful information your file format supports
43    and return it as a dictionary
44    ----------------------------------------------------------------------------- */
45
46 Boolean GetMetadataForFile(void* thisInterface, 
47                            CFMutableDictionaryRef attributes, 
48                            CFStringRef contentTypeUTI,
49                            CFStringRef pathToFile)
50 {
51     /* Pull any available metadata from the file at the specified path */
52     /* Return the attribute keys and attribute values in the dict */
53     /* Return TRUE if successful, FALSE if there was no data provided */
54     
55     #warning To complete your importer please implement the function GetMetadataForFile in GetMetadataForFile.c
56     return FALSE;
57 }