
/*
 * xfobj.idl:
 *      SOM interface description file for the following
 *      XFolder classes (in this order):
 *          XFldObject
 *      and the respective metaclasses.
 *
 *      Check the other files starting with xf* for the
 *      other XFolder classes.
 *
 *      XFldObject gives the other classes access to WPS
 *      internals that cannot be reached otherwise. It
 *      also initializes the whole XFolder environment
 *      at WPS bootup.
 *
 *      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 <wpobject.idl>         // this is SOM for WPObject

/*
   CLASS: XFldObject

   CLASS HIERARCHY:

       SOMObject
         ÀÄÄ WPObject
               ÀÄÄ XFldObject
*/

interface M_XFldObject;            // Forward Reference to XFldObject metaclass

interface XFldObject : WPObject
{

    /*
     * New instance methods for XFldObject:
     *
     */

    ULONG xfAddObjectInternalsPage(in HWND hwndNotebook);
        /*@@ xfAddObjectInternalsPage:
           this actually adds the "Internals" pages into all object notebooks,
           if the Global Settings allow it */

#ifdef __SOMIDL__
  implementation {

    releaseorder: xfAddObjectInternalsPage;

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

    passthru C_h =
"";

    /*
     * Internal instance variables for XFldObject:
     *
     */

    /*
     * The following is forced into the .H file:
     *
     */

    /*
     * WPObject methods overridden by XFldObject:
     *
     */

    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 list (maintained by the Worker thread)
           so that XShutdown knows which objects are currently awake. */

    wpUnInitData: override;
        /*@@ wpUnInitData:
           reverse to XFldObject::wpObjectReady, this instance
           method is called by the system when an object is made
           dormant. We will have this object removed from our
           global list of awake objects. */

    wpFilterPopupMenu: override;
        /*@@ wpFilterPopupMenu:
           remove default entries according to global settings. */

    wpModifyPopupMenu: override;
        /*@@ wpModifyPopupMenu:
           add my own popup menu entries. */

    wpMenuItemSelected: override;
        /*@@ wpMenuItemSelected:
           process input when any menu item was selected. */

    wpAddSettingsPages: override;
        /*@@ wpAddSettingsPages:
           this instance method inserts all the settings
           pages into an object's settings notebook.
           We will add the object's "Internals" page here. */

    wpConfirmObjectTitle: override;
        /*@@ wpConfirmObjectTitle:
           this instance method is called by the WPS during file
           operations (copy, move, rename etc.) for every single
           file that is being processed. This method must verify
           that the operation is valid WRT name clashes and display
           a confirmation dialog in case it is not.
           Apparently, this method is not overridden by subclasses,
           not even WPFileSystem.
           XFolder implements its own "Object exists" dialog here,
           if the Global Settings allow it.
           Like most interesting methods in the WPS, this thing is
           barely documented, so this is what I found out.

           Parameters:
           -- *somSelf      in: the object being worked on
           -- *Folder       in: the folder being worked on
           -- **ppDuplicate out: if we return NAMECLASH_REPLACE,
                            we need to set this to the object to
                            be replaced
           -- pszTitle      out: if we return NAMECLASH_RENAME,
                            we need to set this to somSelf's new title
           -- cbTitle       in: sizeof(*pszTitle)
           -- menuID        in: the user's operation, which is:
                              0x006B    move
                              0x006C    copy
                              0x006E    rename
                              0x013C    create shadow

           Returns:
           -- NAMECLASH_CANCEL (0):
                  abort processing, have the WPS do nothing ("Cancel"
                  button pressed in confirmation dialog); this will
                  just skip the current file;
           -- NAMECLASH_NONE (1):
                  continue processing, but perform no further
                  renaming etc.; we return this if no duplicate file
                  exists;
           -- NAMECLASH_RENAME (2):
                  have the WPS change the title to pszTitle, which we
                  need to set here; note that this does NOT change
                  the real name! So we do the renaming ourselves here;
           -- NAMECLASH_REPLACE (8):
                  have the WPS delete *ppDuplicate, which we need to
                  set here if we return this code; we need to find the
                  duplicate in this method then. */

#ifdef __PRIVATE__

#endif

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

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

interface M_XFldObject : M_WPObject
{

    /*
     * New class methods  for M_XFldObject:
     *
     */

#ifdef __SOMIDL__
  implementation {

    //# Class Modifiers
    externalprefix = xfobjM_;
    externalstem = xfobjM;
    functionprefix = xfobjM_;
    majorversion = 1;
    minorversion = 1;
    filestem = xfobj;           //# specifies the filestem for sc-generated files
    dllname = "xfldr.dll";
    callstyle = oidl;

    /*
     * Internal class variables for M_XFldObject:
     *
     */

    /*
     * M_WPObject methods overridden by M_XFldObject:
     *
     */

    wpclsInitData: override;
        /*@@ wpclsInitData:
           we override this to initialize XFolder altogether.
           This is probably the first SOM method called on the
           system (for M_WPObject, that is), so we use this
           to set up some stuff, most notably, start the
           additional XFolder threads by calling
           xthrInitializeThreads (xthreads.c). */

  };
#endif /* __SOMIDL__ */
};


