PageRenderTime 26ms CodeModel.GetById 23ms RepoModel.GetById 1ms app.codeStats 0ms

/filesystems-objc/SpotlightFS/Source/SpotlightFS.h

http://macfuse.googlecode.com/
C Header | 89 lines | 14 code | 11 blank | 64 comment | 0 complexity | 1fdf149278c0d7419545cf6290c1d4da MD5 | raw file
Possible License(s): Apache-2.0, BSD-3-Clause, GPL-2.0
  1. // ================================================================
  2. // Copyright (C) 2007 Google Inc.
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License");
  5. // you may not use this file except in compliance with the License.
  6. // You may obtain a copy of the License at
  7. //
  8. // http://www.apache.org/licenses/LICENSE-2.0
  9. //
  10. // Unless required by applicable law or agreed to in writing, software
  11. // distributed under the License is distributed on an "AS IS" BASIS,
  12. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. // See the License for the specific language governing permissions and
  14. // limitations under the License.
  15. // ================================================================
  16. //
  17. // SpotlightFS.h
  18. // SpotlightFS
  19. //
  20. // Created by Greg Miller <jgm@> on 1/19/07.
  21. //
  22. #import <Cocoa/Cocoa.h>
  23. // A MacFUSE file system for creating real smart folders. The SpotlightFS
  24. // file system may consist of some top-level directories, and each of these
  25. // directories contain symbolic links to files matching some Spotlight query.
  26. //
  27. // In the simplest case, the Spotlight query used to generate the contents of
  28. // a directory is simply the name of the diretory itself. For example, a
  29. // directory named /Volumes/SpotlightFS/foo would contain symbolic links to
  30. // all files that match a Spotlight query for the word "foo".
  31. //
  32. // Additionally, SpotlightFS looks in "~/Library/Saved Searches" for all files
  33. // with a ".savedSearch" extension, and automatically creates top-level
  34. // directories for these files. The Spotlight query which generates the
  35. // contents for these directories is found by reading the "RawQuery" key from
  36. // the saved search plist.
  37. //
  38. // See the documentation for FUSEFileSystem for more details.
  39. //
  40. @interface SpotlightFS : NSObject {
  41. // Empty
  42. }
  43. // Returns an array of all *.savedSearch files in "~/Library/Saved Searches".
  44. // The returned paths have the ".savedSearch" extension removed. If no
  45. // saved searches are found, then an empty array is returned rather than nil.
  46. //
  47. - (NSArray *)spotlightSavedSearches;
  48. // Returns a dictionary with the contents of the saved search file named "name",
  49. // or "name.savedSearch".
  50. //
  51. - (NSDictionary *)contentsOfSpotlightSavedSearchNamed:(NSString *)name;
  52. // Returns all the user-created search folders.
  53. //
  54. - (NSArray *)userCreatedFolders;
  55. // Returns YES if |path| is a user created folder.
  56. //
  57. - (BOOL)isUserCreatedFolder:(NSString *)path;
  58. // Sets the full user-created folders array.
  59. //
  60. - (void)setUserCreatedFolders:(NSArray *)folders;
  61. // Adds one search (i.e. directory name) to the list of user-created folders.
  62. // As an example, "mkdir /Volumes/SpotlightFS/foo" will ultimately call through
  63. // to this method to create the user-defined search for "foo".
  64. //
  65. - (void)addUserCreatedFolder:(NSString *)folder;
  66. // Remove a user-defined search.
  67. //
  68. - (void)removeUserCreatedFolder:(NSString *)folder;
  69. // Returns the concatenation of -spotlightSavedSearches and -userCreatedFolderes
  70. //
  71. - (NSArray *)topLevelDirectories;
  72. // Runs the Spotlight query specified by "queryString", and returns the paths
  73. // for all the matching files. The returned paths are encoded, meaning that
  74. // all forward slashes have been replaced by colons.
  75. //
  76. - (NSArray *)encodedPathResultsForSpotlightQuery:(NSString *)queryString
  77. scope:(NSArray *)scopeDirectories;
  78. @end