home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
warptlk3.zip
/
TOOLKIT
/
SAMPLES
/
WPS
/
WSFILE
/
WSFILE.IDL
< prev
next >
Wrap
Text File
|
1995-08-24
|
18KB
|
608 lines
//# This file was generated by the SOM Compiler.
//# FileName: wsfile.id2.
//# Generated using:
//# SOM Precompiler somopc: 2.29.1.2
//# SOM Emitter emitidl: 2.41
//
//
// Module Name: WSFILE
//
// OS/2 Work Place Shell Sample Program
//
// Copyright (C) 1994 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 wsfile_idl
#define wsfile_idl
#include "wpdataf.idl"
#include <somcls.idl>
interface M_WSFILE;
interface WSFILE : WPDataFile
//# Comment for parent WPDataFile:
//---Symbol parentComment is undefined---
//
// CLASS: WSFILE
//
// CLASS HIERARCHY:
//
// SOMObject
// └── WPObject
// └── WPFileSystem
// └── WPDataFile
// └── WSFILE
//
// DESCRIPTION:
//
// This is the sample WSFILE object class.
//
// An instance of this class can be created as a Workplace object.
//
{
PSZ queryLastWorker();
//
// METHOD: queryLastWorker ( ) PRIVATE
// (X) PUBLIC
// DESCRIPTION:
//
// Query name of last person to work with wsfile
//
// RETURN:
//
// PSZ name of last person to work on file
//
BOOL setLastWorker(in PSZ pszWorkerName);
//
// METHOD: setLastWorker ( ) PRIVATE
// (X) PUBLIC
// DESCRIPTION:
//
// Set name of last person to work with wsfile
//
// RETURN:
//
// TRUE Brake is on
// FALSE Brake is off
//
BOOL soundAlarm();
//
// METHOD: soundAlarm ( ) PRIVATE
// (X) PUBLIC
// DESCRIPTION:
//
// Sound an alarm
//
// RETURN:
//
// TRUE Successful
// FALSE Unsuccessful
//
ULONG AddLastWorkerPage(in HWND hwndNotebook);
//
// METHOD: AddLastWorkerPage ( ) PRIVATE
// (X) PUBLIC
// DESCRIPTION:
//
// This method adds the Last Worker page to the settings notebook.
//
// RETURN:
//
// 0 Unsuccessful
// ulPageId Identifier for the inserted page
//
// HOW TO OVERRIDE:
//
// Method should always be overridden in order to replace or remove
// the last worker page from an object which is a descendent of wsfile.
// In most cases, an override of this method will not call the parent.
//
#ifdef __SOMIDL__
implementation {
releaseorder: queryLastWorker,setLastWorker,soundAlarm,AddLastWorkerPage;
//# Class Modifiers
externalstem = wsfile;
local;
externalprefix = wsf_;
majorversion = 1;
minorversion = 2;
filestem = wsfile;
metaclass = M_WSFILE;
callstyle = oidl;
/* CSC2IDL: CHANGED ph passthru to a private h passthru */
passthru C_h_after = ""
#ifdef __PRIVATE__
" /*"
" * The following structures will be used to store window specific data"
" * and a pointer to the object that created the window/dialog."
" *"
" * They're allocated when the Client window is created. This"
" * allows us to pass the *somSelf pointer and use it in our"
" * window and dialog procedures (the system only passes this"
" * pointer to methods)."
" */"
""
" typedef struct _WINDOWDATA"
" {"
" USHORT cb; /* size of this structure */"
" WSFILE *somSelf; /* pointer to this instance */"
" USEITEM UseItem; /* global class usage information */"
" VIEWITEM ViewItem; /* global class view information */"
" } WINDOWDATA;"
" typedef WINDOWDATA *PWINDOWDATA;"
""
" /*"
" * Window data for the Worker dialog (settings page)"
" */"
" typedef struct _LASTWORKERDLGDATA"
" {"
" USHORT cb; /* size of this structure */"
" WSFILE *somSelf; /* pointer to this instance */"
" PSZ PrevWorker; /* indicates name of person to last work */"
" /* with this file */"
" PSZ restorePrevWorker; /* used for UNDO */"
" } LASTWORKERDLGDATA;"
" typedef LASTWORKERDLGDATA *PLASTWORKERDLGDATA;"
""
" /*"
" * 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 = ""
" #define INCL_WIN"
" #define INCL_DOS"
" #define INCL_GPIBITMAPS"
" #define INCL_DOSERRORS"
" #include <os2.h>"
""
" #define INCL_WPCLASS"
" #define INCL_WPFOLDER"
""
" #include <pmwp.h>"
""
" #define ID_TITLE 100"
" #define ID_ICON 101"
""
" #define IDD_LASTWORKER 200 /* settings page (dialog) */"
" #define IDC_LASTWORKER 300"
""
""
" /*"
" * The following user-defined Popup menu items (ID_xxx) should be higher"
" * than WPMENUID_USER."
" *"
" * The ID_OPENMENU will become a submenu of the system's popup open menu"
" * id, WPMENUID_OPEN."
" */"
" #define ID_ALARMMENU (WPMENUID_USER+1) /* menus added to popup menu */"
" #define ID_OPENMENU (WPMENUID_USER+2)"
""
" #define IDM_OPENWSFILE (WPMENUID_USER+3) /* submenus of added menus */"
" #define IDM_SOUNDALARM (WPMENUID_USER+4)"
""
" #define ID_FRAME 3000 /* frame window id */"
" #define ID_CLIENT 3001 /* client window id */"
""
" /*"
" * Set unique view ids, in order for the default view checkmark"
" * to be set correctly, on the Open submenu, this OPEN view id must"
" * be the same value as the corresponding menu id."
" */"
" #define OPEN_WSFILE IDM_OPENWSFILE"
""
" /*"
" * IDs of dialog items in WSFILE.RC"
" */"
" #define ID_UNDO 801"
" #define ID_DEFAULT 802"
" #define ID_HELP 803"
""
" /*"
" * Keys for save-restore methods"
" */"
" #define IDKEY_LASTWORKER 1"
""
" /*"
" * Default values of instance data items"
" */"
" #define DEFAULT_LASTWORKER \"Anonymous\""
""
" /*"
" * Help IDs"
" *"
" * NOTE: See wsfile.ipf for the source of this class's help,"
" * from which wsfile.hlp is built"
" */"
" #define ID_HELP_DEFAULT 256"
" #define ID_HELP_OPENWSFILE 257"
" #define ID_HELP_LASTWORKER 258"
" #define ID_HELP_SOUNDALARM 259"
""
" /*"
" * Indexes into WSFILEDETAILS array"
" */"
" #define INDEX_LASTWORKER 0"
""
" /*"
" * WSFILEDETAILS: Structure used for details view"
" */"
" typedef struct _WSFILEDETAILS"
" {"
" PSZ pszLastWorker; /* Last person to work with wsfile */"
" } WSFILEDETAILS;"
" typedef WSFILEDETAILS *PWSFILEDETAILS;"
"";
//# Internal Instance Variables
PSZ pszLastWorker; // name of last person to work with this file
//# Method Modifiers
wpInitData: override;
//
// OVERRIDE: wpInitData ( ) PRIVATE
// (X) PUBLIC
// DESCRIPTION:
//
// Initialize our state variables. Allocate any extra memory that
// we might need.
//
wpUnInitData: override;
//
// OVERRIDE: wpUnInitData ( ) PRIVATE
// (X) PUBLIC
// DESCRIPTION:
//
// Clear up memory that was allocated on wpInitData.
//
wpSaveState: override;
//
// METHOD: wpSaveState ( ) PRIVATE
// (X) PUBLIC
// DESCRIPTION:
//
// Save our state variables (pitch and duration).
//
wpRestoreState: override;
//
// METHOD: wpRestoreState ( ) PRIVATE
// (X) PUBLIC
// DESCRIPTION:
//
// Retrieve our saved state variables (pitch and duration).
//
wpAddSettingsPages: override;
//
// METHOD: wpAddSettingsPages ( ) PRIVATE
// (X) PUBLIC
// DESCRIPTION:
//
// Add our own settings page to let the user alter the pitch
// and duration of the wsfile's beep.
//
wpFilterPopupMenu: override;
//
// METHOD: wpFilterPopupMenu ( ) PRIVATE
// (X) PUBLIC
// DESCRIPTION:
//
// Filter out any options from the context that don't apply.
//
// HOW TO OVERRIDE:
//
// No restrictions.
//
wpModifyPopupMenu: override;
//
// METHOD: wpModifyPopupMenu ( ) PRIVATE
// (X) PUBLIC
// DESCRIPTION:
//
// Add our extra option to the context menu to beep the horn
//
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.
//
wpQueryDetailsData: override;
//
// METHOD: wpQueryDetailsData ( ) PRIVATE
// (X) PUBLIC
// DESCRIPTION:
//
// Returns the wsfile specific data for the details view of this object.
// Sets the pointer (*ppDetailsData) to the beginning of the buffer
// into which the data is written.
//
wpOpen: override;
//
// METHOD: wpOpen ( ) PRIVATE
// (X) PUBLIC
// DESCRIPTION:
//
// Opens the wsfile window.
//
wpSetupOnce: override;
//
//
// METHOD: wpSetupOnce ( ) PRIVATE
// (X) PUBLIC
// DESCRIPTION:
//
// Specify ONE TIME initialization. This method is
// invoked once on an object when it is initially created.
//
// The one time initialization we're doing is to write
// some default data to the file
wpSetup: override;
//
// METHOD: wpSetup ( ) PRIVATE
// (X) PUBLIC
// DESCRIPTION:
//
// Specify Setup strings to do special setup string processing
//
// New Key/Value to be parsed and processed by this override:
//
// SOUND=(YES/NO) YES will invoke _soundAlarm method
// NO will do nothing
wpFormatDragItem: override;
//
// METHOD: wpFormatDragItem ( ) PRIVATE
// (X) PUBLIC
// DESCRIPTION:
//
// Specify a unique RMF that will only be understood by instances
// of class WSFOLDER. (see _wpDragOver and _wpDrop overrides in
// wsfolder.c).
//
//# Data Modifiers
};
#endif /* __SOMIDL__ */
};
interface M_WSFILE
//# Comment for parent WPDataFile:
{
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
//
PSZ clsQueryDefaultFileText();
//
// METHOD: clsQueryDefaultFileText ( ) PRIVATE
// (X) PUBLIC
// DESCRIPTION:
//
// This method returns some default text to stuff in an empty WSFILE.
//
// RETURN:
//
// PSZ
//
#ifdef __SOMIDL__
implementation {
releaseorder: clsQueryModuleHandle,clsQueryDefaultFileText;
//# Class Modifiers
externalstem = wsfile;
local;
externalprefix = wsfM_; /* CSC2IDL: CHANGED from wsf_ after ctoi step */
functionprefix = wsfM_;
majorversion = 1;
minorversion = 2;
filestem = wsfile;
callstyle = oidl;
//# Method Modifiers
wpclsInitData: override;
//
// METHOD: wpclsInitData
//
// DESCRIPTION:
//
// Initalize the class data
//
wpclsUnInitData: override;
//
// METHOD: wpclsUnInitData
//
// DESCRIPTION:
//
// Free any class data
//
wpclsQueryTitle: override;
//
// METHOD: wpclsQueryTitle ( ) PRIVATE
// (X) PUBLIC
// DESCRIPTION:
//
// Return the string "New MyFile".
//
wpclsQueryIconData: override;
//
// METHOD: wpclsQueryIconDdata ( ) PRIVATE
// (X) PUBLIC
// DESCRIPTION:
//
// Return the class icon
//
wpclsQueryDefaultHelp: override;
//
// METHOD: wpclsQueryDefaultHelp ( ) PRIVATE
// (X) PUBLIC
// DESCRIPTION:
//
// Process input from the extra menu option that we added.
//
wpclsQueryDefaultView: override;
//
// METHOD: wpclsQueryDefaultView ( ) PRIVATE
// (X) PUBLIC
// DESCRIPTION:
//
// Returns the default view for a new instance of this object.
//
// REMARKS:
//
// Tell the system what our default open view is...
//
wpclsQueryDetailsInfo: override;
//
// METHOD: wpclsQueryDetailsInfo ( ) PRIVATE
// (X) PUBLIC
// DESCRIPTION:
//
// Appends the wsfile specific chain of FIELDINFO structures describing the
// details data of this object to *ppDetailsData (if ppDetailsData
// is NON-NULL). In this case it also sets *ppDetailsData to the
// head of the linked list.
//
// Adds the number of bytes required by the details data for wsfile to *pSize
// (if pSize is NON-NULL).
//
// REMARKS:
//
// Add details data for this object.
//
// From WPFileSystem
wpclsQueryInstanceFilter: override;
//
// METHOD: wpclsQueryInstanceFilter ( ) PRIVATE
// (X) PUBLIC
// DESCRIPTION:
//
// The wpclsQueryInstanceFilter method is called to allow the class
// object to specify the file title filters for instances of its
// class.
//
// REMARKS:
//
// A pointer to a string containing file title filter(s). This
// string can contain several file title filters separated by a
// comma. Example: "*.TXT, *.DOC"
//
wpclsQueryStyle: override;
//
// METHOD: wpclsQueryStyle ( ) PRIVATE
// (X) PUBLIC
// DESCRIPTION:
//
// The wpclsQueryStyle method is called to allow the class object
// to specify the default object class style for its instances.
//
// REMARKS:
//
// This method can be called at any time in order to determine the
// default style for instances of this class.
//
// This method should be overridden in order to modify the default
// object style for instances of this class.
//
};
#endif /* __SOMIDL__ */
};
#endif /* wsfile_idl */