
//# This file was generated by the SOM Compiler.
//# FileName: wsfolder.id2.
//# Generated using:
//#     SOM Precompiler somopc: 2.29.1.2
//#     SOM Emitter emitidl: 2.41

//
//
//   Module Name: WSFOLDER
//
//   OS/2 Work Place Shell Sample Program
//
//   Copyright (C) 1994,1995 IBM Corporation
//
//       DISCLAIMER OF WARRANTIES.  The following code is
//       sample code created by IBM Corporation. This sample code is not
//       part of any standard or IBM product and is provided to you solely
//       for  the purpose of assisting you in the development of your
//       applications.  The code is provided "AS IS", without
//       warranty of any kind.  IBM shall not be liable for any damages
//       arising out of your use of the sample code, even if they have been
//       advised of the possibility of such damages.
//

#ifndef wsfolder_idl
#define wsfolder_idl

#include "wpfolder.idl"
#include <somcls.idl>

interface M_WSFOLDER;

interface WSFOLDER : WPFolder
//# Comment for parent WPFolder:

//
// CLASS: WSFOLDER
//
// CLASS HIERARCHY:
//
//     SOMObject
//       ÀÄÄ WPObject
//             ÀÄÄ WPFileSystem
//                   ÀÄÄ WPFolder
//                         ÀÄÄ  WSFOLDER
//
// DESCRIPTION:
//
//    This is the sample WSFOLDER object class.
//
//    An instance of this class can be created as a Workplace object.
//

{
  void closeViews();

  //
  //  METHOD: closeViews                                     ( ) PRIVATE
  //                                                         (X) PUBLIC
  //  DESCRIPTION:
  //
  //    Close all but the first open view of a wsfolder object.
  //

  HWND queryFirstViewHandle();

  //
  //  METHOD: queryFirstViewHandle                           ( ) PRIVATE
  //                                                         (X) PUBLIC
  //  DESCRIPTION:
  //
  //    return the handle of the view that was opened first of the
  //    currently open views of this wsfolder object.
  //

  BOOL setFirstViewHandle(in HWND hwndView);

  //
  //  METHOD: setFirstViewHandle                             ( ) PRIVATE
  //                                                         (X) PUBLIC
  //  DESCRIPTION:
  //
  //    Do special processing on first open of folder (save hwnd of
  //    first view opened for this object)
  //
  //  PARAMETERS:
  //
  //     HWND - hwnd of the first currently open view of this object
  //
  //  RETURNS:
  //
  //     TRUE - hwnd set successfully
  //     FALSE - first hwnd wasn't set successfully
  //



#ifdef __SOMIDL__
  implementation {

    releaseorder: closeViews,queryFirstViewHandle,setFirstViewHandle;

    //# Class Modifiers
    externalstem = wsfold;
    local;
    externalprefix = wsfold_;
    majorversion = 1;
    minorversion = 2;
    filestem = wsfolder;
    metaclass = M_WSFOLDER;
    callstyle = oidl;

/* CSC2IDL:  CHANGED ph passthru to a private h passthru */

    passthru C_h_after =  ""
#ifdef __PRIVATE__
"   /*"
"    *   Private Debug helpers go here.  They can be enabled/disabled by"
"    *   defining DEBUG as a compiler directive."
"    */"
"   #if defined(DEBUG)"
""
"      #define DebugBox(title, text) \ "
"                                    \ "
"                 WinMessageBox(     \ "
"                    HWND_DESKTOP,   \ "
"                    HWND_DESKTOP,   \ "
"                    (PSZ) text,     \ "
"                    (PSZ) title,    \ "
"                    20,             \ "
"                    MB_OK | MB_INFORMATION | MB_MOVEABLE)"
"   #else"
"      #define DebugBox(title, text)   /* do nothing if not debugging */"
"   #endif"
#endif /* __PRIVATE */
"";

    passthru C_ih_before =  ""
"   #define ID_TITLE           100"
"   #define ID_ICON            101"
"   #define ID_OPENICON        102"
""
"   #define ID_CLOSEVIEWSMENU     (WPMENUID_USER+1) /* menus added to popup menu */"
""
"   #define IDM_CLOSEVIEWS        (WPMENUID_USER+2) /* submenus of added menus */"
""
"   /*"
"    *   Help IDs"
"    *"
"    *   NOTE:  See wsfolder.ipf for the source of this class's help,"
"    *   from which wsfolder.hlp is built"
"    */"
"   #define ID_HELP_DEFAULT    256"
"   #define ID_HELP_CLOSEVIEWS 257"
""
"";


    //# Internal Instance Variables
    HWND hwndFirstView;

    //# Method Modifiers
    wpOpen: override;

    //
    //  METHOD: wpOpen                                         ( ) PRIVATE
    //                                                         (X) PUBLIC
    //  DESCRIPTION:
    //
    //    Do special processing on first open of folder
    //
    wpInitData: override;

    //
    //  METHOD: wpInitData                                     ( ) PRIVATE
    //                                                         (X) PUBLIC
    //  DESCRIPTION:
    //
    //    Set object's detail class to be WSFILE
    //
    wpModifyPopupMenu: override;

    //
    // METHOD: wpModifyPopupMenu                              ( ) PRIVATE
    //                                                        (X) PUBLIC
    // DESCRIPTION:
    //
    //   Add our extra option to the context menu to close all but first view
    //
    wpMenuItemSelected: override;

    //
    // METHOD: wpMenuItemSelected                             ( ) PRIVATE
    //                                                        (X) PUBLIC
    // DESCRIPTION:
    //
    //   Process input from the extra menu option that we added.
    //
    wpMenuItemHelpSelected: override;

    //
    // METHOD: wpMenuItemHelpSelected                         ( ) PRIVATE
    //                                                        (X) PUBLIC
    // DESCRIPTION:
    //
    //   Process input from the extra menu option that we added.
    //
    wpClose: override;

    //
    // METHOD: wpClose                                        ( ) PRIVATE
    //                                                        (X) PUBLIC
    // DESCRIPTION:
    //
    //   When a folder object is closed, we will zero out its first view
    //   instance variable, so that the next time it has a first view opened,
    //   we can keep track of that.
    //
    wpDragOver: override;

    //
    // METHOD: wpDragOver                                     ( ) PRIVATE
    //                                                        (X) PUBLIC
    // DESCRIPTION:
    //
    //   Instances of class WSFOLDER are the only folders that accept a drop
    //   of a WSFILE object.  This override returns DOR_DROP when a WSFILE
    //   object is dragged over a WSFOLDER object.
    //
    wpDrop: override;

    //
    // METHOD: wpDrop                                         ( ) PRIVATE
    //                                                        (X) PUBLIC
    // DESCRIPTION:
    //
    //   This override will be called after a drop of a WSFILE object, so that
    //   the drop can actually be processed.
    //
    wpDeleteFromObjUseList: override;

    //
    // METHOD: wpDeleteFromObjUseList                         ( ) PRIVATE
    //                                                        (X) PUBLIC
    // DESCRIPTION:
    //
    //   When a the last view of a WSFOLDER object is closed, we will zero out
    //   its first view instance variable, so that the next time it has a first
    //   view opened, we can keep track of that.
    //
    wpQueryConcurrentView: override;

    //
    // METHOD: wpQueryConcurrentView                          ( ) PRIVATE
    //                                                        (X) PUBLIC
    // DESCRIPTION:
    //
    //   Objects of WSFOLDER class have concurrent views set on
    //   by default
    //
    wpPrintObject: override;

    //
    // METHOD: wpPrintObject                                  ( ) PRIVATE
    //                                                        (X) PUBLIC
    // DESCRIPTION:
    //
    //   We will simply beep when a WSFOLDER object is "printed"
    //
    wpAddToContent: override;

    //
    // METHOD: wpAddToContent                                 ( ) PRIVATE
    //                                                        (X) PUBLIC
    // DESCRIPTION:
    //
    //   We will put up a dialog containing the title of
    //   the newly added object whenever one is added to a WSFOLDER
    //   object
    //
    wpDeleteFromContent: override;

    //
    // METHOD: wpDeleteFromContent                            ( ) PRIVATE
    //                                                        (X) PUBLIC
    // DESCRIPTION:
    //
    //   We will put up a dialog containing the title of
    //   the newly removed object whenever one is removed from a WSFOLDER
    //   object
    //


    //# Data Modifiers

  };
#endif /* __SOMIDL__ */
};

