
//# This file was generated by the SOM Compiler.
//# FileName: textfldr.id2.
//# Generated using:
//#     SOM Precompiler somopc: 2.7
//#     SOM Emitter emitidl: 2.22

//
//
//   Module Name: TEXTFLDR
//
//   OS/2 Work Place Shell Sample Program
//
//   Copyright (C) 1993 IBM Corporation
//
//       DISCLAIMER OF WARRANTIES.  The following [enclosed] 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 textfldr_idl
#define textfldr_idl

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

interface M_TextFolder;

interface TextFolder : WPFolder

//
// CLASS: TextFolder
//
// CLASS HIERARCHY:
//
//     SOMObject
//       ÀÄÄ WPObject
//             ÀÄÄ WPFileSystem
//                   ÀÄÄ WPFolder
//                         ÀÄÄ  TextFolder
//
// DESCRIPTION:
//
//    This is the TextFolder object class. This object is similar to
//    normal folders. The text folder rejects any object that isn't
//    a file system object that only contains text. The TextFolder accepts
//    file system objects that have a type of 'Plain Text' or have no type
//    and contain text characters only.
//
//    An instance of this class can be created as a Workplace object.
//

{
#ifdef __PRIVATE__

  BOOL IsTextFile(in PSZ pszFileName);

  //
  // METHOD: IsTextFile                                     (X) PRIVATE
  //                                                        ( ) PUBLIC
  // DESCRIPTION:
  //
  //   This method checks the first 'n' characters of a file to determine
  //   if it is or is not text. This method is invoked by the
  //   ValidateDragAndDrop method. It is invoked only if no type is specified
  //   for the object being manipulated.  A file is considered to be text if
  //   the first 'n' bytes are in the range of ASCII 32 (20 Hex) to ASCII 126
  //   (7E Hex), or is a carriage return (ASCII 10, Hex 0A), line feed
  //   (ASCII 13, Hex 0D), tab (ASCII 8, HEX 08), or end of file marker
  //   (ASCII 26, Hex 1A).
  //
  //   NOTE: The value used for 'n' is stored in the variable ulSampleSize
  //   which is local to the IsTextFile method.
  //
  // RETURN:
  //
  //   TRUE  - the object is a text file.
  //   FALSE - the object is not a text file.
  //
  // HOW TO OVERRIDE:
  //
  //   n/a
  //

  BOOL ValidateDragAndDrop(in PDRAGINFO pdrgInfo);

  //
  // METHOD: ValidateDragAndDrop                            (X) PRIVATE
  //                                                        ( ) PUBLIC
  // DESCRIPTION:
  //
  //   This method determines if an object can be dragged/dropped on the
  //   TextFolder. It is invoked by the wpDrag and wpDragOver methods.
  //
  //   The ValidateDragAndDrop method first checks the type of the object
  //   being manipulated. If a type is specified, and it is Plain Text,
  //   the operation is considered to be valid. If a type is specified and
  //   it is not Plain Text the operation is considered invalid. If no
  //   type is specified the IsTextFile() method is invoked to determine
  //   if the object is or is not a text object.
  //
  // RETURN:
  //
  //   TRUE  - The object can be dragged/dropped on the TextFolder.
  //   FALSE - The object can not be dragged/dropped on the TextFolder.
  //
  // HOW TO OVERRIDE:
  //
  //   n/a
  //
  //
  //   Methods from the WPFileSystem class
  //


#endif


#ifdef __SOMIDL__
  implementation {

    releaseorder: IsTextFile,ValidateDragAndDrop;

    //# Class Modifiers
    externalstem = TextFolderwps;
    local;
    externalprefix = TextFolderwps_;
    majorversion = 1;
    minorversion = 2;
    filestem = textfldr;
    metaclass = M_TextFolder;
    callstyle = oidl;

    passthru C_ih =     ""
"        #define   INCL_WIN"
"        #define   INCL_DOSERRORS"
"        #define   INCL_DOSMODULEMGR"
"        #define   INCL_WPCLASS"
"        #include  <os2.h>"
""
"        #include  <pmwp.h>"
""
"        #include \"string.h\""
""
"        #define ID_ICON 100"
""
"        #define FIRST_TEXT_CHAR         0x20"
"        #define LAST_TEXT_CHAR          0x7e"
"        #define CHAR_CARRIAGE_RETURN    '\r'"
"        #define CHAR_LINE_FEED          '\n'"
"        #define CHAR_TAB                '\t'"
"        #define CHAR_END_OF_FILE        0x1a"
"";

    passthru C_h_after =  ""
"";

    //# Method Modifiers
    wpFilterPopupMenu: override;
    wpAddFolderView2Page: override;
    wpAddFolderIncludePage: override;
    wpDragOver: override;
    wpDrop: override;

#ifdef __PRIVATE__

    //# Data Modifiers

#endif

  };
#endif /* __SOMIDL__ */
};

interface M_TextFolder
{

#ifdef __SOMIDL__
  implementation {

    //# Class Modifiers
    externalstem = TextFolderwps;
    local;
    externalprefix = TextFolderwps_;
    functionprefix = TextFolderM_;
    majorversion = 1;
    minorversion = 2;
    filestem = textfldr;
    callstyle = oidl;

    //# Method Modifiers
    wpclsQueryTitle: override;
    wpclsQueryIconData: override;

  };
#endif /* __SOMIDL__ */
};

#endif  /* textfldr_idl */
