home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Professional
/
OS2PRO194.ISO
/
os2
/
prgramer
/
info
/
redbook4
/
pwfolder.sc
< prev
next >
Wrap
Text File
|
1992-06-28
|
7KB
|
213 lines
# This file was generated by the SOM Compiler.
# FileName: pwfolder.sc.
# Generated using:
# SOM Precompiler spc: 1.22
# SOM Emitter emitcsc: 1.10
#include "wpfolder.sc"
class: PWFolder,
file stem = pwfolder, external prefix = pwfolder_, class prefix = pwfoldercls_,
major version = 1, minor version = 1, local;
-- PWFolder is a Password protected folder.
-- It is derived as follows:
-- SOMOject
-- - WPObject
-- - WPFileSystem
-- - WPFolder
-- - PWFolder
parent class: WPFolder;
release order:
LockFolder, QueryInfo, SetInfo;
passthru: C.h, after;
#define DebugBox(title, text) WinMessageBox(HWND_DESKTOP,HWND_DESKTOP, \
(PSZ) text , (PSZ) title, 0, \
MB_OK | MB_INFORMATION )
endpassthru;
methods:
BOOL LockFolder();
--
-- METHOD: LockFolder PUBLIC
--
-- PURPOSE: Invalidates the current password, thereby locking the folder.
--
-- INVOKED: From _wpMenuItemSelected
--
override wpInitData;
--
-- METHOD: wpInitData PUBLIC
--
-- PURPOSE: Initializes instance data
--
-- INVOKED: By Workplace Shell, upon instantiation of the object instance.
--
override wpModifyPopupMenu;
--
-- METHOD: wpModifyPopupMenu PUBLIC
--
-- PURPOSE: Adds an additional "Lock" item to the object's context menu.
--
-- INVOKED: By Workplace Shell, upon instantiation of the object instance.
--
override wpMenuItemSelected;
--
-- METHOD: wpMenuItemSelected PUBLIC
--
-- PURPOSE: Processes the user's selections from the context menu. The
-- overridden method processes only the added "Lock" item, before
-- invoking the parent's default processing to handle other items.
--
-- INVOKED: By Workplace Shell, upon selection of a menu item by the user.
--
override wpOpen;
--
-- METHOD: wpOpen PUBLIC
--
-- PURPOSE: Only allows a folder to be opened if the folder is unlocked, or
-- if the user supplies the correct password in response to the
-- dialog.
--
-- INVOKED: By Workplace Shell, upon selection of the "Open" menu item by
-- the user.
--
override wpSetTitle;
--
-- METHOD: wpSetTitle PUBLIC
--
-- PURPOSE: Sets the folder's title (icon text) to have the phrase <Locked>
-- as a suffix if the folder is locked, or removes this suffix if
-- the folder is unlocked.
--
-- INVOKED: By wpOpen to set the unlocked state, and by LockFolder to set
-- the locked state.
--
override wpSetup;
--
-- METHOD: wpSetup PUBLIC
--
-- PURPOSE: Sets folder properties based upon a setup string passed by the
-- object's creator as part of the WinCreateObject() call. The
-- overridden method simply processes the PASSWORD keyword to set
-- the folder's password immediately upon instantiation, before
-- invoking the parent's default processing to handle all other
-- keywords.
--
-- INVOKED: By the Workplace Shell, upon instantiation of the object
-- instance.
--
override wpSaveState;
--
-- METHOD: wpSaveState PUBLIC
--
-- PURPOSE: Saves the object instance's persistent state data. The
-- overridden method simply saves the password data, then invokes
-- the parent's default processing to handle any other instance
-- data defined by ancestor classes.
--
-- INVOKED: By the Workplace Shell, when the object becomes dormant.
--
override wpRestoreState;
--
-- METHOD: wpRestoreState PUBLIC
--
-- PURPOSE: Restores the object instance's persistent state data. The
-- overridden method simply restores the password data, then
-- invokes the parent's default processing to handle any other
-- instance data defined by ancestor classes.
--
-- INVOKED: By the Workplace Shell, when the object becomes awake.
--
override wpSetIcon;
--
-- METHOD: wpSetIcon PUBLIC
--
-- PURPOSE: This class method returns the handle to the correct icon for
-- the object.
--
-- INVOKED:
--
override wpclsQueryTitle, class;
--
-- METHOD: wpclsQueryTitle PUBLIC
--
-- PURPOSE: This class method returns the default folder title for any
-- instance of the password protected folder class. This title
-- is used if a title is not supplied in the WinCreateObject()
-- call.
--
-- INVOKED: By the Workplace Shell, upon instantiation of the object
-- instance.
--
override wpclsInitData, class;
--
-- METHOD: wpclsInitData PUBLIC
--
-- PURPOSE: This class method allows the initialization of any class data
-- items. The overridden method simply obtains a module handle
-- to be used when accessing Presentation Manager resources, then
-- invokes the parent's default processing.
--
-- INVOKED: By the Workplace Shell, upon loading the class DLL.
--
override wpclsQueryIcon, class;
--
-- METHOD: wpclsQueryIcon PUBLIC
--
-- PURPOSE: This class method returns the handle to the default icon for
-- the class. This method is not used in the current version,
-- but could be used if different icons are to be used for the
-- locked and unlocked states.
--
-- INVOKED:
--
override wpclsUnInitData, class;
--
-- METHOD: wpclsUnInitData PUBLIC
--
-- PURPOSE: This class method allows the release of any class data items
-- or resources. The overridden method releases the module handle
-- obtained by wpclsInitData, then invokes the parent's default
-- processing.
--
-- INVOKED: By the Workplace Shell, upon unloading the class DLL.
--