/core/externals/update-engine/externals/google-toolbox-for-mac/AppKit/GTMNSImage+SearchCache.h

http://macfuse.googlecode.com/ · C++ Header · 41 lines · 6 code · 3 blank · 32 comment · 0 complexity · a777c747eb675ad1b739c0216c81e28f MD5 · raw file

  1. //
  2. // GTMNSImage+SearchCache.h
  3. //
  4. // Finds NSImages using a variety of techniques
  5. //
  6. // Copyright 2009 Google Inc.
  7. //
  8. // Licensed under the Apache License, Version 2.0 (the "License"); you may not
  9. // use this file except in compliance with the License. You may obtain a copy
  10. // of the License at
  11. //
  12. // http://www.apache.org/licenses/LICENSE-2.0
  13. //
  14. // Unless required by applicable law or agreed to in writing, software
  15. // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  16. // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  17. // License for the specific language governing permissions and limitations under
  18. // the License.
  19. //
  20. // This category provides convenience methods for image initialization based
  21. // on creating an image by searching the following locations:
  22. //
  23. // * A specified bundle
  24. // * Main bundle / +[NSImage imageNamed]
  25. // * An exact path for an image
  26. // * An exact path for any file (using the icon)
  27. // * An app bundle id (using the icon)
  28. // * A file type as .extension, 'OSTYPE' (in single quotes), or UTI
  29. // * An icon in the system icon bundle
  30. //
  31. // TODO(alcor): this class should have basic MRU cache
  32. //
  33. #import <AppKit/AppKit.h>
  34. @interface NSImage (GTMNSImageSearchCache)
  35. + (NSImage *)gtm_imageWithPath:(NSString *)path;
  36. + (NSImage *)gtm_imageNamed:(NSString *)name;
  37. + (NSImage *)gtm_imageNamed:(NSString *)name forBundle:(NSBundle *)bundle;
  38. @end