interface M_WSFOLDER
//# Comment for parent WPFolder:

{
  HMODULE clsQueryModuleHandle();

  //
  // METHOD: clsQueryModuleHandle                           ( ) PRIVATE
  //                                                        (X) PUBLIC
  // DESCRIPTION:
  //
  //   This method returns the module handle of this class.  If this is the
  //   first invocation, DosQueryModuleHandle is called to save the handle
  //   for future invocations.
  //
  // RETURN:
  //
  //   0              Unsuccessful
  //   non-zero       module handle
  //



#ifdef __SOMIDL__
  implementation {

    releaseorder: clsQueryModuleHandle;

    //# Class Modifiers
    externalstem = wsfold;
    local;
    externalprefix = wsfoldM_;   /* CSC2IDL:  CHANGED from wsfold_ after ctoi step */
    functionprefix = wsfoldM_;
    majorversion = 1;
    minorversion = 2;
    filestem = wsfolder;
    callstyle = oidl;

    //# Method Modifiers
    wpclsInitData: override;

    //
    // METHOD: wpclsInitData
    //
    // DESCRIPTION:
    //
    //   Initalize the class data
    //
    wpclsQueryTitle: override;

    //
    // METHOD: wpclsQueryTitle
    //
    // DESCRIPTION:
    //
    //   Return class title for WSFOLDER class
    //
    wpclsQueryIconData: override;

    //
    // METHOD: wpclsQueryIconData                            ( ) PRIVATE
    //                                                        (X) PUBLIC
    // DESCRIPTION:
    //
    //   Return the class icon
    //
    wpclsQueryIconDataN: override;

    //
    // METHOD: wpclsQueryIconDataN                            ( ) PRIVATE
    //                                                        (X) PUBLIC
    // DESCRIPTION:
    //
    //   Return the class open icon
    //
    wpclsQueryDefaultHelp: override;

    //
    // METHOD: wpclsQueryDefaultHelp                          ( ) PRIVATE
    //                                                        (X) PUBLIC
    // DESCRIPTION:
    //
    //   Define help for objects of our class
    //
    wpclsQueryDefaultView: override;

    //
    // METHOD: wpclsQueryDefaultView                          ( ) PRIVATE
    //                                                        (X) PUBLIC
    // DESCRIPTION:
    //
    //   WSFOLDER objects will default to details view
    //
    wpclsQueryStyle: override;

    //
    // METHOD: wpclsQueryDefaultView                          ( ) PRIVATE
    //                                                        (X) PUBLIC
    // DESCRIPTION:
    //
    //   Change default class style so that WSFOLDER objects can be
    //   "printed" (we'll just beep), ans so that this class is not
    //   templatable.
    //

  };
#endif /* __SOMIDL__ */
};

#endif  /* wsfolder_idl */
