Skip to content

Commit

Permalink
modules API docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Stepanov committed Feb 28, 2012
1 parent 7f7725f commit d72326d
Show file tree
Hide file tree
Showing 35 changed files with 1,619 additions and 44 deletions.
65 changes: 65 additions & 0 deletions iphone/AppledocSettings.plist
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>--project-company</key>
<string>Apcelerator, Inc.</string>
<key>--company-id</key>
<string>com.appcelerator</string>
<key>--project-name</key>
<string>Titanium Modules API</string>
<key>--create-docset</key>
<true/>
<key>--install-docset</key>
<false/>
<key>--clean-output</key>
<true/>
<key>--search-undocumented-doc</key>
<false/>
<key>--repeat-first-par</key>
<false/>
<key>--explicit-crossref</key>
<true/>
<key>--verbose</key>
<integer>4</integer>
<key>--logformat</key>
<integer>1</integer>
<key>--input</key>
<array>
<string>Classes/TiRootViewController.h</string>
<string>Classes/TiApp.h</string>
<string>Classes/TiFile.h</string>
<string>Classes/TiUIView.h</string>
<string>Classes/TiViewProxy.h</string>
<string>Classes/TiModule.h</string>
<string>Classes/TiWindowProxy.h</string>
<string>Classes/TiViewController.h</string>
<string>Classes/TiProxy.h</string>
<string>Classes/TiTab.h</string>
<string>Classes/TiBlob.h</string>
<string>Classes/TiBase.h</string>
<string>Classes/TiAnimation.h</string>
<string>Classes/TiAction.h</string>
<string>Classes/TiToolbar.h</string>
<string>Classes/TiTabGroup.h</string>
<string>Classes/TiToolbarButton.h</string>
<string>Classes/TiTabController.h</string>
<string>Classes/TiRootController.h</string>
<string>Classes/TiLocale.h</string>
<string>Classes/TiBuffer.h</string>
<string>Classes/WebFont.h</string>
<string>Classes/Webcolor.h</string>
<string>Classes/TiRect.h</string>
<string>Classes/TiRange.h</string>
<string>Classes/TiPoint.h</string>
<string>Classes/TiComplexValue.h</string>
<string>Classes/TiColor.h</string>
<string>Classes/Ti2DMatrix.h</string>
<string>Classes/ImageLoader.h</string>
<string>Classes/TiLayoutQueue.h</string>
<string>Classes/TiDimension.h</string>
<string>Classes/OperationQueue.h</string>
<string>Classes/TiUtils.h</string>
</array>
</dict>
</plist>
119 changes: 119 additions & 0 deletions iphone/Classes/ImageLoader.h
Expand Up @@ -20,14 +20,39 @@ typedef enum {

@class ImageLoaderRequest;

/**
Protocol for image loader delegate.
*/
@protocol ImageLoaderDelegate
@required

/**
Tells the delegate that the image load request succeeded.
@param request The load request.
@param image The loaded image.
*/
-(void)imageLoadSuccess:(ImageLoaderRequest*)request image:(UIImage*)image;

/**
Tells the delegate that the image load request failed.
@param request The load request.
@param error The error.
*/
-(void)imageLoadFailed:(ImageLoaderRequest*)request error:(NSError*)error;

@optional

/**
Tells the delegate that the image load request has been cancelled.
@param request The load request.
*/
-(void)imageLoadCancelled:(ImageLoaderRequest*)request;

@end

/**
Image loader request class.
*/
@interface ImageLoaderRequest : NSObject {
@private
ASIHTTPRequest *request;
Expand All @@ -41,18 +66,53 @@ typedef enum {

@property(nonatomic,readwrite,retain) ASIHTTPRequest* request;

/**
Returns if the request has completed.
@return _YES_ if the request has completed, _NO_ otherwise.
*/
@property(nonatomic,readwrite,assign) BOOL completed;

/**
Returns loaded image size.
@return The loaded image size
*/
@property(nonatomic,readwrite,assign) CGSize imageSize;

/**
Returns the request delegate.
@return The request delegate.
*/
@property(nonatomic,readonly) NSObject<ImageLoaderDelegate>* delegate;

/**
Cancells the request.
*/
-(void)cancel;

/**
Returns is the image load request was cancelled.
@return _YES_ if request was cancelled, _NO_ otherwise.
*/
-(BOOL)cancelled;

/**
Returns request additional properties.
@return The dictionary of properties.
*/
-(NSDictionary*)userInfo;

/**
Returns the request URL.
@return The image URL.
*/
-(NSURL*)url;


@end

/**
The image loader.
*/
@interface ImageLoader : NSObject<NSCacheDelegate> {
@private
NSCache *cache;
Expand All @@ -61,22 +121,81 @@ typedef enum {
NSRecursiveLock* lock;
}

/**
Returns the shared instance of image loader.
@return The shared instance.
*/
+(ImageLoader*)sharedLoader;

/**
Tells the loader to load remote image from URL.
@param url The image URL
@return The loaded image.
*/
-(UIImage *)loadRemote:(NSURL*)url;

/**
Tells the loader to return previously loaded image with URL.
@param url The image URL
@return The loaded image.
*/
-(UIImage *)loadImmediateImage:(NSURL *)url;

/**
Tells the loader to return previously loaded image with URL and size.
@param url The image URL
@param imageSize The required image size.
@return The loaded image.
*/
-(UIImage *)loadImmediateImage:(NSURL *)url withSize:(CGSize)imageSize;

/**
Tells the loader to return previously loaded stretchable image with URL.
@param url The image URL
@return The loaded image.
*/
-(UIImage *)loadImmediateStretchableImage:(NSURL *)url;

/**
Tells the loader to return previously loaded stretchable image with URL for dimensions.
@param url The image URL
@param left The left dimension
@param top The top dimension.
@return The loaded image.
*/
-(UIImage *)loadImmediateStretchableImage:(NSURL *)url withLeftCap:(TiDimension)left topCap:(TiDimension)top;

/**
Returns the full image size.
@param url The image URL
@return The image size.
*/
-(CGSize)fullImageSize:(NSURL *)url;

/**
Tells the loader to load image from URL with delegate.
@param url The image URL.
@param delegate The loader delegate.
@param userInfo The additional properties to be assigned to the request.
@return The image load request.
*/
-(ImageLoaderRequest*)loadImage:(NSURL*)url
delegate:(NSObject<ImageLoaderDelegate>*)delegate
userInfo:(NSDictionary*)userInfo;

/**
Tells the image loader to suspend it's activities.
*/
-(void)suspend;

/**
Tells teh image loader to resume it's activities.
*/
-(void)resume;

/**
Tells the image loader to cancel all activities.
*/
-(void)cancel;

@end
19 changes: 15 additions & 4 deletions iphone/Classes/OperationQueue.h
Expand Up @@ -12,17 +12,28 @@
* that can be used to handle background jobs and after the jobs complete
* can call a callback either on or off the main UI thread.
*/

@interface OperationQueue : NSObject {
NSOperationQueue *queue;
}

/**
Returns shared instance.
@return The shared instance.
*/
+(OperationQueue*)sharedQueue;

/**
* queue an operation that targets selector on target
* invoke after (if not nil) on when completed
* pass YES to ui to invoke after on UI main thread
Queues an operation.
Queues an operation that targets selector on target
invoke after (if not nil) on when completed
pass YES to ui to invoke after on UI main thread
@param selector The selector.
@param target The target.
@param arg The argument
@param after The after selector.
@param on The after target.
@param ui The flag to invoke after on UI thread.
*/
-(void)queue:(SEL)selector target:(id)target arg:(id)arg after:(SEL)after on:(id)on ui:(BOOL)ui;

Expand Down
17 changes: 17 additions & 0 deletions iphone/Classes/Ti2DMatrix.h
Expand Up @@ -6,15 +6,32 @@
*/
#import "TiProxy.h"

/**
The proxy class for 2D matrix.
*/
@interface Ti2DMatrix : TiProxy {
@protected
CGAffineTransform matrix;
}

/**
Initializes the proxy with properties.
@param dict_ The properties dictionary.
*/
-(id)initWithProperties:(NSDictionary*)dict_;

/**
Initializes the proxy with transform matrix.
@param matrix_ The transform matrix.
*/
-(id)initWithMatrix:(CGAffineTransform)matrix_;

/**
Returns transform matrix.
@return The transform matrix.
*/
-(CGAffineTransform)matrix;

-(Ti2DMatrix*)translate:(id)args;
-(Ti2DMatrix*)scale:(id)args;
-(Ti2DMatrix*)rotate:(id)args;
Expand Down
20 changes: 18 additions & 2 deletions iphone/Classes/TiAction.h
Expand Up @@ -7,22 +7,38 @@
#import "TiBase.h"

/**
* generic action wrapper class for packaging something that you
* The generic action wrapper class for packaging something that you
* want to be executed but simplier than an NSOperation
*/

@interface TiAction : NSObject {
@protected
id target;
SEL selector;
id arg;
}

/**
Initializes the action.
@param target_ The action target object.
@param selector_ The selector to perform on the target.
@param arg_ The argument to pass to the method.
*/
-(id)initWithTarget:(id)target_ selector:(SEL)selector_ arg:(id)arg_;
-(void)execute;

/**
Returns the target object for the action.
*/
@property(nonatomic,readonly) id target;

/**
Returns the actions's selector.
*/
@property(nonatomic,readonly) SEL selector;

/**
Returns the action's argument.
*/
@property(nonatomic,readonly) id arg;


Expand Down

0 comments on commit d72326d

Please sign in to comment.