
/*
 * xfdesk.idl:
 *      SOM interface description file for the following
 *      XFolder classes (in this order):
 *          XFldDesktop
 *      and the respective metaclasses.
 *
 *      Check the other files starting with xf* for the
 *      other XFolder classes.
 *
 *      XFldDesktop provides access to the eXtended
 *      shutdown feature by modifying popup menus and
 *      settings noteboks. Also, the Worker thread needs
 *      notifications when the Desktop has populated
 *      after startup.
 *
 *      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 <wpdesk.idl>           // this is SOM for WPDesktop

/*
   CLASS: XFldDesktop

   CLASS HIERARCHY:

       SOMObject
         ÀÄÄ WPObject = XFldObject
               ÀÄÄ WPFileSystem
                     ÀÄÄ WPFolder = XFolder
                           ÀÄÄ WPDesktop
                                 ÀÄÄ XFldDesktop
*/

interface M_XFldDesktop;            // Forward Reference to XFldDesktop metaclass

interface XFldDesktop : WPDesktop
{

    /*
     * New instance methods for XFldDesktop:
     *
     */

    BOOL xfInitiateShutdown();
        /*@@ xfInitiateShutdown:
           Shutdown entry point; checks pGlobalSettings->XShutdown
           for all the XSD_* flags (shutdown options).
           If compiled with XFLDR_DEBUG defined (in common.h),
           debug mode will also be turned on if the SHIFT key is
           pressed at call time.

           This routine will display a confirmation box,
           if the settings want it, and then start the
           main shutdown thread (xsd_fntShutdownThread),
           which will keep running even after shutdown
           is complete, unless the user presses the
           "Cancel shutdown" button.

           Although this method does return almost
           immediately (after the confirmation dlg is dismissed),
           the shutdown will proceed in the separate thread. */

    BOOL xfRestartWPS();
        /*@@ xfRestartWPS:
           pretty similar to XFldDesktop::xfInitiateShutdown, i.e.
           will also show a confirmation box and start the Shutdown
           thread, except that flags are set differently so that
           after closing all windows, no shutdown is performed, but
           only the WPS is restarted. */

#ifdef __SOMIDL__
  implementation {

    releaseorder:
            xfInitiateShutdown,
            xfRestartWPS;

    /*
     * Class Modifiers:
     *
     */

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

    /*
     * Internal instance variables for XFldDesktop:
     *
     */

    BOOL DesktopOpen;

    /*
     * WPDesktop methods overridden by XFldDesktop:
     *
     */

    wpFilterPopupMenu: override;
        /*@@ wpFilterPopupMenu:
           remove "Create another" for Desktop, because
           we don't want to allow creating another Desktop.
           For some reason, the "Create another" option
           doesn't seem to be working right with XFolder,
           so we need to add all this manually (see
           XFldObject::wpFilterPopupMenu). */

    wpModifyPopupMenu: override;
        /*@@ wpModifyPopupMenu:
           play with the Desktop menu entries
           (Shutdown and such) */

    wpMenuItemSelected: override;
        /*@@ wpMenuItemSelected:
           process input when any menu item was selected;
           intercept Shutdown and such */

    wpAddSettingsPages: override;
        /*@@ wpAddSettingsPages:
           insert "XFldDesktop" settings page into notebook; as opposed
           to the "XFolder" page, which deals with instance data, we save
           these settings in the GlobalSettings structure, because there
           should ever be only one active Desktop. */

    wpOpen: override;
        /*@@ wpOpen:
           after the Desktop is opened, we need to begin processing the
           startup folder, so we need to post a message to the
           Worker thread, which will then take over. */

    wpInitData: override;
        /*@@ wpInitData:
           initialize XFldDesktop instance data. */

#ifdef __PRIVATE__

    //# Data Modifiers

#endif

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

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

interface M_XFldDesktop : M_WPDesktop
{

    /*
     * New class methods for M_XFldDesktop:
     *
     */

#ifdef __SOMIDL__
  implementation {

    /*
     * Class Modifiers:
     *
     */

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

    /*
     * Internal class variables for M_XFldDesktop:
     *
     */

    /*
     * M_WPDesktop methods overridden by M_XFldDesktop:
     *
     */

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

    wpclsQuerySettingsPageSize: override;
        /*@@ wpclsQuerySettingsPageSize:
           this WPObject class method should return the
           size of the largest settings page in dialog
           units; if a settings notebook is initially
           opened, i.e. no window pos has been stored
           yet, the WPS will use this size, to avoid
           truncated settings pages. */

    wpclsQueryIconData: override;
        /*@@ wpclsQueryIconData:
           give XFldDesktop's a new default closed icon, if the
           global settings allow this.
           This is loaded from /ICONS/ICONS.DLL. */

    wpclsQueryIconDataN: override;
        /*@@ wpclsQueryIconDataN:
           give XFldDesktop's a new open closed icon, if the
           global settings allow this.
           This is loaded from /ICONS/ICONS.DLL. */

  };
#endif /* __SOMIDL__ */
};


