home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
VSCPPv8.zip
/
VACPP
/
IBMCPP
/
samples
/
VISBUILD
/
RAPSHEET
/
CPPOV23
/
ILSTSEEN.CPP
< prev
next >
Wrap
Text File
|
1995-05-14
|
6KB
|
174 lines
//****************************************************************************
// ILastSeen Class - C++ Source File (ilstseen.cpp) *
// *
// COPYRIGHT: Copyright (C) International Business Machines Corp., 1994,1995 *
// *
// DISCLAIMER OF WARRANTIES: *
// The following [enclosed] code is sample code created by IBM *
// Corporation. This sample code is not part of any standard 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. *
//****************************************************************************
//NOTE: WE RECOMMEND USING A FIXED-SPACE FONT TO LOOK AT THE SOURCE.
//
#include "ilstseen.hpp"
#ifndef _INOTIFEV_
#include "inotifev.hpp"
#endif
/****************************************************************************
* Constructors
****************************************************************************/
ILastSeen :: ILastSeen() :
dLocation(""),
dWitness(""),
dDate(""),
dComment(""),
iAddress(new IAddress())
{
}
/****************************************************************************
* Destructor
****************************************************************************/
ILastSeen :: ~ILastSeen()
{
}
/****************************************************************************
* Events
****************************************************************************/
INotificationId ILastSeen::locationID = "ILastSeen::location";
INotificationId ILastSeen::witnessID = "ILastSeen::witness";
INotificationId ILastSeen::dateID = "ILastSeen::date";
INotificationId ILastSeen::commentID = "ILastSeen::comment";
INotificationId ILastSeen::addressId = "ILastSeen::address";
/****************************************************************************
* Attribute Access Member Functions
****************************************************************************/
/*------------------------------------------------------------------
* location
*-----------------------------------------------------------------*/
IString ILastSeen :: location() const
{
return dLocation;
}
ILastSeen & ILastSeen ::
setLocation(const IString & iLocation)
{
if (dLocation != iLocation)
{
dLocation = iLocation;
notifyObservers(INotificationEvent(ILastSeen::locationID, *this, true,
IEventData((char *)iLocation)));
}
else
notifyObservers(INotificationEvent(ILastSeen::locationID, *this, false));
return *this;
}
/*------------------------------------------------------------------
* witness
*-----------------------------------------------------------------*/
IString ILastSeen :: witness() const
{
return dWitness;
}
ILastSeen & ILastSeen ::
setWitness(const IString & iWitness)
{
if (dWitness != iWitness)
{
dWitness = iWitness;
notifyObservers(INotificationEvent(ILastSeen::witnessID, *this, true,
IEventData((char *)iWitness)));
}
else
notifyObservers(INotificationEvent(ILastSeen::witnessID, *this, false));
return *this;
}
/*------------------------------------------------------------------
* dateLastSeen
*-----------------------------------------------------------------*/
IString ILastSeen :: dateLastSeen() const
{
return dDate;
}
ILastSeen & ILastSeen ::
setDateLastSeen(const IString & iDateLastSeen)
{
if (dDate != iDateLastSeen)
{
dDate = iDateLastSeen;
notifyObservers(INotificationEvent(ILastSeen::dateID, *this, true,
IEventData((char *)iDateLastSeen)));
}
else
notifyObservers(INotificationEvent(ILastSeen::dateID, *this, false));
return *this;
}
/*------------------------------------------------------------------
* comment
*-----------------------------------------------------------------*/
IString ILastSeen :: comment() const
{
return dComment;
}
ILastSeen & ILastSeen ::
setComment(const IString & iComment)
{
if (dComment != iComment)
{
dComment = iComment;
notifyObservers(INotificationEvent(ILastSeen::commentID, *this, true,
IEventData((char *)iComment)));
}
else
notifyObservers(INotificationEvent(ILastSeen::commentID, *this, false));
return *this;
}
/*-----------------------------------------------------------------
* address()
*-----------------------------------------------------------------*/
IAddress * ILastSeen::address() const
{
return iAddress;
}
ILastSeen & ILastSeen::setAddress(IAddress * aAddress)
{
if (iAddress != aAddress)
{
iAddress = aAddress;
notifyObservers(INotificationEvent(ILastSeen::addressId, *this));
} // endif
return *this;
}
/*-----------------------------------------------------------------
* asString()
*-----------------------------------------------------------------*/
IString ILastSeen :: asString() const
{
// Only return location. Its the only thing that will be in the list box
// The other fields will be in entry fields.
return (dLocation);
}