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

/core/sdk-objc/GMFinderInfo.h

http://macfuse.googlecode.com/
C++ Header | 127 lines | 21 code | 15 blank | 91 comment | 0 complexity | 86e5c57bbecea869737f2600c7cba24d MD5 | raw file
  1// ================================================================
  2// Copyright (c) 2007, Google Inc.
  3// All rights reserved.
  4//
  5// Redistribution and use in source and binary forms, with or without
  6// modification, are permitted provided that the following conditions are
  7// met:
  8//
  9// * Redistributions of source code must retain the above copyright
 10//   notice, this list of conditions and the following disclaimer.
 11// * Redistributions in binary form must reproduce the above
 12//   copyright notice, this list of conditions and the following disclaimer
 13//   in the documentation and/or other materials provided with the
 14//   distribution.
 15// * Neither the name of Google Inc. nor the names of its
 16//   contributors may be used to endorse or promote products derived from
 17//   this software without specific prior written permission.
 18//
 19// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 20// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 21// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 22// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 23// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 24// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 25// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 26// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 27// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 28// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 29// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 30// ================================================================
 31//
 32//  GMFinderInfo.h
 33//  MacFUSE
 34//
 35//  Created by ted on 12/29/07.
 36//
 37
 38/*!
 39 * @header GMFinderInfo
 40 *
 41 * A utility class to construct raw data for FinderInfo. 
 42 * 
 43 * In OS 10.4, the FinderInfo for a file may be present in an AppleDouble (._) 
 44 * file that is associated with the file. In 10.5+, the FinderInfo is present in 
 45 * the com.apple.FinderInfo extended attribute on a file.
 46 */
 47
 48#import <Foundation/Foundation.h>
 49
 50#define GM_EXPORT __attribute__((visibility("default")))
 51
 52/*!
 53 * @class
 54 * @discussion This class can be used to construct raw NSData for FinderInfo.
 55 * For more information about FinderInfo and what it can contain, see
 56 * the CarbonCore/Finder.h header file.
 57 */
 58GM_EXPORT @interface GMFinderInfo : NSObject {
 59 @private
 60  UInt16 flags_;
 61  UInt16 extendedFlags_;
 62  OSType typeCode_;
 63  OSType creatorCode_;
 64}
 65
 66/*! @abstract Returns an autorleased GMFinderInfo */
 67+ (GMFinderInfo *)finderInfo;
 68
 69/*! 
 70 * @abstract Sets FinderInfo flags.
 71 * @discussion See CarbonCore/Finder.h for the set of flags.
 72 * @param flags OR'd set of valid Finder flags.
 73 */
 74- (void)setFlags:(UInt16)flags;
 75
 76/*! 
 77 * @abstract Sets FinderInfo extended flags.
 78 * @discussion See CarbonCore/Finder.h for the set of extended flags.
 79 * @param flags OR'd set of valid Finder extended flags.
 80 */
 81- (void)setExtendedFlags:(UInt16)extendedFlags;
 82
 83/*! 
 84 * @abstract Sets FinderInfo four-char type code.
 85 * @param typeCode The four-char type code to set.
 86 */
 87- (void)setTypeCode:(OSType)typeCode;
 88
 89/*! 
 90 * @abstract Sets FinderInfo four-char creator code.
 91 * @param typeCode The four-char creator code to set.
 92 */
 93- (void)setCreatorCode:(OSType)creatorCode;
 94
 95/*! 
 96 * @abstract Constucts the raw data for the FinderInfo.
 97 * @result NSData for the FinderInfo based on the current settings.
 98 */
 99- (NSData *)data;
100
101// -- Deprecated Convenience Methods --
102
103/*! 
104 * @abstract NSData for a FinderInfo with the given flags.
105 * @param flags OR'd set of FinderInfo flags.
106 * @result NSData of the FinderInfo.
107 * @deprecated This method is deprecated.
108 */
109+ (NSData *)finderInfoWithFinderFlags:(UInt16)flags;
110
111// Suitable only for files (not directories), this version allows you to
112// specify type and creator four-char-codes in addition to the flags.
113/*! 
114 * @abstract NSData for a FinderInfo with the given flags, type, and creator.
115 * @param flags OR'd set of FinderInfo flags.
116 * @param typeCode The four-char type code.
117 * @param creatorCode The four-char creator code.
118 * @result NSData of the FinderInfo.
119 * @deprecated This method is deprecated.
120 */
121+ (NSData *)finderInfoWithFinderFlags:(UInt16)flags
122                             typeCode:(OSType)typeCode
123                          creatorCode:(OSType)creatorCode;
124
125@end
126
127#undef GM_EXPORT