Files
shadowsocks-iOS/ShadowWeb/SWBWebViewContainer.h
2013-02-17 08:17:43 +08:00

53 lines
1.3 KiB
Objective-C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// SWBWebViewContainer.h
// AquaWeb
//
// Created by clowwindy on 11-6-16.
// Copyright 2011年 __MyCompanyName__. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "SWBWebView.h"
#define kMaxCachedWebViews 10
#define kMinCachedWebViews 2
@protocol SWBWebViewContainerDelegate <UIWebViewDelegate>
@required
-(void)webViewContainerWebViewDidCreateNew:(SWBWebView *)webView;
-(void)webViewContainerWebViewDidSwitchToWebView:(SWBWebView *)webView;
-(void)webViewContainerWebViewNeedToReload:(SWBWebView *)webView tag:(NSInteger)tag;
@end
@interface SWBWebViewContainer : UIView <UIWebViewDelegate> {
// 最旧的在0最新的在末尾
NSMutableArray *cachedWebViews;
SWBWebView *currentWebView;
NSString *s;
}
- (void)newWebView:(NSInteger)tag;
- (void)switchToWebView:(NSInteger)tag;
- (void)closeWebView:(NSInteger)tag;
- (SWBWebView *)webViewByTag:(NSInteger)tag;
- (NSInteger)currentWebView;
- (SWBWebView *)currentSWBWebView;
// 彻底释放,适合内存严重不足
- (void)releaseBackgroundWebViews;
// 仅从superview移除可以节省部分内存
- (void)removeBackgroundWebViewsFromSuperView;
- (NSString *)titleForWebView:(SWBWebView *)webView;
//- (void)progressEstimateChanged:(NSNotification*)theNotification;
@property (nonatomic, weak) id<SWBWebViewContainerDelegate> delegate;
@end