home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
VSCPPv8.zip
/
VACPP
/
IBMCPP
/
samples
/
IOC
/
LANCELOT
/
LPERSWIN.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1995-04-07
|
16KB
|
392 lines
/*******************************************************************************
* FILE NAME: lperswin.hpp *
* *
* DESCRIPTION: Frame window for matching personnel *
* *
* Class *
* LPersonnelWindow *
* LPersonnelWindowCommandHandler *
* LPersonnelCnr *
* LPersonnelCnrObject *
* LPersonnelWindowHelpHandler *
* *
* COPYRIGHT: *
* Licensed Materials - Property of IBM *
* (C) Copyright IBM Corporation 1992, 1995 *
* All Rights Reserved *
* US Government Users Restricted Rights - Use, duplication, or disclosure *
* restricted by GSA ADP Schedule Contract with IBM Corp. *
* *
*******************************************************************************/
#ifndef _LPERSWIN_
#define _LPERSWIN_
#include <iapp.hpp>
#include <irect.hpp>
#include <istring.hpp>
#include <iframe.hpp>
#include <ititle.hpp>
#include <iinfoa.hpp>
#include <imenubar.hpp>
#ifdef IC_PM
#include <idmhndlr.hpp>
#include <itbar.hpp>
#include <itbarbut.hpp>
#include <iflytext.hpp>
#include <iflyhhdr.hpp>
#endif
#include <icmdhdr.hpp>
#include <icnrhdr.hpp>
#include <icnrmhdr.hpp>
#include <ievent.hpp>
#include <icnr.hpp>
#include <icnrobj.hpp>
#include <icnrctl.hpp>
#include <icnrcol.hpp>
#include <ipopmenu.hpp>
#include <ifont.hpp>
#include <imsgbox.hpp>
#include <ihelp.hpp>
#include <ihelphdr.hpp>
#include "lcnrobj.hpp"
#include "ldbase.hpp"
#include "ldbqry.hpp"
#include "lancelot.h"
#ifdef IC_PM
#include "lperswdm.hpp"
#endif
class LPersonnelWindow;
/******************************************************************************
* Class LPersonnelCnrObject - LPersonnelMainWindow's container object *
******************************************************************************/
class LPersonnelCnrObject : public LCnrObject
{
friend class LPersonnelCnr;
public:
/*------------------------ Constructors/Destructor ----------------------------
| Construct the object in two of four ways: |
| 1) Existing object |
| 2) Icon resourceId and EmployeeData object. |
-----------------------------------------------------------------------------*/
LPersonnelCnrObject( const LPersonnelCnrObject& cnrobj );
LPersonnelCnrObject( unsigned long icon,
const LEmployeeData& employee );
virtual
~LPersonnelCnrObject();
/*------------------------------- Accessors -----------------------------------
| These functions provide a means of getting and setting the accessible |
| attributes of instances of this class: |
| employeeRecord - Returns the employee data |
-----------------------------------------------------------------------------*/
inline LEmployeeData
employeeRecord() const { return theEmployee; };
private:
LEmployeeData
theEmployee;
};
/******************************************************************************
* Class LPersonnelCnr - Personnel window's container *
******************************************************************************/
class LPersonnelCnr : public IContainerControl,
protected ICnrHandler,
protected ICnrMenuHandler
{
public:
/*------------------------ Constructors/Destructor ----------------------------
| Construct the object in only one way: |
| 1) Window id, parent, owner, and location |
-----------------------------------------------------------------------------*/
LPersonnelCnr( unsigned long id, LPersonnelWindow* parent,
LPersonnelWindow* owner, IRectangle location=IRectangle() );
virtual
~LPersonnelCnr();
/*------------------------------- Accessors -----------------------------------
| These functions provide a means of getting and setting the accessible |
| attributes of instances of this class: |
| lastPopupMenuObject - Returns the last container object that had a |
| popup menu over it. But not guaranteed that the |
| last action was a popup menu. |
| setLastPopupMenuObject - Sets the last container object that had a popup |
| menu over it. |
-----------------------------------------------------------------------------*/
LPersonnelCnrObject
*lastPopupMenuObject() { return ptheLastPopupMenuObject; };
LPersonnelCnr
&setLastPopupMenuObject( LPersonnelCnrObject* object )
{ ptheLastPopupMenuObject = object; return *this; };
protected:
/*----------------------------- Event Processing ------------------------------
| Handle and process events: |
| makePopupMenu - Process popup menu events. |
| enter - Process the enter key for container objects. |
| help - Process the help key for container objects. |
-----------------------------------------------------------------------------*/
virtual Boolean
makePopUpMenu( IMenuEvent& evt ),
enter( ICnrEnterEvent& evt ),
help( ICnrHelpEvent& evt );
private:
LPersonnelCnrObject
*pCnrObject[ ID_PERSONNEL_MAX_CNROBJECTS ];
IContainerColumn
colIcon,
colIconText,
colLastName,
colFirstName,
colMiddleInitial,
colEmployeeNumber,
colInternalPhone,
colExternalPhone,
colInternalAddress,
colExternalAddress,
colRoom,
colBuilding,
colDepartment,
colManagerNumber,
colManagerName;
LPersonnelCnrObject
*ptheLastPopupMenuObject;
IHelpWindow
*helpWin;
IPopUpMenu
*popm;
};
/******************************************************************************
* Class LPersonnelWindowCommandHandler - Handle command events. *
******************************************************************************/
class LPersonnelWindowCommandHandler : public ICommandHandler
{
public:
/*------------------------ Constructors/Destructor ----------------------------
| Construct the object in only one way: |
| 1) Owner, help window, and container. |
-----------------------------------------------------------------------------*/
LPersonnelWindowCommandHandler( LPersonnelWindow* owner,
IHelpWindow* helpWin,
LPersonnelCnr* cnrCtl );
virtual
~LPersonnelWindowCommandHandler();
/*------------------------- Container Object Actions --------------------------
| These functions provide a means of performing actions on container objects. |
| openAction - Opens/views the container object. |
| createAction - Creates a new container object. |
| transferAction - Transfer the container object to another department. |
| deleteAction - Deletes the container object. |
-----------------------------------------------------------------------------*/
LPersonnelWindowCommandHandler
&openAction( LPersonnelCnrObject* cnrObject ),
&createAction( LPersonnelCnrObject* cnrObject ),
&transferAction( LPersonnelCnrObject* cnrObject );
Boolean
deleteAction( LPersonnelCnrObject* cnrObject );
protected:
/*----------------------------- Event Processing ------------------------------
| Handle and process events: |
| command - Process command events. |
-----------------------------------------------------------------------------*/
virtual Boolean
command( ICommandEvent& event );
private:
LPersonnelWindow
*pOwner;
IHelpWindow
*pHelp;
LPersonnelCnr
*pCnr;
};
/******************************************************************************
* Class LPersonnelWindowHelpHandler - Handle help events. *
******************************************************************************/
class LPersonnelWindowHelpHandler : public IHelpHandler
{
public:
/*------------------------ Constructors/Destructor ----------------------------
| Construct the object in only one way: |
| 1) No parameters. |
-----------------------------------------------------------------------------*/
LPersonnelWindowHelpHandler();
virtual
~LPersonnelWindowHelpHandler();
protected:
/*----------------------------- Event Processing ------------------------------
| Handle and process events: |
| keysHelpId - Process help events for the container. |
-----------------------------------------------------------------------------*/
virtual Boolean
keysHelpId( IEvent& event );
};
#ifdef IC_PM
/******************************************************************************
* Class LPersonnelToolBar - Toolbar class *
******************************************************************************/
class LPersonnelToolBar : public IToolBar
{
public:
/*------------------------ Constructors/Destructor ----------------------------
| Construct the object in only one way: |
| 1) Resource id, owner, information area. |
-----------------------------------------------------------------------------*/
LPersonnelToolBar( unsigned long id, IFrameWindow* owner,
ITextControl* infoArea );
/*----------------------------- Manipulators ----------------------------------
| These functions provide a means of manipulating the attributes of |
| instances of this class: |
| enableSelects - Enable or disables the select-all and deselect-all |
| toolbar buttons. |
-----------------------------------------------------------------------------*/
LPersonnelToolBar
&enableSelects( Boolean which = true );
private:
IToolBarButton
openButton,
createButton,
transferButton,
deleteButton,
iconButton,
treeButton,
detailsButton,
selectAllButton,
deselectAllButton,
sortAscButton,
sortDescButton,
arrangeButton,
helpButton;
IFlyText
flyText;
IFlyOverHelpHandler
flyHelpHdr;
};
#endif
/******************************************************************************
* Class LPersonnelWindow - Personnel frame window. *
******************************************************************************/
class LPersonnelWindow : public IFrameWindow
{
public:
/*------------------------ Constructors/Destructor ----------------------------
| Construct the object in only one way: |
| 1) Owner, QueryIntersection object, query string. |
-----------------------------------------------------------------------------*/
LPersonnelWindow( IWindow* owner, QueryIntersection& bagOfIds,
const IString deptQuery);
virtual
~LPersonnelWindow();
/*------------------------------- Accessors -----------------------------------
| These functions provide a means of getting and setting the accessible |
| attributes of instances of this class: |
| helpWindow - Returns the help window for this frame window. |
| deptQuery - If a fully-qualified department name was specified |
| on the query, return the department name. |
| selectsAllowed - Returns true if select all/deselect all is allowed. |
-----------------------------------------------------------------------------*/
inline IHelpWindow
*helpWindow() { return &help; };
inline IString
deptQuery() { return aDeptQuery; };
inline Boolean
selectsAllowed() { return aSelects; };
/*------------------------------- Manipulation --------------------------------
| These functions provide a means of manipulating the instances of this class:|
| populate - Populate the container with employee objects. |
| enableSelects - Enable or disables the select-all and deselect-all |
| toolbar buttons. |
-----------------------------------------------------------------------------*/
LPersonnelWindow
&populate( QueryIntersection& bagOfIds );
LPersonnelWindow
&enableSelects( Boolean which = true );
#ifdef IC_PM
IDMItemProviderFor< EmployeeItem >
provider;
#endif
/*----------------------------- Event Processing ------------------------------
| Handle and process events: |
| command - Process command events. |
| keysHelpId - Process the help key for container objects. |
-----------------------------------------------------------------------------*/
protected:
Boolean
command( ICommandEvent& evt ),
keysHelpId( IEvent& evt );
private:
ITitle
title;
IMenuBar
menubar;
IInfoArea
infoarea;
LPersonnelCnr
cnr;
#ifdef IC_PM
LPersonnelToolBar
toolbar;
#endif
IHelpWindow
help;
LPersonnelWindowCommandHandler
cmdHdr;
LPersonnelWindowHelpHandler
helpHdr;
IString
aDeptQuery;
Boolean
aSelects;
};
#endif