// Copyright 1997-2000 Omni Development, Inc.  All rights reserved.
//
// This software may only be used and reproduced according to the
// terms in the file OmniSourceLicense.html, which should be
// distributed with this project and can also be found at
// http://www.omnigroup.com/DeveloperResources/OmniSourceLicense.html.
//
// $Header: /Network/Source/CVS/OmniGroup/Frameworks/OmniDocument/ODDocumentController.h,v 1.11 2000/01/19 23:36:25 kc Exp $

// The OmniDocument framework was used in OmniPDF and OmniImage, but we consider it obsolete now that NSDocument exists.

#import <OmniFoundation/OFObject.h>
#import <Foundation/NSDate.h>  // For NSTimeInterval

@class NSArray, NSMutableArray, NSMutableDictionary, NSNotification, NSString;
@class NSPanel, NSMenuItem, NSApplication, NSTextField, NSButton;
@class OFScheduledEvent;
@class ODDocument;

#import <AppKit/NSNibDeclarations.h> // For IBOutlet

@interface ODDocumentController : OFObject
{
    IBOutlet NSPanel *helpPanel;

    // Info.nib
    IBOutlet NSPanel *infoPanel;
    IBOutlet NSTextField *infoPanelVersionTextField;

    //

    ODDocument *nonretainedActiveDocument;
    ODDocument *newDocument;
    NSMutableDictionary *extensionToClass;
    NSMutableDictionary *pathToDocument;
    NSMutableArray *allDocuments;
    Class defaultDocumentClass;

    OFScheduledEvent *hideSplashPanelEvent;
}

+ sharedInstance;
+ (NSString *)appVersionString;

+ (NSTimeInterval)minimumSplashPanelDisplayTime;


// API
- (NSArray *)openDocumentPaths;

- (ODDocument *)activeDocument;
- (void)setActiveDocument:(ODDocument *)aDocument;

- (void)setDefaultDocumentClass:(Class)aClass;
- (void)registerDocumentClass:(Class)aClass forFileExtension:(NSString *)anExtension;
- (void)registerDocumentClass:(Class)aClass;
- (Class)documentClassForFileExtension:(NSString *)anExtension;

- (void)registerDocument:(ODDocument *)aDocument forPath:(NSString *)aPath;
- (void)deregisterDocumentForPath:(NSString *)aPath;
- (ODDocument *)documentForPath:(NSString *)aPath;

- (ODDocument *)openFile:(NSString *)path;

- (void)switchToNextDocumentFromDocument:(ODDocument *)document;
- (void)switchToPreviousDocumentFromDocument:(ODDocument *)document;


// Actions
- (IBAction)new:(id)sender;
- (IBAction)open:(id)sender;
- (IBAction)saveAll:(id)sender;
- (IBAction)closeAll:(id)sender;
- (IBAction)showInfoPanel:(id)sender;

@end
