// Copyright 2003 - 2004 Nathan Hamblen
// Modified BSD license:
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
// 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission.
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#import "WebLocationWrapper.h"
#import "pcre.h"
#import <Cocoa/Cocoa.h>

@interface MyDocument : NSDocument <NSUserInterfaceValidations>
{
  NSString *mUrl;                    
// filled only if this is not a dynamic location
  NSString *mDynamicLocation;        
// filled only if this is a dynamic location
  NSURL *mPageUrl;                  
// holds url of the page during site icon retrieval
  NSMutableSet *mImages;            
// holds site icons which might need to be restored for an undo or redo
  NSURLConnection *mPageConnection; 
// current connection to load a page and get site icon pointer tag
  NSURLConnection *mImageConnection;
// current connection to load site icon
  NSMutableData *mData;              
// data for page or site icon
  NSURLResponse *mPageResponse;      
// response object for page retrieval
  NSImage *mSiteImage;              
// the site icon retrieved for the URL
  NSMutableDictionary *mSpecificPreferences; 
// prefs, such as location of window and search history, for dynamic locations only
  pcre *mCompiledRegularExpression; 
// holds the pcre regexp for finding a site icon tag in html / xml
  unsigned mRedirectCount;          
// keep track of the number of connection redirects
}

- (BOOL)validate;
- (void)refreshSiteImage;
- (void)switchToFillin:(BOOL)fillinFlag;

- (NSString *)url;
- (void)setUrl:(NSString *)aUrl;
- (NSString *)dynamicLocation;
- (void)setDynamicLocation:(NSString *)aDynamicLocation;
- (NSImage *)siteImage;
- (NSMutableDictionary *)specificPreferences;

@end

@interface NSString (ParameterAccess)

- (NSArray *)parameterNameArray;
- (NSString *)stringFilledWithParameters:(NSArray *)valueArray;
- (NSString *)stringFilledWithDummyParameters;

@end