diff options
author | Kurt Zenker <kz@openoffice.org> | 2007-10-09 14:05:30 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2007-10-09 14:05:30 +0000 |
commit | aef466bd63d2af1ea2ea91932c0fee0ba35e73d3 (patch) | |
tree | 99359a8987cdd4faa2db3c7068f1db766b703b07 /extensions/source/macosx | |
parent | ae10bde58034c3d5e53e9a5018ab7c2381150232 (diff) |
INTEGRATION: CWS spotlightplugin01 (1.1.2); FILE ADDED
2007/09/14 21:06:33 fheckl 1.1.2.1: #72355 adding new files for macosx spotlight plugin
Diffstat (limited to 'extensions/source/macosx')
-rw-r--r-- | extensions/source/macosx/spotlight/GetMetadataForFile.m | 78 | ||||
-rw-r--r-- | extensions/source/macosx/spotlight/delzip | 0 |
2 files changed, 78 insertions, 0 deletions
diff --git a/extensions/source/macosx/spotlight/GetMetadataForFile.m b/extensions/source/macosx/spotlight/GetMetadataForFile.m new file mode 100644 index 000000000000..23af9a6a1d8f --- /dev/null +++ b/extensions/source/macosx/spotlight/GetMetadataForFile.m @@ -0,0 +1,78 @@ +/************************************************************************* +* +* OpenOffice.org - a multi-platform office productivity suite +* +* $RCSfile: GetMetadataForFile.m,v $ +* +* $Revision: 1.2 $ +* +* last change: $Author: kz $ $Date: 2007-10-09 15:04:18 $ +* +* The Contents of this file are made available subject to +* the terms of GNU Lesser General Public License Version 2.1. +* +* +* GNU Lesser General Public License Version 2.1 +* ============================================= +* Copyright 2005 by Sun Microsystems, Inc. +* 901 San Antonio Road, Palo Alto, CA 94303, USA +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License version 2.1, as published by the Free Software Foundation. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, +* MA 02111-1307 USA +* +*************************************************************************/ + +#include <CoreFoundation/CoreFoundation.h> +#include <CoreServices/CoreServices.h> +#include <Foundation/Foundation.h> + + +#import "OOoSpotlightImporter.h" + + +/* ----------------------------------------------------------------------------- + Get metadata attributes from file + + This function's job is to extract useful information your file format supports + and return it as a dictionary + ----------------------------------------------------------------------------- */ + +Boolean GetMetadataForFile(void* thisInterface, + CFMutableDictionaryRef attributes, + CFStringRef contentTypeUTI, + CFStringRef pathToFile) +{ + /* Pull any available metadata from the file at the specified path */ + /* Return the attribute keys and attribute values in the dict */ + /* Return TRUE if successful, FALSE if there was no data provided */ + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + + OOoSpotlightImporter *importer = [OOoSpotlightImporter new]; + + Boolean importOK = NO; + @try { + importOK = [importer importDocument:(NSString*)pathToFile + contentType:(NSString*)contentTypeUTI + attributes:(NSMutableDictionary*)attributes]; + } + @catch (NSException *exception) { + NSLog(@"main: Caught %@: %@", [exception name], [exception reason]); + } + + [importer release]; + + [pool release]; + + return importOK; +} diff --git a/extensions/source/macosx/spotlight/delzip b/extensions/source/macosx/spotlight/delzip new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/extensions/source/macosx/spotlight/delzip |