topical media & game development

talk show tell print

#mobile-application-10-DerbyApp-build-iphone-Classes-TiBlob.h / h



  
Appcelerator Titanium Mobile Copyright (c) 2009-2011 by Appcelerator, Inc. All Rights Reserved. Licensed under the terms of the Apache Public License Please see the LICENSE included with this distribution for details. WARNING: This is generated code. Modify at your own risk and without support.

  
  #import <TiProxy.h>
  
  typedef enum {
          TiBlobTypeImage = 0,
          TiBlobTypeFile = 1,
          TiBlobTypeData = 2
  } TiBlobType;
  
  @interface TiBlob : TiProxy {
  @private
          TiBlobType type;
          NSString *mimetype;
          NSData *data;
          UIImage *image;
          NSString *path;
  }
  
  // these are only appropriate for image type and return 0 otherwise
  @property(nonatomic,readonly) NSInteger width;
  @property(nonatomic,readonly) NSInteger height;
  
  // return a textual representation of the blob
  @property(nonatomic,readonly) NSString* text;
  
  // Returns the data length
  @property(nonatomic,readonly) NSNumber* length;
  
  // for file, data returns the size in bytes
  // for image, returns the width x height
  @property(nonatomic,readonly) NSInteger size;
  
  -(id)initWithImage:(UIImage*)image;
  -(id)initWithData:(NSData*)data_ mimetype:(NSString*)mimetype_;
  -(id)initWithFile:(NSString*)path;
  
  -(void)setData:(NSData*)data;
  -(void)setImage:(UIImage*)image;
  -(void)setMimeType:(NSString*)mime type:(TiBlobType)type;
  
  -(TiBlobType)type;
  -(NSString*)mimeType;
  
  -(NSData*)data;
  -(UIImage*)image;
  -(NSString*)path;
  -(NSString*)nativePath; // Android compatibility
  
  -(BOOL)writeTo:(NSString*)path error:(NSError**)error;
  
  #pragma mark Image specific blob manipulations
  
  @end
  


(C) Æliens 04/09/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.