/core/externals/google-toolbox-for-mac/AppKit/GTMFadeTruncatingTextFieldCell.h

http://macfuse.googlecode.com/ · C Header · 46 lines · 16 code · 9 blank · 21 comment · 0 complexity · 7ae3ed97d61c651147f00c884c76370a MD5 · raw file

  1. //
  2. // GTMFadeTruncatingTextFieldCell.h
  3. //
  4. // Copyright 2009 Google Inc.
  5. //
  6. // Licensed under the Apache License, Version 2.0 (the "License"); you may not
  7. // use this file except in compliance with the License. You may obtain a copy
  8. // of the License at
  9. //
  10. // http://www.apache.org/licenses/LICENSE-2.0
  11. //
  12. // Unless required by applicable law or agreed to in writing, software
  13. // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  14. // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  15. // License for the specific language governing permissions and limitations under
  16. // the License.
  17. //
  18. #import <Cocoa/Cocoa.h>
  19. #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
  20. typedef enum {
  21. GTMFadeTruncatingTail,
  22. GTMFadeTruncatingHead,
  23. GTMFadeTruncatingHeadAndTail,
  24. } GTMFadeTruncateMode;
  25. // A simple text field cell that can truncate at the beginning or the end
  26. // using a gradient. By default it truncates the end.
  27. @interface GTMFadeTruncatingTextFieldCell : NSTextFieldCell {
  28. @private
  29. NSUInteger desiredCharactersToTruncateFromHead_;
  30. GTMFadeTruncateMode truncateMode_;
  31. }
  32. @property (nonatomic) GTMFadeTruncateMode truncateMode;
  33. // When truncating the head this specifies the maximum number of characters
  34. // that can be truncated. Setting this to 0 means that there is no maximum.
  35. @property (nonatomic) NSUInteger desiredCharactersToTruncateFromHead;
  36. @end
  37. #endif