File: programming/cocoa/Filie.zip/Filie/Filie/UKFSItemController.m


/* =============================================================================
    PROJECT:    Filie
    FILE:       UKFSItemController.m
    
    COPYRIGHT:  (c) 2004 by M. Uli Kusterer, all rights reserved.
    
    AUTHORS:    M. Uli Kusterer - UK
    
    LICENSES:   GNU GPL
    
    REVISIONS:
        2004-04-15  UK  Created.
   ========================================================================== */
 
// -----------------------------------------------------------------------------
//  Headers:
// -----------------------------------------------------------------------------
 
#import "UKFSItemController.h"
 
 
// -----------------------------------------------------------------------------
//  Globals:
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
//  sharedRegistry:
//      Return the singleton object that is our Controller registry.
//
//  REVISIONS:
//      2004-12-22  UK  Documented.
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
//  init:
//      Create a new registry object. Since this is a singleton, this may return
//      NIL if there already is an object. Otherwise, this will set itself up
//      as the singleton.
//
//  REVISIONS:
//      2004-12-22  UK  Documented.
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
//  dealloc:
//      Destructor. Also sets the gRegistrySingleton global to NIL.
//
//  REVISIONS:
//      2004-12-22  UK  Documented.
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
//  registerController:forType:
//      Add a new controller to our registry, for viewing the specified type.
//
//  REVISIONS:
//      2004-12-22  UK  Documented.
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
//  controllerClassForType:
//      Return the class of object to create for viewing an object of the
//      specified type.
//
//  REVISIONS:
//      2004-12-22  UK  Documented.
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
//  controllerForItemAtURL:
//      Create a controller object (or return an existing one) for the specified
//      item (URL).
//
//      FIX ME! This assumes a file: URL right now. We need to change the
//      registry to work with URLs!
//
//  REVISIONS:
//      2004-12-22  UK  Documented.
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
//  controllerIndexForPath:
//      Return the index in our array of controllers for the controller for the
//      specified path. If there is none, returns NSNotFound.
//
//      This is a workaround for indexOfObject:, which somehow sometimes returns
//      NSNotFound even though there *is* a controller in the list.
//
//  REVISIONS:
//      2004-12-22  UK  Documented.
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
//  controllerForItemAtPath:
//      Return the controller for the item at the specified path. Creates a new
//      controller if there's none yet/anymore.
//
//  REVISIONS:
//      2004-12-22  UK  Documented.
// -----------------------------------------------------------------------------
// controllerInstances indexOfObject: fails to work occasionally, so we do it manually.
"''"// No OSType?
""// -----------------------------------------------------------------------------
//  controllerClosed:
//      Called by controllers when they close so we can remove them from our list,
//      which also releases them.
//
//  REVISIONS:
//      2004-12-22  UK  Documented.
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
//  closeAllControllers:
//      Close all controllers that are currently open, e.g. when we quit.
//
//  REVISIONS:
//      2004-12-22  UK  Documented.
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
//  memorizeOpenControllers:
//      Save a list of the paths for which viuewers are currently open to the
//      user defaults so they can later be reopened using
//      reopenMemorizedControllers.
//
//  REVISIONS:
//      2004-12-22  UK  Documented.
// -----------------------------------------------------------------------------
"UKFilieMemorizedControllers"];
}
 
 
// -----------------------------------------------------------------------------
//  reopenMemorizedControllers:
//      Reopen the controllers for the paths that have been saved to the user
//      defaults using memorizeOpenControllers. This is useful for reopening the
//      windows the user had open when they quit Filie.
//
//  REVISIONS:
//      2004-12-22  UK  Documented.
// -----------------------------------------------------------------------------
"UKFilieMemorizedControllers"// -----------------------------------------------------------------------------
//  canCloseAllControllers:
//      Ask all controllers whether they want to close. If a controller needs to be
//      saved before it can be closed, it will return NO and then this will
//      return NO as well. Used when the app quits to give the controllers a chance
//      to save.
//
//  REVISIONS:
//      2004-12-22  UK  Documented.
// -----------------------------------------------------------------------------
 

This code uses the PclZip Zip File reading code, which is subject to the GNU LGPL. It also uses the GeSHi syntax highlighter, subject to the GPL. Ask if you want this for your own web site, it's free.