PageRenderTime 16ms CodeModel.GetById 13ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/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
21// This category provides convenience methods for image initialization based
22// on creating an image by searching the following locations:
23//
24// * A specified bundle
25// * Main bundle / +[NSImage imageNamed]
26// * An exact path for an image
27// * An exact path for any file (using the icon)
28// * An app bundle id (using the icon)
29// * A file type as .extension,  'OSTYPE' (in single quotes), or UTI
30// * An icon in the system icon bundle
31//
32// TODO(alcor): this class should have basic MRU cache
33//
34
35#import <AppKit/AppKit.h>
36
37@interface NSImage (GTMNSImageSearchCache)
38+ (NSImage *)gtm_imageWithPath:(NSString *)path;
39+ (NSImage *)gtm_imageNamed:(NSString *)name;
40+ (NSImage *)gtm_imageNamed:(NSString *)name forBundle:(NSBundle *)bundle;
41@end