Subversion Repositories TruePreview

[/] [trunk/] [Source/] [TruePreviewPreferenceValueTransformer.m] - Diff between revs 42 and 47

Show entire file | Ignore whitespace | Details | Blame | View Log

Rev 42 Rev 47
Line 34... Line 34...
@implementation TruePreviewPreferenceValueTransformer
@implementation TruePreviewPreferenceValueTransformer
 
 
#pragma mark NSValueTransformer class methods
#pragma mark NSValueTransformer class methods
 
 
+ (Class)transformedValueClass {
+ (Class)transformedValueClass {
 
  TRUEPREVIEW_LOG();
 
 
  return [NSNumber class];
  return [NSNumber class];
}
}
 
 
#pragma mark NSValueTransformer instance methods
#pragma mark NSValueTransformer instance methods
 
 
- (id)transformedValue:(id)inValue {
- (id)transformedValue:(id)inValue {
 
  TRUEPREVIEW_LOG(@"%@", inValue);
 
 
  float theValue = [inValue floatValue];
  float theValue = [inValue floatValue];
 
 
  if ((theValue > 0) && (theValue <= TRUEPREVIEW_DELAY_MAX)) {
  if ((theValue > 0) && (theValue <= TRUEPREVIEW_DELAY_MAX)) {
    return [NSNumber numberWithInt:1];
    return [NSNumber numberWithInt:1];
  }
  }
Line 64... Line 68...
@implementation TruePreviewPreferenceValueTransformerDelay
@implementation TruePreviewPreferenceValueTransformerDelay
 
 
#pragma mark NSValueTransformer class methods
#pragma mark NSValueTransformer class methods
 
 
+ (Class)transformedValueClass {
+ (Class)transformedValueClass {
 
  TRUEPREVIEW_LOG();
 
 
  return [NSNumber class];
  return [NSNumber class];
}
}
 
 
#pragma mark NSValueTransformer instance methods
#pragma mark NSValueTransformer instance methods
 
 
- (id)transformedValue:(id)inValue {
- (id)transformedValue:(id)inValue {
 
  TRUEPREVIEW_LOG(@"%@", inValue);
 
 
  float theValue = [inValue floatValue];
  float theValue = [inValue floatValue];
 
 
  if ((theValue <= 0) || (theValue > TRUEPREVIEW_DELAY_MAX)) {
  if ((theValue <= 0) || (theValue > TRUEPREVIEW_DELAY_MAX)) {
    return nil;
    return nil;
  }
  }
Line 87... Line 95...
@implementation TruePreviewPreferenceValueTransformerDelayEditIndicator
@implementation TruePreviewPreferenceValueTransformerDelayEditIndicator
 
 
#pragma mark NSValueTransformer class methods
#pragma mark NSValueTransformer class methods
 
 
+ (Class)transformedValueClass {
+ (Class)transformedValueClass {
 
  TRUEPREVIEW_LOG();
 
 
  return [NSNumber class];
  return [NSNumber class];
}
}
 
 
#pragma mark NSValueTransformer instance methods
#pragma mark NSValueTransformer instance methods
 
 
- (id)transformedValue:(id)inValue {
- (id)transformedValue:(id)inValue {
 
  TRUEPREVIEW_LOG(@"%@", inValue);
 
 
  float theValue = [inValue floatValue];
  float theValue = [inValue floatValue];
 
 
  return [NSNumber numberWithInt:((theValue > 0) && (theValue <= TRUEPREVIEW_DELAY_MAX))];
  return [NSNumber numberWithInt:((theValue > 0) && (theValue <= TRUEPREVIEW_DELAY_MAX))];
}
}