doc
|
00001 /* 00002 Copyright 2001, 2012, Oracle and/or its affiliates. All rights reserved. 00003 Oracle and Java are registered trademarks of Oracle and/or its 00004 affiliates. Other names may be trademarks of their respective owners. 00005 UNIX is a registered trademark of The Open Group. 00006 00007 This software and related documentation are provided under a license 00008 agreement containing restrictions on use and disclosure and are 00009 protected by intellectual property laws. Except as expressly permitted 00010 in your license agreement or allowed by law, you may not use, copy, 00011 reproduce, translate, broadcast, modify, license, transmit, distribute, 00012 exhibit, perform, publish, or display any part, in any form, or by any 00013 means. Reverse engineering, disassembly, or decompilation of this 00014 software, unless required by law for interoperability, is prohibited. 00015 The information contained herein is subject to change without notice 00016 and is not warranted to be error-free. If you find any errors, please 00017 report them to us in writing. 00018 U.S. GOVERNMENT END USERS: Oracle programs, including any operating 00019 system, integrated software, any programs installed on the hardware, 00020 and/or documentation, delivered to U.S. Government end users are 00021 "commercial computer software" pursuant to the applicable Federal 00022 Acquisition Regulation and agency-specific supplemental regulations. 00023 As such, use, duplication, disclosure, modification, and adaptation 00024 of the programs, including any operating system, integrated software, 00025 any programs installed on the hardware, and/or documentation, shall be 00026 subject to license terms and license restrictions applicable to the 00027 programs. No other rights are granted to the U.S. Government. 00028 This software or hardware is developed for general use in a variety 00029 of information management applications. It is not developed or 00030 intended for use in any inherently dangerous applications, including 00031 applications that may create a risk of personal injury. If you use 00032 this software or hardware in dangerous applications, then you shall 00033 be responsible to take all appropriate fail-safe, backup, redundancy, 00034 and other measures to ensure its safe use. Oracle Corporation and its 00035 affiliates disclaim any liability for any damages caused by use of this 00036 software or hardware in dangerous applications. 00037 This software or hardware and documentation may provide access to or 00038 information on content, products, and services from third parties. 00039 Oracle Corporation and its affiliates are not responsible for and 00040 expressly disclaim all warranties of any kind with respect to 00041 third-party content, products, and services. Oracle Corporation and 00042 its affiliates will not be responsible for any loss, costs, or damages 00043 incurred due to your access to or use of third-party content, products, 00044 or services. 00045 */ 00046 00047 00048 #import <UIKit/UIKit.h> 00049 #import <Three20/Three20.h> 00050 #import "EMPhotoViewDelegate.h" 00051 00056 #define ANIMATE_DURATION 0.35 00057 00058 @class EMLoadingImageView, EMPhotoViewController; 00059 00060 @interface EMPhotoView : UIView { 00061 id<EMPhotoViewDelegate> delegate; 00062 id<TTPhotoSource> _photoSource; 00063 00064 NSInteger currentIndex; 00065 NSInteger scrollToIndex; 00066 BOOL scrolling; 00067 CGFloat scrollAnimateDuration; 00068 00069 BOOL zoomEnabled; 00070 CGFloat doubleTapZoomRatio; 00071 CGFloat maxZoomRatio; 00072 NSUInteger imageGap; 00073 00074 BOOL rotationEnabled; 00075 00076 EMLoadingImageView *imageView, *rightImageView, *leftImageView; 00077 00078 CGPoint mLastTouchLocation; 00079 CGFloat mLastTouchSpacing; 00080 00081 int deltaX; 00082 00083 BOOL slided; 00084 BOOL animating; 00085 00086 id animateTarget; 00087 SEL animateSelector; 00088 00089 00090 int slideDx, slideDy, touchCount; 00091 NSTimer *doubleClickTimer; 00092 CGFloat zoomRatio; 00093 00094 UIInterfaceOrientation currentOrientation; 00095 00096 CGPoint _center; 00097 00098 BOOL sideImagesHidden; 00099 00100 //CGRect photoViewFrame; 00101 CGFloat lastWidth; 00102 CGFloat lastHeight; 00103 00104 UIEdgeInsets contentInset; 00105 } 00106 00116 - (void) scrollToPhotoAtIndex:(NSInteger)index; 00117 00121 @property (assign) NSInteger currentIndex; 00122 00123 00133 @property(nonatomic, assign) id<TTPhotoSource> photoSource; 00134 00138 @property(nonatomic, assign) id<EMPhotoViewDelegate> delegate; 00139 00140 00150 @property(nonatomic) BOOL zoomEnabled; 00151 00155 @property(nonatomic) BOOL rotationEnabled; 00156 00160 @property(nonatomic) CGFloat doubleTapZoomRatio; // defaults to 2.0 00161 00165 @property(nonatomic) CGFloat maxZoomRatio; 00166 00170 @property(nonatomic) NSUInteger imageGap; 00171 00176 @property (nonatomic, assign) UIActivityIndicatorViewStyle indicatorStyle; 00177 00187 @property (readonly) UIImage *currentImage; 00188 00189 00190 00191 00192 00199 @property (nonatomic, assign) UIInterfaceOrientation currentOrientation; 00200 00201 00202 - (void) reloadData; 00203 - (BOOL) rightImageLoaded; 00204 00205 @property (nonatomic, assign) BOOL animating; 00206 @property (nonatomic, assign) BOOL scrolling; 00207 00208 - (void) sizeAndPositionImage; 00209 - (void) sizeAndPositionLeftImage; 00210 - (void) sizeAndPositionRightImage; 00211 00212 - (void) hideImage; 00213 - (void) hideSideImages; 00214 - (void) showSideImages; 00215 - (void) resetZoom; 00216 00217 - (void) slideLeft:(BOOL)animated; 00218 - (void) slideRight:(BOOL)animated; 00219 00220 - (void) animateLeft; 00221 - (void) animateRight; 00222 - (void) animateReset; 00223 00224 - (void) cancelImage; 00225 - (void) cancelLeftImage; 00226 - (void) cancelRightImage; 00227 00228 // The following methods are used by EMLoadingImageView 00229 - (void) setImage:(UIImage *)image forIndex:(NSInteger)index; 00230 00231 @end