
/*
 * xfdisk.idl:
 *      SOM interface description file for the following
 *      XFolder classes (in this order):
 *          XFldDisk
 *      and the respective metaclasses.
 *
 *      Check the other files starting with xf* for the
 *      other XFolder classes.
 *
 *      XFldDisk is needed mainly to modify the popup menus
 *      of Disk objects also. Since these are not instances
 *      of WPFolder, we need an extra subclass.
 *
 *      This class must always be installed.
 *
 *      Copyright (C) 1997-99 Ulrich M”ller.
 *      This file is part of the XFolder source package.
 *      XFolder is free software; you can redistribute it and/or modify
 *      it under the terms of the GNU General Public License as published
 *      by the Free Software Foundation, in version 2 as it comes in the
 *      "COPYING" file of the XFolder main distribution.
 *      This program is distributed in the hope that it will be useful,
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *      GNU General Public License for more details.
 */

#include <wpdisk.idl>           // this is SOM for WPDisk

/*
   CLASS: XFldDisk

   CLASS HIERARCHY:

       SOMObject
         ÀÄÄ WPObject = XFldObject
               ÀÄÄ WPAbstract
                     ÀÄÄ WPDisk
                           ÀÄÄ XFldDisk
*/

interface M_XFldDisk;            // Forward Reference to XFldDisk metaclass

interface XFldDisk : WPDisk
{

    /*
     * New instance methods for XFldDisk:
     *
     */

#ifdef __SOMIDL__
  implementation {

    releaseorder: xf_withdrawn1,
                  xf_withdrawn2;

    /*
     * Class Modifiers:
     *
     */

    externalprefix = xfdisk_;
    externalstem = xfdisk;
    majorversion = 1;
    minorversion = 1;
    filestem = xfdisk;           //# specifies the filestem for sc-generated files
    metaclass = M_XFldDisk;
    dllname = "xfldr.dll";
    callstyle = oidl;           //# forget CORBA stuff (*ev and such)

    /*
     * Internal instance variables for XFldDisk:
     *
     */

    /*
     * WPDisk methods overridden by XFldDisk:
     *
     */

    wpFilterPopupMenu: override;
        /*@@ wpFilterPopupMenu:
           remove default entries for disks according to Global Settings */

    wpModifyPopupMenu: override;
        /*@@ wpModifyPopupMenu:
           this method allows an object to modify a context
           menu. We add the various XFolder menu entries here
           by calling mnuModifyPopupMenu in menus.c,
           which is also used by the XFolder class. */

    wpMenuItemSelected: override;
        /*@@ wpMenuItemSelected:
           process input when any menu item was selected;
           we pass the input to mnuMenuItemSelected in menus.c. */

    wpMenuItemHelpSelected: override;
        /*@@ wpMenuItemHelpSelected:
           display help for a context menu item;
           we pass the input to mnuMenuItemHelpSelected in menus.c. */

    wpViewObject: override;
        /*@@ wpViewObject:
           this either opens a view of the given Disk object
           as a root folder (using wpOpen) or resurfaces an
           already open view.
           This gets called every time the user tries to open
           a disk object, e.g. by double-clicking on one in the
           "Drives" folder.
           The WPS seems to be doing no drive checking in here,
           which leads to the annoying "Drive not ready" popups.
           So we try to implement this here. */

    wpOpen: override;
        /*@@ wpOpen:
           this method gets called when wpViewObject thinks a
           new view of the object needs to be opened.
           We call the parent first and then subclass the
           resulting frame window, similar to what we're doing
           with folder views (see XFolder::wpOpen). */

    wpInitData: override;
        /*@@ wpInitData:
           initialize XFldDisk instance data */

    wpObjectReady: override;
        /*@@ wpObjectReady:
           this instance method is called by the system when
           object awakening is complete and object data seems
           to be stable in memory.
           We will have this object's pointer stored in a
           global array to be able to find the Disk object for
           a given object (xfclsQueryDiskObject). */

#ifdef __PRIVATE__

#endif

  }; // implementation
#endif /* __SOMIDL__ */
};

//#
//#
//# Now define Metaclass.
//# ---------------------
//#

interface M_XFldDisk : M_WPDisk
{

    /*
     * New class methods for M_XFldDisk:
     *
     */

    XFldDisk xfclsQueryDiskObject(in WPObject pObject);
        /*@@ xfclsQueryDisk:
           since I have no idea what the default wpQueryDisk
           is for (why the hell does it return a WPFileSystem?),
           this is a proper method which returns the disk object
           which corresponds to the drive on which the object
           resides. This works for both abstract and file-system
           objects.
           Returns NULL upon errors.
           Note: this method only works after the Drives folder
           has been populated because it relies on our
           wpObjectReady override for XFldDisk. Otherwise you'll
           get NULL back.
           The WPS normally populates that folder a few seconds
           after the Desktop is up. */

#ifdef __SOMIDL__
  implementation {

    releaseorder: xfclsQueryDiskObject;

    /*
     * Class Modifiers:
     *
     */

    externalprefix = xfdiskM_;
    externalstem = xfdiskM;
    functionprefix = xfdiskM_;
    majorversion = 1;
    minorversion = 1;
    filestem = xfdisk;           //# specifies the filestem for sc-generated files
    dllname = "xfldr.dll";
    callstyle = oidl;

    /*
     * Internal class variables for M_XFldDisk:
     *
     */

    /*
     * M_WPDisk methods overridden by M_XFldDisk:
     *
     */

    wpclsInitData: override;
        /*@@ wpclsInitData:
           initialize class instance data */

  };
#endif /* __SOMIDL__ */
};


