Annotation of chimera/NSBrowserView.h, revision 1.1

1.1     ! hyatt       1: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
        !             2: /* ***** BEGIN LICENSE BLOCK *****
        !             3:  * Version: NPL 1.1/GPL 2.0/LGPL 2.1
        !             4:  *
        !             5:  * The contents of this file are subject to the Netscape Public License
        !             6:  * Version 1.1 (the "License"); you may not use this file except in
        !             7:  * compliance with the License. You may obtain a copy of the License at
        !             8:  * http://www.mozilla.org/NPL/
        !             9:  *
        !            10:  * Software distributed under the License is distributed on an "AS IS" basis,
        !            11:  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
        !            12:  * for the specific language governing rights and limitations under the
        !            13:  * License.
        !            14:  *
        !            15:  * The Original Code is mozilla.org code.
        !            16:  *
        !            17:  * The Initial Developer of the Original Code is 
        !            18:  * Netscape Communications Corporation.
        !            19:  * Portions created by the Initial Developer are Copyright (C) 1998
        !            20:  * the Initial Developer. All Rights Reserved.
        !            21:  *
        !            22:  * Contributor(s):
        !            23:  *
        !            24:  * Alternatively, the contents of this file may be used under the terms of
        !            25:  * either the GNU General Public License Version 2 or later (the "GPL"), or 
        !            26:  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
        !            27:  * in which case the provisions of the GPL or the LGPL are applicable instead
        !            28:  * of those above. If you wish to allow use of your version of this file only
        !            29:  * under the terms of either the GPL or the LGPL, and not to allow others to
        !            30:  * use your version of this file under the terms of the NPL, indicate your
        !            31:  * decision by deleting the provisions above and replace them with the notice
        !            32:  * and other provisions required by the GPL or the LGPL. If you do not delete
        !            33:  * the provisions above, a recipient may use your version of this file under
        !            34:  * the terms of any one of the NPL, the GPL or the LGPL.
        !            35:  *
        !            36:  * ***** END LICENSE BLOCK ***** */
        !            37: 
        !            38: #ifndef __nsCocoaBrowserView_h__
        !            39: #define __nsCocoaBrowserView_h__
        !            40: 
        !            41: #undef DARWIN
        !            42: #import <Cocoa/Cocoa.h>
        !            43: 
        !            44: @class NSBrowserView;
        !            45: class nsCocoaBrowserListener;
        !            46: class nsIDOMWindow;
        !            47: class nsIWebBrowser;
        !            48: 
        !            49: // Protocol implemented by anyone interested in progress
        !            50: // related to a BrowserView. A listener should explicitly
        !            51: // register itself with the view using the addListener
        !            52: // method.
        !            53: @protocol NSBrowserListener
        !            54: - (void)onLoadingStarted;
        !            55: - (void)onLoadingCompleted:(BOOL)succeeded;
        !            56: // Invoked regularly as data associated with a page streams
        !            57: // in. If the total number of bytes expected is unknown,
        !            58: // maxBytes is -1.
        !            59: - (void)onProgressChange:(int)currentBytes outOf:(int)maxBytes;
        !            60: - (void)onLocationChange:(NSURL*)url;
        !            61: @end
        !            62: 
        !            63: typedef enum {
        !            64:   NSStatusTypeScript            = 0x0001,
        !            65:   NSStatusTypeScriptDefault     = 0x0002,
        !            66:   NSStatusTypeLink              = 0x0003,
        !            67: } NSStatusType;
        !            68: 
        !            69: @protocol NSBrowserContainer
        !            70: - (void)setStatus:(NSString *)statusString ofType:(NSStatusType)type;
        !            71: - (NSString *)title;
        !            72: - (void)setTitle:(NSString *)title;
        !            73: // Set the dimensions of our NSView. The container might need to do
        !            74: // some adjustment, so the view doesn't do it directly.
        !            75: - (void)sizeBrowserTo:(NSSize)dimensions;
        !            76: // Create a new browser container window and return the contained view. 
        !            77: - (NSBrowserView*)createBrowserWindow:(unsigned int)mask;
        !            78: @end
        !            79: 
        !            80: enum {
        !            81:   NSLoadFlagsNone                   = 0x0000,
        !            82:   NSLoadFlagsDontPutInHistory       = 0x0010,
        !            83:   NSLoadFlagsReplaceHistoryEntry    = 0x0020,
        !            84:   NSLoadFlagsBypassCacheAndProxy    = 0x0040
        !            85: }; 
        !            86: 
        !            87: enum {
        !            88:   NSStopLoadNetwork   = 0x01,
        !            89:   NSStopLoadContent   = 0x02,
        !            90:   NSStopLoadAll       = 0x03  
        !            91: };
        !            92: 
        !            93: @interface NSBrowserView : NSView 
        !            94: {
        !            95:   nsIWebBrowser* _webBrowser;
        !            96:   nsCocoaBrowserListener* _listener;
        !            97: }
        !            98: 
        !            99: // NSView overrides
        !           100: - (id)initWithFrame:(NSRect)frame;
        !           101: - (void)dealloc;
        !           102: - (void)setFrame:(NSRect)frameRect;
        !           103: 
        !           104: // nsIWebBrowser methods
        !           105: - (void)addListener:(id <NSBrowserListener>)listener;
        !           106: - (void)removeListener:(id <NSBrowserListener>)listener;
        !           107: - (void)setContainer:(id <NSBrowserContainer>)container;
        !           108: - (nsIDOMWindow*)getContentWindow;
        !           109: 
        !           110: // nsIWebNavigation methods
        !           111: - (void)loadURI:(NSURL *)url flags:(unsigned int)flags;
        !           112: - (void)reload:(unsigned int)flags;
        !           113: - (BOOL)canGoBack;
        !           114: - (BOOL)canGoForward;
        !           115: - (void)goBack;
        !           116: - (void)goForward;
        !           117: - (void)gotoIndex:(int)index;
        !           118: - (void)stop:(unsigned int)flags;
        !           119: - (NSURL*)getCurrentURI;
        !           120: 
        !           121: - (nsIWebBrowser*)getWebBrowser;
        !           122: - (void)setWebBrowser:(nsIWebBrowser*)browser;
        !           123: @end
        !           124: 
        !           125: #endif // __nsCocoaBrowserView_h__

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>