Initial
This commit is contained in:
55
pop/DRGSPRT.HPP
Normal file
55
pop/DRGSPRT.HPP
Normal file
@@ -0,0 +1,55 @@
|
||||
#ifndef _POP_DRAGSPRITE_HPP_
|
||||
#define _POP_DRAGSPRITE_HPP_
|
||||
#ifndef _COMMON_PUREBITMAP_HPP_
|
||||
#include <common/purebmp.hpp>
|
||||
#endif
|
||||
#ifndef _SPRITE_PURESPRITE_HPP_
|
||||
#include <pop/sprite.hpp>
|
||||
#endif
|
||||
|
||||
class DragSprite : public PureBitmap, public PureSprite
|
||||
{
|
||||
public:
|
||||
DragSprite(void);
|
||||
virtual ~DragSprite();
|
||||
void setBitmap(HBITMAP hBitmap);
|
||||
protected:
|
||||
virtual operator PureBitmap&(void);
|
||||
private:
|
||||
DragSprite(const DragSprite &someDragSprite);
|
||||
DragSprite &operator=(const DragSprite &someDragSprite);
|
||||
};
|
||||
|
||||
inline
|
||||
DragSprite::DragSprite(void)
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
DragSprite::DragSprite(const DragSprite &/*someDragSprite*/)
|
||||
{ // private implementation
|
||||
}
|
||||
|
||||
inline
|
||||
DragSprite::~DragSprite()
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
DragSprite::operator PureBitmap&(void)
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline
|
||||
DragSprite &DragSprite::operator=(const DragSprite &/*someDragSprite*/)
|
||||
{ // private implementation
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline
|
||||
void DragSprite::setBitmap(HBITMAP hBitmap)
|
||||
{
|
||||
(PureBitmap&)*this=hBitmap;
|
||||
}
|
||||
#endif
|
||||
120
pop/HEADER.CPP
Normal file
120
pop/HEADER.CPP
Normal file
@@ -0,0 +1,120 @@
|
||||
#include <pop/header.hpp>
|
||||
#include <common/openfile.hpp>
|
||||
#include <common/filemap.hpp>
|
||||
#include <common/pview.hpp>
|
||||
#include <common/block.hpp>
|
||||
|
||||
Header &Header::operator=(const Header &someHeader)
|
||||
{
|
||||
path(someHeader.path());
|
||||
from(someHeader.from());
|
||||
newsGroups(someHeader.newsGroups());
|
||||
subject(someHeader.subject());
|
||||
date(someHeader.date());
|
||||
organization(someHeader.organization());
|
||||
lines(someHeader.lines());
|
||||
messageID(someHeader.messageID());
|
||||
replyTo(someHeader.replyTo());
|
||||
postingHost(someHeader.postingHost());
|
||||
newsReader(someHeader.newsReader());
|
||||
crossReference(someHeader.crossReference());
|
||||
contentType(someHeader.contentType());
|
||||
xMailer(someHeader.xMailer());
|
||||
return *this;
|
||||
}
|
||||
|
||||
Header &Header::operator=(Block<String> &headerLines)
|
||||
{
|
||||
UINT lineCount(headerLines.size());
|
||||
for(int lineIndex=0;lineIndex<lineCount;lineIndex++)
|
||||
{
|
||||
String lineItem(headerLines[lineIndex].betweenString(' ',0));
|
||||
String &headerLine=headerLines[lineIndex];
|
||||
if(headerLine.isNull())continue;
|
||||
if(isPath(headerLine))path(lineItem);
|
||||
else if(isFrom(headerLine))from(lineItem);
|
||||
else if(isNewsGroups(headerLine))newsGroups(lineItem);
|
||||
else if(isSubject(headerLine))subject(lineItem);
|
||||
else if(isDate(headerLine))date(lineItem);
|
||||
else if(isOrganization(headerLine))organization(lineItem);
|
||||
else if(isLines(headerLine))lines(lineItem);
|
||||
else if(isMessageID(headerLine))messageID(lineItem);
|
||||
else if(isReplyTo(headerLine))replyTo(lineItem);
|
||||
else if(isNNTPPostingHost(headerLine))postingHost(lineItem);
|
||||
else if(isNewsReader(headerLine))newsReader(lineItem);
|
||||
else if(isCrossReference(headerLine))crossReference(lineItem);
|
||||
else if(isContentType(headerLine))contentType(lineItem);
|
||||
else if(isMailer(headerLine))xMailer(lineItem);
|
||||
}
|
||||
if(replyTo().isNull())replyTo(from());
|
||||
return *this;
|
||||
}
|
||||
|
||||
Header &Header::operator=(const String &pathFileName)
|
||||
{
|
||||
FileHandle headerFile(pathFileName,FileHandle::Read,FileHandle::ShareRead);
|
||||
FileMap headerMap(headerFile);
|
||||
PureViewOfFile headerView(headerMap);
|
||||
String headerLine;
|
||||
String lineItem;
|
||||
|
||||
if(!headerFile.isOkay())return *this;
|
||||
while(headerView.getLine(headerLine))
|
||||
{
|
||||
if(headerLine.isNull()||!headerLine.length())break;
|
||||
lineItem=(headerLine.betweenString(' ',0));
|
||||
if(isPath(headerLine))path(lineItem);
|
||||
else if(isFrom(headerLine))from(lineItem);
|
||||
else if(isNewsGroups(headerLine))newsGroups(lineItem);
|
||||
else if(isSubject(headerLine))subject(lineItem);
|
||||
else if(isDate(headerLine))date(lineItem);
|
||||
else if(isOrganization(headerLine))organization(lineItem);
|
||||
else if(isLines(headerLine))lines(lineItem);
|
||||
else if(isMessageID(headerLine))messageID(lineItem);
|
||||
else if(isReplyTo(headerLine))replyTo(lineItem);
|
||||
else if(isNNTPPostingHost(headerLine))postingHost(lineItem);
|
||||
else if(isNewsReader(headerLine))newsReader(lineItem);
|
||||
else if(isCrossReference(headerLine))crossReference(lineItem);
|
||||
else if(isContentType(headerLine))contentType(lineItem);
|
||||
else if(isMailer(headerLine))xMailer(lineItem);
|
||||
}
|
||||
if(replyTo().isNull())replyTo(from());
|
||||
return *this;
|
||||
}
|
||||
|
||||
SystemTime Header::systemTime(void)
|
||||
{
|
||||
SystemTime systemTime;
|
||||
char *ptrString;
|
||||
|
||||
if(mDate.isNull())return systemTime;
|
||||
String tmpDate(mDate.betweenString(',',0));
|
||||
if(tmpDate.isNull())return systemTime;
|
||||
ptrString=(LPSTR)tmpDate;
|
||||
ptrString=::strtok(ptrString," ");
|
||||
if(!ptrString)return systemTime;
|
||||
systemTime.day(::atoi(ptrString));
|
||||
ptrString=::strtok(0," ");
|
||||
if(!ptrString)return systemTime;
|
||||
if(!::strcmp(ptrString,"Jan"))systemTime.month(SystemTime::January);
|
||||
else if(!::strcmp(ptrString,"Feb"))systemTime.month(SystemTime::February);
|
||||
else if(!::strcmp(ptrString,"Mar"))systemTime.month(SystemTime::March);
|
||||
else if(!::strcmp(ptrString,"Apr"))systemTime.month(SystemTime::April);
|
||||
else if(!::strcmp(ptrString,"May"))systemTime.month(SystemTime::May);
|
||||
else if(!::strcmp(ptrString,"Jun"))systemTime.month(SystemTime::June);
|
||||
else if(!::strcmp(ptrString,"Jul"))systemTime.month(SystemTime::July);
|
||||
else if(!::strcmp(ptrString,"Aug"))systemTime.month(SystemTime::August);
|
||||
else if(!::strcmp(ptrString,"Sep"))systemTime.month(SystemTime::September);
|
||||
else if(!::strcmp(ptrString,"Oct"))systemTime.month(SystemTime::October);
|
||||
else if(!::strcmp(ptrString,"Nov"))systemTime.month(SystemTime::November);
|
||||
else if(!::strcmp(ptrString,"Dec"))systemTime.month(SystemTime::December);
|
||||
else systemTime.month(SystemTime::None);
|
||||
ptrString=::strtok(0," ");
|
||||
if(!ptrString)return systemTime;
|
||||
systemTime.year(::atoi(ptrString));
|
||||
systemTime.hour(0);
|
||||
systemTime.minute(0);
|
||||
systemTime.second(0);
|
||||
systemTime.milliseconds(0);
|
||||
return systemTime;
|
||||
}
|
||||
366
pop/HEADER.HPP
Normal file
366
pop/HEADER.HPP
Normal file
@@ -0,0 +1,366 @@
|
||||
#ifndef _POP_HEADER_HPP_
|
||||
#define _POP_HEADER_HPP_
|
||||
#ifndef _COMMON_STRING_HPP_
|
||||
#include <common/string.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_SYSTEMTIME_HPP_
|
||||
#include <common/systime.hpp>
|
||||
#endif
|
||||
|
||||
template <class T>
|
||||
class Block;
|
||||
|
||||
class Header
|
||||
{
|
||||
public:
|
||||
Header(void);
|
||||
Header(Block<String> &headerLines);
|
||||
Header(const Header &someHeader);
|
||||
Header(const String &pathFileName);
|
||||
virtual ~Header();
|
||||
Header &operator=(const Header &someHeader);
|
||||
Header &operator=(Block<String> &headerLines);
|
||||
Header &operator=(const String &pathFileName);
|
||||
const String &path(void)const;
|
||||
const String &from(void)const;
|
||||
const String &newsGroups(void)const;
|
||||
const String &subject(void)const;
|
||||
const String &date(void)const;
|
||||
SystemTime systemTime(void);
|
||||
const String &organization(void)const;
|
||||
const String &lines(void)const;
|
||||
const String &messageID(void)const;
|
||||
const String &replyTo(void)const;
|
||||
const String &postingHost(void)const;
|
||||
const String &newsReader(void)const;
|
||||
const String &crossReference(void)const;
|
||||
const String &contentType(void)const;
|
||||
const String &xMailer(void)const;
|
||||
private:
|
||||
void path(const String &path);
|
||||
void from(const String &from);
|
||||
void newsGroups(const String &newsGroups);
|
||||
void subject(const String &subject);
|
||||
void date(const String &date);
|
||||
void organization(const String &organization);
|
||||
void lines(const String &lines);
|
||||
void messageID(const String &messageID);
|
||||
void replyTo(const String &replyTo);
|
||||
void postingHost(const String &postingHost);
|
||||
void newsReader(const String &newsReader);
|
||||
void crossReference(const String &crossReference);
|
||||
void contentType(const String &contentType);
|
||||
void xMailer(const String &xMailer);
|
||||
WORD isPath(const String &stringLine)const;
|
||||
WORD isFrom(const String &stringLine)const;
|
||||
WORD isNewsGroups(const String &stringLine)const;
|
||||
WORD isSubject(const String &stringLine)const;
|
||||
WORD isDate(const String &stringLine)const;
|
||||
WORD isOrganization(const String &stringLine)const;
|
||||
WORD isLines(const String &stringLine)const;
|
||||
WORD isMessageID(const String &stringLine)const;
|
||||
WORD isReplyTo(const String &stringLine)const;
|
||||
WORD isNNTPPostingHost(const String &stringLine)const;
|
||||
WORD isNewsReader(const String &stringLine)const;
|
||||
WORD isCrossReference(const String &stringLine)const;
|
||||
WORD isContentType(const String &stringLine)const;
|
||||
WORD isMailer(const String &stringLine)const;
|
||||
|
||||
String mPath;
|
||||
String mFrom;
|
||||
String mNewsGroups;
|
||||
String mSubject;
|
||||
String mDate;
|
||||
String mOrganization;
|
||||
String mLines;
|
||||
String mMessageID;
|
||||
String mReplyTo;
|
||||
String mPostingHost;
|
||||
String mContentType;
|
||||
String mXMailer;
|
||||
String mNewsReader;
|
||||
String mCrossReference;
|
||||
};
|
||||
|
||||
inline
|
||||
Header::Header(void)
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
Header::Header(Block<String> &headerLines)
|
||||
{
|
||||
*this=headerLines;
|
||||
}
|
||||
|
||||
inline
|
||||
Header::Header(const Header &someHeader)
|
||||
{
|
||||
*this=someHeader;
|
||||
}
|
||||
|
||||
inline
|
||||
Header::Header(const String &pathFileName)
|
||||
{
|
||||
*this=pathFileName;
|
||||
}
|
||||
|
||||
inline
|
||||
Header::~Header()
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Header::path(void)const
|
||||
{
|
||||
return mPath;
|
||||
}
|
||||
|
||||
inline
|
||||
void Header::path(const String &path)
|
||||
{
|
||||
mPath=path;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Header::from(void)const
|
||||
{
|
||||
return mFrom;
|
||||
}
|
||||
|
||||
inline
|
||||
void Header::from(const String &from)
|
||||
{
|
||||
mFrom=from;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Header::newsGroups(void)const
|
||||
{
|
||||
return mNewsGroups;
|
||||
}
|
||||
|
||||
inline
|
||||
void Header::newsGroups(const String &newsGroups)
|
||||
{
|
||||
mNewsGroups=newsGroups;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Header::subject(void)const
|
||||
{
|
||||
return mSubject;
|
||||
}
|
||||
|
||||
inline
|
||||
void Header::subject(const String &subject)
|
||||
{
|
||||
mSubject=subject;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Header::date(void)const
|
||||
{
|
||||
return mDate;
|
||||
}
|
||||
|
||||
inline
|
||||
void Header::date(const String &date)
|
||||
{
|
||||
mDate=date;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Header::organization(void)const
|
||||
{
|
||||
return mOrganization;
|
||||
}
|
||||
|
||||
inline
|
||||
void Header::organization(const String &organization)
|
||||
{
|
||||
mOrganization=organization;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Header::lines(void)const
|
||||
{
|
||||
return mLines;
|
||||
}
|
||||
|
||||
inline
|
||||
void Header::lines(const String &lines)
|
||||
{
|
||||
mLines=lines;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Header::messageID(void)const
|
||||
{
|
||||
return mMessageID;
|
||||
}
|
||||
|
||||
inline
|
||||
void Header::messageID(const String &messageID)
|
||||
{
|
||||
mMessageID=messageID;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Header::replyTo(void)const
|
||||
{
|
||||
return mReplyTo;
|
||||
}
|
||||
|
||||
inline
|
||||
void Header::replyTo(const String &replyTo)
|
||||
{
|
||||
mReplyTo=replyTo;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Header::postingHost(void)const
|
||||
{
|
||||
return mPostingHost;
|
||||
}
|
||||
|
||||
inline
|
||||
void Header::postingHost(const String &postingHost)
|
||||
{
|
||||
mPostingHost=postingHost;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Header::newsReader(void)const
|
||||
{
|
||||
return mNewsReader;
|
||||
}
|
||||
|
||||
inline
|
||||
void Header::newsReader(const String &newsReader)
|
||||
{
|
||||
mNewsReader=newsReader;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Header::crossReference(void)const
|
||||
{
|
||||
return mCrossReference;
|
||||
}
|
||||
|
||||
inline
|
||||
void Header::crossReference(const String &crossReference)
|
||||
{
|
||||
mCrossReference=crossReference;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Header::contentType(void)const
|
||||
{
|
||||
return mContentType;
|
||||
}
|
||||
|
||||
inline
|
||||
void Header::contentType(const String &contentType)
|
||||
{
|
||||
mContentType=contentType;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Header::xMailer(void)const
|
||||
{
|
||||
return mXMailer;
|
||||
}
|
||||
|
||||
inline
|
||||
void Header::xMailer(const String &xMailer)
|
||||
{
|
||||
mXMailer=xMailer;
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Header::isPath(const String &stringLine)const
|
||||
{
|
||||
return (!::strncmp(stringLine,"Path: ",6)?TRUE:FALSE);
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Header::isFrom(const String &stringLine)const
|
||||
{
|
||||
return (!::strncmp(stringLine,"From: ",6)?TRUE:FALSE);
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Header::isNewsGroups(const String &stringLine)const
|
||||
{
|
||||
return (!::strncmp(stringLine,"Newsgroups: ",12)?TRUE:FALSE);
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Header::isSubject(const String &stringLine)const
|
||||
{
|
||||
return (!::strncmp(stringLine,"Subject: ",9)?TRUE:FALSE);
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Header::isDate(const String &stringLine)const
|
||||
{
|
||||
return (!::strncmp(stringLine,"Date: ",6)?TRUE:FALSE);
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Header::isOrganization(const String &stringLine)const
|
||||
{
|
||||
return (!::strncmp(stringLine,"Organization: ",14)?TRUE:FALSE);
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Header::isLines(const String &stringLine)const
|
||||
{
|
||||
return (!::strncmp(stringLine,"Lines: ",7)?TRUE:FALSE);
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Header::isMessageID(const String &stringLine)const
|
||||
{
|
||||
return (!::strncmp(stringLine,"Message-ID: ",12)?TRUE:FALSE);
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Header::isReplyTo(const String &stringLine)const
|
||||
{
|
||||
return (!::strncmp(stringLine,"Reply-To: ",10)?TRUE:FALSE);
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Header::isNNTPPostingHost(const String &stringLine)const
|
||||
{
|
||||
return (!::strncmp(stringLine,"NNTP-Posting-Host",17)?TRUE:FALSE);
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Header::isNewsReader(const String &stringLine)const
|
||||
{
|
||||
return (!::strncmp(stringLine,"X-Newsreader: ",14)?TRUE:FALSE);
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Header::isCrossReference(const String &stringLine)const
|
||||
{
|
||||
return (!::strncmp(stringLine,"Xref: ",6)?TRUE:FALSE);
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Header::isContentType(const String &stringLine)const
|
||||
{
|
||||
return (!::strncmp(stringLine,"Content-Type: ",14)?TRUE:FALSE);
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Header::isMailer(const String &stringLine)const
|
||||
{
|
||||
return (!::strncmp(stringLine,"X-Mailer: ",10)?TRUE:FALSE);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
120
pop/HOLD/HEADER.CPP
Normal file
120
pop/HOLD/HEADER.CPP
Normal file
@@ -0,0 +1,120 @@
|
||||
#include <pop/header.hpp>
|
||||
#include <common/openfile.hpp>
|
||||
#include <common/filemap.hpp>
|
||||
#include <common/pview.hpp>
|
||||
#include <common/block.hpp>
|
||||
|
||||
Header &Header::operator=(const Header &someHeader)
|
||||
{
|
||||
path(someHeader.path());
|
||||
from(someHeader.from());
|
||||
newsGroups(someHeader.newsGroups());
|
||||
subject(someHeader.subject());
|
||||
date(someHeader.date());
|
||||
organization(someHeader.organization());
|
||||
lines(someHeader.lines());
|
||||
messageID(someHeader.messageID());
|
||||
replyTo(someHeader.replyTo());
|
||||
postingHost(someHeader.postingHost());
|
||||
newsReader(someHeader.newsReader());
|
||||
crossReference(someHeader.crossReference());
|
||||
contentType(someHeader.contentType());
|
||||
xMailer(someHeader.xMailer());
|
||||
return *this;
|
||||
}
|
||||
|
||||
Header &Header::operator=(Block<String> &headerLines)
|
||||
{
|
||||
UINT lineCount(headerLines.size());
|
||||
for(int lineIndex=0;lineIndex<lineCount;lineIndex++)
|
||||
{
|
||||
String lineItem(headerLines[lineIndex].betweenString(' ',0));
|
||||
String &headerLine=headerLines[lineIndex];
|
||||
if(headerLine.isNull())continue;
|
||||
if(isPath(headerLine))path(lineItem);
|
||||
else if(isFrom(headerLine))from(lineItem);
|
||||
else if(isNewsGroups(headerLine))newsGroups(lineItem);
|
||||
else if(isSubject(headerLine))subject(lineItem);
|
||||
else if(isDate(headerLine))date(lineItem);
|
||||
else if(isOrganization(headerLine))organization(lineItem);
|
||||
else if(isLines(headerLine))lines(lineItem);
|
||||
else if(isMessageID(headerLine))messageID(lineItem);
|
||||
else if(isReplyTo(headerLine))replyTo(lineItem);
|
||||
else if(isNNTPPostingHost(headerLine))postingHost(lineItem);
|
||||
else if(isNewsReader(headerLine))newsReader(lineItem);
|
||||
else if(isCrossReference(headerLine))crossReference(lineItem);
|
||||
else if(isContentType(headerLine))contentType(lineItem);
|
||||
else if(isMailer(headerLine))xMailer(lineItem);
|
||||
}
|
||||
if(replyTo().isNull())replyTo(from());
|
||||
return *this;
|
||||
}
|
||||
|
||||
Header &Header::operator=(const String &pathFileName)
|
||||
{
|
||||
FileHandle headerFile(pathFileName,FileHandle::Read,FileHandle::ShareRead);
|
||||
FileMap headerMap(headerFile);
|
||||
PureViewOfFile headerView(headerMap);
|
||||
String headerLine;
|
||||
String lineItem;
|
||||
|
||||
if(!headerFile.isOkay())return *this;
|
||||
while(headerView.getLine(headerLine))
|
||||
{
|
||||
if(headerLine.isNull()||!headerLine.length())break;
|
||||
lineItem=(headerLine.betweenString(' ',0));
|
||||
if(isPath(headerLine))path(lineItem);
|
||||
else if(isFrom(headerLine))from(lineItem);
|
||||
else if(isNewsGroups(headerLine))newsGroups(lineItem);
|
||||
else if(isSubject(headerLine))subject(lineItem);
|
||||
else if(isDate(headerLine))date(lineItem);
|
||||
else if(isOrganization(headerLine))organization(lineItem);
|
||||
else if(isLines(headerLine))lines(lineItem);
|
||||
else if(isMessageID(headerLine))messageID(lineItem);
|
||||
else if(isReplyTo(headerLine))replyTo(lineItem);
|
||||
else if(isNNTPPostingHost(headerLine))postingHost(lineItem);
|
||||
else if(isNewsReader(headerLine))newsReader(lineItem);
|
||||
else if(isCrossReference(headerLine))crossReference(lineItem);
|
||||
else if(isContentType(headerLine))contentType(lineItem);
|
||||
else if(isMailer(headerLine))xMailer(lineItem);
|
||||
}
|
||||
if(replyTo().isNull())replyTo(from());
|
||||
return *this;
|
||||
}
|
||||
|
||||
SystemTime Header::systemTime(void)
|
||||
{
|
||||
SystemTime systemTime;
|
||||
char *ptrString;
|
||||
|
||||
if(mDate.isNull())return systemTime;
|
||||
String tmpDate(mDate.betweenString(',',0));
|
||||
if(tmpDate.isNull())return systemTime;
|
||||
ptrString=(LPSTR)tmpDate;
|
||||
ptrString=::strtok(ptrString," ");
|
||||
if(!ptrString)return systemTime;
|
||||
systemTime.day(::atoi(ptrString));
|
||||
ptrString=::strtok(0," ");
|
||||
if(!ptrString)return systemTime;
|
||||
if(!::strcmp(ptrString,"Jan"))systemTime.month(SystemTime::January);
|
||||
else if(!::strcmp(ptrString,"Feb"))systemTime.month(SystemTime::February);
|
||||
else if(!::strcmp(ptrString,"Mar"))systemTime.month(SystemTime::March);
|
||||
else if(!::strcmp(ptrString,"Apr"))systemTime.month(SystemTime::April);
|
||||
else if(!::strcmp(ptrString,"May"))systemTime.month(SystemTime::May);
|
||||
else if(!::strcmp(ptrString,"Jun"))systemTime.month(SystemTime::June);
|
||||
else if(!::strcmp(ptrString,"Jul"))systemTime.month(SystemTime::July);
|
||||
else if(!::strcmp(ptrString,"Aug"))systemTime.month(SystemTime::August);
|
||||
else if(!::strcmp(ptrString,"Sep"))systemTime.month(SystemTime::September);
|
||||
else if(!::strcmp(ptrString,"Oct"))systemTime.month(SystemTime::October);
|
||||
else if(!::strcmp(ptrString,"Nov"))systemTime.month(SystemTime::November);
|
||||
else if(!::strcmp(ptrString,"Dec"))systemTime.month(SystemTime::December);
|
||||
else systemTime.month(SystemTime::None);
|
||||
ptrString=::strtok(0," ");
|
||||
if(!ptrString)return systemTime;
|
||||
systemTime.year(::atoi(ptrString));
|
||||
systemTime.hour(0);
|
||||
systemTime.minute(0);
|
||||
systemTime.second(0);
|
||||
systemTime.milliseconds(0);
|
||||
return systemTime;
|
||||
}
|
||||
366
pop/HOLD/HEADER.HPP
Normal file
366
pop/HOLD/HEADER.HPP
Normal file
@@ -0,0 +1,366 @@
|
||||
#ifndef _POP_HEADER_HPP_
|
||||
#define _POP_HEADER_HPP_
|
||||
#ifndef _COMMON_STRING_HPP_
|
||||
#include <common/string.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_SYSTEMTIME_HPP_
|
||||
#include <common/systime.hpp>
|
||||
#endif
|
||||
|
||||
template <class T>
|
||||
class Block;
|
||||
|
||||
class Header
|
||||
{
|
||||
public:
|
||||
Header(void);
|
||||
Header(Block<String> &headerLines);
|
||||
Header(const Header &someHeader);
|
||||
Header(const String &pathFileName);
|
||||
virtual ~Header();
|
||||
Header &operator=(const Header &someHeader);
|
||||
Header &operator=(Block<String> &headerLines);
|
||||
Header &operator=(const String &pathFileName);
|
||||
const String &path(void)const;
|
||||
const String &from(void)const;
|
||||
const String &newsGroups(void)const;
|
||||
const String &subject(void)const;
|
||||
const String &date(void)const;
|
||||
SystemTime systemTime(void);
|
||||
const String &organization(void)const;
|
||||
const String &lines(void)const;
|
||||
const String &messageID(void)const;
|
||||
const String &replyTo(void)const;
|
||||
const String &postingHost(void)const;
|
||||
const String &newsReader(void)const;
|
||||
const String &crossReference(void)const;
|
||||
const String &contentType(void)const;
|
||||
const String &xMailer(void)const;
|
||||
private:
|
||||
void path(const String &path);
|
||||
void from(const String &from);
|
||||
void newsGroups(const String &newsGroups);
|
||||
void subject(const String &subject);
|
||||
void date(const String &date);
|
||||
void organization(const String &organization);
|
||||
void lines(const String &lines);
|
||||
void messageID(const String &messageID);
|
||||
void replyTo(const String &replyTo);
|
||||
void postingHost(const String &postingHost);
|
||||
void newsReader(const String &newsReader);
|
||||
void crossReference(const String &crossReference);
|
||||
void contentType(const String &contentType);
|
||||
void xMailer(const String &xMailer);
|
||||
WORD isPath(const String &stringLine)const;
|
||||
WORD isFrom(const String &stringLine)const;
|
||||
WORD isNewsGroups(const String &stringLine)const;
|
||||
WORD isSubject(const String &stringLine)const;
|
||||
WORD isDate(const String &stringLine)const;
|
||||
WORD isOrganization(const String &stringLine)const;
|
||||
WORD isLines(const String &stringLine)const;
|
||||
WORD isMessageID(const String &stringLine)const;
|
||||
WORD isReplyTo(const String &stringLine)const;
|
||||
WORD isNNTPPostingHost(const String &stringLine)const;
|
||||
WORD isNewsReader(const String &stringLine)const;
|
||||
WORD isCrossReference(const String &stringLine)const;
|
||||
WORD isContentType(const String &stringLine)const;
|
||||
WORD isMailer(const String &stringLine)const;
|
||||
|
||||
String mPath;
|
||||
String mFrom;
|
||||
String mNewsGroups;
|
||||
String mSubject;
|
||||
String mDate;
|
||||
String mOrganization;
|
||||
String mLines;
|
||||
String mMessageID;
|
||||
String mReplyTo;
|
||||
String mPostingHost;
|
||||
String mContentType;
|
||||
String mXMailer;
|
||||
String mNewsReader;
|
||||
String mCrossReference;
|
||||
};
|
||||
|
||||
inline
|
||||
Header::Header(void)
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
Header::Header(Block<String> &headerLines)
|
||||
{
|
||||
*this=headerLines;
|
||||
}
|
||||
|
||||
inline
|
||||
Header::Header(const Header &someHeader)
|
||||
{
|
||||
*this=someHeader;
|
||||
}
|
||||
|
||||
inline
|
||||
Header::Header(const String &pathFileName)
|
||||
{
|
||||
*this=pathFileName;
|
||||
}
|
||||
|
||||
inline
|
||||
Header::~Header()
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Header::path(void)const
|
||||
{
|
||||
return mPath;
|
||||
}
|
||||
|
||||
inline
|
||||
void Header::path(const String &path)
|
||||
{
|
||||
mPath=path;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Header::from(void)const
|
||||
{
|
||||
return mFrom;
|
||||
}
|
||||
|
||||
inline
|
||||
void Header::from(const String &from)
|
||||
{
|
||||
mFrom=from;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Header::newsGroups(void)const
|
||||
{
|
||||
return mNewsGroups;
|
||||
}
|
||||
|
||||
inline
|
||||
void Header::newsGroups(const String &newsGroups)
|
||||
{
|
||||
mNewsGroups=newsGroups;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Header::subject(void)const
|
||||
{
|
||||
return mSubject;
|
||||
}
|
||||
|
||||
inline
|
||||
void Header::subject(const String &subject)
|
||||
{
|
||||
mSubject=subject;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Header::date(void)const
|
||||
{
|
||||
return mDate;
|
||||
}
|
||||
|
||||
inline
|
||||
void Header::date(const String &date)
|
||||
{
|
||||
mDate=date;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Header::organization(void)const
|
||||
{
|
||||
return mOrganization;
|
||||
}
|
||||
|
||||
inline
|
||||
void Header::organization(const String &organization)
|
||||
{
|
||||
mOrganization=organization;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Header::lines(void)const
|
||||
{
|
||||
return mLines;
|
||||
}
|
||||
|
||||
inline
|
||||
void Header::lines(const String &lines)
|
||||
{
|
||||
mLines=lines;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Header::messageID(void)const
|
||||
{
|
||||
return mMessageID;
|
||||
}
|
||||
|
||||
inline
|
||||
void Header::messageID(const String &messageID)
|
||||
{
|
||||
mMessageID=messageID;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Header::replyTo(void)const
|
||||
{
|
||||
return mReplyTo;
|
||||
}
|
||||
|
||||
inline
|
||||
void Header::replyTo(const String &replyTo)
|
||||
{
|
||||
mReplyTo=replyTo;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Header::postingHost(void)const
|
||||
{
|
||||
return mPostingHost;
|
||||
}
|
||||
|
||||
inline
|
||||
void Header::postingHost(const String &postingHost)
|
||||
{
|
||||
mPostingHost=postingHost;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Header::newsReader(void)const
|
||||
{
|
||||
return mNewsReader;
|
||||
}
|
||||
|
||||
inline
|
||||
void Header::newsReader(const String &newsReader)
|
||||
{
|
||||
mNewsReader=newsReader;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Header::crossReference(void)const
|
||||
{
|
||||
return mCrossReference;
|
||||
}
|
||||
|
||||
inline
|
||||
void Header::crossReference(const String &crossReference)
|
||||
{
|
||||
mCrossReference=crossReference;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Header::contentType(void)const
|
||||
{
|
||||
return mContentType;
|
||||
}
|
||||
|
||||
inline
|
||||
void Header::contentType(const String &contentType)
|
||||
{
|
||||
mContentType=contentType;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Header::xMailer(void)const
|
||||
{
|
||||
return mXMailer;
|
||||
}
|
||||
|
||||
inline
|
||||
void Header::xMailer(const String &xMailer)
|
||||
{
|
||||
mXMailer=xMailer;
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Header::isPath(const String &stringLine)const
|
||||
{
|
||||
return (!::strncmp(stringLine,"Path: ",6)?TRUE:FALSE);
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Header::isFrom(const String &stringLine)const
|
||||
{
|
||||
return (!::strncmp(stringLine,"From: ",6)?TRUE:FALSE);
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Header::isNewsGroups(const String &stringLine)const
|
||||
{
|
||||
return (!::strncmp(stringLine,"Newsgroups: ",12)?TRUE:FALSE);
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Header::isSubject(const String &stringLine)const
|
||||
{
|
||||
return (!::strncmp(stringLine,"Subject: ",9)?TRUE:FALSE);
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Header::isDate(const String &stringLine)const
|
||||
{
|
||||
return (!::strncmp(stringLine,"Date: ",6)?TRUE:FALSE);
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Header::isOrganization(const String &stringLine)const
|
||||
{
|
||||
return (!::strncmp(stringLine,"Organization: ",14)?TRUE:FALSE);
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Header::isLines(const String &stringLine)const
|
||||
{
|
||||
return (!::strncmp(stringLine,"Lines: ",7)?TRUE:FALSE);
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Header::isMessageID(const String &stringLine)const
|
||||
{
|
||||
return (!::strncmp(stringLine,"Message-ID: ",12)?TRUE:FALSE);
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Header::isReplyTo(const String &stringLine)const
|
||||
{
|
||||
return (!::strncmp(stringLine,"Reply-To: ",10)?TRUE:FALSE);
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Header::isNNTPPostingHost(const String &stringLine)const
|
||||
{
|
||||
return (!::strncmp(stringLine,"NNTP-Posting-Host",17)?TRUE:FALSE);
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Header::isNewsReader(const String &stringLine)const
|
||||
{
|
||||
return (!::strncmp(stringLine,"X-Newsreader: ",14)?TRUE:FALSE);
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Header::isCrossReference(const String &stringLine)const
|
||||
{
|
||||
return (!::strncmp(stringLine,"Xref: ",6)?TRUE:FALSE);
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Header::isContentType(const String &stringLine)const
|
||||
{
|
||||
return (!::strncmp(stringLine,"Content-Type: ",14)?TRUE:FALSE);
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Header::isMailer(const String &stringLine)const
|
||||
{
|
||||
return (!::strncmp(stringLine,"X-Mailer: ",10)?TRUE:FALSE);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
275
pop/HOLD/HOOKPROC.CPP
Normal file
275
pop/HOLD/HOOKPROC.CPP
Normal file
@@ -0,0 +1,275 @@
|
||||
#include <pop/hookproc.hpp>
|
||||
#include <common/dde.hpp>
|
||||
#include <common/mmsystem.hpp>
|
||||
|
||||
WinHookProc::WinHookProc(void)
|
||||
: mPrevHook(0), mhHookWnd(0)
|
||||
{
|
||||
}
|
||||
|
||||
WinHookProc::~WinHookProc()
|
||||
{
|
||||
}
|
||||
|
||||
BOOL WinHookProc::hookWin(HWND hWnd)
|
||||
{
|
||||
unhookWin();
|
||||
mhHookWnd=hWnd;
|
||||
::SetProp(hWnd,(LPSTR)"INSTANCEDATA@@NEARPTR",(HANDLE)((void*)this));
|
||||
mPrevHook=(WNDPROC)::SetWindowLong(mhHookWnd,winID(),(DWORD)hookProc);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL WinHookProc::unhookWin(void)
|
||||
{
|
||||
if(!isOkay()||!mPrevHook)return FALSE;
|
||||
::SetWindowLong(mhHookWnd,winID(),(DWORD)mPrevHook);
|
||||
::RemoveProp(mhHookWnd,(LPSTR)"INSTANCEDATA@@NEARPTR");
|
||||
mPrevHook=0;
|
||||
mhHookWnd=0;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
DWORD WinHookProc::winID(void)const
|
||||
{
|
||||
return GWL_WNDPROC;
|
||||
}
|
||||
|
||||
BOOL WinHookProc::isOkay(void)const
|
||||
{
|
||||
return (mhHookWnd?TRUE:FALSE);
|
||||
}
|
||||
|
||||
LRESULT WinHookProc::hookProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
|
||||
{
|
||||
WinHookProc *pWinHookProc=(WinHookProc*)::GetProp(hWnd,"INSTANCEDATA@@NEARPTR");
|
||||
if(!pWinHookProc)return ::DefWindowProc(hWnd,msg,wParam,lParam);
|
||||
pWinHookProc->windowProcedure(hWnd,msg,wParam,lParam);
|
||||
return ::CallWindowProc(pWinHookProc->mPrevHook,hWnd,msg,wParam,lParam);
|
||||
}
|
||||
|
||||
void WinHookProc::windowProcedure(HWND hWnd,UINT message,WPARAM wParam,LPARAM lParam)
|
||||
{
|
||||
switch(message)
|
||||
{
|
||||
case WM_NCCREATE :
|
||||
if(!installedHandlers(VectorHandler::NCCreateHandler))break;
|
||||
callHandlers(VectorHandler::NCCreateHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_CREATE :
|
||||
if(!installedHandlers(VectorHandler::CreateHandler))break;
|
||||
callHandlers(VectorHandler::CreateHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_PAINT :
|
||||
if(!installedHandlers(VectorHandler::PaintHandler))break;
|
||||
callHandlers(VectorHandler::PaintHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_DRAWITEM :
|
||||
if(!installedHandlers(VectorHandler::DrawItemHandler))break;
|
||||
callHandlers(VectorHandler::DrawItemHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_TIMER :
|
||||
if(!installedHandlers(VectorHandler::TimerHandler))break;
|
||||
callHandlers(VectorHandler::TimerHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_CHAR :
|
||||
if(!installedHandlers(VectorHandler::CharHandler))break;
|
||||
callHandlers(VectorHandler::CharHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_COMMAND :
|
||||
if(!installedHandlers(VectorHandler::CommandHandler))break;
|
||||
callHandlers(VectorHandler::CommandHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_COMPACTING :
|
||||
if(!installedHandlers(VectorHandler::CompactingHandler))break;
|
||||
callHandlers(VectorHandler::CompactingHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_WININICHANGE :
|
||||
if(!installedHandlers(VectorHandler::WinIniChangeHandler))break;
|
||||
callHandlers(VectorHandler::WinIniChangeHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_SYSCOLORCHANGE :
|
||||
if(!installedHandlers(VectorHandler::SysColorChangeHandler))break;
|
||||
callHandlers(VectorHandler::SysColorChangeHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_CTLCOLOR :
|
||||
if(!installedHandlers(VectorHandler::ControlColorHandler))break;
|
||||
callHandlers(VectorHandler::ControlColorHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_CTLCOLORMSGBOX :
|
||||
if(!installedHandlers(VectorHandler::ControlColorHandler))break;
|
||||
callHandlers(VectorHandler::ControlColorHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_CTLCOLOREDIT :
|
||||
if(!installedHandlers(VectorHandler::ControlColorHandler))break;
|
||||
callHandlers(VectorHandler::ControlColorHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_CTLCOLORLISTBOX :
|
||||
if(!installedHandlers(VectorHandler::ControlColorHandler))break;
|
||||
callHandlers(VectorHandler::ControlColorHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_CTLCOLORBTN :
|
||||
if(!installedHandlers(VectorHandler::ControlColorHandler))break;
|
||||
callHandlers(VectorHandler::ControlColorHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_CTLCOLORDLG :
|
||||
if(!installedHandlers(VectorHandler::ControlColorHandler))break;
|
||||
callHandlers(VectorHandler::ControlColorHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_CTLCOLORSCROLLBAR :
|
||||
if(!installedHandlers(VectorHandler::ControlColorHandler))break;
|
||||
callHandlers(VectorHandler::ControlColorHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_CTLCOLORSTATIC :
|
||||
if(!installedHandlers(VectorHandler::ControlColorHandler))break;
|
||||
callHandlers(VectorHandler::ControlColorHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_DDE_INITIATE :
|
||||
if(!installedHandlers(VectorHandler::DDEInitiateHandler))break;
|
||||
callHandlers(VectorHandler::DDEInitiateHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_DDE_ACK :
|
||||
if(!installedHandlers(VectorHandler::DDEAckHandler))break;
|
||||
callHandlers(VectorHandler::DDEAckHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_DDE_REQUEST :
|
||||
if(!installedHandlers(VectorHandler::DDERequestHandler))break;
|
||||
callHandlers(VectorHandler::DDERequestHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_DDE_TERMINATE :
|
||||
if(!installedHandlers(VectorHandler::DDETerminateHandler))break;
|
||||
callHandlers(VectorHandler::DDETerminateHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_DDE_DATA :
|
||||
if(!installedHandlers(VectorHandler::DDEDataHandler))break;
|
||||
callHandlers(VectorHandler::DDEDataHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case MM_WOM_OPEN :
|
||||
if(!installedHandlers(VectorHandler::MMOpenHandler))break;
|
||||
callHandlers(VectorHandler::MMOpenHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case MM_WOM_CLOSE :
|
||||
if(!installedHandlers(VectorHandler::MMCloseHandler))break;
|
||||
callHandlers(VectorHandler::MMCloseHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case MM_WOM_DONE :
|
||||
if(!installedHandlers(VectorHandler::MMDoneHandler))break;
|
||||
callHandlers(VectorHandler::MMDoneHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_LBUTTONDBLCLK :
|
||||
if(!installedHandlers(VectorHandler::LeftButtonDoubleHandler))break;
|
||||
callHandlers(VectorHandler::LeftButtonDoubleHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_LBUTTONDOWN :
|
||||
if(!installedHandlers(VectorHandler::LeftButtonDownHandler))break;
|
||||
callHandlers(VectorHandler::LeftButtonDownHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_LBUTTONUP :
|
||||
if(!installedHandlers(VectorHandler::LeftButtonUpHandler))break;
|
||||
callHandlers(VectorHandler::LeftButtonUpHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_RBUTTONDBLCLK :
|
||||
if(!installedHandlers(VectorHandler::RightButtonDoubleHandler))break;
|
||||
callHandlers(VectorHandler::RightButtonDoubleHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_RBUTTONDOWN :
|
||||
::OutputDebugString("WM_RBUTTONDOWN\n");
|
||||
if(!installedHandlers(VectorHandler::RightButtonDownHandler))break;
|
||||
callHandlers(VectorHandler::RightButtonDownHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_RBUTTONUP :
|
||||
::OutputDebugString("WM_RBUTTONUP\n");
|
||||
if(!installedHandlers(VectorHandler::RightButtonUpHandler))break;
|
||||
callHandlers(VectorHandler::RightButtonUpHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_NCLBUTTONUP :
|
||||
if(!installedHandlers(VectorHandler::NCLeftButtonUpHandler))break;
|
||||
callHandlers(VectorHandler::NCLeftButtonUpHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_NCLBUTTONDOWN :
|
||||
if(!installedHandlers(VectorHandler::NCLeftButtonDownHandler))break;
|
||||
callHandlers(VectorHandler::NCLeftButtonDownHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_NCRBUTTONUP :
|
||||
if(!installedHandlers(VectorHandler::NCRightButtonUpHandler))break;
|
||||
callHandlers(VectorHandler::NCRightButtonUpHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_NCRBUTTONDOWN :
|
||||
if(!installedHandlers(VectorHandler::NCRightButtonDownHandler))break;
|
||||
callHandlers(VectorHandler::NCRightButtonDownHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_MOUSEMOVE :
|
||||
if(!installedHandlers(VectorHandler::MouseMoveHandler))break;
|
||||
callHandlers(VectorHandler::MouseMoveHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_SETFOCUS :
|
||||
if(!installedHandlers(VectorHandler::SetFocusHandler))break;
|
||||
callHandlers(VectorHandler::SetFocusHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_SETFONT :
|
||||
if(!installedHandlers(VectorHandler::SetFontHandler))break;
|
||||
callHandlers(VectorHandler::SetFontHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_KILLFOCUS :
|
||||
if(!installedHandlers(VectorHandler::KillFocusHandler))break;
|
||||
callHandlers(VectorHandler::KillFocusHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_KEYUP :
|
||||
if(!installedHandlers(VectorHandler::KeyUpHandler))break;
|
||||
callHandlers(VectorHandler::KeyUpHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_KEYDOWN :
|
||||
if(!installedHandlers(VectorHandler::KeyDownHandler))break;
|
||||
callHandlers(VectorHandler::KeyDownHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_GETMINMAXINFO :
|
||||
if(!installedHandlers(VectorHandler::MinMaxHandler))break;
|
||||
callHandlers(VectorHandler::MinMaxHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_ENTERIDLE :
|
||||
if(!installedHandlers(VectorHandler::EnterIdleHandler))break;
|
||||
callHandlers(VectorHandler::EnterIdleHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_MENUSELECT :
|
||||
if(!installedHandlers(VectorHandler::MenuSelectHandler))break;
|
||||
callHandlers(VectorHandler::MenuSelectHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_GETDLGCODE :
|
||||
if(!installedHandlers(VectorHandler::DialogCodeHandler))break;
|
||||
callHandlers(VectorHandler::DialogCodeHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_MEASUREITEM :
|
||||
if(!installedHandlers(VectorHandler::MeasureItemHandler))break;
|
||||
callHandlers(VectorHandler::MeasureItemHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_VSCROLL :
|
||||
if(!installedHandlers(VectorHandler::VerticalScrollHandler))break;
|
||||
callHandlers(VectorHandler::VerticalScrollHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_HSCROLL :
|
||||
if(!installedHandlers(VectorHandler::HorizontalScrollHandler))break;
|
||||
callHandlers(VectorHandler::HorizontalScrollHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
#if defined(__FLAT__)
|
||||
case WM_NOTIFY :
|
||||
if(!installedHandlers(VectorHandler::NotifyHandler))break;
|
||||
callHandlers(VectorHandler::NotifyHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
#endif
|
||||
case WM_SIZE :
|
||||
if(!installedHandlers(VectorHandler::SizeHandler))break;
|
||||
callHandlers(VectorHandler::SizeHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_DROPFILES :
|
||||
if(!installedHandlers(VectorHandler::DropFilesHandler))break;
|
||||
callHandlers(VectorHandler::DropFilesHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_DESTROY :
|
||||
if(!installedHandlers(VectorHandler::SizeHandler))break;
|
||||
callHandlers(VectorHandler::DestroyHandler,CallbackData(wParam,lParam,hWnd));
|
||||
break;
|
||||
case WM_NCDESTROY :
|
||||
default :
|
||||
break;
|
||||
}
|
||||
}
|
||||
26
pop/HOLD/HOOKPROC.HPP
Normal file
26
pop/HOLD/HOOKPROC.HPP
Normal file
@@ -0,0 +1,26 @@
|
||||
#ifndef _COMMON_HOOKPROC_HPP_
|
||||
#define _COMMON_HOOKPROC_HPP_
|
||||
#ifndef _COMMON_WINDOWS_HPP_
|
||||
#include <common/windows.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_VECTORHANDLER_HPP_
|
||||
#include <common/vhandler.hpp>
|
||||
#endif
|
||||
|
||||
class WinHookProc : public VectorHandler
|
||||
{
|
||||
public:
|
||||
WinHookProc(void);
|
||||
virtual ~WinHookProc();
|
||||
BOOL hookWin(HWND hWnd);
|
||||
BOOL unhookWin(void);
|
||||
BOOL isOkay(void)const;
|
||||
protected:
|
||||
virtual DWORD winID(void)const;
|
||||
void windowProcedure(HWND hWnd,UINT message,WPARAM wParam,LPARAM lParam);
|
||||
private:
|
||||
static LRESULT hookProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam);
|
||||
WNDPROC mPrevHook;
|
||||
HWND mhHookWnd;
|
||||
};
|
||||
#endif
|
||||
77
pop/HOLD/LOGINDLG.CPP
Normal file
77
pop/HOLD/LOGINDLG.CPP
Normal file
@@ -0,0 +1,77 @@
|
||||
#include <pop/logindlg.hpp>
|
||||
|
||||
WORD LoginDialog::performLogin(void)
|
||||
{
|
||||
DialogTemplate dlgTemplate;
|
||||
DialogItemTemplate userEdit;
|
||||
DialogItemTemplate passEdit;
|
||||
DialogItemTemplate userStatic;
|
||||
DialogItemTemplate passStatic;
|
||||
|
||||
dlgTemplate.titleText("Login to host...");
|
||||
dlgTemplate.posRect(Rect(8,19,197,76));
|
||||
dlgTemplate.pointSize(8);
|
||||
dlgTemplate.typeFace("Helv");
|
||||
dlgTemplate.style(DS_MODALFRAME|WS_TABSTOP|WS_VISIBLE|WS_CAPTION|WS_SYSMENU|DS_3DLOOK|DS_SETFONT|WS_POPUP);
|
||||
|
||||
userEdit.className("EDIT");
|
||||
userEdit.titleText("");
|
||||
userEdit.style(WS_BORDER|WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_AUTOHSCROLL);
|
||||
userEdit.posRect(Rect(56,19,98,12));
|
||||
userEdit.itemID(UserNameID);
|
||||
|
||||
passEdit.className("EDIT");
|
||||
passEdit.style(WS_BORDER|WS_TABSTOP|ES_PASSWORD|WS_CHILD|WS_VISIBLE);
|
||||
passEdit.posRect(Rect(56,35,98,12));
|
||||
passEdit.itemID(PasswordID);
|
||||
|
||||
userStatic.className("STATIC");
|
||||
userStatic.titleText("User Name :");
|
||||
userStatic.style(WS_CHILD|WS_VISIBLE);
|
||||
userStatic.posRect(Rect(2,20,39,8));
|
||||
userStatic.itemID(-1);
|
||||
|
||||
passStatic.className("STATIC");
|
||||
passStatic.titleText("Password :");
|
||||
passStatic.style(WS_CHILD|WS_VISIBLE);
|
||||
passStatic.posRect(Rect(2,36,39,8));
|
||||
passStatic.itemID(-1);
|
||||
|
||||
dlgTemplate+=userEdit;
|
||||
dlgTemplate+=passEdit;
|
||||
dlgTemplate+=userStatic;
|
||||
dlgTemplate+=passStatic;
|
||||
|
||||
createDialog(::GetTopWindow((HWND)0),dlgTemplate);
|
||||
if(userName().isNull()&&password().isNull())return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD LoginDialog::dlgCommand(DWORD commandID,CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
switch(commandID)
|
||||
{
|
||||
case IDOK :
|
||||
getText(UserNameID,mUserName);
|
||||
getText(PasswordID,mPassword);
|
||||
if(mUserName.isNull()||mPassword.isNull()){::MessageBeep(0);return TRUE;}
|
||||
break;
|
||||
case IDCANCEL :
|
||||
mUserName.reserve(String::MaxString);
|
||||
mPassword.reserve(String::MaxString);
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void LoginDialog::dlgInitDialog(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
if(!userName().isNull())setText(UserNameID,userName());
|
||||
if(!password().isNull())setText(PasswordID,password());
|
||||
setFocus();
|
||||
}
|
||||
|
||||
void LoginDialog::dlgDestroyDialog(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
}
|
||||
|
||||
69
pop/HOLD/LOGINDLG.HPP
Normal file
69
pop/HOLD/LOGINDLG.HPP
Normal file
@@ -0,0 +1,69 @@
|
||||
#ifndef _POP_LOGINDIALOG_HPP_
|
||||
#define _POP_LOGINDIALOG_HPP_
|
||||
#ifndef _COMMON_WINDOWS_HPP_
|
||||
#include <common/windows.hpp>
|
||||
#endif
|
||||
#ifndef _DIALOG_DYNAMICDIALOG_HPP_
|
||||
#include <dialog/dyndlg.hpp>
|
||||
#endif
|
||||
|
||||
class LoginDialog : public DynamicDialog
|
||||
{
|
||||
public:
|
||||
LoginDialog(void);
|
||||
virtual ~LoginDialog();
|
||||
WORD performLogin(void);
|
||||
String userName(void)const;
|
||||
void userName(const String &userName);
|
||||
String password(void)const;
|
||||
void password(const String &password);
|
||||
private:
|
||||
enum {UserNameID=101,PasswordID=102};
|
||||
LoginDialog(const LoginDialog &loginDialog);
|
||||
WORD dlgCommand(DWORD commandID,CallbackData &someCallbackData);
|
||||
void dlgInitDialog(CallbackData &someCallbackData);
|
||||
void dlgDestroyDialog(CallbackData &someCallbackData);
|
||||
String mUserName;
|
||||
String mPassword;
|
||||
};
|
||||
|
||||
inline
|
||||
LoginDialog::LoginDialog(void)
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
LoginDialog::LoginDialog(const LoginDialog &/*loginDialog*/)
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
LoginDialog::~LoginDialog()
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
String LoginDialog::userName(void)const
|
||||
{
|
||||
return mUserName;
|
||||
}
|
||||
|
||||
inline
|
||||
void LoginDialog::userName(const String &userName)
|
||||
{
|
||||
mUserName=userName;
|
||||
}
|
||||
|
||||
inline
|
||||
String LoginDialog::password(void)const
|
||||
{
|
||||
return mPassword;
|
||||
}
|
||||
|
||||
inline
|
||||
void LoginDialog::password(const String &password)
|
||||
{
|
||||
mPassword=password;
|
||||
}
|
||||
#endif
|
||||
|
||||
46
pop/HOLD/MAIL.HPP
Normal file
46
pop/HOLD/MAIL.HPP
Normal file
@@ -0,0 +1,46 @@
|
||||
#ifndef _POP_MAILMESSAGE_HPP_
|
||||
#define _POP_MAILMESSAGE_HPP_
|
||||
#ifndef _POP_HEADER_HPP_
|
||||
#include <pop/header.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_BLOCK_HPP_
|
||||
#include <common/block.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_STRING_HPP_
|
||||
#include <common/string.hpp>
|
||||
#endif
|
||||
|
||||
class Mail : public Block<String>, public Header
|
||||
{
|
||||
public:
|
||||
Mail(void);
|
||||
Mail(Block<String> &msgLines);
|
||||
virtual ~Mail();
|
||||
Mail &operator=(Block<String> &msgLines);
|
||||
private:
|
||||
};
|
||||
|
||||
inline
|
||||
Mail::Mail(void)
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
Mail::Mail(Block<String> &msgLines)
|
||||
: Block<String>(msgLines), Header(msgLines)
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
Mail::~Mail()
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
Mail &Mail::operator=(Block<String> &msgLines)
|
||||
{
|
||||
(Block<String>&)*this=msgLines;
|
||||
(Header&)*this=msgLines;
|
||||
return *this;
|
||||
}
|
||||
#endif
|
||||
48
pop/HOLD/MAIN.CPP
Normal file
48
pop/HOLD/MAIN.CPP
Normal file
@@ -0,0 +1,48 @@
|
||||
#include <pop/main.hpp>
|
||||
#include <pop/popdlg.hpp>
|
||||
|
||||
HINSTANCE Main::smhInstance=0;
|
||||
HINSTANCE Main::smhPrevInstance=0;
|
||||
int Main::smnCmdShow=0;
|
||||
|
||||
int PASCAL WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR /*lpszCmdLine*/,int nCmdShow)
|
||||
{
|
||||
Main::processInstance(hInstance);
|
||||
Main::previousProcessInstance(hPrevInstance);
|
||||
Main::cmdShow(nCmdShow);
|
||||
POPDlg popDialog;
|
||||
return popDialog.perform();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#if 0
|
||||
#include <common/string.hpp>
|
||||
#include <pop/main.hpp>
|
||||
#include <pop/mainwnd.hpp>
|
||||
|
||||
HINSTANCE Main::smhInstance=0;
|
||||
HINSTANCE Main::smhPrevInstance=0;
|
||||
int Main::smnCmdShow=0;
|
||||
|
||||
int PASCAL WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR /*lpszCmdLine*/,int nCmdShow)
|
||||
{
|
||||
Main::processInstance(hInstance);
|
||||
Main::previousProcessInstance(hPrevInstance);
|
||||
Main::cmdShow(nCmdShow);
|
||||
if(Main::previousProcessInstance())
|
||||
{
|
||||
HWND hWnd=::FindWindow(MainWindow::className(),MainWindow::className());
|
||||
if(!hWnd)
|
||||
{
|
||||
::MessageBox(::GetFocus(),(LPSTR)"Failed to maximize previous instance",(LPSTR)"Error",MB_ICONSTOP|MB_SYSTEMMODAL);
|
||||
return FALSE;
|
||||
}
|
||||
::PostMessage(hWnd,WM_REACTIVATE,0,0L);
|
||||
return FALSE;
|
||||
}
|
||||
MainWindow applicationWindow(Main::processInstance());
|
||||
return applicationWindow.messageLoop();
|
||||
}
|
||||
#endif
|
||||
68
pop/HOLD/MAIN.HPP
Normal file
68
pop/HOLD/MAIN.HPP
Normal file
@@ -0,0 +1,68 @@
|
||||
#ifndef _POP_MAIN_HPP_
|
||||
#define _POP_MAIN_HPP_
|
||||
#ifndef _COMMON_WINDOWS_HPP_
|
||||
#include <common/windows.hpp>
|
||||
#endif
|
||||
|
||||
class Main
|
||||
{
|
||||
public:
|
||||
static HINSTANCE processInstance(HWND hWnd);
|
||||
static HINSTANCE processInstance(void);
|
||||
static HINSTANCE previousProcessInstance(void);
|
||||
static void processInstance(HINSTANCE processInstance);
|
||||
static void previousProcessInstance(HINSTANCE previousProcessInstance);
|
||||
static void cmdShow(int nCmdShow);
|
||||
private:
|
||||
static HINSTANCE smhInstance;
|
||||
static HINSTANCE smhPrevInstance;
|
||||
static int smnCmdShow;
|
||||
};
|
||||
|
||||
inline
|
||||
void Main::processInstance(HINSTANCE hProcessInstance)
|
||||
{
|
||||
smhInstance=hProcessInstance;
|
||||
}
|
||||
|
||||
inline
|
||||
void Main::previousProcessInstance(HINSTANCE previousProcessInstance)
|
||||
{
|
||||
smhPrevInstance=previousProcessInstance;
|
||||
}
|
||||
|
||||
inline
|
||||
void Main::cmdShow(int nCmdShow)
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
HINSTANCE Main::processInstance(void)
|
||||
{
|
||||
return smhInstance;
|
||||
}
|
||||
|
||||
inline
|
||||
HINSTANCE Main::previousProcessInstance(void)
|
||||
{
|
||||
return smhPrevInstance;
|
||||
}
|
||||
|
||||
#if defined(__FLAT__)
|
||||
inline
|
||||
HINSTANCE Main::processInstance(HWND hWnd)
|
||||
{
|
||||
return (HINSTANCE)::GetWindowLong(hWnd,GWL_HINSTANCE);
|
||||
}
|
||||
#else
|
||||
inline
|
||||
HINSTANCE Main::processInstance(HWND hWnd)
|
||||
{
|
||||
return (HINSTANCE)::GetWindowWord(hWnd,GWW_HINSTANCE);
|
||||
}
|
||||
#endif
|
||||
#define WM_REACTIVATE WM_USER+1
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
140
pop/HOLD/MAINWND.CPP
Normal file
140
pop/HOLD/MAINWND.CPP
Normal file
@@ -0,0 +1,140 @@
|
||||
#include <pop/mainwnd.hpp>
|
||||
#include <pop/pop.hpp>
|
||||
|
||||
char MainWindow::szClassName[]="POP3 client v1.00";
|
||||
char MainWindow::szMenuName[]="POP3";
|
||||
|
||||
MainWindow::MainWindow(HINSTANCE hInstance)
|
||||
: mPaintHandler(this,&MainWindow::paintHandler),
|
||||
mDestroyHandler(this,&MainWindow::destroyHandler),
|
||||
mCommandHandler(this,&MainWindow::commandHandler),
|
||||
mKeyDownHandler(this,&MainWindow::keyDownHandler),
|
||||
mSizeHandler(this,&MainWindow::sizeHandler),
|
||||
mCreateHandler(this,&MainWindow::createHandler),
|
||||
mTimerHandler(this,&MainWindow::timerHandler),
|
||||
mSetFocusHandler(this,&MainWindow::setFocusHandler),
|
||||
mhInstance(hInstance)
|
||||
{
|
||||
insertHandlers();
|
||||
registerClass();
|
||||
::CreateWindow(szClassName,szClassName,
|
||||
WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_SIZEBOX|WS_MINIMIZEBOX|WS_MAXIMIZEBOX|WS_DLGFRAME|WS_CLIPCHILDREN,
|
||||
CW_USEDEFAULT,CW_USEDEFAULT,
|
||||
CW_USEDEFAULT,CW_USEDEFAULT,
|
||||
NULL,NULL,mhInstance,(LPSTR)this);
|
||||
show(SW_SHOW);
|
||||
update();
|
||||
|
||||
Block<String> msgLines;
|
||||
WORD messages;
|
||||
WORD octets;
|
||||
|
||||
POPClient popClient;
|
||||
popClient.open("mailhost.li.net");
|
||||
if(!popClient.authenticate("europa","cygnus-x1"))
|
||||
{
|
||||
popClient.quit();
|
||||
popClient.close();
|
||||
return;
|
||||
}
|
||||
popClient.stat(messages,octets);
|
||||
popClient.top(msgLines,1);
|
||||
// for(int msgIndex=1;msgIndex<=messages;msgIndex++)popClient.retrieve(msgIndex,msgLines);
|
||||
popClient.quit();
|
||||
popClient.close();
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
destroy();
|
||||
}
|
||||
|
||||
void MainWindow::insertHandlers(void)
|
||||
{
|
||||
insertHandler(VectorHandler::DestroyHandler,&mDestroyHandler);
|
||||
insertHandler(VectorHandler::PaintHandler,&mPaintHandler);
|
||||
insertHandler(VectorHandler::CommandHandler,&mCommandHandler);
|
||||
insertHandler(VectorHandler::SizeHandler,&mSizeHandler);
|
||||
insertHandler(VectorHandler::KeyDownHandler,&mKeyDownHandler);
|
||||
insertHandler(VectorHandler::CreateHandler,&mCreateHandler);
|
||||
insertHandler(VectorHandler::TimerHandler,&mTimerHandler);
|
||||
insertHandler(VectorHandler::SetFocusHandler,&mSetFocusHandler);
|
||||
}
|
||||
|
||||
void MainWindow::removeHandlers(void)
|
||||
{
|
||||
removeHandler(VectorHandler::DestroyHandler,&mDestroyHandler);
|
||||
removeHandler(VectorHandler::PaintHandler,&mPaintHandler);
|
||||
removeHandler(VectorHandler::CommandHandler,&mCommandHandler);
|
||||
removeHandler(VectorHandler::SizeHandler,&mSizeHandler);
|
||||
removeHandler(VectorHandler::KeyDownHandler,&mKeyDownHandler);
|
||||
removeHandler(VectorHandler::CreateHandler,&mCreateHandler);
|
||||
removeHandler(VectorHandler::TimerHandler,&mTimerHandler);
|
||||
removeHandler(VectorHandler::SetFocusHandler,&mSetFocusHandler);
|
||||
}
|
||||
|
||||
void MainWindow::registerClass(void)const
|
||||
{
|
||||
WNDCLASS wndClass;
|
||||
|
||||
if(::GetClassInfo(mhInstance,className(),(WNDCLASS FAR*)&wndClass))return;
|
||||
wndClass.style =CS_HREDRAW|CS_VREDRAW|CS_DBLCLKS|CS_OWNDC;
|
||||
wndClass.lpfnWndProc =(WNDPROC)Window::WndProc;
|
||||
wndClass.cbClsExtra =0;
|
||||
wndClass.cbWndExtra =sizeof(MainWindow*);
|
||||
wndClass.hInstance =mhInstance;
|
||||
wndClass.hIcon =::LoadIcon(NULL,IDI_APPLICATION);
|
||||
wndClass.hCursor =::LoadCursor(NULL,IDC_ARROW);
|
||||
wndClass.hbrBackground =(HBRUSH)::GetStockObject(BLACK_BRUSH);
|
||||
wndClass.lpszMenuName =szMenuName;
|
||||
wndClass.lpszClassName =szClassName;
|
||||
::RegisterClass(&wndClass);
|
||||
assert(0!=::GetClassInfo(mhInstance,className(),(WNDCLASS FAR*)&wndClass));
|
||||
}
|
||||
|
||||
CallbackData::ReturnType MainWindow::destroyHandler(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
removeHandlers();
|
||||
::PostQuitMessage(0);
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType MainWindow::sizeHandler(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType MainWindow::commandHandler(CallbackData &someCallbackData)
|
||||
{
|
||||
switch(someCallbackData.wParam())
|
||||
{
|
||||
default :
|
||||
break;
|
||||
}
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType MainWindow::keyDownHandler(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType MainWindow::paintHandler(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType MainWindow::createHandler(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType MainWindow::timerHandler(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType MainWindow::setFocusHandler(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
56
pop/HOLD/MAINWND.HPP
Normal file
56
pop/HOLD/MAINWND.HPP
Normal file
@@ -0,0 +1,56 @@
|
||||
#ifndef _POP_MAINWINDOW_HPP_
|
||||
#define _POP_MAINWINDOW_HPP_
|
||||
#ifndef _COMMON_WINDOW_HPP_
|
||||
#include <common/window.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_STRING_HPP_
|
||||
#include <common/string.hpp>
|
||||
#endif
|
||||
#ifndef _SOCKET_WSADATA_HPP_
|
||||
#include <socket/wsadata.hpp>
|
||||
#endif
|
||||
|
||||
class MainWindow : public Window
|
||||
{
|
||||
public:
|
||||
MainWindow(HINSTANCE hInstance);
|
||||
virtual ~MainWindow();
|
||||
static String className(void);
|
||||
private:
|
||||
enum{TimerID=0};
|
||||
void registerClass(void)const;
|
||||
void insertHandlers(void);
|
||||
void removeHandlers(void);
|
||||
void message(const String &messageString);
|
||||
void message(Block<String> &messageStrings);
|
||||
CallbackData::ReturnType paintHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType destroyHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType commandHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType keyDownHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType sizeHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType createHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType timerHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType setFocusHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType lineHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType completionHandler(CallbackData &someCallbackData);
|
||||
|
||||
Callback<MainWindow> mPaintHandler;
|
||||
Callback<MainWindow> mDestroyHandler;
|
||||
Callback<MainWindow> mCommandHandler;
|
||||
Callback<MainWindow> mKeyDownHandler;
|
||||
Callback<MainWindow> mSizeHandler;
|
||||
Callback<MainWindow> mCreateHandler;
|
||||
Callback<MainWindow> mTimerHandler;
|
||||
Callback<MainWindow> mSetFocusHandler;
|
||||
static char szClassName[];
|
||||
static char szMenuName[];
|
||||
HINSTANCE mhInstance;
|
||||
WSASystem mWSASystem;
|
||||
};
|
||||
|
||||
inline
|
||||
String MainWindow::className(void)
|
||||
{
|
||||
return String(szClassName);
|
||||
}
|
||||
#endif
|
||||
188
pop/HOLD/POP.CPP
Normal file
188
pop/HOLD/POP.CPP
Normal file
@@ -0,0 +1,188 @@
|
||||
#include <pop/pop.hpp>
|
||||
#include <socket/hostent.hpp>
|
||||
#include <socket/servent.hpp>
|
||||
|
||||
POPClient::POPClient(void)
|
||||
: mSpace(" "), mIsLoggedIn(FALSE)
|
||||
{
|
||||
createCmds();
|
||||
createStats();
|
||||
}
|
||||
|
||||
POPClient::~POPClient()
|
||||
{
|
||||
}
|
||||
|
||||
BOOL POPClient::open(const String &hostName)
|
||||
{
|
||||
HostEnt hostEntry;
|
||||
ServEnt serverEntry;
|
||||
Block<String> responseLines;
|
||||
INETSocketAddress internetSocketAddress;
|
||||
|
||||
if(hostName.isNull())return FALSE;
|
||||
if(mPOPControl.isConnected())mPOPControl.closeSocket();
|
||||
message(String("trying ")+hostName+String("..."));
|
||||
if(!mWSASystem.isInitialized()){message("WINSOCK initialization failure.");return FALSE;}
|
||||
InternetAddress internetAddress(hostName);
|
||||
if(!internetAddress.isZero()){if(!hostEntry.hostByAddress(internetAddress)){return FALSE;}}
|
||||
else if(!hostEntry.hostByName(hostName)){return FALSE;}
|
||||
if(!internetAddress.isZero()){if(!hostEntry.hostByAddress(internetAddress)){message(String("no DNS entry for ")+hostName);return FALSE;}}
|
||||
else if(!hostEntry.hostByName(hostName)){message(String("no DNS entry for ")+hostName);return FALSE;}
|
||||
message(String("connect...")+String("'")+hostEntry.hostName()+String("' (")+(String)(hostEntry.addresses())[0]+String(")"));
|
||||
internetSocketAddress.internetAddress((hostEntry.addresses())[0]);
|
||||
if(serverEntry.serviceByName("pop3","tcp"))
|
||||
{
|
||||
if(!mPOPControl.openSocket()){message("unable to create socket.");return FALSE;}
|
||||
internetSocketAddress.family(PF_INET);
|
||||
internetSocketAddress.port(serverEntry.port());
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!mPOPControl.openSocket()){message("unable to create socket.");return FALSE;}
|
||||
internetSocketAddress.family(PF_INET);
|
||||
internetSocketAddress.port(htons(POPPort));
|
||||
}
|
||||
if(!mPOPControl.connect(internetSocketAddress)){message("unable to connect to pop3 server");return FALSE;}
|
||||
mPOPControl.getSocketName(internetSocketAddress);
|
||||
if(!mPOPControl.isConnected())return FALSE;
|
||||
// if(!mPOPControl.receive(responseLines)) //||!responseLines.size()||!
|
||||
if(!mPOPControl.receive(responseLines)||!isInAckResponse(responseLines))
|
||||
{
|
||||
mPOPControl.closeSocket();
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL POPClient::quit(void)
|
||||
{
|
||||
Block<String> responseLines;
|
||||
|
||||
if(!isConnected())return FALSE;
|
||||
isLoggedIn(FALSE);
|
||||
if(!putControlData(mPOPCmds[Quit],FALSE))return FALSE;
|
||||
mPOPControl.receive(responseLines);
|
||||
mPOPControl.closeSocket();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL POPClient::authenticate(const String &user,const String &password)
|
||||
{
|
||||
Block<String> responseLines;
|
||||
|
||||
if(!isConnected())return FALSE;
|
||||
if(!putControlData(mPOPCmds[User]+String(" ")+user,FALSE))return FALSE;
|
||||
if(!mPOPControl.receive(responseLines))return FALSE;
|
||||
if(!isInAckResponse(responseLines))return FALSE;
|
||||
if(!putControlData(mPOPCmds[Pass]+String(" ")+password,FALSE))return FALSE;
|
||||
if(!mPOPControl.receive(responseLines))return FALSE;
|
||||
if(!isInAckResponse(responseLines))return FALSE;
|
||||
isLoggedIn(TRUE);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL POPClient::stat(WORD &messages,WORD &octets)
|
||||
{
|
||||
Block<String> responseLines;
|
||||
String strItem;
|
||||
|
||||
if(!isConnected()||!isLoggedIn())return FALSE;
|
||||
if(!putControlData(mPOPCmds[Stat],FALSE))return FALSE;
|
||||
if(!mPOPControl.receive(responseLines))return FALSE;
|
||||
if(!isInAckResponse(responseLines))return FALSE;
|
||||
strItem=responseLines[0].betweenString(' ',' ');
|
||||
messages=::atoi((char*)strItem);
|
||||
strItem=responseLines[0].betweenString(' ',0);
|
||||
strItem=strItem.betweenString(' ',0);
|
||||
octets=::atoi((char*)strItem);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL POPClient::retrieve(WORD msgNum,Block<String> &messageLines)
|
||||
{
|
||||
Block<String> responseLines;
|
||||
String strMsg;
|
||||
|
||||
if(!isConnected()||!isLoggedIn())return FALSE;
|
||||
::sprintf(strMsg,"%d",msgNum);
|
||||
if(!putControlData(mPOPCmds[Retr]+String(" ")+strMsg,FALSE))return FALSE;
|
||||
if(!mPOPControl.receive(responseLines))return FALSE;
|
||||
if(!isInAckResponse(responseLines))return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void POPClient::createStats(void)
|
||||
{
|
||||
mPOPStatus.insert(&String("+OK"));
|
||||
mPOPStatus.insert(&String("-ERR"));
|
||||
}
|
||||
|
||||
void POPClient::createCmds(void)
|
||||
{
|
||||
mPOPCmds.remove();
|
||||
mPOPCmds.insert(&String("QUIT"));
|
||||
mPOPCmds.insert(&String("USER"));
|
||||
mPOPCmds.insert(&String("PASS"));
|
||||
mPOPCmds.insert(&String("STAT"));
|
||||
mPOPCmds.insert(&String("RETR"));
|
||||
}
|
||||
|
||||
WORD POPClient::putControlData(const String &stringData,WORD waitForResponse)
|
||||
{
|
||||
if(!mPOPControl.isConnected())return FALSE;
|
||||
if(!mPOPControl.send(stringData))
|
||||
{
|
||||
mPOPControl.closeSocket();
|
||||
String errorString(String("error sending '")+stringData+String("' to POP server."));
|
||||
message(errorString);
|
||||
errorString+="\n";
|
||||
::OutputDebugString(errorString);
|
||||
return FALSE;
|
||||
}
|
||||
if(waitForResponse&&!getControlData())
|
||||
{
|
||||
mPOPControl.closeSocket();
|
||||
String errorString(String("error reading result of '")+stringData+String("' command from NNTP server."));
|
||||
message(errorString);
|
||||
errorString+="\n";
|
||||
::OutputDebugString(errorString);
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD POPClient::getControlData(void)
|
||||
{
|
||||
Block<String> responseStrings;
|
||||
mPOPControl.receive(responseStrings);
|
||||
return responseStrings.size();
|
||||
}
|
||||
|
||||
BOOL POPClient::isInAckResponse(Block<String> &responseLines)
|
||||
{
|
||||
if(!responseLines.size())return FALSE;
|
||||
if(responseLines[0].substr(0,2)==mPOPStatus[Ok])return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL POPClient::isInNakResponse(Block<String> &responseLines)
|
||||
{
|
||||
if(!responseLines.size())return FALSE;
|
||||
if(responseLines[0].substr(0,3)==mPOPStatus[Error])return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
// virtuals
|
||||
|
||||
void POPClient::message(const String &messageString)
|
||||
{
|
||||
::OutputDebugString(messageString+String("\n"));
|
||||
}
|
||||
|
||||
void POPClient::message(Block<String> &messageStrings)
|
||||
{
|
||||
for(int itemIndex=0;itemIndex<messageStrings.size();itemIndex++)
|
||||
::OutputDebugString(messageStrings[itemIndex]+String("\n"));
|
||||
}
|
||||
4
pop/HOLD/POP.HPP
Normal file
4
pop/HOLD/POP.HPP
Normal file
@@ -0,0 +1,4 @@
|
||||
#ifndef _POP_POP_HPP_
|
||||
#define _POP_POP_HPP_
|
||||
#include <pop/pop.h>
|
||||
#endif
|
||||
263
pop/HOLD/POPCLNT.CPP
Normal file
263
pop/HOLD/POPCLNT.CPP
Normal file
@@ -0,0 +1,263 @@
|
||||
#include <pop/popclnt.hpp>
|
||||
#include <socket/hostent.hpp>
|
||||
#include <socket/servent.hpp>
|
||||
|
||||
POPClient::POPClient(void)
|
||||
: mSpace(" "), mIsLoggedIn(FALSE)
|
||||
{
|
||||
createCmds();
|
||||
createStats();
|
||||
}
|
||||
|
||||
POPClient::~POPClient()
|
||||
{
|
||||
}
|
||||
|
||||
BOOL POPClient::open(const String &hostName)
|
||||
{
|
||||
HostEnt hostEntry;
|
||||
ServEnt serverEntry;
|
||||
Block<String> responseLines;
|
||||
INETSocketAddress internetSocketAddress;
|
||||
|
||||
if(hostName.isNull())return FALSE;
|
||||
if(mPOPControl.isConnected())mPOPControl.closeSocket();
|
||||
message(String("trying ")+hostName+String("..."));
|
||||
if(!mWSASystem.isInitialized()){message("WINSOCK initialization failure.");return FALSE;}
|
||||
InternetAddress internetAddress(hostName);
|
||||
if(!internetAddress.isZero()){if(!hostEntry.hostByAddress(internetAddress)){return FALSE;}}
|
||||
else if(!hostEntry.hostByName(hostName)){return FALSE;}
|
||||
if(!internetAddress.isZero()){if(!hostEntry.hostByAddress(internetAddress)){message(String("no DNS entry for ")+hostName);return FALSE;}}
|
||||
else if(!hostEntry.hostByName(hostName)){message(String("no DNS entry for ")+hostName);return FALSE;}
|
||||
message(String("connect...")+String("'")+hostEntry.hostName()+String("' (")+(String)(hostEntry.addresses())[0]+String(")"));
|
||||
internetSocketAddress.internetAddress((hostEntry.addresses())[0]);
|
||||
if(serverEntry.serviceByName("pop3","tcp"))
|
||||
{
|
||||
if(!mPOPControl.openSocket()){message("unable to create socket.");return FALSE;}
|
||||
internetSocketAddress.family(PF_INET);
|
||||
internetSocketAddress.port(serverEntry.port());
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!mPOPControl.openSocket()){message("unable to create socket.");return FALSE;}
|
||||
internetSocketAddress.family(PF_INET);
|
||||
internetSocketAddress.port(htons(POPPort));
|
||||
}
|
||||
if(!mPOPControl.connect(internetSocketAddress)){message("unable to connect to pop3 server");return FALSE;}
|
||||
mPOPControl.getSocketName(internetSocketAddress);
|
||||
if(!mPOPControl.isConnected())return FALSE;
|
||||
if(!receive(responseLines)||!isInAckResponse(responseLines))
|
||||
{
|
||||
mPOPControl.closeSocket();
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL POPClient::quit(void)
|
||||
{
|
||||
Block<String> responseLines;
|
||||
|
||||
if(!isConnected())return FALSE;
|
||||
isLoggedIn(FALSE);
|
||||
if(!putControlData(mPOPCmds[Quit],FALSE))return FALSE;
|
||||
receive(responseLines);
|
||||
mPOPControl.closeSocket();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL POPClient::authenticate(const String &user,const String &password)
|
||||
{
|
||||
Block<String> responseLines;
|
||||
|
||||
if(!isConnected())return FALSE;
|
||||
if(!putControlData(mPOPCmds[User]+String(" ")+user,FALSE))return FALSE;
|
||||
if(!receive(responseLines))return FALSE;
|
||||
if(!isInAckResponse(responseLines))return FALSE;
|
||||
if(!putControlData(mPOPCmds[Pass]+String(" ")+password,FALSE))return FALSE;
|
||||
if(!receive(responseLines))return FALSE;
|
||||
isLoggedIn(TRUE);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL POPClient::stat(WORD &messages,WORD &octets)
|
||||
{
|
||||
Block<String> responseLines;
|
||||
String strItem;
|
||||
|
||||
if(!isConnected()||!isLoggedIn())return FALSE;
|
||||
if(!putControlData(mPOPCmds[Stat],FALSE))return FALSE;
|
||||
if(!receive(responseLines))return FALSE;
|
||||
if(!isInAckResponse(responseLines))return FALSE;
|
||||
strItem=responseLines[0].betweenString(' ',' ');
|
||||
messages=::atoi((char*)strItem);
|
||||
strItem=responseLines[0].betweenString(' ',0);
|
||||
strItem=strItem.betweenString(' ',0);
|
||||
octets=::atoi((char*)strItem);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL POPClient::retrieve(WORD msgNum,Block<String> &messageLines)
|
||||
{
|
||||
Block<String> responseLines;
|
||||
String strMsg;
|
||||
|
||||
messageLines.remove();
|
||||
if(!isConnected()||!isLoggedIn())return FALSE;
|
||||
::sprintf(strMsg,"%d",msgNum);
|
||||
if(!putControlData(mPOPCmds[Retr]+String(" ")+strMsg,FALSE))return FALSE;
|
||||
if(!receive(responseLines))return FALSE;
|
||||
if(!isInAckResponse(responseLines))return FALSE;
|
||||
receiveLines(messageLines);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL POPClient::dele(WORD msgNum)
|
||||
{
|
||||
Block<String> responseLines;
|
||||
String strMsg;
|
||||
if(!isConnected()||!isLoggedIn())return FALSE;
|
||||
::sprintf(strMsg,"%d",msgNum);
|
||||
if(!putControlData(mPOPCmds[Dele]+String(" ")+strMsg,FALSE))return FALSE;
|
||||
if(!receive(responseLines))return FALSE;
|
||||
if(!isInAckResponse(responseLines))return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL POPClient::noop(void)
|
||||
{
|
||||
Block<String> responseLines;
|
||||
|
||||
if(!isConnected()||!isLoggedIn())return FALSE;
|
||||
if(!putControlData(mPOPCmds[Noop],FALSE))return FALSE;
|
||||
if(!receive(responseLines))return FALSE;
|
||||
if(!isInAckResponse(responseLines))return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL POPClient::rset(void)
|
||||
{
|
||||
Block<String> responseLines;
|
||||
|
||||
if(!isConnected()||!isLoggedIn())return FALSE;
|
||||
if(!putControlData(mPOPCmds[Rset],FALSE))return FALSE;
|
||||
if(!receive(responseLines))return FALSE;
|
||||
if(!isInAckResponse(responseLines))return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL POPClient::top(Block<String> &msgLines,WORD msgNum,WORD lineCount)
|
||||
{
|
||||
Block<String> responseLines;
|
||||
String strMsg;
|
||||
|
||||
if(!isConnected()||!isLoggedIn())return FALSE;
|
||||
::sprintf(strMsg,"%d %d",msgNum,lineCount);
|
||||
if(!putControlData(mPOPCmds[Top]+String(" ")+strMsg,FALSE))return FALSE;
|
||||
if(!receive(responseLines))return FALSE;
|
||||
if(!isInAckResponse(responseLines))return FALSE;
|
||||
if(!receiveLines(msgLines))return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void POPClient::createStats(void)
|
||||
{
|
||||
mPOPStatus.insert(&String("+OK"));
|
||||
mPOPStatus.insert(&String("-ERR"));
|
||||
}
|
||||
|
||||
void POPClient::createCmds(void)
|
||||
{
|
||||
mPOPCmds.remove();
|
||||
mPOPCmds.insert(&String("QUIT"));
|
||||
mPOPCmds.insert(&String("USER"));
|
||||
mPOPCmds.insert(&String("PASS"));
|
||||
mPOPCmds.insert(&String("STAT"));
|
||||
mPOPCmds.insert(&String("RETR"));
|
||||
mPOPCmds.insert(&String("RSET"));
|
||||
mPOPCmds.insert(&String("DELE"));
|
||||
mPOPCmds.insert(&String("NOOP"));
|
||||
mPOPCmds.insert(&String("TOP"));
|
||||
}
|
||||
|
||||
WORD POPClient::putControlData(const String &stringData,WORD waitForResponse)
|
||||
{
|
||||
if(!mPOPControl.isConnected())return FALSE;
|
||||
if(!mPOPControl.send(stringData))
|
||||
{
|
||||
mPOPControl.closeSocket();
|
||||
String errorString(String("error sending '")+stringData+String("' to POP server."));
|
||||
message(errorString);
|
||||
errorString+="\n";
|
||||
::OutputDebugString(errorString);
|
||||
return FALSE;
|
||||
}
|
||||
if(waitForResponse&&!getControlData())
|
||||
{
|
||||
mPOPControl.closeSocket();
|
||||
String errorString(String("error reading result of '")+stringData+String("' command from NNTP server."));
|
||||
message(errorString);
|
||||
errorString+="\n";
|
||||
::OutputDebugString(errorString);
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD POPClient::getControlData(void)
|
||||
{
|
||||
Block<String> responseStrings;
|
||||
mPOPControl.receive(responseStrings);
|
||||
return responseStrings.size();
|
||||
}
|
||||
|
||||
BOOL POPClient::isInAckResponse(Block<String> &responseLines)
|
||||
{
|
||||
if(!responseLines.size())return FALSE;
|
||||
if(responseLines[0].substr(0,2)==mPOPStatus[Ok])return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL POPClient::isInNakResponse(Block<String> &responseLines)
|
||||
{
|
||||
if(!responseLines.size())return FALSE;
|
||||
if(responseLines[0].substr(0,3)==mPOPStatus[Error])return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL POPClient::receive(Block<String> &responseLines)
|
||||
{
|
||||
if(!mPOPControl.receive(responseLines))return FALSE;
|
||||
// message(responseLines);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL POPClient::receiveLines(Block<String> &receiveStrings)
|
||||
{
|
||||
String stringData;
|
||||
String seriesItem;
|
||||
|
||||
receiveStrings.remove();
|
||||
while(TRUE)
|
||||
{
|
||||
if(!mPOPControl.receive(stringData))break;
|
||||
if(stringData==String("."))break;
|
||||
if(stringData==String(".."))stringData=".";
|
||||
receiveStrings.insert(&stringData);
|
||||
if(!isConnected())break;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// virtuals
|
||||
|
||||
void POPClient::message(const String &messageString)
|
||||
{
|
||||
::OutputDebugString(messageString+String("\n"));
|
||||
}
|
||||
|
||||
void POPClient::message(Block<String> &messageStrings)
|
||||
{
|
||||
for(int itemIndex=0;itemIndex<messageStrings.size();itemIndex++)
|
||||
::OutputDebugString(messageStrings[itemIndex]+String("\n"));
|
||||
}
|
||||
83
pop/HOLD/POPCLNT.HPP
Normal file
83
pop/HOLD/POPCLNT.HPP
Normal file
@@ -0,0 +1,83 @@
|
||||
#ifndef _POP_POPCLIENT_HPP_
|
||||
#define _POP_POPCLIENT_HPP_
|
||||
#ifndef _COMMON_WINDOWS_HPP_
|
||||
#include <common/windows.hpp>
|
||||
#endif
|
||||
#ifndef _SOCKET_SOCKET_HPP_
|
||||
#include <socket/socket.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_BLOCK_HPP_
|
||||
#include <common/block.hpp>
|
||||
#endif
|
||||
|
||||
class String;
|
||||
|
||||
class POPClient
|
||||
{
|
||||
public:
|
||||
POPClient(void);
|
||||
virtual ~POPClient();
|
||||
BOOL open(const String &hostName);
|
||||
void close(void);
|
||||
BOOL isConnected(void)const;
|
||||
BOOL isLoggedIn(void)const;
|
||||
BOOL quit(void);
|
||||
BOOL authenticate(const String &user,const String &password);
|
||||
BOOL retrieve(WORD msgNum,Block<String> &messageLines);
|
||||
BOOL top(Block<String> &messageLines,WORD msgNum,WORD lineCount=10);
|
||||
BOOL dele(WORD msgNum);
|
||||
BOOL rset(void);
|
||||
BOOL noop(void);
|
||||
BOOL stat(WORD &messages,WORD &octets);
|
||||
protected:
|
||||
virtual void message(const String &messageString);
|
||||
virtual void message(Block<String> &messageStrings);
|
||||
private:
|
||||
enum {POPPort=110};
|
||||
enum POPCmds{Quit,User,Pass,Stat,Retr,Rset,Dele,Noop,Top};
|
||||
enum POPStatus{Ok,Error};
|
||||
POPClient(const POPClient &somePOPClient);
|
||||
POPClient &operator=(const POPClient &somePOPClient);
|
||||
void isLoggedIn(BOOL isLoggedIn);
|
||||
WORD putControlData(const String &stringData,WORD waitForResponse=TRUE);
|
||||
BOOL isInNakResponse(Block<String> &responseLines);
|
||||
BOOL isInAckResponse(Block<String> &responseLines);
|
||||
BOOL receive(Block<String> &responseLines);
|
||||
BOOL receiveLines(Block<String> &receiveStrings);
|
||||
WORD getControlData(void);
|
||||
void createCmds(void);
|
||||
void createStats(void);
|
||||
|
||||
Socket mPOPControl;
|
||||
WSASystem mWSASystem;
|
||||
Block<String> mPOPCmds;
|
||||
Block<String> mPOPStatus;
|
||||
BOOL mIsLoggedIn;
|
||||
String mSpace;
|
||||
};
|
||||
|
||||
inline
|
||||
BOOL POPClient::isConnected(void)const
|
||||
{
|
||||
return mPOPControl.isConnected();
|
||||
}
|
||||
|
||||
inline
|
||||
BOOL POPClient::isLoggedIn(void)const
|
||||
{
|
||||
return mIsLoggedIn;
|
||||
}
|
||||
|
||||
inline
|
||||
void POPClient::isLoggedIn(BOOL isLoggedIn)
|
||||
{
|
||||
mIsLoggedIn=isLoggedIn;
|
||||
}
|
||||
|
||||
inline
|
||||
void POPClient::close(void)
|
||||
{
|
||||
mPOPControl.closeSocket();
|
||||
isLoggedIn(FALSE);
|
||||
}
|
||||
#endif
|
||||
240
pop/HOLD/POPDLG.CPP
Normal file
240
pop/HOLD/POPDLG.CPP
Normal file
@@ -0,0 +1,240 @@
|
||||
#include <pop/popdlg.hpp>
|
||||
#include <pop/srvrdlg.hpp>
|
||||
#include <pop/popclnt.hpp>
|
||||
#include <pop/srvrreg.hpp>
|
||||
#include <pop/logindlg.hpp>
|
||||
#include <pop/header.hpp>
|
||||
#include <pop/mail.hpp>
|
||||
#include <common/systime.hpp>
|
||||
#include <common/opendlg.hpp>
|
||||
#include <statbar/statbar.hpp>
|
||||
#include <imagelst/ftree.hpp>
|
||||
|
||||
POPDlg::POPDlg(void)
|
||||
{
|
||||
mInitHandler.setCallback(this,&POPDlg::initHandler);
|
||||
mDestroyHandler.setCallback(this,&POPDlg::destroyHandler);
|
||||
mCommandHandler.setCallback(this,&POPDlg::commandHandler);
|
||||
mCloseHandler.setCallback(this,&POPDlg::closeHandler);
|
||||
mDlgCodeHandler.setCallback(this,&POPDlg::dlgCodeHandler);
|
||||
mMailSelChangedHandler.setCallback(this,&POPDlg::mailSelChangedHandler);
|
||||
DWindow::insertHandler(VectorHandler::InitDialogHandler,&mInitHandler);
|
||||
DWindow::insertHandler(VectorHandler::DestroyHandler,&mDestroyHandler);
|
||||
DWindow::insertHandler(VectorHandler::CommandHandler,&mCommandHandler);
|
||||
DWindow::insertHandler(VectorHandler::CloseHandler,&mCloseHandler);
|
||||
DWindow::insertHandler(VectorHandler::DialogCodeHandler,&mDlgCodeHandler);
|
||||
}
|
||||
|
||||
POPDlg::~POPDlg()
|
||||
{
|
||||
DWindow::removeHandler(VectorHandler::InitDialogHandler,&mInitHandler);
|
||||
DWindow::removeHandler(VectorHandler::DestroyHandler,&mDestroyHandler);
|
||||
DWindow::removeHandler(VectorHandler::CommandHandler,&mCommandHandler);
|
||||
DWindow::removeHandler(VectorHandler::CloseHandler,&mCloseHandler);
|
||||
DWindow::insertHandler(VectorHandler::DialogCodeHandler,&mDlgCodeHandler);
|
||||
}
|
||||
|
||||
POPDlg &POPDlg::operator=(const POPDlg &/*somePOPDlg*/)
|
||||
{ // private implementation
|
||||
return *this;
|
||||
}
|
||||
|
||||
BOOL POPDlg::perform(void)
|
||||
{
|
||||
return ::DialogBoxParam(processInstance(),(LPSTR)"POPCLIENT",(HWND)0,DWindow::DlgProc,(LPARAM)(DWindow*)this);
|
||||
}
|
||||
|
||||
|
||||
CallbackData::ReturnType POPDlg::initHandler(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
mStatusBar=new StatusBar(*this);
|
||||
mFolderTree=new FolderTree(*this,Rect(xFolder,yFolder,cxFolder,cyFolder));
|
||||
mMailTree=new FolderTree(*this,Rect(xMail,yMail,cxMail,cyMail));
|
||||
mMailTree->insertHandler(FolderTree::SelChangedHandler,&mMailSelChangedHandler);
|
||||
mStatusBar.disposition(PointerDisposition::Delete);
|
||||
// getMail();
|
||||
// retrieveMail();
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType POPDlg::destroyHandler(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType POPDlg::dlgCodeHandler(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
return (CallbackData::ReturnType)DLGC_WANTARROWS|DLGC_WANTCHARS;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType POPDlg::commandHandler(CallbackData &someCallbackData)
|
||||
{
|
||||
switch(someCallbackData.wmCommandID())
|
||||
{
|
||||
case IDOK :
|
||||
break;
|
||||
case IDCANCEL :
|
||||
endDialog(FALSE);
|
||||
break;
|
||||
case Server :
|
||||
handleServer(someCallbackData);
|
||||
break;
|
||||
case GetMail :
|
||||
getMail();
|
||||
break;
|
||||
}
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType POPDlg::closeHandler(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType POPDlg::mailSelChangedHandler(CallbackData &someCallbackData)
|
||||
{
|
||||
setDisplay(someCallbackData.loWord()-1);
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
void POPDlg::handleServer(CallbackData &someCallbackData)
|
||||
{
|
||||
ServerDialog serverDialog(*this);
|
||||
serverDialog.performDialog();
|
||||
}
|
||||
|
||||
void POPDlg::getMail(void)
|
||||
{
|
||||
retrieveMail();
|
||||
populateMail();
|
||||
populateFolders();
|
||||
}
|
||||
|
||||
void POPDlg::retrieveMail(void)
|
||||
{
|
||||
mMailBlock.remove();
|
||||
|
||||
for(int itemIndex=0;itemIndex<20;itemIndex++)
|
||||
{
|
||||
String strIndex;
|
||||
Block<String> mailBlock;
|
||||
::sprintf(strIndex,"hello(%d)",itemIndex);
|
||||
mailBlock.insert(&String("From: Sean Kessler<europa@li.net>"));
|
||||
mailBlock.insert(&String(" "));
|
||||
mailBlock.insert(&String("Sean Kessler wrote:"));
|
||||
mailBlock.insert(&strIndex);
|
||||
mMailBlock.insert(&Mail(mailBlock));
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
void POPDlg::retrieveMail(void)
|
||||
{
|
||||
POPClient popClient;
|
||||
ServerReg serverReg;
|
||||
WORD messages;
|
||||
WORD octets;
|
||||
|
||||
mMailBlock.remove();
|
||||
if(!handleLoginParams(serverReg)){userMessage("Incorrect Login.");return;}
|
||||
if(!popClient.open(serverReg.serverName())){userMessage("Connect Failed..");return;}
|
||||
if(!popClient.authenticate(serverReg.userName(),serverReg.password()))
|
||||
{
|
||||
popClient.quit();
|
||||
popClient.close();
|
||||
userMessage("Authentication Failed.");
|
||||
return;
|
||||
}
|
||||
popClient.stat(messages,octets);
|
||||
if(!messages){userMessage("No Messages.");return;}
|
||||
for(int msgIndex=1;msgIndex<=messages;msgIndex++)
|
||||
{
|
||||
mMailBlock.insert(&Mail());
|
||||
Block<String> &msgLines=mMailBlock[mMailBlock.size()-1];
|
||||
Header &mailHeader=mMailBlock[mMailBlock.size()-1];
|
||||
popClient.retrieve(msgIndex,msgLines);
|
||||
mailHeader=msgLines;
|
||||
if(!msgLines.size())continue;
|
||||
}
|
||||
popClient.quit();
|
||||
popClient.close();
|
||||
}
|
||||
#endif
|
||||
|
||||
BOOL POPDlg::handleLoginParams(ServerReg &serverReg)
|
||||
{
|
||||
if(serverReg.serverName().isNull()){::MessageBox(*this,(LPSTR)"No Server Defined",(LPSTR)"SERVER ERROR",MB_ICONSTOP);return FALSE;}
|
||||
if(serverReg.userName().isNull()||serverReg.password().isNull())
|
||||
{
|
||||
String userName;
|
||||
String password;
|
||||
LoginDialog loginDialog;
|
||||
if(!loginDialog.performLogin())return FALSE;
|
||||
userName=loginDialog.userName();
|
||||
password=loginDialog.password();
|
||||
serverReg.userName(userName);
|
||||
serverReg.password(password);
|
||||
}
|
||||
if(serverReg.userName().isNull()||serverReg.password().isNull())return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void POPDlg::populateMail(void)
|
||||
{
|
||||
String strMailBox(STRING_MAILBOXNAME);
|
||||
|
||||
mMailTree->setRedraw(FALSE);
|
||||
mMailTree->remove();
|
||||
mMailTree->addRootNode(FolderTree::FolderClosed,strMailBox,makeItemID(NullNode,RootID));
|
||||
for(int itemIndex=0;itemIndex<mMailBlock.size();itemIndex++)
|
||||
{
|
||||
TreeViewItem insertItem(0,0,0,0,(LPSTR)mMailBlock[itemIndex].from(),mMailBlock[itemIndex].from().length(),FolderTree::FolderClosed,FolderTree::FolderOpen,0,makeItemID(MailNode,itemIndex+1));
|
||||
mMailTree->addNode(TreeView::NodeChild,insertItem,strMailBox);
|
||||
|
||||
}
|
||||
mMailTree->setRedraw(TRUE);
|
||||
}
|
||||
|
||||
void POPDlg::populateFolders(void)
|
||||
{
|
||||
String strUserFolder(STRING_USERFOLDERNAME);
|
||||
|
||||
mFolderTree->setRedraw(FALSE);
|
||||
mFolderTree->remove();
|
||||
mFolderTree->addRootNode(FolderTree::FolderClosed,strUserFolder,makeItemID(NullNode,RootID));
|
||||
mFolderTree->setRedraw(TRUE);
|
||||
}
|
||||
|
||||
void POPDlg::setDisplay(int itemID)
|
||||
{
|
||||
String lineItem;
|
||||
Block<String> &mailList=mMailBlock[itemID];
|
||||
|
||||
if(itemID<0)return;
|
||||
for(int itemIndex=0;itemIndex<mailList.size();itemIndex++)
|
||||
{
|
||||
lineItem+=mailList[itemIndex];
|
||||
lineItem+="\r\n";
|
||||
}
|
||||
setText(EditControl,(LPSTR)lineItem);
|
||||
}
|
||||
|
||||
void POPDlg::userMessage(const String &message)
|
||||
{
|
||||
::MessageBox(*this,(LPSTR)(String&)message,(LPSTR)"POPClient",MB_OK);
|
||||
}
|
||||
|
||||
// **************** virtuals
|
||||
|
||||
void POPDlg::message(const String &messageString)
|
||||
{
|
||||
if(!mStatusBar.isOkay())return;
|
||||
mStatusBar->setText(messageString);
|
||||
}
|
||||
|
||||
void POPDlg::message(Block<String> &messageStrings)
|
||||
{
|
||||
if(!mStatusBar.isOkay())return;
|
||||
for(int lineIndex=0;lineIndex<messageStrings.size();lineIndex++)
|
||||
mStatusBar->setText(messageStrings[lineIndex]);
|
||||
}
|
||||
69
pop/HOLD/POPDLG.HPP
Normal file
69
pop/HOLD/POPDLG.HPP
Normal file
@@ -0,0 +1,69 @@
|
||||
#ifndef _POP_POPDLG_HPP_
|
||||
#define _POP_POPDLG_HPP_
|
||||
#ifndef _COMMON_DWINDOW_HPP_
|
||||
#include <common/dwindow.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_SMARTPOINTER_HPP_
|
||||
#include <common/pointer.hpp>
|
||||
#endif
|
||||
#ifndef _POP_POP_HPP_
|
||||
#include <pop/pop.hpp>
|
||||
#endif
|
||||
|
||||
class StatusBar;
|
||||
class FolderTree;
|
||||
class ServerReg;
|
||||
class Mail;
|
||||
|
||||
class POPDlg : public DWindow
|
||||
{
|
||||
public:
|
||||
POPDlg(void);
|
||||
virtual ~POPDlg();
|
||||
BOOL perform(void);
|
||||
protected:
|
||||
virtual void message(const String &messageString);
|
||||
virtual void message(Block<String> &messageStrings);
|
||||
private:
|
||||
enum DlgControls{Server=PC_SERVER,GetMail=PC_GETMAIL,EditControl=PC_EDIT};
|
||||
enum FolderCoords{xFolder=5,yFolder=50,cxFolder=235,cyFolder=150};
|
||||
enum MailCoords{xMail=245,yMail=50,cxMail=235,cyMail=150};
|
||||
enum {RootID=0};
|
||||
enum NodeType{NullNode=0x0000,MailNode=0x0001};
|
||||
POPDlg &operator=(const POPDlg &someMailDlg);
|
||||
CallbackData::ReturnType initHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType destroyHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType commandHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType closeHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType dlgCodeHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType mailSelChangedHandler(CallbackData &someCallbackData);
|
||||
|
||||
void handleServer(CallbackData &someCallbackData);
|
||||
void userMessage(const String &message);
|
||||
void retrieveMail(void);
|
||||
void populateFolders(void);
|
||||
void populateMail(void);
|
||||
void getMail(void);
|
||||
void setDisplay(int itemID);
|
||||
BOOL handleLoginParams(ServerReg &serverReg);
|
||||
LPARAM makeItemID(NodeType nodeType,WORD itemID);
|
||||
|
||||
Callback<POPDlg> mInitHandler;
|
||||
Callback<POPDlg> mDestroyHandler;
|
||||
Callback<POPDlg> mCommandHandler;
|
||||
Callback<POPDlg> mCloseHandler;
|
||||
Callback<POPDlg> mDlgCodeHandler;
|
||||
Callback<POPDlg> mMailSelChangedHandler;
|
||||
SmartPointer<StatusBar> mStatusBar;
|
||||
SmartPointer<FolderTree> mFolderTree;
|
||||
SmartPointer<FolderTree> mMailTree;
|
||||
Block<Mail> mMailBlock;
|
||||
};
|
||||
|
||||
|
||||
inline
|
||||
LPARAM POPDlg::makeItemID(NodeType nodeType,WORD itemID)
|
||||
{
|
||||
return MAKELPARAM(itemID,nodeType);
|
||||
}
|
||||
#endif
|
||||
38
pop/HOLD/SRVRDLG.CPP
Normal file
38
pop/HOLD/SRVRDLG.CPP
Normal file
@@ -0,0 +1,38 @@
|
||||
#include <pop/srvrdlg.hpp>
|
||||
#include <common/regkey.hpp>
|
||||
|
||||
WORD ServerDialog::performDialog(void)
|
||||
{
|
||||
::DialogBoxParam(processInstance(),(LPSTR)"ServerDialog",mhParent,(DLGPROC)DWindow::DlgProc,(LONG)((DWindow*)this));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType ServerDialog::initDialogHandler(CallbackData &someCallbackData)
|
||||
{
|
||||
if(!mServerReg.serverName().isNull())setText(ServerName,mServerReg.serverName());
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
void ServerDialog::getServerName(void)
|
||||
{
|
||||
String serverName;
|
||||
|
||||
getText(ServerName,serverName);
|
||||
if(serverName.isNull())return;
|
||||
mServerReg.serverName(serverName);
|
||||
}
|
||||
|
||||
CallbackData::ReturnType ServerDialog::commandHandler(CallbackData &someCallbackData)
|
||||
{
|
||||
switch(someCallbackData.wmCommandID())
|
||||
{
|
||||
case IDOK :
|
||||
getServerName();
|
||||
endDialog(TRUE);
|
||||
break;
|
||||
case IDCANCEL :
|
||||
endDialog(TRUE);
|
||||
break;
|
||||
}
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
68
pop/HOLD/SRVRDLG.HPP
Normal file
68
pop/HOLD/SRVRDLG.HPP
Normal file
@@ -0,0 +1,68 @@
|
||||
#ifndef _POP_SERVERDLG_HPP_
|
||||
#define _POP_SERVERDLG_HPP_
|
||||
#ifndef _COMMON_DWINDOW_HPP_
|
||||
#include <common/dwindow.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_WINDOW_HPP_
|
||||
#include <common/window.hpp>
|
||||
#endif
|
||||
#ifndef _POP_POP_HPP_
|
||||
#include <pop/pop.hpp>
|
||||
#endif
|
||||
#ifndef _POP_SERVERREG_HPP_
|
||||
#include <pop/srvrreg.hpp>
|
||||
#endif
|
||||
|
||||
class String;
|
||||
|
||||
class ServerDialog : private DWindow
|
||||
{
|
||||
public:
|
||||
ServerDialog(const GUIWindow &parentWindow);
|
||||
virtual ~ServerDialog();
|
||||
WORD performDialog(void);
|
||||
private:
|
||||
enum{ServerName=NS_SERVERNAME};
|
||||
ServerDialog(const ServerDialog &someServerDialog);
|
||||
ServerDialog &operator=(const ServerDialog &someServerDialog);
|
||||
CallbackData::ReturnType initDialogHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType commandHandler(CallbackData &someCallbackData);
|
||||
void getServerName(void);
|
||||
|
||||
Callback<ServerDialog> mInitDialogHandler;
|
||||
Callback<ServerDialog> mCommandHandler;
|
||||
ServerReg mServerReg;
|
||||
HWND mhParent;
|
||||
};
|
||||
|
||||
inline
|
||||
ServerDialog::ServerDialog(const GUIWindow &parentWindow)
|
||||
: mhParent(parentWindow)
|
||||
{
|
||||
mInitDialogHandler.setCallback(this,&ServerDialog::initDialogHandler);
|
||||
mCommandHandler.setCallback(this,&ServerDialog::commandHandler);
|
||||
insertHandler(VectorHandler::CommandHandler,&mCommandHandler);
|
||||
insertHandler(VectorHandler::InitDialogHandler,&mInitDialogHandler);
|
||||
}
|
||||
|
||||
inline
|
||||
ServerDialog::ServerDialog(const ServerDialog &someServerDialog)
|
||||
: mhParent(someServerDialog.mhParent)
|
||||
{ // no implementation
|
||||
mInitDialogHandler.setCallback(this,&ServerDialog::initDialogHandler);
|
||||
mCommandHandler.setCallback(this,&ServerDialog::commandHandler);
|
||||
}
|
||||
|
||||
inline
|
||||
ServerDialog::~ServerDialog()
|
||||
{
|
||||
removeHandler(VectorHandler::CommandHandler,&mCommandHandler);
|
||||
removeHandler(VectorHandler::InitDialogHandler,&mInitDialogHandler);
|
||||
}
|
||||
|
||||
inline
|
||||
ServerDialog &ServerDialog::operator=(const ServerDialog &/*someServerDialog*/)
|
||||
{ // no implementation
|
||||
return *this;
|
||||
}
|
||||
#endif
|
||||
142
pop/HOLD/SRVRREG.HPP
Normal file
142
pop/HOLD/SRVRREG.HPP
Normal file
@@ -0,0 +1,142 @@
|
||||
#ifndef _POP_SERVERREG_HPP_
|
||||
#define _POP_SERVERREG_HPP_
|
||||
#ifndef _COMMON_WINDOWS_HPP_
|
||||
#include <common/windows.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_REGKEY_HPP_
|
||||
#include <common/regkey.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_STRING_HPP_
|
||||
#include <common/string.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_DISKINFO_HPP_
|
||||
#include <common/diskinfo.hpp>
|
||||
#endif
|
||||
#ifndef _POP_POP_HPP_
|
||||
#include <pop/pop.hpp>
|
||||
#endif
|
||||
|
||||
class ServerReg
|
||||
{
|
||||
public:
|
||||
ServerReg(void);
|
||||
ServerReg(const ServerReg &someServerReg);
|
||||
virtual ~ServerReg();
|
||||
ServerReg &operator=(const ServerReg &someServerReg);
|
||||
const String &serverName(void)const;
|
||||
void serverName(const String &hostName);
|
||||
const String &userName(void)const;
|
||||
void userName(const String &userName);
|
||||
const String &password(void)const;
|
||||
void password(const String &password);
|
||||
const String &mailDir(void)const;
|
||||
void mailDir(const String &mailDirectory);
|
||||
private:
|
||||
RegKey mRegKey;
|
||||
|
||||
String mServerName;
|
||||
String mMailDir;
|
||||
String mUserName;
|
||||
String mPassword;
|
||||
String mRegEntryKey;
|
||||
String mServerNameKey;
|
||||
String mMailDirKey;
|
||||
String mUserNameKey;
|
||||
String mPasswordKey;
|
||||
};
|
||||
|
||||
inline
|
||||
ServerReg::ServerReg(void)
|
||||
: mRegKey(RegKey::CurrentUser), mRegEntryKey(STRING_REGENTRYKEY),
|
||||
mServerNameKey(STRING_SERVERNAMEKEY), mMailDirKey(STRING_MAILDIRKEY),
|
||||
mUserNameKey(STRING_USERNAMEKEY), mPasswordKey(STRING_PASSWORDKEY)
|
||||
{
|
||||
if(!mRegKey.openKey(mRegEntryKey))
|
||||
{
|
||||
mRegKey.createKey(mRegEntryKey,"");
|
||||
mRegKey.openKey(mRegEntryKey);
|
||||
}
|
||||
mRegKey.queryValue(mMailDirKey,mMailDir);
|
||||
if(mMailDir.isNull())
|
||||
{
|
||||
DiskInfo diskInfo;
|
||||
diskInfo.getCurrentDirectory(mMailDir);
|
||||
mRegKey.setValue(mMailDirKey,mMailDir);
|
||||
}
|
||||
mRegKey.queryValue(mServerNameKey,mServerName);
|
||||
mRegKey.queryValue(mUserNameKey,mUserName);
|
||||
mRegKey.queryValue(mPasswordKey,mPassword);
|
||||
}
|
||||
|
||||
inline
|
||||
ServerReg::ServerReg(const ServerReg &someServerReg)
|
||||
: mRegKey(RegKey::CurrentUser), mRegEntryKey(STRING_REGENTRYKEY),
|
||||
mServerNameKey(STRING_SERVERNAMEKEY), mMailDirKey(STRING_MAILDIRKEY),
|
||||
mUserNameKey(STRING_USERNAMEKEY), mPasswordKey(STRING_PASSWORDKEY)
|
||||
{
|
||||
*this=someServerReg;
|
||||
}
|
||||
|
||||
inline
|
||||
ServerReg::~ServerReg()
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
ServerReg &ServerReg::operator=(const ServerReg &someServerReg)
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &ServerReg::serverName(void)const
|
||||
{
|
||||
return mServerName;
|
||||
}
|
||||
|
||||
inline
|
||||
void ServerReg::serverName(const String &serverName)
|
||||
{
|
||||
mServerName=serverName;
|
||||
mRegKey.setValue(mServerNameKey,mServerName);
|
||||
}
|
||||
|
||||
inline
|
||||
const String &ServerReg::mailDir(void)const
|
||||
{
|
||||
return mMailDir;
|
||||
}
|
||||
|
||||
inline
|
||||
void ServerReg::mailDir(const String &mailDir)
|
||||
{
|
||||
mMailDir=mailDir;
|
||||
mRegKey.setValue(mMailDirKey,mMailDir);
|
||||
}
|
||||
|
||||
inline
|
||||
const String &ServerReg::userName(void)const
|
||||
{
|
||||
return mUserName;
|
||||
}
|
||||
|
||||
inline
|
||||
void ServerReg::userName(const String &userName)
|
||||
{
|
||||
mUserName=userName;
|
||||
mRegKey.setValue(mUserNameKey,mUserName);
|
||||
}
|
||||
|
||||
inline
|
||||
const String &ServerReg::password(void)const
|
||||
{
|
||||
return mPassword;
|
||||
}
|
||||
|
||||
inline
|
||||
void ServerReg::password(const String &password)
|
||||
{
|
||||
mPassword=password;
|
||||
mRegKey.setValue(mPasswordKey,mPassword);
|
||||
}
|
||||
#endif
|
||||
78
pop/LOGINDLG.CPP
Normal file
78
pop/LOGINDLG.CPP
Normal file
@@ -0,0 +1,78 @@
|
||||
#include <pop/logindlg.hpp>
|
||||
|
||||
WORD LoginDialog::performLogin(void)
|
||||
{
|
||||
DialogTemplate dlgTemplate;
|
||||
DialogItemTemplate userEdit;
|
||||
DialogItemTemplate passEdit;
|
||||
DialogItemTemplate userStatic;
|
||||
DialogItemTemplate passStatic;
|
||||
|
||||
dlgTemplate.titleText("Login to host...");
|
||||
dlgTemplate.posRect(Rect(8,19,197,76));
|
||||
dlgTemplate.pointSize(8);
|
||||
dlgTemplate.typeFace("Helv");
|
||||
dlgTemplate.style(DS_MODALFRAME|WS_TABSTOP|WS_VISIBLE|WS_CAPTION|WS_SYSMENU|DS_3DLOOK|DS_SETFONT|WS_POPUP);
|
||||
|
||||
userEdit.className("EDIT");
|
||||
userEdit.titleText("");
|
||||
userEdit.style(WS_BORDER|WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_AUTOHSCROLL);
|
||||
userEdit.posRect(Rect(56,19,98,12));
|
||||
userEdit.itemID(UserNameID);
|
||||
|
||||
passEdit.className("EDIT");
|
||||
passEdit.style(WS_BORDER|WS_TABSTOP|ES_PASSWORD|WS_CHILD|WS_VISIBLE);
|
||||
passEdit.posRect(Rect(56,35,98,12));
|
||||
passEdit.itemID(PasswordID);
|
||||
|
||||
userStatic.className("STATIC");
|
||||
userStatic.titleText("User Name :");
|
||||
userStatic.style(WS_CHILD|WS_VISIBLE);
|
||||
userStatic.posRect(Rect(2,20,39,8));
|
||||
userStatic.itemID(-1);
|
||||
|
||||
passStatic.className("STATIC");
|
||||
passStatic.titleText("Password :");
|
||||
passStatic.style(WS_CHILD|WS_VISIBLE);
|
||||
passStatic.posRect(Rect(2,36,39,8));
|
||||
passStatic.itemID(-1);
|
||||
|
||||
dlgTemplate+=userEdit;
|
||||
dlgTemplate+=passEdit;
|
||||
dlgTemplate+=userStatic;
|
||||
dlgTemplate+=passStatic;
|
||||
|
||||
createDialog(::GetTopWindow((HWND)0),dlgTemplate);
|
||||
if(userName().isNull()&&password().isNull())return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD LoginDialog::dlgCommand(DWORD commandID,CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
switch(commandID)
|
||||
{
|
||||
case IDOK :
|
||||
getText(UserNameID,mUserName);
|
||||
getText(PasswordID,mPassword);
|
||||
if(mUserName.isNull()||mPassword.isNull()){::MessageBeep(0);return TRUE;}
|
||||
break;
|
||||
case IDCANCEL :
|
||||
mUserName.reserve(String::MaxString);
|
||||
mPassword.reserve(String::MaxString);
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL LoginDialog::dlgInitDialog(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
if(!userName().isNull())setText(UserNameID,userName());
|
||||
if(!password().isNull())setText(PasswordID,password());
|
||||
setFocus();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void LoginDialog::dlgDestroyDialog(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
}
|
||||
|
||||
69
pop/LOGINDLG.HPP
Normal file
69
pop/LOGINDLG.HPP
Normal file
@@ -0,0 +1,69 @@
|
||||
#ifndef _POP_LOGINDIALOG_HPP_
|
||||
#define _POP_LOGINDIALOG_HPP_
|
||||
#ifndef _COMMON_WINDOWS_HPP_
|
||||
#include <common/windows.hpp>
|
||||
#endif
|
||||
#ifndef _DIALOG_DYNAMICDIALOG_HPP_
|
||||
#include <dialog/dyndlg.hpp>
|
||||
#endif
|
||||
|
||||
class LoginDialog : public DynamicDialog
|
||||
{
|
||||
public:
|
||||
LoginDialog(void);
|
||||
virtual ~LoginDialog();
|
||||
WORD performLogin(void);
|
||||
String userName(void)const;
|
||||
void userName(const String &userName);
|
||||
String password(void)const;
|
||||
void password(const String &password);
|
||||
private:
|
||||
enum {UserNameID=101,PasswordID=102};
|
||||
LoginDialog(const LoginDialog &loginDialog);
|
||||
WORD dlgCommand(DWORD commandID,CallbackData &someCallbackData);
|
||||
BOOL dlgInitDialog(CallbackData &someCallbackData);
|
||||
void dlgDestroyDialog(CallbackData &someCallbackData);
|
||||
String mUserName;
|
||||
String mPassword;
|
||||
};
|
||||
|
||||
inline
|
||||
LoginDialog::LoginDialog(void)
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
LoginDialog::LoginDialog(const LoginDialog &/*loginDialog*/)
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
LoginDialog::~LoginDialog()
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
String LoginDialog::userName(void)const
|
||||
{
|
||||
return mUserName;
|
||||
}
|
||||
|
||||
inline
|
||||
void LoginDialog::userName(const String &userName)
|
||||
{
|
||||
mUserName=userName;
|
||||
}
|
||||
|
||||
inline
|
||||
String LoginDialog::password(void)const
|
||||
{
|
||||
return mPassword;
|
||||
}
|
||||
|
||||
inline
|
||||
void LoginDialog::password(const String &password)
|
||||
{
|
||||
mPassword=password;
|
||||
}
|
||||
#endif
|
||||
|
||||
46
pop/MAIL.HPP
Normal file
46
pop/MAIL.HPP
Normal file
@@ -0,0 +1,46 @@
|
||||
#ifndef _POP_MAILMESSAGE_HPP_
|
||||
#define _POP_MAILMESSAGE_HPP_
|
||||
#ifndef _POP_HEADER_HPP_
|
||||
#include <pop/header.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_BLOCK_HPP_
|
||||
#include <common/block.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_STRING_HPP_
|
||||
#include <common/string.hpp>
|
||||
#endif
|
||||
|
||||
class Mail : public Block<String>, public Header
|
||||
{
|
||||
public:
|
||||
Mail(void);
|
||||
Mail(Block<String> &msgLines);
|
||||
virtual ~Mail();
|
||||
Mail &operator=(Block<String> &msgLines);
|
||||
private:
|
||||
};
|
||||
|
||||
inline
|
||||
Mail::Mail(void)
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
Mail::Mail(Block<String> &msgLines)
|
||||
: Block<String>(msgLines), Header(msgLines)
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
Mail::~Mail()
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
Mail &Mail::operator=(Block<String> &msgLines)
|
||||
{
|
||||
(Block<String>&)*this=msgLines;
|
||||
(Header&)*this=msgLines;
|
||||
return *this;
|
||||
}
|
||||
#endif
|
||||
48
pop/MAIN.CPP
Normal file
48
pop/MAIN.CPP
Normal file
@@ -0,0 +1,48 @@
|
||||
#include <pop/main.hpp>
|
||||
#include <pop/popdlg.hpp>
|
||||
|
||||
HINSTANCE Main::smhInstance=0;
|
||||
HINSTANCE Main::smhPrevInstance=0;
|
||||
int Main::smnCmdShow=0;
|
||||
|
||||
int PASCAL WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR /*lpszCmdLine*/,int nCmdShow)
|
||||
{
|
||||
Main::processInstance(hInstance);
|
||||
Main::previousProcessInstance(hPrevInstance);
|
||||
Main::cmdShow(nCmdShow);
|
||||
POPDlg popDialog;
|
||||
return popDialog.perform();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#if 0
|
||||
#include <common/string.hpp>
|
||||
#include <pop/main.hpp>
|
||||
#include <pop/mainwnd.hpp>
|
||||
|
||||
HINSTANCE Main::smhInstance=0;
|
||||
HINSTANCE Main::smhPrevInstance=0;
|
||||
int Main::smnCmdShow=0;
|
||||
|
||||
int PASCAL WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR /*lpszCmdLine*/,int nCmdShow)
|
||||
{
|
||||
Main::processInstance(hInstance);
|
||||
Main::previousProcessInstance(hPrevInstance);
|
||||
Main::cmdShow(nCmdShow);
|
||||
if(Main::previousProcessInstance())
|
||||
{
|
||||
HWND hWnd=::FindWindow(MainWindow::className(),MainWindow::className());
|
||||
if(!hWnd)
|
||||
{
|
||||
::MessageBox(::GetFocus(),(LPSTR)"Failed to maximize previous instance",(LPSTR)"Error",MB_ICONSTOP|MB_SYSTEMMODAL);
|
||||
return FALSE;
|
||||
}
|
||||
::PostMessage(hWnd,WM_REACTIVATE,0,0L);
|
||||
return FALSE;
|
||||
}
|
||||
MainWindow applicationWindow(Main::processInstance());
|
||||
return applicationWindow.messageLoop();
|
||||
}
|
||||
#endif
|
||||
68
pop/MAIN.HPP
Normal file
68
pop/MAIN.HPP
Normal file
@@ -0,0 +1,68 @@
|
||||
#ifndef _POP_MAIN_HPP_
|
||||
#define _POP_MAIN_HPP_
|
||||
#ifndef _COMMON_WINDOWS_HPP_
|
||||
#include <common/windows.hpp>
|
||||
#endif
|
||||
|
||||
class Main
|
||||
{
|
||||
public:
|
||||
static HINSTANCE processInstance(HWND hWnd);
|
||||
static HINSTANCE processInstance(void);
|
||||
static HINSTANCE previousProcessInstance(void);
|
||||
static void processInstance(HINSTANCE processInstance);
|
||||
static void previousProcessInstance(HINSTANCE previousProcessInstance);
|
||||
static void cmdShow(int nCmdShow);
|
||||
private:
|
||||
static HINSTANCE smhInstance;
|
||||
static HINSTANCE smhPrevInstance;
|
||||
static int smnCmdShow;
|
||||
};
|
||||
|
||||
inline
|
||||
void Main::processInstance(HINSTANCE hProcessInstance)
|
||||
{
|
||||
smhInstance=hProcessInstance;
|
||||
}
|
||||
|
||||
inline
|
||||
void Main::previousProcessInstance(HINSTANCE previousProcessInstance)
|
||||
{
|
||||
smhPrevInstance=previousProcessInstance;
|
||||
}
|
||||
|
||||
inline
|
||||
void Main::cmdShow(int nCmdShow)
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
HINSTANCE Main::processInstance(void)
|
||||
{
|
||||
return smhInstance;
|
||||
}
|
||||
|
||||
inline
|
||||
HINSTANCE Main::previousProcessInstance(void)
|
||||
{
|
||||
return smhPrevInstance;
|
||||
}
|
||||
|
||||
#if defined(__FLAT__)
|
||||
inline
|
||||
HINSTANCE Main::processInstance(HWND hWnd)
|
||||
{
|
||||
return (HINSTANCE)::GetWindowLong(hWnd,GWL_HINSTANCE);
|
||||
}
|
||||
#else
|
||||
inline
|
||||
HINSTANCE Main::processInstance(HWND hWnd)
|
||||
{
|
||||
return (HINSTANCE)::GetWindowWord(hWnd,GWW_HINSTANCE);
|
||||
}
|
||||
#endif
|
||||
#define WM_REACTIVATE WM_USER+1
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
140
pop/MAINWND.CPP
Normal file
140
pop/MAINWND.CPP
Normal file
@@ -0,0 +1,140 @@
|
||||
#include <pop/mainwnd.hpp>
|
||||
#include <pop/pop.hpp>
|
||||
|
||||
char MainWindow::szClassName[]="POP3 client v1.00";
|
||||
char MainWindow::szMenuName[]="POP3";
|
||||
|
||||
MainWindow::MainWindow(HINSTANCE hInstance)
|
||||
: mPaintHandler(this,&MainWindow::paintHandler),
|
||||
mDestroyHandler(this,&MainWindow::destroyHandler),
|
||||
mCommandHandler(this,&MainWindow::commandHandler),
|
||||
mKeyDownHandler(this,&MainWindow::keyDownHandler),
|
||||
mSizeHandler(this,&MainWindow::sizeHandler),
|
||||
mCreateHandler(this,&MainWindow::createHandler),
|
||||
mTimerHandler(this,&MainWindow::timerHandler),
|
||||
mSetFocusHandler(this,&MainWindow::setFocusHandler),
|
||||
mhInstance(hInstance)
|
||||
{
|
||||
insertHandlers();
|
||||
registerClass();
|
||||
::CreateWindow(szClassName,szClassName,
|
||||
WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_SIZEBOX|WS_MINIMIZEBOX|WS_MAXIMIZEBOX|WS_DLGFRAME|WS_CLIPCHILDREN,
|
||||
CW_USEDEFAULT,CW_USEDEFAULT,
|
||||
CW_USEDEFAULT,CW_USEDEFAULT,
|
||||
NULL,NULL,mhInstance,(LPSTR)this);
|
||||
show(SW_SHOW);
|
||||
update();
|
||||
|
||||
Block<String> msgLines;
|
||||
WORD messages;
|
||||
WORD octets;
|
||||
|
||||
POPClient popClient;
|
||||
popClient.open("mailhost.li.net");
|
||||
if(!popClient.authenticate("europa","cygnus-x1"))
|
||||
{
|
||||
popClient.quit();
|
||||
popClient.close();
|
||||
return;
|
||||
}
|
||||
popClient.stat(messages,octets);
|
||||
popClient.top(msgLines,1);
|
||||
// for(int msgIndex=1;msgIndex<=messages;msgIndex++)popClient.retrieve(msgIndex,msgLines);
|
||||
popClient.quit();
|
||||
popClient.close();
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
destroy();
|
||||
}
|
||||
|
||||
void MainWindow::insertHandlers(void)
|
||||
{
|
||||
insertHandler(VectorHandler::DestroyHandler,&mDestroyHandler);
|
||||
insertHandler(VectorHandler::PaintHandler,&mPaintHandler);
|
||||
insertHandler(VectorHandler::CommandHandler,&mCommandHandler);
|
||||
insertHandler(VectorHandler::SizeHandler,&mSizeHandler);
|
||||
insertHandler(VectorHandler::KeyDownHandler,&mKeyDownHandler);
|
||||
insertHandler(VectorHandler::CreateHandler,&mCreateHandler);
|
||||
insertHandler(VectorHandler::TimerHandler,&mTimerHandler);
|
||||
insertHandler(VectorHandler::SetFocusHandler,&mSetFocusHandler);
|
||||
}
|
||||
|
||||
void MainWindow::removeHandlers(void)
|
||||
{
|
||||
removeHandler(VectorHandler::DestroyHandler,&mDestroyHandler);
|
||||
removeHandler(VectorHandler::PaintHandler,&mPaintHandler);
|
||||
removeHandler(VectorHandler::CommandHandler,&mCommandHandler);
|
||||
removeHandler(VectorHandler::SizeHandler,&mSizeHandler);
|
||||
removeHandler(VectorHandler::KeyDownHandler,&mKeyDownHandler);
|
||||
removeHandler(VectorHandler::CreateHandler,&mCreateHandler);
|
||||
removeHandler(VectorHandler::TimerHandler,&mTimerHandler);
|
||||
removeHandler(VectorHandler::SetFocusHandler,&mSetFocusHandler);
|
||||
}
|
||||
|
||||
void MainWindow::registerClass(void)const
|
||||
{
|
||||
WNDCLASS wndClass;
|
||||
|
||||
if(::GetClassInfo(mhInstance,className(),(WNDCLASS FAR*)&wndClass))return;
|
||||
wndClass.style =CS_HREDRAW|CS_VREDRAW|CS_DBLCLKS|CS_OWNDC;
|
||||
wndClass.lpfnWndProc =(WNDPROC)Window::WndProc;
|
||||
wndClass.cbClsExtra =0;
|
||||
wndClass.cbWndExtra =sizeof(MainWindow*);
|
||||
wndClass.hInstance =mhInstance;
|
||||
wndClass.hIcon =::LoadIcon(NULL,IDI_APPLICATION);
|
||||
wndClass.hCursor =::LoadCursor(NULL,IDC_ARROW);
|
||||
wndClass.hbrBackground =(HBRUSH)::GetStockObject(BLACK_BRUSH);
|
||||
wndClass.lpszMenuName =szMenuName;
|
||||
wndClass.lpszClassName =szClassName;
|
||||
::RegisterClass(&wndClass);
|
||||
assert(0!=::GetClassInfo(mhInstance,className(),(WNDCLASS FAR*)&wndClass));
|
||||
}
|
||||
|
||||
CallbackData::ReturnType MainWindow::destroyHandler(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
removeHandlers();
|
||||
::PostQuitMessage(0);
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType MainWindow::sizeHandler(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType MainWindow::commandHandler(CallbackData &someCallbackData)
|
||||
{
|
||||
switch(someCallbackData.wParam())
|
||||
{
|
||||
default :
|
||||
break;
|
||||
}
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType MainWindow::keyDownHandler(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType MainWindow::paintHandler(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType MainWindow::createHandler(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType MainWindow::timerHandler(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType MainWindow::setFocusHandler(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
56
pop/MAINWND.HPP
Normal file
56
pop/MAINWND.HPP
Normal file
@@ -0,0 +1,56 @@
|
||||
#ifndef _POP_MAINWINDOW_HPP_
|
||||
#define _POP_MAINWINDOW_HPP_
|
||||
#ifndef _COMMON_WINDOW_HPP_
|
||||
#include <common/window.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_STRING_HPP_
|
||||
#include <common/string.hpp>
|
||||
#endif
|
||||
#ifndef _SOCKET_WSADATA_HPP_
|
||||
#include <socket/wsadata.hpp>
|
||||
#endif
|
||||
|
||||
class MainWindow : public Window
|
||||
{
|
||||
public:
|
||||
MainWindow(HINSTANCE hInstance);
|
||||
virtual ~MainWindow();
|
||||
static String className(void);
|
||||
private:
|
||||
enum{TimerID=0};
|
||||
void registerClass(void)const;
|
||||
void insertHandlers(void);
|
||||
void removeHandlers(void);
|
||||
void message(const String &messageString);
|
||||
void message(Block<String> &messageStrings);
|
||||
CallbackData::ReturnType paintHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType destroyHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType commandHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType keyDownHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType sizeHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType createHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType timerHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType setFocusHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType lineHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType completionHandler(CallbackData &someCallbackData);
|
||||
|
||||
Callback<MainWindow> mPaintHandler;
|
||||
Callback<MainWindow> mDestroyHandler;
|
||||
Callback<MainWindow> mCommandHandler;
|
||||
Callback<MainWindow> mKeyDownHandler;
|
||||
Callback<MainWindow> mSizeHandler;
|
||||
Callback<MainWindow> mCreateHandler;
|
||||
Callback<MainWindow> mTimerHandler;
|
||||
Callback<MainWindow> mSetFocusHandler;
|
||||
static char szClassName[];
|
||||
static char szMenuName[];
|
||||
HINSTANCE mhInstance;
|
||||
WSASystem mWSASystem;
|
||||
};
|
||||
|
||||
inline
|
||||
String MainWindow::className(void)
|
||||
{
|
||||
return String(szClassName);
|
||||
}
|
||||
#endif
|
||||
206
pop/MTREECTL.CPP
Normal file
206
pop/MTREECTL.CPP
Normal file
@@ -0,0 +1,206 @@
|
||||
// MyTreeCtrl.cpp : implementation file
|
||||
//
|
||||
|
||||
// This is a part of the Microsoft Foundation Classes C++ library.
|
||||
// Copyright (C) 1992-1997 Microsoft Corporation
|
||||
// All rights reserved.
|
||||
//
|
||||
// This source code is only intended as a supplement to the
|
||||
// Microsoft Foundation Classes Reference and related
|
||||
// electronic documentation provided with the library.
|
||||
// See these sources for detailed information regarding the
|
||||
// Microsoft Foundation Classes product.
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "ctrldemo.h"
|
||||
#include "mtreectl.h"
|
||||
#include "treecpg.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMyTreeCtrl
|
||||
|
||||
CMyTreeCtrl::CMyTreeCtrl()
|
||||
{
|
||||
m_bDragging = FALSE;
|
||||
m_pimagelist = NULL;
|
||||
}
|
||||
|
||||
CMyTreeCtrl::~CMyTreeCtrl()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CMyTreeCtrl, CTreeCtrl)
|
||||
//{{AFX_MSG_MAP(CMyTreeCtrl)
|
||||
ON_NOTIFY_REFLECT(TVN_ENDLABELEDIT, OnEndLabelEdit)
|
||||
ON_NOTIFY_REFLECT(TVN_BEGINDRAG, OnBeginDrag)
|
||||
ON_NOTIFY_REFLECT(TVN_BEGINRDRAG, OnBeginDrag)
|
||||
ON_WM_MOUSEMOVE()
|
||||
ON_WM_DESTROY()
|
||||
ON_WM_LBUTTONUP()
|
||||
ON_WM_RBUTTONUP()
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMyTreeCtrl message handlers
|
||||
void CMyTreeCtrl::OnDestroy()
|
||||
{
|
||||
CImageList *pimagelist;
|
||||
|
||||
pimagelist = GetImageList(TVSIL_NORMAL);
|
||||
pimagelist->DeleteImageList();
|
||||
delete pimagelist;
|
||||
}
|
||||
|
||||
void CMyTreeCtrl::SetNewStyle(long lStyleMask, BOOL bSetBits)
|
||||
{
|
||||
long lStyleOld;
|
||||
|
||||
lStyleOld = GetWindowLong(m_hWnd, GWL_STYLE);
|
||||
lStyleOld &= ~lStyleMask;
|
||||
if (bSetBits)
|
||||
lStyleOld |= lStyleMask;
|
||||
|
||||
SetWindowLong(m_hWnd, GWL_STYLE, lStyleOld);
|
||||
SetWindowPos(NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER);
|
||||
}
|
||||
|
||||
void CMyTreeCtrl::OnEndLabelEdit(LPNMHDR pnmhdr, LRESULT *pLResult)
|
||||
{
|
||||
TV_DISPINFO *ptvinfo;
|
||||
|
||||
((CTreeCtrlPage *)GetParent())->ShowNotification(pnmhdr, pLResult);
|
||||
ptvinfo = (TV_DISPINFO *)pnmhdr;
|
||||
if (ptvinfo->item.pszText != NULL)
|
||||
{
|
||||
ptvinfo->item.mask = TVIF_TEXT;
|
||||
SetItem(&ptvinfo->item);
|
||||
}
|
||||
*pLResult = TRUE;
|
||||
}
|
||||
|
||||
void CMyTreeCtrl::OnMouseMove(UINT nFlags, CPoint point)
|
||||
{
|
||||
HTREEITEM hitem;
|
||||
UINT flags;
|
||||
|
||||
if (m_bDragging)
|
||||
{
|
||||
ASSERT(m_pimagelist != NULL);
|
||||
m_pimagelist->DragMove(point);
|
||||
if ((hitem = HitTest(point, &flags)) != NULL)
|
||||
{
|
||||
m_pimagelist->DragLeave(this);
|
||||
SelectDropTarget(hitem);
|
||||
m_hitemDrop = hitem;
|
||||
m_pimagelist->DragEnter(this, point);
|
||||
}
|
||||
}
|
||||
|
||||
CTreeCtrl::OnMouseMove(nFlags, point);
|
||||
}
|
||||
|
||||
BOOL CMyTreeCtrl::IsChildNodeOf(HTREEITEM hitemChild, HTREEITEM hitemSuspectedParent)
|
||||
{
|
||||
do
|
||||
{
|
||||
if (hitemChild == hitemSuspectedParent)
|
||||
break;
|
||||
}
|
||||
while ((hitemChild = GetParentItem(hitemChild)) != NULL);
|
||||
|
||||
return (hitemChild != NULL);
|
||||
}
|
||||
|
||||
|
||||
BOOL CMyTreeCtrl::TransferItem(HTREEITEM hitemDrag, HTREEITEM hitemDrop)
|
||||
{
|
||||
TV_INSERTSTRUCT tvstruct;
|
||||
TCHAR sztBuffer[50];
|
||||
HTREEITEM hNewItem, hFirstChild;
|
||||
|
||||
// avoid an infinite recursion situation
|
||||
tvstruct.item.hItem = hitemDrag;
|
||||
tvstruct.item.cchTextMax = 49;
|
||||
tvstruct.item.pszText = sztBuffer;
|
||||
tvstruct.item.mask = TVIF_CHILDREN | TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_TEXT;
|
||||
GetItem(&tvstruct.item); // get information of the dragged element
|
||||
tvstruct.hParent = hitemDrop;
|
||||
tvstruct.hInsertAfter = TVI_SORT;
|
||||
tvstruct.item.mask = TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_TEXT;
|
||||
hNewItem = InsertItem(&tvstruct);
|
||||
|
||||
while ((hFirstChild = GetChildItem(hitemDrag)) != NULL)
|
||||
{
|
||||
TransferItem(hFirstChild, hNewItem); // recursively transfer all the items
|
||||
DeleteItem(hFirstChild); // delete the first child and all its children
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CMyTreeCtrl::OnButtonUp()
|
||||
{
|
||||
if (m_bDragging)
|
||||
{
|
||||
ASSERT(m_pimagelist != NULL);
|
||||
m_pimagelist->DragLeave(this);
|
||||
m_pimagelist->EndDrag();
|
||||
delete m_pimagelist;
|
||||
m_pimagelist = NULL;
|
||||
|
||||
if (m_hitemDrag != m_hitemDrop && !IsChildNodeOf(m_hitemDrop, m_hitemDrag) &&
|
||||
GetParentItem(m_hitemDrag) != m_hitemDrop)
|
||||
{
|
||||
TransferItem(m_hitemDrag, m_hitemDrop);
|
||||
DeleteItem(m_hitemDrag);
|
||||
}
|
||||
else
|
||||
MessageBeep(0);
|
||||
|
||||
ReleaseCapture();
|
||||
m_bDragging = FALSE;
|
||||
SelectDropTarget(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
void CMyTreeCtrl::OnLButtonUp(UINT nFlags, CPoint point)
|
||||
{
|
||||
OnButtonUp();
|
||||
CTreeCtrl::OnLButtonUp(nFlags, point);
|
||||
}
|
||||
|
||||
void CMyTreeCtrl::OnRButtonUp(UINT nFlags, CPoint point)
|
||||
{
|
||||
OnButtonUp();
|
||||
CTreeCtrl::OnRButtonUp(nFlags, point);
|
||||
}
|
||||
|
||||
void CMyTreeCtrl::OnBeginDrag(LPNMHDR pnmhdr, LRESULT *pLResult)
|
||||
{
|
||||
CPoint ptAction;
|
||||
UINT nFlags;
|
||||
|
||||
GetCursorPos(&ptAction);
|
||||
ScreenToClient(&ptAction);
|
||||
((CTreeCtrlPage *)GetParent())->ShowNotification(pnmhdr, pLResult);
|
||||
ASSERT(!m_bDragging);
|
||||
m_bDragging = TRUE;
|
||||
m_hitemDrag = HitTest(ptAction, &nFlags);
|
||||
m_hitemDrop = NULL;
|
||||
|
||||
ASSERT(m_pimagelist == NULL);
|
||||
m_pimagelist = CreateDragImage(m_hitemDrag); // get the image list for dragging
|
||||
m_pimagelist->DragShowNolock(TRUE);
|
||||
m_pimagelist->SetDragCursorImage(0, CPoint(0, 0));
|
||||
m_pimagelist->BeginDrag(0, CPoint(0,0));
|
||||
m_pimagelist->DragMove(ptAction);
|
||||
m_pimagelist->DragEnter(this, ptAction);
|
||||
SetCapture();
|
||||
}
|
||||
807
pop/POP.BAK
Normal file
807
pop/POP.BAK
Normal file
@@ -0,0 +1,807 @@
|
||||
# Microsoft Developer Studio Generated NMAKE File, Format Version 4.20
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
!IF "$(CFG)" == ""
|
||||
CFG=pop - Win32 Debug
|
||||
!MESSAGE No configuration specified. Defaulting to pop - Win32 Debug.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" != "pop - Win32 Release" && "$(CFG)" != "pop - Win32 Debug"
|
||||
!MESSAGE Invalid configuration "$(CFG)" specified.
|
||||
!MESSAGE You can specify a configuration when running NMAKE on this makefile
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "Pop.mak" CFG="pop - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "pop - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "pop - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
!ERROR An invalid configuration is specified.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(OS)" == "Windows_NT"
|
||||
NULL=
|
||||
!ELSE
|
||||
NULL=nul
|
||||
!ENDIF
|
||||
################################################################################
|
||||
# Begin Project
|
||||
# PROP Target_Last_Scanned "pop - Win32 Debug"
|
||||
RSC=rc.exe
|
||||
MTL=mktyplib.exe
|
||||
CPP=cl.exe
|
||||
|
||||
!IF "$(CFG)" == "pop - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Target_Dir ""
|
||||
OUTDIR=.\Release
|
||||
INTDIR=.\Release
|
||||
|
||||
ALL : "$(OUTDIR)\Pop.exe"
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\Main.obj"
|
||||
-@erase "$(INTDIR)\Mainwnd.obj"
|
||||
-@erase "$(INTDIR)\pop.obj"
|
||||
-@erase "$(OUTDIR)\Pop.exe"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
|
||||
CPP_PROJ=/nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS"\
|
||||
/Fp"$(INTDIR)/Pop.pch" /YX /Fo"$(INTDIR)/" /c
|
||||
CPP_OBJS=.\Release/
|
||||
CPP_SBRS=.\.
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /win32
|
||||
MTL_PROJ=/nologo /D "NDEBUG" /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)/Pop.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
|
||||
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
|
||||
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
|
||||
odbccp32.lib /nologo /subsystem:windows /incremental:no\
|
||||
/pdb:"$(OUTDIR)/Pop.pdb" /machine:I386 /out:"$(OUTDIR)/Pop.exe"
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\Main.obj" \
|
||||
"$(INTDIR)\Mainwnd.obj" \
|
||||
"$(INTDIR)\pop.obj" \
|
||||
"..\Exe\mscommon.lib" \
|
||||
"..\Exe\mssocket.lib"
|
||||
|
||||
"$(OUTDIR)\Pop.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ELSEIF "$(CFG)" == "pop - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "msvcobj"
|
||||
# PROP Intermediate_Dir "msvcobj"
|
||||
# PROP Target_Dir ""
|
||||
OUTDIR=.\msvcobj
|
||||
INTDIR=.\msvcobj
|
||||
|
||||
ALL : "$(OUTDIR)\Pop.exe"
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\Main.obj"
|
||||
-@erase "$(INTDIR)\Mainwnd.obj"
|
||||
-@erase "$(INTDIR)\pop.obj"
|
||||
-@erase "$(INTDIR)\vc40.idb"
|
||||
-@erase "$(INTDIR)\vc40.pdb"
|
||||
-@erase "$(OUTDIR)\Pop.exe"
|
||||
-@erase "$(OUTDIR)\Pop.ilk"
|
||||
-@erase "$(OUTDIR)\Pop.pdb"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
|
||||
# ADD CPP /nologo /Zp1 /MTd /Gm /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__FLAT__" /D "STRICT" /Fp"c:\work\exe\msvc42.pch" /YX"windows.h" /c
|
||||
CPP_PROJ=/nologo /Zp1 /MTd /Gm /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D\
|
||||
"__FLAT__" /D "STRICT" /Fp"c:\work\exe\msvc42.pch" /YX"windows.h"\
|
||||
/Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c
|
||||
CPP_OBJS=.\msvcobj/
|
||||
CPP_SBRS=.\.
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /win32
|
||||
MTL_PROJ=/nologo /D "_DEBUG" /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)/Pop.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib wsock32.lib /nologo /subsystem:windows /debug /machine:I386
|
||||
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
|
||||
advapi32.lib shell32.lib uuid.lib wsock32.lib /nologo /subsystem:windows\
|
||||
/incremental:yes /pdb:"$(OUTDIR)/Pop.pdb" /debug /machine:I386\
|
||||
/out:"$(OUTDIR)/Pop.exe"
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\Main.obj" \
|
||||
"$(INTDIR)\Mainwnd.obj" \
|
||||
"$(INTDIR)\pop.obj" \
|
||||
"..\Exe\mscommon.lib" \
|
||||
"..\Exe\mssocket.lib"
|
||||
|
||||
"$(OUTDIR)\Pop.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ENDIF
|
||||
|
||||
.c{$(CPP_OBJS)}.obj:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.cpp{$(CPP_OBJS)}.obj:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.cxx{$(CPP_OBJS)}.obj:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.c{$(CPP_SBRS)}.sbr:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.cpp{$(CPP_SBRS)}.sbr:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.cxx{$(CPP_SBRS)}.sbr:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
################################################################################
|
||||
# Begin Target
|
||||
|
||||
# Name "pop - Win32 Release"
|
||||
# Name "pop - Win32 Debug"
|
||||
|
||||
!IF "$(CFG)" == "pop - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "pop - Win32 Debug"
|
||||
|
||||
!ENDIF
|
||||
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Mainwnd.cpp
|
||||
|
||||
!IF "$(CFG)" == "pop - Win32 Release"
|
||||
|
||||
DEP_CPP_MAINW=\
|
||||
{$(INCLUDE)}"\.\Mainwnd.hpp"\
|
||||
{$(INCLUDE)}"\.\Pop.hpp"\
|
||||
{$(INCLUDE)}"\Assert.h"\
|
||||
{$(INCLUDE)}"\Basetyps.h"\
|
||||
{$(INCLUDE)}"\Cderr.h"\
|
||||
{$(INCLUDE)}"\Cguid.h"\
|
||||
{$(INCLUDE)}"\Commdlg.h"\
|
||||
{$(INCLUDE)}"\Common\Assert.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.tpp"\
|
||||
{$(INCLUDE)}"\common\callback.hpp"\
|
||||
{$(INCLUDE)}"\common\callback.tpp"\
|
||||
{$(INCLUDE)}"\common\cbdata.hpp"\
|
||||
{$(INCLUDE)}"\common\cbptr.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.tpp"\
|
||||
{$(INCLUDE)}"\common\guiwnd.hpp"\
|
||||
{$(INCLUDE)}"\common\pcallbck.hpp"\
|
||||
{$(INCLUDE)}"\Common\Stdlib.hpp"\
|
||||
{$(INCLUDE)}"\Common\String.hpp"\
|
||||
{$(INCLUDE)}"\Common\Types.hpp"\
|
||||
{$(INCLUDE)}"\common\vhandler.hpp"\
|
||||
{$(INCLUDE)}"\Common\Window.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windows.hpp"\
|
||||
{$(INCLUDE)}"\common\windowsx.hpp"\
|
||||
{$(INCLUDE)}"\Common\Winsock.hpp"\
|
||||
{$(INCLUDE)}"\Ctype.h"\
|
||||
{$(INCLUDE)}"\Dde.h"\
|
||||
{$(INCLUDE)}"\Ddeml.h"\
|
||||
{$(INCLUDE)}"\Dlgs.h"\
|
||||
{$(INCLUDE)}"\Excpt.h"\
|
||||
{$(INCLUDE)}"\Imm.h"\
|
||||
{$(INCLUDE)}"\Lzexpand.h"\
|
||||
{$(INCLUDE)}"\Mcx.h"\
|
||||
{$(INCLUDE)}"\Mmsystem.h"\
|
||||
{$(INCLUDE)}"\Mswsock.h"\
|
||||
{$(INCLUDE)}"\Nb30.h"\
|
||||
{$(INCLUDE)}"\Nspapi.h"\
|
||||
{$(INCLUDE)}"\Oaidl.h"\
|
||||
{$(INCLUDE)}"\Objbase.h"\
|
||||
{$(INCLUDE)}"\Objidl.h"\
|
||||
{$(INCLUDE)}"\Ole.h"\
|
||||
{$(INCLUDE)}"\Ole2.h"\
|
||||
{$(INCLUDE)}"\Oleauto.h"\
|
||||
{$(INCLUDE)}"\Oleidl.h"\
|
||||
{$(INCLUDE)}"\Poppack.h"\
|
||||
{$(INCLUDE)}"\Prsht.h"\
|
||||
{$(INCLUDE)}"\Pshpack1.h"\
|
||||
{$(INCLUDE)}"\Pshpack2.h"\
|
||||
{$(INCLUDE)}"\Pshpack4.h"\
|
||||
{$(INCLUDE)}"\Pshpack8.h"\
|
||||
{$(INCLUDE)}"\Rpc.h"\
|
||||
{$(INCLUDE)}"\Rpcdce.h"\
|
||||
{$(INCLUDE)}"\Rpcdcep.h"\
|
||||
{$(INCLUDE)}"\Rpcndr.h"\
|
||||
{$(INCLUDE)}"\Rpcnsi.h"\
|
||||
{$(INCLUDE)}"\Rpcnsip.h"\
|
||||
{$(INCLUDE)}"\Rpcnterr.h"\
|
||||
{$(INCLUDE)}"\Shellapi.h"\
|
||||
{$(INCLUDE)}"\Socket\Cache.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Inaddr.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Intsaddr.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Socket.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Timeinfo.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Wsadata.hpp"\
|
||||
{$(INCLUDE)}"\Stdarg.h"\
|
||||
{$(INCLUDE)}"\Stdio.h"\
|
||||
{$(INCLUDE)}"\Stdlib.h"\
|
||||
{$(INCLUDE)}"\String.h"\
|
||||
{$(INCLUDE)}"\Svcguid.h"\
|
||||
{$(INCLUDE)}"\Unknwn.h"\
|
||||
{$(INCLUDE)}"\Winbase.h"\
|
||||
{$(INCLUDE)}"\Wincon.h"\
|
||||
{$(INCLUDE)}"\Wincrypt.h"\
|
||||
{$(INCLUDE)}"\Windef.h"\
|
||||
{$(INCLUDE)}"\Windows.h"\
|
||||
{$(INCLUDE)}"\windowsx.h"\
|
||||
{$(INCLUDE)}"\Winerror.h"\
|
||||
{$(INCLUDE)}"\Wingdi.h"\
|
||||
{$(INCLUDE)}"\Winnetwk.h"\
|
||||
{$(INCLUDE)}"\Winnls.h"\
|
||||
{$(INCLUDE)}"\Winnt.h"\
|
||||
{$(INCLUDE)}"\Winperf.h"\
|
||||
{$(INCLUDE)}"\Winreg.h"\
|
||||
{$(INCLUDE)}"\Winsock.h"\
|
||||
{$(INCLUDE)}"\Winsock2.h"\
|
||||
{$(INCLUDE)}"\Winspool.h"\
|
||||
{$(INCLUDE)}"\Winsvc.h"\
|
||||
{$(INCLUDE)}"\Winuser.h"\
|
||||
{$(INCLUDE)}"\Winver.h"\
|
||||
{$(INCLUDE)}"\Wtypes.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\Mainwnd.obj" : $(SOURCE) $(DEP_CPP_MAINW) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "pop - Win32 Debug"
|
||||
|
||||
DEP_CPP_MAINW=\
|
||||
{$(INCLUDE)}"\.\Mainwnd.hpp"\
|
||||
{$(INCLUDE)}"\.\Pop.hpp"\
|
||||
{$(INCLUDE)}"\Assert.h"\
|
||||
{$(INCLUDE)}"\Basetyps.h"\
|
||||
{$(INCLUDE)}"\Cderr.h"\
|
||||
{$(INCLUDE)}"\Cguid.h"\
|
||||
{$(INCLUDE)}"\Commdlg.h"\
|
||||
{$(INCLUDE)}"\Common\Assert.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.tpp"\
|
||||
{$(INCLUDE)}"\common\callback.hpp"\
|
||||
{$(INCLUDE)}"\common\callback.tpp"\
|
||||
{$(INCLUDE)}"\common\cbdata.hpp"\
|
||||
{$(INCLUDE)}"\common\cbptr.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.tpp"\
|
||||
{$(INCLUDE)}"\common\guiwnd.hpp"\
|
||||
{$(INCLUDE)}"\common\pcallbck.hpp"\
|
||||
{$(INCLUDE)}"\Common\Stdlib.hpp"\
|
||||
{$(INCLUDE)}"\Common\String.hpp"\
|
||||
{$(INCLUDE)}"\Common\Types.hpp"\
|
||||
{$(INCLUDE)}"\common\vhandler.hpp"\
|
||||
{$(INCLUDE)}"\Common\Window.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windows.hpp"\
|
||||
{$(INCLUDE)}"\common\windowsx.hpp"\
|
||||
{$(INCLUDE)}"\Common\Winsock.hpp"\
|
||||
{$(INCLUDE)}"\Ctype.h"\
|
||||
{$(INCLUDE)}"\Dde.h"\
|
||||
{$(INCLUDE)}"\Ddeml.h"\
|
||||
{$(INCLUDE)}"\Dlgs.h"\
|
||||
{$(INCLUDE)}"\Excpt.h"\
|
||||
{$(INCLUDE)}"\Imm.h"\
|
||||
{$(INCLUDE)}"\Lzexpand.h"\
|
||||
{$(INCLUDE)}"\Mcx.h"\
|
||||
{$(INCLUDE)}"\Mmsystem.h"\
|
||||
{$(INCLUDE)}"\Mswsock.h"\
|
||||
{$(INCLUDE)}"\Nb30.h"\
|
||||
{$(INCLUDE)}"\Nspapi.h"\
|
||||
{$(INCLUDE)}"\Oaidl.h"\
|
||||
{$(INCLUDE)}"\Objbase.h"\
|
||||
{$(INCLUDE)}"\Objidl.h"\
|
||||
{$(INCLUDE)}"\Ole.h"\
|
||||
{$(INCLUDE)}"\Ole2.h"\
|
||||
{$(INCLUDE)}"\Oleauto.h"\
|
||||
{$(INCLUDE)}"\Oleidl.h"\
|
||||
{$(INCLUDE)}"\Poppack.h"\
|
||||
{$(INCLUDE)}"\Prsht.h"\
|
||||
{$(INCLUDE)}"\Pshpack1.h"\
|
||||
{$(INCLUDE)}"\Pshpack2.h"\
|
||||
{$(INCLUDE)}"\Pshpack4.h"\
|
||||
{$(INCLUDE)}"\Pshpack8.h"\
|
||||
{$(INCLUDE)}"\Rpc.h"\
|
||||
{$(INCLUDE)}"\Rpcdce.h"\
|
||||
{$(INCLUDE)}"\Rpcdcep.h"\
|
||||
{$(INCLUDE)}"\Rpcndr.h"\
|
||||
{$(INCLUDE)}"\Rpcnsi.h"\
|
||||
{$(INCLUDE)}"\Rpcnsip.h"\
|
||||
{$(INCLUDE)}"\Rpcnterr.h"\
|
||||
{$(INCLUDE)}"\Shellapi.h"\
|
||||
{$(INCLUDE)}"\Socket\Cache.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Inaddr.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Intsaddr.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Socket.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Timeinfo.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Wsadata.hpp"\
|
||||
{$(INCLUDE)}"\Stdarg.h"\
|
||||
{$(INCLUDE)}"\Stdio.h"\
|
||||
{$(INCLUDE)}"\Stdlib.h"\
|
||||
{$(INCLUDE)}"\String.h"\
|
||||
{$(INCLUDE)}"\Svcguid.h"\
|
||||
{$(INCLUDE)}"\Unknwn.h"\
|
||||
{$(INCLUDE)}"\Winbase.h"\
|
||||
{$(INCLUDE)}"\Wincon.h"\
|
||||
{$(INCLUDE)}"\Wincrypt.h"\
|
||||
{$(INCLUDE)}"\Windef.h"\
|
||||
{$(INCLUDE)}"\Windows.h"\
|
||||
{$(INCLUDE)}"\windowsx.h"\
|
||||
{$(INCLUDE)}"\Winerror.h"\
|
||||
{$(INCLUDE)}"\Wingdi.h"\
|
||||
{$(INCLUDE)}"\Winnetwk.h"\
|
||||
{$(INCLUDE)}"\Winnls.h"\
|
||||
{$(INCLUDE)}"\Winnt.h"\
|
||||
{$(INCLUDE)}"\Winperf.h"\
|
||||
{$(INCLUDE)}"\Winreg.h"\
|
||||
{$(INCLUDE)}"\Winsock.h"\
|
||||
{$(INCLUDE)}"\Winsock2.h"\
|
||||
{$(INCLUDE)}"\Winspool.h"\
|
||||
{$(INCLUDE)}"\Winsvc.h"\
|
||||
{$(INCLUDE)}"\Winuser.h"\
|
||||
{$(INCLUDE)}"\Winver.h"\
|
||||
{$(INCLUDE)}"\Wtypes.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\Mainwnd.obj" : $(SOURCE) $(DEP_CPP_MAINW) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Main.cpp
|
||||
|
||||
!IF "$(CFG)" == "pop - Win32 Release"
|
||||
|
||||
DEP_CPP_MAIN_=\
|
||||
{$(INCLUDE)}"\.\Main.hpp"\
|
||||
{$(INCLUDE)}"\.\Mainwnd.hpp"\
|
||||
{$(INCLUDE)}"\Assert.h"\
|
||||
{$(INCLUDE)}"\Basetyps.h"\
|
||||
{$(INCLUDE)}"\Cderr.h"\
|
||||
{$(INCLUDE)}"\Cguid.h"\
|
||||
{$(INCLUDE)}"\Commdlg.h"\
|
||||
{$(INCLUDE)}"\Common\Assert.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.tpp"\
|
||||
{$(INCLUDE)}"\common\callback.hpp"\
|
||||
{$(INCLUDE)}"\common\callback.tpp"\
|
||||
{$(INCLUDE)}"\common\cbdata.hpp"\
|
||||
{$(INCLUDE)}"\common\cbptr.hpp"\
|
||||
{$(INCLUDE)}"\common\guiwnd.hpp"\
|
||||
{$(INCLUDE)}"\common\pcallbck.hpp"\
|
||||
{$(INCLUDE)}"\Common\Stdlib.hpp"\
|
||||
{$(INCLUDE)}"\Common\String.hpp"\
|
||||
{$(INCLUDE)}"\common\vhandler.hpp"\
|
||||
{$(INCLUDE)}"\Common\Window.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windows.hpp"\
|
||||
{$(INCLUDE)}"\common\windowsx.hpp"\
|
||||
{$(INCLUDE)}"\Common\Winsock.hpp"\
|
||||
{$(INCLUDE)}"\Ctype.h"\
|
||||
{$(INCLUDE)}"\Dde.h"\
|
||||
{$(INCLUDE)}"\Ddeml.h"\
|
||||
{$(INCLUDE)}"\Dlgs.h"\
|
||||
{$(INCLUDE)}"\Excpt.h"\
|
||||
{$(INCLUDE)}"\Imm.h"\
|
||||
{$(INCLUDE)}"\Lzexpand.h"\
|
||||
{$(INCLUDE)}"\Mcx.h"\
|
||||
{$(INCLUDE)}"\Mmsystem.h"\
|
||||
{$(INCLUDE)}"\Mswsock.h"\
|
||||
{$(INCLUDE)}"\Nb30.h"\
|
||||
{$(INCLUDE)}"\Nspapi.h"\
|
||||
{$(INCLUDE)}"\Oaidl.h"\
|
||||
{$(INCLUDE)}"\Objbase.h"\
|
||||
{$(INCLUDE)}"\Objidl.h"\
|
||||
{$(INCLUDE)}"\Ole.h"\
|
||||
{$(INCLUDE)}"\Ole2.h"\
|
||||
{$(INCLUDE)}"\Oleauto.h"\
|
||||
{$(INCLUDE)}"\Oleidl.h"\
|
||||
{$(INCLUDE)}"\Poppack.h"\
|
||||
{$(INCLUDE)}"\Prsht.h"\
|
||||
{$(INCLUDE)}"\Pshpack1.h"\
|
||||
{$(INCLUDE)}"\Pshpack2.h"\
|
||||
{$(INCLUDE)}"\Pshpack4.h"\
|
||||
{$(INCLUDE)}"\Pshpack8.h"\
|
||||
{$(INCLUDE)}"\Rpc.h"\
|
||||
{$(INCLUDE)}"\Rpcdce.h"\
|
||||
{$(INCLUDE)}"\Rpcdcep.h"\
|
||||
{$(INCLUDE)}"\Rpcndr.h"\
|
||||
{$(INCLUDE)}"\Rpcnsi.h"\
|
||||
{$(INCLUDE)}"\Rpcnsip.h"\
|
||||
{$(INCLUDE)}"\Rpcnterr.h"\
|
||||
{$(INCLUDE)}"\Shellapi.h"\
|
||||
{$(INCLUDE)}"\Socket\Wsadata.hpp"\
|
||||
{$(INCLUDE)}"\Stdarg.h"\
|
||||
{$(INCLUDE)}"\Stdlib.h"\
|
||||
{$(INCLUDE)}"\String.h"\
|
||||
{$(INCLUDE)}"\Svcguid.h"\
|
||||
{$(INCLUDE)}"\Unknwn.h"\
|
||||
{$(INCLUDE)}"\Winbase.h"\
|
||||
{$(INCLUDE)}"\Wincon.h"\
|
||||
{$(INCLUDE)}"\Wincrypt.h"\
|
||||
{$(INCLUDE)}"\Windef.h"\
|
||||
{$(INCLUDE)}"\Windows.h"\
|
||||
{$(INCLUDE)}"\windowsx.h"\
|
||||
{$(INCLUDE)}"\Winerror.h"\
|
||||
{$(INCLUDE)}"\Wingdi.h"\
|
||||
{$(INCLUDE)}"\Winnetwk.h"\
|
||||
{$(INCLUDE)}"\Winnls.h"\
|
||||
{$(INCLUDE)}"\Winnt.h"\
|
||||
{$(INCLUDE)}"\Winperf.h"\
|
||||
{$(INCLUDE)}"\Winreg.h"\
|
||||
{$(INCLUDE)}"\Winsock.h"\
|
||||
{$(INCLUDE)}"\Winsock2.h"\
|
||||
{$(INCLUDE)}"\Winspool.h"\
|
||||
{$(INCLUDE)}"\Winsvc.h"\
|
||||
{$(INCLUDE)}"\Winuser.h"\
|
||||
{$(INCLUDE)}"\Winver.h"\
|
||||
{$(INCLUDE)}"\Wtypes.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\Main.obj" : $(SOURCE) $(DEP_CPP_MAIN_) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "pop - Win32 Debug"
|
||||
|
||||
DEP_CPP_MAIN_=\
|
||||
{$(INCLUDE)}"\.\Main.hpp"\
|
||||
{$(INCLUDE)}"\.\Mainwnd.hpp"\
|
||||
{$(INCLUDE)}"\Assert.h"\
|
||||
{$(INCLUDE)}"\Basetyps.h"\
|
||||
{$(INCLUDE)}"\Cderr.h"\
|
||||
{$(INCLUDE)}"\Cguid.h"\
|
||||
{$(INCLUDE)}"\Commdlg.h"\
|
||||
{$(INCLUDE)}"\Common\Assert.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.tpp"\
|
||||
{$(INCLUDE)}"\common\callback.hpp"\
|
||||
{$(INCLUDE)}"\common\callback.tpp"\
|
||||
{$(INCLUDE)}"\common\cbdata.hpp"\
|
||||
{$(INCLUDE)}"\common\cbptr.hpp"\
|
||||
{$(INCLUDE)}"\common\guiwnd.hpp"\
|
||||
{$(INCLUDE)}"\common\pcallbck.hpp"\
|
||||
{$(INCLUDE)}"\Common\Stdlib.hpp"\
|
||||
{$(INCLUDE)}"\Common\String.hpp"\
|
||||
{$(INCLUDE)}"\common\vhandler.hpp"\
|
||||
{$(INCLUDE)}"\Common\Window.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windows.hpp"\
|
||||
{$(INCLUDE)}"\common\windowsx.hpp"\
|
||||
{$(INCLUDE)}"\Common\Winsock.hpp"\
|
||||
{$(INCLUDE)}"\Ctype.h"\
|
||||
{$(INCLUDE)}"\Dde.h"\
|
||||
{$(INCLUDE)}"\Ddeml.h"\
|
||||
{$(INCLUDE)}"\Dlgs.h"\
|
||||
{$(INCLUDE)}"\Excpt.h"\
|
||||
{$(INCLUDE)}"\Imm.h"\
|
||||
{$(INCLUDE)}"\Lzexpand.h"\
|
||||
{$(INCLUDE)}"\Mcx.h"\
|
||||
{$(INCLUDE)}"\Mmsystem.h"\
|
||||
{$(INCLUDE)}"\Mswsock.h"\
|
||||
{$(INCLUDE)}"\Nb30.h"\
|
||||
{$(INCLUDE)}"\Nspapi.h"\
|
||||
{$(INCLUDE)}"\Oaidl.h"\
|
||||
{$(INCLUDE)}"\Objbase.h"\
|
||||
{$(INCLUDE)}"\Objidl.h"\
|
||||
{$(INCLUDE)}"\Ole.h"\
|
||||
{$(INCLUDE)}"\Ole2.h"\
|
||||
{$(INCLUDE)}"\Oleauto.h"\
|
||||
{$(INCLUDE)}"\Oleidl.h"\
|
||||
{$(INCLUDE)}"\Poppack.h"\
|
||||
{$(INCLUDE)}"\Prsht.h"\
|
||||
{$(INCLUDE)}"\Pshpack1.h"\
|
||||
{$(INCLUDE)}"\Pshpack2.h"\
|
||||
{$(INCLUDE)}"\Pshpack4.h"\
|
||||
{$(INCLUDE)}"\Pshpack8.h"\
|
||||
{$(INCLUDE)}"\Rpc.h"\
|
||||
{$(INCLUDE)}"\Rpcdce.h"\
|
||||
{$(INCLUDE)}"\Rpcdcep.h"\
|
||||
{$(INCLUDE)}"\Rpcndr.h"\
|
||||
{$(INCLUDE)}"\Rpcnsi.h"\
|
||||
{$(INCLUDE)}"\Rpcnsip.h"\
|
||||
{$(INCLUDE)}"\Rpcnterr.h"\
|
||||
{$(INCLUDE)}"\Shellapi.h"\
|
||||
{$(INCLUDE)}"\Socket\Wsadata.hpp"\
|
||||
{$(INCLUDE)}"\Stdarg.h"\
|
||||
{$(INCLUDE)}"\Stdlib.h"\
|
||||
{$(INCLUDE)}"\String.h"\
|
||||
{$(INCLUDE)}"\Svcguid.h"\
|
||||
{$(INCLUDE)}"\Unknwn.h"\
|
||||
{$(INCLUDE)}"\Winbase.h"\
|
||||
{$(INCLUDE)}"\Wincon.h"\
|
||||
{$(INCLUDE)}"\Wincrypt.h"\
|
||||
{$(INCLUDE)}"\Windef.h"\
|
||||
{$(INCLUDE)}"\Windows.h"\
|
||||
{$(INCLUDE)}"\windowsx.h"\
|
||||
{$(INCLUDE)}"\Winerror.h"\
|
||||
{$(INCLUDE)}"\Wingdi.h"\
|
||||
{$(INCLUDE)}"\Winnetwk.h"\
|
||||
{$(INCLUDE)}"\Winnls.h"\
|
||||
{$(INCLUDE)}"\Winnt.h"\
|
||||
{$(INCLUDE)}"\Winperf.h"\
|
||||
{$(INCLUDE)}"\Winreg.h"\
|
||||
{$(INCLUDE)}"\Winsock.h"\
|
||||
{$(INCLUDE)}"\Winsock2.h"\
|
||||
{$(INCLUDE)}"\Winspool.h"\
|
||||
{$(INCLUDE)}"\Winsvc.h"\
|
||||
{$(INCLUDE)}"\Winuser.h"\
|
||||
{$(INCLUDE)}"\Winver.h"\
|
||||
{$(INCLUDE)}"\Wtypes.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\Main.obj" : $(SOURCE) $(DEP_CPP_MAIN_) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=\work\Exe\mscommon.lib
|
||||
|
||||
!IF "$(CFG)" == "pop - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "pop - Win32 Debug"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=\work\Exe\mssocket.lib
|
||||
|
||||
!IF "$(CFG)" == "pop - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "pop - Win32 Debug"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\pop.Cpp
|
||||
|
||||
!IF "$(CFG)" == "pop - Win32 Release"
|
||||
|
||||
DEP_CPP_POP_C=\
|
||||
{$(INCLUDE)}"\.\Pop.hpp"\
|
||||
{$(INCLUDE)}"\Assert.h"\
|
||||
{$(INCLUDE)}"\Basetyps.h"\
|
||||
{$(INCLUDE)}"\Cderr.h"\
|
||||
{$(INCLUDE)}"\Cguid.h"\
|
||||
{$(INCLUDE)}"\Commdlg.h"\
|
||||
{$(INCLUDE)}"\Common\Assert.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.tpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.tpp"\
|
||||
{$(INCLUDE)}"\Common\Stdlib.hpp"\
|
||||
{$(INCLUDE)}"\Common\String.hpp"\
|
||||
{$(INCLUDE)}"\Common\Types.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windows.hpp"\
|
||||
{$(INCLUDE)}"\Common\Winsock.hpp"\
|
||||
{$(INCLUDE)}"\Ctype.h"\
|
||||
{$(INCLUDE)}"\Dde.h"\
|
||||
{$(INCLUDE)}"\Ddeml.h"\
|
||||
{$(INCLUDE)}"\Dlgs.h"\
|
||||
{$(INCLUDE)}"\Excpt.h"\
|
||||
{$(INCLUDE)}"\Imm.h"\
|
||||
{$(INCLUDE)}"\Lzexpand.h"\
|
||||
{$(INCLUDE)}"\Mcx.h"\
|
||||
{$(INCLUDE)}"\Mmsystem.h"\
|
||||
{$(INCLUDE)}"\Mswsock.h"\
|
||||
{$(INCLUDE)}"\Nb30.h"\
|
||||
{$(INCLUDE)}"\Nspapi.h"\
|
||||
{$(INCLUDE)}"\Oaidl.h"\
|
||||
{$(INCLUDE)}"\Objbase.h"\
|
||||
{$(INCLUDE)}"\Objidl.h"\
|
||||
{$(INCLUDE)}"\Ole.h"\
|
||||
{$(INCLUDE)}"\Ole2.h"\
|
||||
{$(INCLUDE)}"\Oleauto.h"\
|
||||
{$(INCLUDE)}"\Oleidl.h"\
|
||||
{$(INCLUDE)}"\Poppack.h"\
|
||||
{$(INCLUDE)}"\Prsht.h"\
|
||||
{$(INCLUDE)}"\Pshpack1.h"\
|
||||
{$(INCLUDE)}"\Pshpack2.h"\
|
||||
{$(INCLUDE)}"\Pshpack4.h"\
|
||||
{$(INCLUDE)}"\Pshpack8.h"\
|
||||
{$(INCLUDE)}"\Rpc.h"\
|
||||
{$(INCLUDE)}"\Rpcdce.h"\
|
||||
{$(INCLUDE)}"\Rpcdcep.h"\
|
||||
{$(INCLUDE)}"\Rpcndr.h"\
|
||||
{$(INCLUDE)}"\Rpcnsi.h"\
|
||||
{$(INCLUDE)}"\Rpcnsip.h"\
|
||||
{$(INCLUDE)}"\Rpcnterr.h"\
|
||||
{$(INCLUDE)}"\Shellapi.h"\
|
||||
{$(INCLUDE)}"\Socket\Cache.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Hostent.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Inaddr.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Intsaddr.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Servent.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Socket.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Timeinfo.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Wsadata.hpp"\
|
||||
{$(INCLUDE)}"\Stdarg.h"\
|
||||
{$(INCLUDE)}"\Stdio.h"\
|
||||
{$(INCLUDE)}"\Stdlib.h"\
|
||||
{$(INCLUDE)}"\String.h"\
|
||||
{$(INCLUDE)}"\Svcguid.h"\
|
||||
{$(INCLUDE)}"\Unknwn.h"\
|
||||
{$(INCLUDE)}"\Winbase.h"\
|
||||
{$(INCLUDE)}"\Wincon.h"\
|
||||
{$(INCLUDE)}"\Wincrypt.h"\
|
||||
{$(INCLUDE)}"\Windef.h"\
|
||||
{$(INCLUDE)}"\Windows.h"\
|
||||
{$(INCLUDE)}"\Winerror.h"\
|
||||
{$(INCLUDE)}"\Wingdi.h"\
|
||||
{$(INCLUDE)}"\Winnetwk.h"\
|
||||
{$(INCLUDE)}"\Winnls.h"\
|
||||
{$(INCLUDE)}"\Winnt.h"\
|
||||
{$(INCLUDE)}"\Winperf.h"\
|
||||
{$(INCLUDE)}"\Winreg.h"\
|
||||
{$(INCLUDE)}"\Winsock.h"\
|
||||
{$(INCLUDE)}"\Winsock2.h"\
|
||||
{$(INCLUDE)}"\Winspool.h"\
|
||||
{$(INCLUDE)}"\Winsvc.h"\
|
||||
{$(INCLUDE)}"\Winuser.h"\
|
||||
{$(INCLUDE)}"\Winver.h"\
|
||||
{$(INCLUDE)}"\Wtypes.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\pop.obj" : $(SOURCE) $(DEP_CPP_POP_C) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "pop - Win32 Debug"
|
||||
|
||||
DEP_CPP_POP_C=\
|
||||
{$(INCLUDE)}"\.\Pop.hpp"\
|
||||
{$(INCLUDE)}"\Assert.h"\
|
||||
{$(INCLUDE)}"\Basetyps.h"\
|
||||
{$(INCLUDE)}"\Cderr.h"\
|
||||
{$(INCLUDE)}"\Cguid.h"\
|
||||
{$(INCLUDE)}"\Commdlg.h"\
|
||||
{$(INCLUDE)}"\Common\Assert.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.tpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.tpp"\
|
||||
{$(INCLUDE)}"\Common\Stdlib.hpp"\
|
||||
{$(INCLUDE)}"\Common\String.hpp"\
|
||||
{$(INCLUDE)}"\Common\Types.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windows.hpp"\
|
||||
{$(INCLUDE)}"\Common\Winsock.hpp"\
|
||||
{$(INCLUDE)}"\Ctype.h"\
|
||||
{$(INCLUDE)}"\Dde.h"\
|
||||
{$(INCLUDE)}"\Ddeml.h"\
|
||||
{$(INCLUDE)}"\Dlgs.h"\
|
||||
{$(INCLUDE)}"\Excpt.h"\
|
||||
{$(INCLUDE)}"\Imm.h"\
|
||||
{$(INCLUDE)}"\Lzexpand.h"\
|
||||
{$(INCLUDE)}"\Mcx.h"\
|
||||
{$(INCLUDE)}"\Mmsystem.h"\
|
||||
{$(INCLUDE)}"\Mswsock.h"\
|
||||
{$(INCLUDE)}"\Nb30.h"\
|
||||
{$(INCLUDE)}"\Nspapi.h"\
|
||||
{$(INCLUDE)}"\Oaidl.h"\
|
||||
{$(INCLUDE)}"\Objbase.h"\
|
||||
{$(INCLUDE)}"\Objidl.h"\
|
||||
{$(INCLUDE)}"\Ole.h"\
|
||||
{$(INCLUDE)}"\Ole2.h"\
|
||||
{$(INCLUDE)}"\Oleauto.h"\
|
||||
{$(INCLUDE)}"\Oleidl.h"\
|
||||
{$(INCLUDE)}"\Poppack.h"\
|
||||
{$(INCLUDE)}"\Prsht.h"\
|
||||
{$(INCLUDE)}"\Pshpack1.h"\
|
||||
{$(INCLUDE)}"\Pshpack2.h"\
|
||||
{$(INCLUDE)}"\Pshpack4.h"\
|
||||
{$(INCLUDE)}"\Pshpack8.h"\
|
||||
{$(INCLUDE)}"\Rpc.h"\
|
||||
{$(INCLUDE)}"\Rpcdce.h"\
|
||||
{$(INCLUDE)}"\Rpcdcep.h"\
|
||||
{$(INCLUDE)}"\Rpcndr.h"\
|
||||
{$(INCLUDE)}"\Rpcnsi.h"\
|
||||
{$(INCLUDE)}"\Rpcnsip.h"\
|
||||
{$(INCLUDE)}"\Rpcnterr.h"\
|
||||
{$(INCLUDE)}"\Shellapi.h"\
|
||||
{$(INCLUDE)}"\Socket\Cache.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Hostent.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Inaddr.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Intsaddr.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Servent.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Socket.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Timeinfo.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Wsadata.hpp"\
|
||||
{$(INCLUDE)}"\Stdarg.h"\
|
||||
{$(INCLUDE)}"\Stdio.h"\
|
||||
{$(INCLUDE)}"\Stdlib.h"\
|
||||
{$(INCLUDE)}"\String.h"\
|
||||
{$(INCLUDE)}"\Svcguid.h"\
|
||||
{$(INCLUDE)}"\Unknwn.h"\
|
||||
{$(INCLUDE)}"\Winbase.h"\
|
||||
{$(INCLUDE)}"\Wincon.h"\
|
||||
{$(INCLUDE)}"\Wincrypt.h"\
|
||||
{$(INCLUDE)}"\Windef.h"\
|
||||
{$(INCLUDE)}"\Windows.h"\
|
||||
{$(INCLUDE)}"\Winerror.h"\
|
||||
{$(INCLUDE)}"\Wingdi.h"\
|
||||
{$(INCLUDE)}"\Winnetwk.h"\
|
||||
{$(INCLUDE)}"\Winnls.h"\
|
||||
{$(INCLUDE)}"\Winnt.h"\
|
||||
{$(INCLUDE)}"\Winperf.h"\
|
||||
{$(INCLUDE)}"\Winreg.h"\
|
||||
{$(INCLUDE)}"\Winsock.h"\
|
||||
{$(INCLUDE)}"\Winsock2.h"\
|
||||
{$(INCLUDE)}"\Winspool.h"\
|
||||
{$(INCLUDE)}"\Winsvc.h"\
|
||||
{$(INCLUDE)}"\Winuser.h"\
|
||||
{$(INCLUDE)}"\Winver.h"\
|
||||
{$(INCLUDE)}"\Wtypes.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\pop.obj" : $(SOURCE) $(DEP_CPP_POP_C) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
################################################################################
|
||||
188
pop/POP.CPP
Normal file
188
pop/POP.CPP
Normal file
@@ -0,0 +1,188 @@
|
||||
#include <pop/pop.hpp>
|
||||
#include <socket/hostent.hpp>
|
||||
#include <socket/servent.hpp>
|
||||
|
||||
POPClient::POPClient(void)
|
||||
: mSpace(" "), mIsLoggedIn(FALSE)
|
||||
{
|
||||
createCmds();
|
||||
createStats();
|
||||
}
|
||||
|
||||
POPClient::~POPClient()
|
||||
{
|
||||
}
|
||||
|
||||
BOOL POPClient::open(const String &hostName)
|
||||
{
|
||||
HostEnt hostEntry;
|
||||
ServEnt serverEntry;
|
||||
Block<String> responseLines;
|
||||
INETSocketAddress internetSocketAddress;
|
||||
|
||||
if(hostName.isNull())return FALSE;
|
||||
if(mPOPControl.isConnected())mPOPControl.closeSocket();
|
||||
message(String("trying ")+hostName+String("..."));
|
||||
if(!mWSASystem.isInitialized()){message("WINSOCK initialization failure.");return FALSE;}
|
||||
InternetAddress internetAddress(hostName);
|
||||
if(!internetAddress.isZero()){if(!hostEntry.hostByAddress(internetAddress)){return FALSE;}}
|
||||
else if(!hostEntry.hostByName(hostName)){return FALSE;}
|
||||
if(!internetAddress.isZero()){if(!hostEntry.hostByAddress(internetAddress)){message(String("no DNS entry for ")+hostName);return FALSE;}}
|
||||
else if(!hostEntry.hostByName(hostName)){message(String("no DNS entry for ")+hostName);return FALSE;}
|
||||
message(String("connect...")+String("'")+hostEntry.hostName()+String("' (")+(String)(hostEntry.addresses())[0]+String(")"));
|
||||
internetSocketAddress.internetAddress((hostEntry.addresses())[0]);
|
||||
if(serverEntry.serviceByName("pop3","tcp"))
|
||||
{
|
||||
if(!mPOPControl.openSocket()){message("unable to create socket.");return FALSE;}
|
||||
internetSocketAddress.family(PF_INET);
|
||||
internetSocketAddress.port(serverEntry.port());
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!mPOPControl.openSocket()){message("unable to create socket.");return FALSE;}
|
||||
internetSocketAddress.family(PF_INET);
|
||||
internetSocketAddress.port(htons(POPPort));
|
||||
}
|
||||
if(!mPOPControl.connect(internetSocketAddress)){message("unable to connect to pop3 server");return FALSE;}
|
||||
mPOPControl.getSocketName(internetSocketAddress);
|
||||
if(!mPOPControl.isConnected())return FALSE;
|
||||
// if(!mPOPControl.receive(responseLines)) //||!responseLines.size()||!
|
||||
if(!mPOPControl.receive(responseLines)||!isInAckResponse(responseLines))
|
||||
{
|
||||
mPOPControl.closeSocket();
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL POPClient::quit(void)
|
||||
{
|
||||
Block<String> responseLines;
|
||||
|
||||
if(!isConnected())return FALSE;
|
||||
isLoggedIn(FALSE);
|
||||
if(!putControlData(mPOPCmds[Quit],FALSE))return FALSE;
|
||||
mPOPControl.receive(responseLines);
|
||||
mPOPControl.closeSocket();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL POPClient::authenticate(const String &user,const String &password)
|
||||
{
|
||||
Block<String> responseLines;
|
||||
|
||||
if(!isConnected())return FALSE;
|
||||
if(!putControlData(mPOPCmds[User]+String(" ")+user,FALSE))return FALSE;
|
||||
if(!mPOPControl.receive(responseLines))return FALSE;
|
||||
if(!isInAckResponse(responseLines))return FALSE;
|
||||
if(!putControlData(mPOPCmds[Pass]+String(" ")+password,FALSE))return FALSE;
|
||||
if(!mPOPControl.receive(responseLines))return FALSE;
|
||||
if(!isInAckResponse(responseLines))return FALSE;
|
||||
isLoggedIn(TRUE);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL POPClient::stat(WORD &messages,WORD &octets)
|
||||
{
|
||||
Block<String> responseLines;
|
||||
String strItem;
|
||||
|
||||
if(!isConnected()||!isLoggedIn())return FALSE;
|
||||
if(!putControlData(mPOPCmds[Stat],FALSE))return FALSE;
|
||||
if(!mPOPControl.receive(responseLines))return FALSE;
|
||||
if(!isInAckResponse(responseLines))return FALSE;
|
||||
strItem=responseLines[0].betweenString(' ',' ');
|
||||
messages=::atoi((char*)strItem);
|
||||
strItem=responseLines[0].betweenString(' ',0);
|
||||
strItem=strItem.betweenString(' ',0);
|
||||
octets=::atoi((char*)strItem);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL POPClient::retrieve(WORD msgNum,Block<String> &messageLines)
|
||||
{
|
||||
Block<String> responseLines;
|
||||
String strMsg;
|
||||
|
||||
if(!isConnected()||!isLoggedIn())return FALSE;
|
||||
::sprintf(strMsg,"%d",msgNum);
|
||||
if(!putControlData(mPOPCmds[Retr]+String(" ")+strMsg,FALSE))return FALSE;
|
||||
if(!mPOPControl.receive(responseLines))return FALSE;
|
||||
if(!isInAckResponse(responseLines))return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void POPClient::createStats(void)
|
||||
{
|
||||
mPOPStatus.insert(&String("+OK"));
|
||||
mPOPStatus.insert(&String("-ERR"));
|
||||
}
|
||||
|
||||
void POPClient::createCmds(void)
|
||||
{
|
||||
mPOPCmds.remove();
|
||||
mPOPCmds.insert(&String("QUIT"));
|
||||
mPOPCmds.insert(&String("USER"));
|
||||
mPOPCmds.insert(&String("PASS"));
|
||||
mPOPCmds.insert(&String("STAT"));
|
||||
mPOPCmds.insert(&String("RETR"));
|
||||
}
|
||||
|
||||
WORD POPClient::putControlData(const String &stringData,WORD waitForResponse)
|
||||
{
|
||||
if(!mPOPControl.isConnected())return FALSE;
|
||||
if(!mPOPControl.send(stringData))
|
||||
{
|
||||
mPOPControl.closeSocket();
|
||||
String errorString(String("error sending '")+stringData+String("' to POP server."));
|
||||
message(errorString);
|
||||
errorString+="\n";
|
||||
::OutputDebugString(errorString);
|
||||
return FALSE;
|
||||
}
|
||||
if(waitForResponse&&!getControlData())
|
||||
{
|
||||
mPOPControl.closeSocket();
|
||||
String errorString(String("error reading result of '")+stringData+String("' command from NNTP server."));
|
||||
message(errorString);
|
||||
errorString+="\n";
|
||||
::OutputDebugString(errorString);
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD POPClient::getControlData(void)
|
||||
{
|
||||
Block<String> responseStrings;
|
||||
mPOPControl.receive(responseStrings);
|
||||
return responseStrings.size();
|
||||
}
|
||||
|
||||
BOOL POPClient::isInAckResponse(Block<String> &responseLines)
|
||||
{
|
||||
if(!responseLines.size())return FALSE;
|
||||
if(responseLines[0].substr(0,2)==mPOPStatus[Ok])return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL POPClient::isInNakResponse(Block<String> &responseLines)
|
||||
{
|
||||
if(!responseLines.size())return FALSE;
|
||||
if(responseLines[0].substr(0,3)==mPOPStatus[Error])return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
// virtuals
|
||||
|
||||
void POPClient::message(const String &messageString)
|
||||
{
|
||||
::OutputDebugString(messageString+String("\n"));
|
||||
}
|
||||
|
||||
void POPClient::message(Block<String> &messageStrings)
|
||||
{
|
||||
for(int itemIndex=0;itemIndex<messageStrings.size();itemIndex++)
|
||||
::OutputDebugString(messageStrings[itemIndex]+String("\n"));
|
||||
}
|
||||
104
pop/POP.DSW
Normal file
104
pop/POP.DSW
Normal file
@@ -0,0 +1,104 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "common"=..\COMMON\common.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "dialog"=..\DIALOG\Dialog.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "imagelst"=..\IMAGELST\imagelst.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "pop"=.\Pop.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name common
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name dialog
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name imagelst
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name socket
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name statbar
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "socket"=..\SOCKET\socket.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "statbar"=..\STATBAR\Statbar.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
14
pop/POP.H
Normal file
14
pop/POP.H
Normal file
@@ -0,0 +1,14 @@
|
||||
#define PC_SERVER 102
|
||||
#define PC_GETMAIL 103
|
||||
#define PC_EDIT 104
|
||||
|
||||
#define NS_SERVERNAME 101
|
||||
|
||||
#define STRING_SERVERNAMEKEY 1
|
||||
#define STRING_MAILDIRKEY 2
|
||||
#define STRING_REGENTRYKEY 3
|
||||
#define STRING_USERNAMEKEY 4
|
||||
#define STRING_PASSWORDKEY 5
|
||||
#define STRING_MAILBOXNAME 6
|
||||
#define STRING_USERFOLDERNAME 7
|
||||
|
||||
4
pop/POP.HPP
Normal file
4
pop/POP.HPP
Normal file
@@ -0,0 +1,4 @@
|
||||
#ifndef _POP_POP_HPP_
|
||||
#define _POP_POP_HPP_
|
||||
#include <pop/pop.h>
|
||||
#endif
|
||||
838
pop/POP.MAK
Normal file
838
pop/POP.MAK
Normal file
@@ -0,0 +1,838 @@
|
||||
# Microsoft Developer Studio Generated NMAKE File, Format Version 4.20
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
!IF "$(CFG)" == ""
|
||||
CFG=pop - Win32 Debug
|
||||
!MESSAGE No configuration specified. Defaulting to pop - Win32 Debug.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" != "pop - Win32 Release" && "$(CFG)" != "pop - Win32 Debug"
|
||||
!MESSAGE Invalid configuration "$(CFG)" specified.
|
||||
!MESSAGE You can specify a configuration when running NMAKE on this makefile
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "Pop.mak" CFG="pop - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "pop - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "pop - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
!ERROR An invalid configuration is specified.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(OS)" == "Windows_NT"
|
||||
NULL=
|
||||
!ELSE
|
||||
NULL=nul
|
||||
!ENDIF
|
||||
################################################################################
|
||||
# Begin Project
|
||||
# PROP Target_Last_Scanned "pop - Win32 Debug"
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
MTL=mktyplib.exe
|
||||
|
||||
!IF "$(CFG)" == "pop - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Target_Dir ""
|
||||
OUTDIR=.\Release
|
||||
INTDIR=.\Release
|
||||
|
||||
ALL : "$(OUTDIR)\Pop.exe"
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\Header.obj"
|
||||
-@erase "$(INTDIR)\Logindlg.obj"
|
||||
-@erase "$(INTDIR)\Main.obj"
|
||||
-@erase "$(INTDIR)\Pop.res"
|
||||
-@erase "$(INTDIR)\popclnt.obj"
|
||||
-@erase "$(INTDIR)\popdlg.obj"
|
||||
-@erase "$(INTDIR)\Purebmp.obj"
|
||||
-@erase "$(INTDIR)\Srvrdlg.obj"
|
||||
-@erase "$(OUTDIR)\Pop.exe"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
|
||||
CPP_PROJ=/nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS"\
|
||||
/Fp"$(INTDIR)/Pop.pch" /YX /Fo"$(INTDIR)/" /c
|
||||
CPP_OBJS=.\Release/
|
||||
CPP_SBRS=.\.
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /win32
|
||||
MTL_PROJ=/nologo /D "NDEBUG" /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
RSC_PROJ=/l 0x409 /fo"$(INTDIR)/Pop.res" /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)/Pop.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
|
||||
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
|
||||
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
|
||||
odbccp32.lib /nologo /subsystem:windows /incremental:no\
|
||||
/pdb:"$(OUTDIR)/Pop.pdb" /machine:I386 /out:"$(OUTDIR)/Pop.exe"
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\Header.obj" \
|
||||
"$(INTDIR)\Logindlg.obj" \
|
||||
"$(INTDIR)\Main.obj" \
|
||||
"$(INTDIR)\Pop.res" \
|
||||
"$(INTDIR)\popclnt.obj" \
|
||||
"$(INTDIR)\popdlg.obj" \
|
||||
"$(INTDIR)\Purebmp.obj" \
|
||||
"$(INTDIR)\Srvrdlg.obj" \
|
||||
"..\Exe\mscommon.lib" \
|
||||
"..\exe\msdialog.lib" \
|
||||
"..\Exe\msimglst.lib" \
|
||||
"..\Exe\mssocket.lib" \
|
||||
"..\Exe\statbar.lib"
|
||||
|
||||
"$(OUTDIR)\Pop.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ELSEIF "$(CFG)" == "pop - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "msvcobj"
|
||||
# PROP Intermediate_Dir "msvcobj"
|
||||
# PROP Target_Dir ""
|
||||
OUTDIR=.\msvcobj
|
||||
INTDIR=.\msvcobj
|
||||
|
||||
ALL : "$(OUTDIR)\Pop.exe"
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\Header.obj"
|
||||
-@erase "$(INTDIR)\Logindlg.obj"
|
||||
-@erase "$(INTDIR)\Main.obj"
|
||||
-@erase "$(INTDIR)\popclnt.obj"
|
||||
-@erase "$(INTDIR)\popdlg.obj"
|
||||
-@erase "$(INTDIR)\Purebmp.obj"
|
||||
-@erase "$(INTDIR)\Srvrdlg.obj"
|
||||
-@erase "$(INTDIR)\vc40.idb"
|
||||
-@erase "$(INTDIR)\vc40.pdb"
|
||||
-@erase "$(OUTDIR)\Pop.exe"
|
||||
-@erase "$(OUTDIR)\Pop.ilk"
|
||||
-@erase "$(OUTDIR)\Pop.pdb"
|
||||
-@erase ".\Pop.res"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
|
||||
# ADD CPP /nologo /Zp1 /MTd /Gm /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__FLAT__" /D "STRICT" /Fp"c:\work\exe\msvc42.pch" /YX"windows.h" /c
|
||||
CPP_PROJ=/nologo /Zp1 /MTd /Gm /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D\
|
||||
"__FLAT__" /D "STRICT" /Fp"c:\work\exe\msvc42.pch" /YX"windows.h"\
|
||||
/Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c
|
||||
CPP_OBJS=.\msvcobj/
|
||||
CPP_SBRS=.\.
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /win32
|
||||
MTL_PROJ=/nologo /D "_DEBUG" /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /fo"Pop.res" /d "_DEBUG"
|
||||
RSC_PROJ=/l 0x409 /fo"Pop.res" /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)/Pop.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib wsock32.lib comctl32.lib /nologo /subsystem:windows /debug /machine:I386
|
||||
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
|
||||
advapi32.lib shell32.lib uuid.lib wsock32.lib comctl32.lib /nologo\
|
||||
/subsystem:windows /incremental:yes /pdb:"$(OUTDIR)/Pop.pdb" /debug\
|
||||
/machine:I386 /out:"$(OUTDIR)/Pop.exe"
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\Header.obj" \
|
||||
"$(INTDIR)\Logindlg.obj" \
|
||||
"$(INTDIR)\Main.obj" \
|
||||
"$(INTDIR)\popclnt.obj" \
|
||||
"$(INTDIR)\popdlg.obj" \
|
||||
"$(INTDIR)\Purebmp.obj" \
|
||||
"$(INTDIR)\Srvrdlg.obj" \
|
||||
"..\Exe\mscommon.lib" \
|
||||
"..\exe\msdialog.lib" \
|
||||
"..\Exe\msimglst.lib" \
|
||||
"..\Exe\mssocket.lib" \
|
||||
"..\Exe\statbar.lib" \
|
||||
".\Pop.res"
|
||||
|
||||
"$(OUTDIR)\Pop.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ENDIF
|
||||
|
||||
.c{$(CPP_OBJS)}.obj:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.cpp{$(CPP_OBJS)}.obj:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.cxx{$(CPP_OBJS)}.obj:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.c{$(CPP_SBRS)}.sbr:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.cpp{$(CPP_SBRS)}.sbr:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.cxx{$(CPP_SBRS)}.sbr:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
################################################################################
|
||||
# Begin Target
|
||||
|
||||
# Name "pop - Win32 Release"
|
||||
# Name "pop - Win32 Debug"
|
||||
|
||||
!IF "$(CFG)" == "pop - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "pop - Win32 Debug"
|
||||
|
||||
!ENDIF
|
||||
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Main.cpp
|
||||
|
||||
!IF "$(CFG)" == "pop - Win32 Release"
|
||||
|
||||
DEP_CPP_MAIN_=\
|
||||
{$(INCLUDE)}"\.\Main.hpp"\
|
||||
{$(INCLUDE)}"\.\Mainwnd.hpp"\
|
||||
{$(INCLUDE)}"\.\Popdlg.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.tpp"\
|
||||
{$(INCLUDE)}"\Common\Callback.hpp"\
|
||||
{$(INCLUDE)}"\Common\Callback.tpp"\
|
||||
{$(INCLUDE)}"\Common\Cbdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Cbptr.hpp"\
|
||||
{$(INCLUDE)}"\Common\Dwindow.hpp"\
|
||||
{$(INCLUDE)}"\Common\except.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdipoint.hpp"\
|
||||
{$(INCLUDE)}"\Common\Guiwnd.hpp"\
|
||||
{$(INCLUDE)}"\Common\Pcallbck.hpp"\
|
||||
{$(INCLUDE)}"\Common\Point.hpp"\
|
||||
{$(INCLUDE)}"\Common\Rect.hpp"\
|
||||
{$(INCLUDE)}"\Common\Stdlib.hpp"\
|
||||
{$(INCLUDE)}"\Common\String.hpp"\
|
||||
{$(INCLUDE)}"\Common\Vhandler.hpp"\
|
||||
{$(INCLUDE)}"\Common\Window.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windows.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windowsx.hpp"\
|
||||
{$(INCLUDE)}"\Common\Winsock.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Wsadata.hpp"\
|
||||
|
||||
|
||||
"$(INTDIR)\Main.obj" : $(SOURCE) $(DEP_CPP_MAIN_) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "pop - Win32 Debug"
|
||||
|
||||
DEP_CPP_MAIN_=\
|
||||
{$(INCLUDE)}"\.\Main.hpp"\
|
||||
{$(INCLUDE)}"\.\Mainwnd.hpp"\
|
||||
{$(INCLUDE)}"\.\Pop.h"\
|
||||
{$(INCLUDE)}"\.\Pop.hpp"\
|
||||
{$(INCLUDE)}"\.\Popdlg.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.tpp"\
|
||||
{$(INCLUDE)}"\Common\Callback.hpp"\
|
||||
{$(INCLUDE)}"\Common\Callback.tpp"\
|
||||
{$(INCLUDE)}"\Common\Cbdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Cbptr.hpp"\
|
||||
{$(INCLUDE)}"\Common\Commctrl.hpp"\
|
||||
{$(INCLUDE)}"\Common\Dwindow.hpp"\
|
||||
{$(INCLUDE)}"\Common\except.hpp"\
|
||||
{$(INCLUDE)}"\Common\Fixup.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.tpp"\
|
||||
{$(INCLUDE)}"\Common\Gdiobj.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdipoint.hpp"\
|
||||
{$(INCLUDE)}"\Common\Guiwnd.hpp"\
|
||||
{$(INCLUDE)}"\Common\Pcallbck.hpp"\
|
||||
{$(INCLUDE)}"\Common\Pen.hpp"\
|
||||
{$(INCLUDE)}"\Common\Point.hpp"\
|
||||
{$(INCLUDE)}"\Common\Pointer.hpp"\
|
||||
{$(INCLUDE)}"\Common\Purebmp.hpp"\
|
||||
{$(INCLUDE)}"\Common\Purehdc.hpp"\
|
||||
{$(INCLUDE)}"\Common\Pvector.hpp"\
|
||||
{$(INCLUDE)}"\Common\Pvector.tpp"\
|
||||
{$(INCLUDE)}"\Common\Rect.hpp"\
|
||||
{$(INCLUDE)}"\Common\Rgbcolor.hpp"\
|
||||
{$(INCLUDE)}"\Common\Stdlib.hpp"\
|
||||
{$(INCLUDE)}"\Common\String.hpp"\
|
||||
{$(INCLUDE)}"\Common\Types.hpp"\
|
||||
{$(INCLUDE)}"\Common\Vhandler.hpp"\
|
||||
{$(INCLUDE)}"\Common\Window.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windows.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windowsx.hpp"\
|
||||
{$(INCLUDE)}"\Common\Winsock.hpp"\
|
||||
{$(INCLUDE)}"\Imagelst\Imagelst.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Wsadata.hpp"\
|
||||
|
||||
|
||||
"$(INTDIR)\Main.obj" : $(SOURCE) $(DEP_CPP_MAIN_) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=\work\Exe\mscommon.lib
|
||||
|
||||
!IF "$(CFG)" == "pop - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "pop - Win32 Debug"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=\work\Exe\mssocket.lib
|
||||
|
||||
!IF "$(CFG)" == "pop - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "pop - Win32 Debug"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\popdlg.cpp
|
||||
|
||||
!IF "$(CFG)" == "pop - Win32 Release"
|
||||
|
||||
DEP_CPP_POPDL=\
|
||||
{$(INCLUDE)}"\.\Drgsprt.hpp"\
|
||||
{$(INCLUDE)}"\.\Header.hpp"\
|
||||
{$(INCLUDE)}"\.\Logindlg.hpp"\
|
||||
{$(INCLUDE)}"\.\Mail.hpp"\
|
||||
{$(INCLUDE)}"\.\Pop.h"\
|
||||
{$(INCLUDE)}"\.\Pop.hpp"\
|
||||
{$(INCLUDE)}"\.\Popclnt.hpp"\
|
||||
{$(INCLUDE)}"\.\Popdlg.hpp"\
|
||||
{$(INCLUDE)}"\.\Sprite.hpp"\
|
||||
{$(INCLUDE)}"\.\Srvrdlg.hpp"\
|
||||
{$(INCLUDE)}"\.\Srvrreg.hpp"\
|
||||
{$(INCLUDE)}"\common\array.hpp"\
|
||||
{$(INCLUDE)}"\Common\Assert.hpp"\
|
||||
{$(INCLUDE)}"\Common\Bitmap.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.tpp"\
|
||||
{$(INCLUDE)}"\Common\Bmdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Bminfo.hpp"\
|
||||
{$(INCLUDE)}"\Common\Boverlay.hpp"\
|
||||
{$(INCLUDE)}"\Common\Brush.hpp"\
|
||||
{$(INCLUDE)}"\Common\Callback.hpp"\
|
||||
{$(INCLUDE)}"\Common\Callback.tpp"\
|
||||
{$(INCLUDE)}"\Common\Cbdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Cbdatahk.hpp"\
|
||||
{$(INCLUDE)}"\Common\Cbptr.hpp"\
|
||||
{$(INCLUDE)}"\Common\Commctrl.hpp"\
|
||||
{$(INCLUDE)}"\Common\Commdlg.hpp"\
|
||||
{$(INCLUDE)}"\Common\Crsctrl.hpp"\
|
||||
{$(INCLUDE)}"\Common\Diskinfo.hpp"\
|
||||
{$(INCLUDE)}"\Common\Dwindow.hpp"\
|
||||
{$(INCLUDE)}"\Common\except.hpp"\
|
||||
{$(INCLUDE)}"\Common\Finddata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Fixup.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.tpp"\
|
||||
{$(INCLUDE)}"\Common\Gdiobj.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdipoint.hpp"\
|
||||
{$(INCLUDE)}"\Common\Guiwnd.hpp"\
|
||||
{$(INCLUDE)}"\Common\Hookproc.hpp"\
|
||||
{$(INCLUDE)}"\Common\Menuitem.hpp"\
|
||||
{$(INCLUDE)}"\Common\Notify.hpp"\
|
||||
{$(INCLUDE)}"\Common\Opendlg.hpp"\
|
||||
{$(INCLUDE)}"\Common\Palentry.hpp"\
|
||||
{$(INCLUDE)}"\Common\Pcallbck.hpp"\
|
||||
{$(INCLUDE)}"\Common\Pen.hpp"\
|
||||
{$(INCLUDE)}"\Common\Point.hpp"\
|
||||
{$(INCLUDE)}"\Common\Purebmp.hpp"\
|
||||
{$(INCLUDE)}"\Common\Purehdc.hpp"\
|
||||
{$(INCLUDE)}"\Common\Puremenu.hpp"\
|
||||
{$(INCLUDE)}"\Common\Purepal.hpp"\
|
||||
{$(INCLUDE)}"\Common\Pvector.hpp"\
|
||||
{$(INCLUDE)}"\Common\Pvector.tpp"\
|
||||
{$(INCLUDE)}"\Common\Rect.hpp"\
|
||||
{$(INCLUDE)}"\Common\Regkey.hpp"\
|
||||
{$(INCLUDE)}"\Common\Regsam.hpp"\
|
||||
{$(INCLUDE)}"\Common\Rgbcolor.hpp"\
|
||||
{$(INCLUDE)}"\Common\Rgbquad.hpp"\
|
||||
{$(INCLUDE)}"\Common\Shellapi.hpp"\
|
||||
{$(INCLUDE)}"\Common\Stdlib.hpp"\
|
||||
{$(INCLUDE)}"\Common\String.hpp"\
|
||||
{$(INCLUDE)}"\Common\Systime.hpp"\
|
||||
{$(INCLUDE)}"\Common\Types.hpp"\
|
||||
{$(INCLUDE)}"\Common\Vhandler.hpp"\
|
||||
{$(INCLUDE)}"\Common\Window.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windows.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windowsx.hpp"\
|
||||
{$(INCLUDE)}"\Common\Winsock.hpp"\
|
||||
{$(INCLUDE)}"\Dialog\Dlgitem.hpp"\
|
||||
{$(INCLUDE)}"\Dialog\Dlgtmpl.hpp"\
|
||||
{$(INCLUDE)}"\Dialog\Dyndlg.hpp"\
|
||||
{$(INCLUDE)}"\Imagelst\Ftree.hpp"\
|
||||
{$(INCLUDE)}"\Imagelst\Hittest.hpp"\
|
||||
{$(INCLUDE)}"\Imagelst\Imagelst.hpp"\
|
||||
{$(INCLUDE)}"\Imagelst\Imgeinfo.hpp"\
|
||||
{$(INCLUDE)}"\Imagelst\Treeview.hpp"\
|
||||
{$(INCLUDE)}"\Imagelst\Tvinsert.hpp"\
|
||||
{$(INCLUDE)}"\Imagelst\Tvitem.hpp"\
|
||||
{$(INCLUDE)}"\Imagelst\Tvmsghdr.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Cache.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Inaddr.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Intsaddr.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Socket.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Timeinfo.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Wsadata.hpp"\
|
||||
{$(INCLUDE)}"\Statbar\Popup.hpp"\
|
||||
{$(INCLUDE)}"\Statbar\Statbar.hpp"\
|
||||
{$(INCLUDE)}"\Statbar\Statinfo.hpp"\
|
||||
{$(INCLUDE)}"\Statbar\Statmenu.hpp"\
|
||||
|
||||
|
||||
"$(INTDIR)\popdlg.obj" : $(SOURCE) $(DEP_CPP_POPDL) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "pop - Win32 Debug"
|
||||
|
||||
DEP_CPP_POPDL=\
|
||||
{$(INCLUDE)}"\.\Drgsprt.hpp"\
|
||||
{$(INCLUDE)}"\.\Header.hpp"\
|
||||
{$(INCLUDE)}"\.\Logindlg.hpp"\
|
||||
{$(INCLUDE)}"\.\Mail.hpp"\
|
||||
{$(INCLUDE)}"\.\Pop.h"\
|
||||
{$(INCLUDE)}"\.\Pop.hpp"\
|
||||
{$(INCLUDE)}"\.\Popclnt.hpp"\
|
||||
{$(INCLUDE)}"\.\Popdlg.hpp"\
|
||||
{$(INCLUDE)}"\.\Sprite.hpp"\
|
||||
{$(INCLUDE)}"\.\Srvrdlg.hpp"\
|
||||
{$(INCLUDE)}"\.\Srvrreg.hpp"\
|
||||
{$(INCLUDE)}"\Common\Bitmap.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.tpp"\
|
||||
{$(INCLUDE)}"\Common\Bmdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Bminfo.hpp"\
|
||||
{$(INCLUDE)}"\Common\Boverlay.hpp"\
|
||||
{$(INCLUDE)}"\Common\Brush.hpp"\
|
||||
{$(INCLUDE)}"\Common\Callback.hpp"\
|
||||
{$(INCLUDE)}"\Common\Callback.tpp"\
|
||||
{$(INCLUDE)}"\Common\Cbdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Cbdatahk.hpp"\
|
||||
{$(INCLUDE)}"\Common\Cbptr.hpp"\
|
||||
{$(INCLUDE)}"\Common\Commctrl.hpp"\
|
||||
{$(INCLUDE)}"\Common\Commdlg.hpp"\
|
||||
{$(INCLUDE)}"\Common\Crsctrl.hpp"\
|
||||
{$(INCLUDE)}"\Common\Diskinfo.hpp"\
|
||||
{$(INCLUDE)}"\Common\Dwindow.hpp"\
|
||||
{$(INCLUDE)}"\Common\except.hpp"\
|
||||
{$(INCLUDE)}"\Common\Filetime.hpp"\
|
||||
{$(INCLUDE)}"\Common\Finddata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Fixup.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.tpp"\
|
||||
{$(INCLUDE)}"\Common\Gdiobj.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdipoint.hpp"\
|
||||
{$(INCLUDE)}"\Common\Guiwnd.hpp"\
|
||||
{$(INCLUDE)}"\Common\Hookproc.hpp"\
|
||||
{$(INCLUDE)}"\Common\Menuitem.hpp"\
|
||||
{$(INCLUDE)}"\Common\Notify.hpp"\
|
||||
{$(INCLUDE)}"\Common\Opendlg.hpp"\
|
||||
{$(INCLUDE)}"\Common\Palentry.hpp"\
|
||||
{$(INCLUDE)}"\Common\Pcallbck.hpp"\
|
||||
{$(INCLUDE)}"\Common\Pen.hpp"\
|
||||
{$(INCLUDE)}"\Common\Point.hpp"\
|
||||
{$(INCLUDE)}"\Common\Pointer.hpp"\
|
||||
{$(INCLUDE)}"\Common\Purebmp.hpp"\
|
||||
{$(INCLUDE)}"\Common\Purehdc.hpp"\
|
||||
{$(INCLUDE)}"\Common\Puremenu.hpp"\
|
||||
{$(INCLUDE)}"\Common\Purepal.hpp"\
|
||||
{$(INCLUDE)}"\Common\Pvector.hpp"\
|
||||
{$(INCLUDE)}"\Common\Pvector.tpp"\
|
||||
{$(INCLUDE)}"\Common\Rect.hpp"\
|
||||
{$(INCLUDE)}"\Common\Regkey.hpp"\
|
||||
{$(INCLUDE)}"\Common\Regsam.hpp"\
|
||||
{$(INCLUDE)}"\Common\Rgbcolor.hpp"\
|
||||
{$(INCLUDE)}"\Common\Rgbquad.hpp"\
|
||||
{$(INCLUDE)}"\Common\Shellapi.hpp"\
|
||||
{$(INCLUDE)}"\Common\Stdlib.hpp"\
|
||||
{$(INCLUDE)}"\Common\String.hpp"\
|
||||
{$(INCLUDE)}"\Common\Systime.hpp"\
|
||||
{$(INCLUDE)}"\Common\Types.hpp"\
|
||||
{$(INCLUDE)}"\Common\Vhandler.hpp"\
|
||||
{$(INCLUDE)}"\Common\Window.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windows.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windowsx.hpp"\
|
||||
{$(INCLUDE)}"\Common\Winsock.hpp"\
|
||||
{$(INCLUDE)}"\Dialog\Dlgitem.hpp"\
|
||||
{$(INCLUDE)}"\Dialog\Dlgtmpl.hpp"\
|
||||
{$(INCLUDE)}"\Dialog\Dyndlg.hpp"\
|
||||
{$(INCLUDE)}"\Imagelst\Ftree.hpp"\
|
||||
{$(INCLUDE)}"\Imagelst\Hittest.hpp"\
|
||||
{$(INCLUDE)}"\Imagelst\Imagelst.hpp"\
|
||||
{$(INCLUDE)}"\Imagelst\Imgeinfo.hpp"\
|
||||
{$(INCLUDE)}"\Imagelst\Treeview.hpp"\
|
||||
{$(INCLUDE)}"\Imagelst\Tvinsert.hpp"\
|
||||
{$(INCLUDE)}"\Imagelst\Tvitem.hpp"\
|
||||
{$(INCLUDE)}"\Imagelst\Tvmsghdr.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Cache.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Inaddr.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Intsaddr.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Socket.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Timeinfo.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Wsadata.hpp"\
|
||||
{$(INCLUDE)}"\Statbar\Popup.hpp"\
|
||||
{$(INCLUDE)}"\Statbar\Statbar.hpp"\
|
||||
{$(INCLUDE)}"\Statbar\Statinfo.hpp"\
|
||||
{$(INCLUDE)}"\Statbar\Statmenu.hpp"\
|
||||
|
||||
|
||||
"$(INTDIR)\popdlg.obj" : $(SOURCE) $(DEP_CPP_POPDL) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=\work\Exe\statbar.lib
|
||||
|
||||
!IF "$(CFG)" == "pop - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "pop - Win32 Debug"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Pop.rc
|
||||
DEP_RSC_POP_R=\
|
||||
".\SSTRIP.BMP"\
|
||||
{$(INCLUDE)}"\Ctype.h"\
|
||||
{$(INCLUDE)}"\dde.h"\
|
||||
{$(INCLUDE)}"\ddeml.h"\
|
||||
{$(INCLUDE)}"\Dlgs.h"\
|
||||
{$(INCLUDE)}"\Excpt.h"\
|
||||
{$(INCLUDE)}"\lzexpand.h"\
|
||||
{$(INCLUDE)}"\MMSystem.h"\
|
||||
{$(INCLUDE)}"\MSWSock.h"\
|
||||
{$(INCLUDE)}"\nb30.h"\
|
||||
{$(INCLUDE)}"\poppack.h"\
|
||||
{$(INCLUDE)}"\PshPack1.h"\
|
||||
{$(INCLUDE)}"\PshPack2.h"\
|
||||
{$(INCLUDE)}"\PshPack4.h"\
|
||||
{$(INCLUDE)}"\Rpc.h"\
|
||||
{$(INCLUDE)}"\RpcDce.h"\
|
||||
{$(INCLUDE)}"\RpcDceP.h"\
|
||||
{$(INCLUDE)}"\RpcNsi.h"\
|
||||
{$(INCLUDE)}"\RpcNtErr.h"\
|
||||
{$(INCLUDE)}"\ShellAPI.h"\
|
||||
{$(INCLUDE)}"\Stdarg.h"\
|
||||
{$(INCLUDE)}"\String.h"\
|
||||
{$(INCLUDE)}"\WinBase.h"\
|
||||
{$(INCLUDE)}"\Wincon.h"\
|
||||
{$(INCLUDE)}"\wincrypt.h"\
|
||||
{$(INCLUDE)}"\WinDef.h"\
|
||||
{$(INCLUDE)}"\windows.h"\
|
||||
{$(INCLUDE)}"\WinError.h"\
|
||||
{$(INCLUDE)}"\wingdi.h"\
|
||||
{$(INCLUDE)}"\Winnetwk.h"\
|
||||
{$(INCLUDE)}"\WinNls.h"\
|
||||
{$(INCLUDE)}"\WinNT.h"\
|
||||
{$(INCLUDE)}"\WinPerf.h"\
|
||||
{$(INCLUDE)}"\Winreg.h"\
|
||||
{$(INCLUDE)}"\WinSpool.h"\
|
||||
{$(INCLUDE)}"\WinUser.h"\
|
||||
{$(INCLUDE)}"\WinVer.h"\
|
||||
|
||||
|
||||
!IF "$(CFG)" == "pop - Win32 Release"
|
||||
|
||||
|
||||
"$(INTDIR)\Pop.res" : $(SOURCE) $(DEP_RSC_POP_R) "$(INTDIR)"
|
||||
$(RSC) $(RSC_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "pop - Win32 Debug"
|
||||
|
||||
|
||||
".\Pop.res" : $(SOURCE) $(DEP_RSC_POP_R) "$(INTDIR)"
|
||||
$(RSC) $(RSC_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\popclnt.Cpp
|
||||
DEP_CPP_POPCL=\
|
||||
{$(INCLUDE)}"\.\Popclnt.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.tpp"\
|
||||
{$(INCLUDE)}"\Common\except.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.tpp"\
|
||||
{$(INCLUDE)}"\Common\Stdlib.hpp"\
|
||||
{$(INCLUDE)}"\Common\String.hpp"\
|
||||
{$(INCLUDE)}"\Common\Types.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windows.hpp"\
|
||||
{$(INCLUDE)}"\Common\Winsock.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Cache.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Hostent.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Inaddr.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Intsaddr.hpp"\
|
||||
{$(INCLUDE)}"\socket\servent.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Socket.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Timeinfo.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Wsadata.hpp"\
|
||||
|
||||
|
||||
"$(INTDIR)\popclnt.obj" : $(SOURCE) $(DEP_CPP_POPCL) "$(INTDIR)"
|
||||
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Srvrdlg.cpp
|
||||
|
||||
!IF "$(CFG)" == "pop - Win32 Release"
|
||||
|
||||
DEP_CPP_SRVRD=\
|
||||
{$(INCLUDE)}"\.\Pop.h"\
|
||||
{$(INCLUDE)}"\.\Pop.hpp"\
|
||||
{$(INCLUDE)}"\.\Srvrdlg.hpp"\
|
||||
{$(INCLUDE)}"\.\Srvrreg.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.tpp"\
|
||||
{$(INCLUDE)}"\Common\Callback.hpp"\
|
||||
{$(INCLUDE)}"\Common\Callback.tpp"\
|
||||
{$(INCLUDE)}"\Common\Cbdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Cbptr.hpp"\
|
||||
{$(INCLUDE)}"\Common\Diskinfo.hpp"\
|
||||
{$(INCLUDE)}"\Common\Dwindow.hpp"\
|
||||
{$(INCLUDE)}"\Common\except.hpp"\
|
||||
{$(INCLUDE)}"\Common\Finddata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdipoint.hpp"\
|
||||
{$(INCLUDE)}"\Common\Guiwnd.hpp"\
|
||||
{$(INCLUDE)}"\Common\Pcallbck.hpp"\
|
||||
{$(INCLUDE)}"\Common\Point.hpp"\
|
||||
{$(INCLUDE)}"\Common\Rect.hpp"\
|
||||
{$(INCLUDE)}"\Common\Regkey.hpp"\
|
||||
{$(INCLUDE)}"\Common\Regsam.hpp"\
|
||||
{$(INCLUDE)}"\Common\Shellapi.hpp"\
|
||||
{$(INCLUDE)}"\Common\Stdlib.hpp"\
|
||||
{$(INCLUDE)}"\Common\String.hpp"\
|
||||
{$(INCLUDE)}"\Common\Systime.hpp"\
|
||||
{$(INCLUDE)}"\Common\Vhandler.hpp"\
|
||||
{$(INCLUDE)}"\Common\Window.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windows.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windowsx.hpp"\
|
||||
|
||||
|
||||
"$(INTDIR)\Srvrdlg.obj" : $(SOURCE) $(DEP_CPP_SRVRD) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "pop - Win32 Debug"
|
||||
|
||||
DEP_CPP_SRVRD=\
|
||||
{$(INCLUDE)}"\.\Pop.h"\
|
||||
{$(INCLUDE)}"\.\Pop.hpp"\
|
||||
{$(INCLUDE)}"\.\Srvrdlg.hpp"\
|
||||
{$(INCLUDE)}"\.\Srvrreg.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.tpp"\
|
||||
{$(INCLUDE)}"\Common\Callback.hpp"\
|
||||
{$(INCLUDE)}"\Common\Callback.tpp"\
|
||||
{$(INCLUDE)}"\Common\Cbdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Cbptr.hpp"\
|
||||
{$(INCLUDE)}"\Common\Diskinfo.hpp"\
|
||||
{$(INCLUDE)}"\Common\Dwindow.hpp"\
|
||||
{$(INCLUDE)}"\Common\except.hpp"\
|
||||
{$(INCLUDE)}"\Common\Filetime.hpp"\
|
||||
{$(INCLUDE)}"\Common\Finddata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Guiwnd.hpp"\
|
||||
{$(INCLUDE)}"\Common\Pcallbck.hpp"\
|
||||
{$(INCLUDE)}"\Common\Regkey.hpp"\
|
||||
{$(INCLUDE)}"\Common\Regsam.hpp"\
|
||||
{$(INCLUDE)}"\Common\Shellapi.hpp"\
|
||||
{$(INCLUDE)}"\Common\Stdlib.hpp"\
|
||||
{$(INCLUDE)}"\Common\String.hpp"\
|
||||
{$(INCLUDE)}"\Common\Systime.hpp"\
|
||||
{$(INCLUDE)}"\Common\Vhandler.hpp"\
|
||||
{$(INCLUDE)}"\Common\Window.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windows.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windowsx.hpp"\
|
||||
|
||||
|
||||
"$(INTDIR)\Srvrdlg.obj" : $(SOURCE) $(DEP_CPP_SRVRD) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Logindlg.cpp
|
||||
DEP_CPP_LOGIN=\
|
||||
{$(INCLUDE)}"\.\Logindlg.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.tpp"\
|
||||
{$(INCLUDE)}"\Common\Callback.hpp"\
|
||||
{$(INCLUDE)}"\Common\Callback.tpp"\
|
||||
{$(INCLUDE)}"\Common\Cbdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Cbptr.hpp"\
|
||||
{$(INCLUDE)}"\Common\Dwindow.hpp"\
|
||||
{$(INCLUDE)}"\Common\except.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.tpp"\
|
||||
{$(INCLUDE)}"\Common\Gdipoint.hpp"\
|
||||
{$(INCLUDE)}"\Common\Guiwnd.hpp"\
|
||||
{$(INCLUDE)}"\Common\Pcallbck.hpp"\
|
||||
{$(INCLUDE)}"\Common\Point.hpp"\
|
||||
{$(INCLUDE)}"\Common\Rect.hpp"\
|
||||
{$(INCLUDE)}"\Common\Stdlib.hpp"\
|
||||
{$(INCLUDE)}"\Common\String.hpp"\
|
||||
{$(INCLUDE)}"\Common\Types.hpp"\
|
||||
{$(INCLUDE)}"\Common\Vhandler.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windows.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windowsx.hpp"\
|
||||
{$(INCLUDE)}"\Dialog\Dlgitem.hpp"\
|
||||
{$(INCLUDE)}"\Dialog\Dlgtmpl.hpp"\
|
||||
{$(INCLUDE)}"\Dialog\Dyndlg.hpp"\
|
||||
|
||||
|
||||
"$(INTDIR)\Logindlg.obj" : $(SOURCE) $(DEP_CPP_LOGIN) "$(INTDIR)"
|
||||
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=\work\exe\msdialog.lib
|
||||
|
||||
!IF "$(CFG)" == "pop - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "pop - Win32 Debug"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=\work\Exe\msimglst.lib
|
||||
|
||||
!IF "$(CFG)" == "pop - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "pop - Win32 Debug"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Header.cpp
|
||||
DEP_CPP_HEADE=\
|
||||
{$(INCLUDE)}"\.\Header.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.tpp"\
|
||||
{$(INCLUDE)}"\Common\except.hpp"\
|
||||
{$(INCLUDE)}"\Common\Filemap.hpp"\
|
||||
{$(INCLUDE)}"\Common\Filetime.hpp"\
|
||||
{$(INCLUDE)}"\Common\Openfile.hpp"\
|
||||
{$(INCLUDE)}"\Common\Puredwrd.hpp"\
|
||||
{$(INCLUDE)}"\Common\Pview.hpp"\
|
||||
{$(INCLUDE)}"\Common\Stdlib.hpp"\
|
||||
{$(INCLUDE)}"\Common\String.hpp"\
|
||||
{$(INCLUDE)}"\Common\Systime.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windows.hpp"\
|
||||
|
||||
|
||||
"$(INTDIR)\Header.obj" : $(SOURCE) $(DEP_CPP_HEADE) "$(INTDIR)"
|
||||
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=\work\Common\Purebmp.cpp
|
||||
DEP_CPP_PUREB=\
|
||||
{$(INCLUDE)}"\Common\except.hpp"\
|
||||
{$(INCLUDE)}"\Common\Fixup.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.tpp"\
|
||||
{$(INCLUDE)}"\Common\Gdiobj.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdipoint.hpp"\
|
||||
{$(INCLUDE)}"\Common\Pen.hpp"\
|
||||
{$(INCLUDE)}"\Common\Point.hpp"\
|
||||
{$(INCLUDE)}"\Common\Purebmp.hpp"\
|
||||
{$(INCLUDE)}"\Common\Purehdc.hpp"\
|
||||
{$(INCLUDE)}"\Common\Pvector.hpp"\
|
||||
{$(INCLUDE)}"\Common\Pvector.tpp"\
|
||||
{$(INCLUDE)}"\Common\Rect.hpp"\
|
||||
{$(INCLUDE)}"\Common\Rgbcolor.hpp"\
|
||||
{$(INCLUDE)}"\Common\Stdlib.hpp"\
|
||||
{$(INCLUDE)}"\Common\String.hpp"\
|
||||
{$(INCLUDE)}"\Common\Types.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windows.hpp"\
|
||||
|
||||
|
||||
"$(INTDIR)\Purebmp.obj" : $(SOURCE) $(DEP_CPP_PUREB) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
################################################################################
|
||||
BIN
pop/POP.MDP
Normal file
BIN
pop/POP.MDP
Normal file
Binary file not shown.
36
pop/POP.PLG
Normal file
36
pop/POP.PLG
Normal file
@@ -0,0 +1,36 @@
|
||||
<html>
|
||||
<body>
|
||||
<pre>
|
||||
<h1>Build Log</h1>
|
||||
<h3>
|
||||
--------------------Configuration: pop - Win32 Debug--------------------
|
||||
</h3>
|
||||
<h3>Command Lines</h3>
|
||||
Creating temporary file "C:\WINNT\Profiles\sean\LOCALS~1\Temp\RSP40.tmp" with contents
|
||||
[
|
||||
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib wsock32.lib comctl32.lib /nologo /subsystem:windows /incremental:yes /pdb:".\msvcobj/Pop.pdb" /debug /machine:I386 /out:".\msvcobj/Pop.exe"
|
||||
.\msvcobj\Header.obj
|
||||
.\msvcobj\Logindlg.obj
|
||||
.\msvcobj\Main.obj
|
||||
.\msvcobj\Popclnt.obj
|
||||
.\msvcobj\Popdlg.obj
|
||||
.\msvcobj\Srvrdlg.obj
|
||||
.\msvcobj\Pop.res
|
||||
..\Exe\mscommon.lib
|
||||
..\exe\msdialog.lib
|
||||
\work\exe\imagelst.lib
|
||||
..\Exe\mssocket.lib
|
||||
..\exe\statbar.lib
|
||||
]
|
||||
Creating command line "link.exe @C:\WINNT\Profiles\sean\LOCALS~1\Temp\RSP40.tmp"
|
||||
<h3>Output Window</h3>
|
||||
Linking...
|
||||
Creating library .\msvcobj/Pop.lib and object .\msvcobj/Pop.exp
|
||||
|
||||
|
||||
|
||||
<h3>Results</h3>
|
||||
Pop.exe - 0 error(s), 0 warning(s)
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
36
pop/POP.RC
Normal file
36
pop/POP.RC
Normal file
@@ -0,0 +1,36 @@
|
||||
#include <windows.h>
|
||||
#include <pop.h>
|
||||
|
||||
LIST BITMAP "SSTRIP.BMP"
|
||||
|
||||
POPCLIENT DIALOG 19, 20, 325, 234
|
||||
STYLE DS_MODALFRAME | 0x4L | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "POPClient"
|
||||
FONT 6, "Helv"
|
||||
{
|
||||
PUSHBUTTON "Quit", IDCANCEL, 272, 5, 50, 14
|
||||
PUSHBUTTON "Server", PC_SERVER, 222, 5, 50, 14
|
||||
PUSHBUTTON "Get Mail", PC_GETMAIL, 172, 5, 50, 14
|
||||
EDITTEXT PC_EDIT, 4, 126, 315, 93, ES_MULTILINE | ES_AUTOHSCROLL | ES_OEMCONVERT | ES_WANTRETURN | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
|
||||
}
|
||||
|
||||
ServerDialog DIALOG 6, 15, 202, 49
|
||||
STYLE DS_MODALFRAME | 0x4L | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "News Server"
|
||||
FONT 8, "MS Sans Serif"
|
||||
{
|
||||
LTEXT "News Server:", -1, 6, 11, 49, 8
|
||||
EDITTEXT NS_SERVERNAME, 51, 10, 144, 12, ES_AUTOHSCROLL | ES_WANTRETURN | WS_BORDER | WS_TABSTOP
|
||||
PUSHBUTTON "Cancel", IDCANCEL, 145, 27, 50, 14
|
||||
}
|
||||
|
||||
STRINGTABLE
|
||||
{
|
||||
STRING_REGENTRYKEY, "Software\\Diversified\\POPClient"
|
||||
STRING_SERVERNAMEKEY, "ServerName"
|
||||
STRING_MAILDIRKEY, "MailDir"
|
||||
STRING_USERNAMEKEY, "UserName"
|
||||
STRING_PASSWORDKEY, "Password"
|
||||
STRING_MAILBOXNAME, "MailBox"
|
||||
STRING_USERFOLDERNAME, "MyFolder"
|
||||
}
|
||||
BIN
pop/POP.RES
Normal file
BIN
pop/POP.RES
Normal file
Binary file not shown.
BIN
pop/POP.RWS
Normal file
BIN
pop/POP.RWS
Normal file
Binary file not shown.
265
pop/POPCLNT.CPP
Normal file
265
pop/POPCLNT.CPP
Normal file
@@ -0,0 +1,265 @@
|
||||
#include <pop/popclnt.hpp>
|
||||
#include <socket/hostent.hpp>
|
||||
#include <socket/servent.hpp>
|
||||
|
||||
POPClient::POPClient(void)
|
||||
: mSpace(" "), mIsLoggedIn(FALSE)
|
||||
{
|
||||
createCmds();
|
||||
createStats();
|
||||
}
|
||||
|
||||
POPClient::~POPClient()
|
||||
{
|
||||
}
|
||||
|
||||
BOOL POPClient::open(const String &hostName)
|
||||
{
|
||||
HostEnt hostEntry;
|
||||
ServEnt serverEntry;
|
||||
Block<String> responseLines;
|
||||
INETSocketAddress internetSocketAddress;
|
||||
|
||||
if(hostName.isNull())return FALSE;
|
||||
if(mPOPControl.isConnected())mPOPControl.destroy();
|
||||
message(String("trying ")+hostName+String("..."));
|
||||
if(!mWSASystem.isInitialized()){message("WINSOCK initialization failure.");return FALSE;}
|
||||
InternetAddress internetAddress(hostName);
|
||||
if(!internetAddress.isZero()){if(!hostEntry.hostByAddress(internetAddress)){return FALSE;}}
|
||||
else if(!hostEntry.hostByName(hostName)){return FALSE;}
|
||||
if(!internetAddress.isZero()){if(!hostEntry.hostByAddress(internetAddress)){message(String("no DNS entry for ")+hostName);return FALSE;}}
|
||||
else if(!hostEntry.hostByName(hostName)){message(String("no DNS entry for ")+hostName);return FALSE;}
|
||||
message(String("connect...")+String("'")+hostEntry.hostName()+String("' (")+(String)(hostEntry.addresses())[0]+String(")"));
|
||||
internetSocketAddress.internetAddress((hostEntry.addresses())[0]);
|
||||
if(serverEntry.serviceByName("pop3","tcp"))
|
||||
{
|
||||
if(!mPOPControl.create()){message("unable to create socket.");return FALSE;}
|
||||
internetSocketAddress.family(PF_INET);
|
||||
internetSocketAddress.port(serverEntry.port());
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!mPOPControl.create()){message("unable to create socket.");return FALSE;}
|
||||
internetSocketAddress.family(PF_INET);
|
||||
internetSocketAddress.port(htons(POPPort));
|
||||
}
|
||||
if(!mPOPControl.connect(internetSocketAddress)){message("unable to connect to pop3 server");return FALSE;}
|
||||
mPOPControl.getSocketName(internetSocketAddress);
|
||||
if(!mPOPControl.isConnected())return FALSE;
|
||||
if(!receive(responseLines)||!isInAckResponse(responseLines))
|
||||
{
|
||||
mPOPControl.destroy();
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL POPClient::quit(void)
|
||||
{
|
||||
Block<String> responseLines;
|
||||
|
||||
if(!isConnected())return FALSE;
|
||||
isLoggedIn(FALSE);
|
||||
if(!putControlData(mPOPCmds[Quit],FALSE))return FALSE;
|
||||
receive(responseLines);
|
||||
mPOPControl.destroy();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL POPClient::authenticate(const String &user,const String &password)
|
||||
{
|
||||
Block<String> responseLines;
|
||||
|
||||
if(!isConnected())return FALSE;
|
||||
if(!putControlData(mPOPCmds[User]+String(" ")+user,FALSE))return FALSE;
|
||||
if(!receive(responseLines))return FALSE;
|
||||
if(!isInAckResponse(responseLines))return FALSE;
|
||||
if(!putControlData(mPOPCmds[Pass]+String(" ")+password,FALSE))return FALSE;
|
||||
if(!receive(responseLines))return FALSE;
|
||||
isLoggedIn(TRUE);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL POPClient::stat(WORD &messages,WORD &octets)
|
||||
{
|
||||
Block<String> responseLines;
|
||||
String strItem;
|
||||
|
||||
messages=0;
|
||||
octets=0;
|
||||
if(!isConnected()||!isLoggedIn())return FALSE;
|
||||
if(!putControlData(mPOPCmds[Stat],FALSE))return FALSE;
|
||||
if(!receive(responseLines))return FALSE;
|
||||
if(!isInAckResponse(responseLines))return FALSE;
|
||||
strItem=responseLines[0].betweenString(' ',' ');
|
||||
messages=::atoi((char*)strItem);
|
||||
strItem=responseLines[0].betweenString(' ',0);
|
||||
strItem=strItem.betweenString(' ',0);
|
||||
octets=::atoi((char*)strItem);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL POPClient::retrieve(WORD msgNum,Block<String> &messageLines)
|
||||
{
|
||||
Block<String> responseLines;
|
||||
String strMsg;
|
||||
|
||||
messageLines.remove();
|
||||
if(!isConnected()||!isLoggedIn())return FALSE;
|
||||
::sprintf(strMsg,"%d",msgNum);
|
||||
if(!putControlData(mPOPCmds[Retr]+String(" ")+strMsg,FALSE))return FALSE;
|
||||
if(!receive(responseLines))return FALSE;
|
||||
if(!isInAckResponse(responseLines))return FALSE;
|
||||
receiveLines(messageLines);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL POPClient::dele(WORD msgNum)
|
||||
{
|
||||
Block<String> responseLines;
|
||||
String strMsg;
|
||||
if(!isConnected()||!isLoggedIn())return FALSE;
|
||||
::sprintf(strMsg,"%d",msgNum);
|
||||
if(!putControlData(mPOPCmds[Dele]+String(" ")+strMsg,FALSE))return FALSE;
|
||||
if(!receive(responseLines))return FALSE;
|
||||
if(!isInAckResponse(responseLines))return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL POPClient::noop(void)
|
||||
{
|
||||
Block<String> responseLines;
|
||||
|
||||
if(!isConnected()||!isLoggedIn())return FALSE;
|
||||
if(!putControlData(mPOPCmds[Noop],FALSE))return FALSE;
|
||||
if(!receive(responseLines))return FALSE;
|
||||
if(!isInAckResponse(responseLines))return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL POPClient::rset(void)
|
||||
{
|
||||
Block<String> responseLines;
|
||||
|
||||
if(!isConnected()||!isLoggedIn())return FALSE;
|
||||
if(!putControlData(mPOPCmds[Rset],FALSE))return FALSE;
|
||||
if(!receive(responseLines))return FALSE;
|
||||
if(!isInAckResponse(responseLines))return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL POPClient::top(Block<String> &msgLines,WORD msgNum,WORD lineCount)
|
||||
{
|
||||
Block<String> responseLines;
|
||||
String strMsg;
|
||||
|
||||
if(!isConnected()||!isLoggedIn())return FALSE;
|
||||
::sprintf(strMsg,"%d %d",msgNum,lineCount);
|
||||
if(!putControlData(mPOPCmds[Top]+String(" ")+strMsg,FALSE))return FALSE;
|
||||
if(!receive(responseLines))return FALSE;
|
||||
if(!isInAckResponse(responseLines))return FALSE;
|
||||
if(!receiveLines(msgLines))return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void POPClient::createStats(void)
|
||||
{
|
||||
mPOPStatus.insert(&String("+OK"));
|
||||
mPOPStatus.insert(&String("-ERR"));
|
||||
}
|
||||
|
||||
void POPClient::createCmds(void)
|
||||
{
|
||||
mPOPCmds.remove();
|
||||
mPOPCmds.insert(&String("QUIT"));
|
||||
mPOPCmds.insert(&String("USER"));
|
||||
mPOPCmds.insert(&String("PASS"));
|
||||
mPOPCmds.insert(&String("STAT"));
|
||||
mPOPCmds.insert(&String("RETR"));
|
||||
mPOPCmds.insert(&String("RSET"));
|
||||
mPOPCmds.insert(&String("DELE"));
|
||||
mPOPCmds.insert(&String("NOOP"));
|
||||
mPOPCmds.insert(&String("TOP"));
|
||||
}
|
||||
|
||||
WORD POPClient::putControlData(const String &stringData,WORD waitForResponse)
|
||||
{
|
||||
if(!mPOPControl.isConnected())return FALSE;
|
||||
if(!mPOPControl.send(stringData))
|
||||
{
|
||||
mPOPControl.destroy();
|
||||
String errorString(String("error sending '")+stringData+String("' to POP server."));
|
||||
message(errorString);
|
||||
errorString+="\n";
|
||||
::OutputDebugString(errorString);
|
||||
return FALSE;
|
||||
}
|
||||
if(waitForResponse&&!getControlData())
|
||||
{
|
||||
mPOPControl.destroy();
|
||||
String errorString(String("error reading result of '")+stringData+String("' command from NNTP server."));
|
||||
message(errorString);
|
||||
errorString+="\n";
|
||||
::OutputDebugString(errorString);
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD POPClient::getControlData(void)
|
||||
{
|
||||
Block<String> responseStrings;
|
||||
mPOPControl.receive(responseStrings);
|
||||
return responseStrings.size();
|
||||
}
|
||||
|
||||
BOOL POPClient::isInAckResponse(Block<String> &responseLines)
|
||||
{
|
||||
if(!responseLines.size())return FALSE;
|
||||
if(responseLines[0].substr(0,2)==mPOPStatus[Ok])return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL POPClient::isInNakResponse(Block<String> &responseLines)
|
||||
{
|
||||
if(!responseLines.size())return FALSE;
|
||||
if(responseLines[0].substr(0,3)==mPOPStatus[Error])return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL POPClient::receive(Block<String> &responseLines)
|
||||
{
|
||||
if(!mPOPControl.receive(responseLines))return FALSE;
|
||||
// message(responseLines);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL POPClient::receiveLines(Block<String> &receiveStrings)
|
||||
{
|
||||
String stringData;
|
||||
String seriesItem;
|
||||
|
||||
receiveStrings.remove();
|
||||
while(TRUE)
|
||||
{
|
||||
if(!mPOPControl.receive(stringData))break;
|
||||
if(stringData==String("."))break;
|
||||
if(stringData==String(".."))stringData=".";
|
||||
receiveStrings.insert(&stringData);
|
||||
if(!isConnected())break;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// virtuals
|
||||
|
||||
void POPClient::message(const String &messageString)
|
||||
{
|
||||
::OutputDebugString(messageString+String("\n"));
|
||||
}
|
||||
|
||||
void POPClient::message(Block<String> &messageStrings)
|
||||
{
|
||||
for(int itemIndex=0;itemIndex<messageStrings.size();itemIndex++)
|
||||
::OutputDebugString(messageStrings[itemIndex]+String("\n"));
|
||||
}
|
||||
83
pop/POPCLNT.HPP
Normal file
83
pop/POPCLNT.HPP
Normal file
@@ -0,0 +1,83 @@
|
||||
#ifndef _POP_POPCLIENT_HPP_
|
||||
#define _POP_POPCLIENT_HPP_
|
||||
#ifndef _COMMON_WINDOWS_HPP_
|
||||
#include <common/windows.hpp>
|
||||
#endif
|
||||
#ifndef _SOCKET_SOCKET_HPP_
|
||||
#include <socket/socket.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_BLOCK_HPP_
|
||||
#include <common/block.hpp>
|
||||
#endif
|
||||
|
||||
class String;
|
||||
|
||||
class POPClient
|
||||
{
|
||||
public:
|
||||
POPClient(void);
|
||||
virtual ~POPClient();
|
||||
BOOL open(const String &hostName);
|
||||
void close(void);
|
||||
BOOL isConnected(void)const;
|
||||
BOOL isLoggedIn(void)const;
|
||||
BOOL quit(void);
|
||||
BOOL authenticate(const String &user,const String &password);
|
||||
BOOL retrieve(WORD msgNum,Block<String> &messageLines);
|
||||
BOOL top(Block<String> &messageLines,WORD msgNum,WORD lineCount=10);
|
||||
BOOL dele(WORD msgNum);
|
||||
BOOL rset(void);
|
||||
BOOL noop(void);
|
||||
BOOL stat(WORD &messages,WORD &octets);
|
||||
protected:
|
||||
virtual void message(const String &messageString);
|
||||
virtual void message(Block<String> &messageStrings);
|
||||
private:
|
||||
enum {POPPort=110};
|
||||
enum POPCmds{Quit,User,Pass,Stat,Retr,Rset,Dele,Noop,Top};
|
||||
enum POPStatus{Ok,Error};
|
||||
POPClient(const POPClient &somePOPClient);
|
||||
POPClient &operator=(const POPClient &somePOPClient);
|
||||
void isLoggedIn(BOOL isLoggedIn);
|
||||
WORD putControlData(const String &stringData,WORD waitForResponse=TRUE);
|
||||
BOOL isInNakResponse(Block<String> &responseLines);
|
||||
BOOL isInAckResponse(Block<String> &responseLines);
|
||||
BOOL receive(Block<String> &responseLines);
|
||||
BOOL receiveLines(Block<String> &receiveStrings);
|
||||
WORD getControlData(void);
|
||||
void createCmds(void);
|
||||
void createStats(void);
|
||||
|
||||
Socket mPOPControl;
|
||||
WSASystem mWSASystem;
|
||||
Block<String> mPOPCmds;
|
||||
Block<String> mPOPStatus;
|
||||
BOOL mIsLoggedIn;
|
||||
String mSpace;
|
||||
};
|
||||
|
||||
inline
|
||||
BOOL POPClient::isConnected(void)const
|
||||
{
|
||||
return mPOPControl.isConnected();
|
||||
}
|
||||
|
||||
inline
|
||||
BOOL POPClient::isLoggedIn(void)const
|
||||
{
|
||||
return mIsLoggedIn;
|
||||
}
|
||||
|
||||
inline
|
||||
void POPClient::isLoggedIn(BOOL isLoggedIn)
|
||||
{
|
||||
mIsLoggedIn=isLoggedIn;
|
||||
}
|
||||
|
||||
inline
|
||||
void POPClient::close(void)
|
||||
{
|
||||
mPOPControl.destroy();
|
||||
isLoggedIn(FALSE);
|
||||
}
|
||||
#endif
|
||||
421
pop/POPDLG.CPP
Normal file
421
pop/POPDLG.CPP
Normal file
@@ -0,0 +1,421 @@
|
||||
#include <pop/popdlg.hpp>
|
||||
#include <pop/srvrdlg.hpp>
|
||||
#include <pop/popclnt.hpp>
|
||||
#include <pop/srvrreg.hpp>
|
||||
#include <pop/logindlg.hpp>
|
||||
#include <pop/header.hpp>
|
||||
#include <pop/mail.hpp>
|
||||
#include <pop/drgsprt.hpp>
|
||||
#include <common/systime.hpp>
|
||||
#include <common/opendlg.hpp>
|
||||
#include <common/purehdc.hpp>
|
||||
#include <common/crsctrl.hpp>
|
||||
#include <common/brush.hpp>
|
||||
#include <statbar/statbar.hpp>
|
||||
#include <imagelst/ftree.hpp>
|
||||
#include <imagelst/tvmsghdr.hpp>
|
||||
#include <imagelst/imgeinfo.hpp>
|
||||
#include <imagelst/hittest.hpp>
|
||||
|
||||
POPDlg::POPDlg(void)
|
||||
: mIsInDrag(FALSE), mhItemDrop(0), mhItemDrag(0)
|
||||
{
|
||||
mInitHandler.setCallback(this,&POPDlg::initHandler);
|
||||
mDestroyHandler.setCallback(this,&POPDlg::destroyHandler);
|
||||
mCommandHandler.setCallback(this,&POPDlg::commandHandler);
|
||||
mCloseHandler.setCallback(this,&POPDlg::closeHandler);
|
||||
mDlgCodeHandler.setCallback(this,&POPDlg::dlgCodeHandler);
|
||||
mMailSelChangedHandler.setCallback(this,&POPDlg::mailSelChangedHandler);
|
||||
mMailBeginDragHandler.setCallback(this,&POPDlg::mailBeginDragHandler);
|
||||
mFolderBeginDragHandler.setCallback(this,&POPDlg::folderBeginDragHandler);
|
||||
mMouseMoveHandler.setCallback(this,&POPDlg::mouseMoveHandler);
|
||||
mLeftButtonUpHandler.setCallback(this,&POPDlg::leftButtonUpHandler);
|
||||
|
||||
Callback<POPDlg> mRightButtonDownHandler;
|
||||
Callback<POPDlg> mRightButtonUpHandler;
|
||||
|
||||
DWindow::insertHandler(VectorHandler::InitDialogHandler,&mInitHandler);
|
||||
DWindow::insertHandler(VectorHandler::DestroyHandler,&mDestroyHandler);
|
||||
DWindow::insertHandler(VectorHandler::CommandHandler,&mCommandHandler);
|
||||
DWindow::insertHandler(VectorHandler::CloseHandler,&mCloseHandler);
|
||||
DWindow::insertHandler(VectorHandler::DialogCodeHandler,&mDlgCodeHandler);
|
||||
DWindow::insertHandler(VectorHandler::MouseMoveHandler,&mMouseMoveHandler);
|
||||
DWindow::insertHandler(VectorHandler::LeftButtonUpHandler,&mLeftButtonUpHandler);
|
||||
}
|
||||
|
||||
POPDlg::~POPDlg()
|
||||
{
|
||||
DWindow::removeHandler(VectorHandler::InitDialogHandler,&mInitHandler);
|
||||
DWindow::removeHandler(VectorHandler::DestroyHandler,&mDestroyHandler);
|
||||
DWindow::removeHandler(VectorHandler::CommandHandler,&mCommandHandler);
|
||||
DWindow::removeHandler(VectorHandler::CloseHandler,&mCloseHandler);
|
||||
DWindow::removeHandler(VectorHandler::DialogCodeHandler,&mDlgCodeHandler);
|
||||
DWindow::removeHandler(VectorHandler::MouseMoveHandler,&mMouseMoveHandler);
|
||||
DWindow::removeHandler(VectorHandler::LeftButtonUpHandler,&mLeftButtonUpHandler);
|
||||
}
|
||||
|
||||
POPDlg &POPDlg::operator=(const POPDlg &/*somePOPDlg*/)
|
||||
{ // private implementation
|
||||
return *this;
|
||||
}
|
||||
|
||||
BOOL POPDlg::perform(void)
|
||||
{
|
||||
return ::DialogBoxParam(processInstance(),(LPSTR)"POPCLIENT",(HWND)0,DWindow::DlgProc,(LPARAM)(DWindow*)this);
|
||||
}
|
||||
|
||||
CallbackData::ReturnType POPDlg::initHandler(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
mStatusBar=new StatusBar(*this);
|
||||
mFolderTree=new FolderTree(*this,Rect(xFolder,yFolder,cxFolder,cyFolder),110);
|
||||
mFolderTree->insertHandler(FolderTree::BeginDragHandler,&mFolderBeginDragHandler);
|
||||
mMailTree=new FolderTree(*this,Rect(xMail,yMail,cxMail,cyMail),111);
|
||||
mMailTree->insertHandler(FolderTree::SelChangedHandler,&mMailSelChangedHandler);
|
||||
mMailTree->insertHandler(FolderTree::BeginDragHandler,&mMailBeginDragHandler);
|
||||
mFolderTree.disposition(PointerDisposition::Delete);
|
||||
mMailTree.disposition(PointerDisposition::Delete);
|
||||
mStatusBar.disposition(PointerDisposition::Delete);
|
||||
getMail();
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType POPDlg::destroyHandler(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType POPDlg::dlgCodeHandler(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
return (CallbackData::ReturnType)DLGC_WANTARROWS|DLGC_WANTCHARS;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType POPDlg::commandHandler(CallbackData &someCallbackData)
|
||||
{
|
||||
switch(someCallbackData.wmCommandID())
|
||||
{
|
||||
case IDOK :
|
||||
break;
|
||||
case IDCANCEL :
|
||||
endDialog(FALSE);
|
||||
break;
|
||||
case Server :
|
||||
handleServer(someCallbackData);
|
||||
break;
|
||||
case GetMail :
|
||||
getMail();
|
||||
break;
|
||||
}
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType POPDlg::closeHandler(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType POPDlg::mouseMoveHandler(CallbackData &someCallbackData)
|
||||
{
|
||||
if(!mIsInDrag)return (CallbackData::ReturnType)FALSE;
|
||||
GDIPoint mousePoint(someCallbackData.loWord(),someCallbackData.hiWord());
|
||||
mImageList.dragMove(GDIPoint(mousePoint.x(),mousePoint.y()+::GetSystemMetrics(SM_CYCAPTION)));
|
||||
handleFolderDrag();
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType POPDlg::leftButtonUpHandler(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
if(!mIsInDrag)return (CallbackData::ReturnType)FALSE;
|
||||
mIsInDrag=FALSE;
|
||||
mImageList.dragLeave(*this);
|
||||
mImageList.endDrag();
|
||||
mImageList=(HIMAGELIST)0;
|
||||
copyItem(mhItemDrag,mhItemDrop);
|
||||
mMailTree->remove(mhItemDrag);
|
||||
mFolderTree->selectDropTarget((HTREEITEM)0);
|
||||
releaseCapture();
|
||||
mhItemDrag=0;
|
||||
mhItemDrop=0;
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType POPDlg::mailBeginDragHandler(CallbackData &someCallbackData)
|
||||
{
|
||||
#if 0
|
||||
GDIPoint ptAction;
|
||||
HitTestInfo hitInfo;
|
||||
|
||||
mIsInDrag=TRUE;
|
||||
::GetCursorPos(&((POINT&)ptAction));
|
||||
::ScreenToClient(mMailTree->getControlWnd(),&((POINT&)ptAction));
|
||||
hitInfo.point(ptAction);
|
||||
mhItemDrag=mMailTree->hitTest(hitInfo);
|
||||
mMailTree->selectItem(mhItemDrag);
|
||||
mhItemDrag=hitInfo.item();
|
||||
mImageList=mMailTree->createDragImage(mhItemDrag);
|
||||
mImageList.dragShowNoLock(TRUE);
|
||||
mImageList.setDragCursorImage(0,GDIPoint());
|
||||
mImageList.beginDrag(0,GDIPoint());
|
||||
::GetCursorPos(&((POINT&)ptAction));
|
||||
::ScreenToClient(*this,&((POINT&)ptAction));
|
||||
ptAction.y(ptAction.y()+::GetSystemMetrics(SM_CYCAPTION));
|
||||
mImageList.dragMove(ptAction);
|
||||
mImageList.dragEnter(*this,ptAction);
|
||||
setCapture();
|
||||
#endif
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType POPDlg::mailSelChangedHandler(CallbackData &someCallbackData)
|
||||
{
|
||||
String itemID;
|
||||
|
||||
::sprintf(itemID,"index:%d type:%d\n",someCallbackData.loWord()-1,someCallbackData.hiWord());
|
||||
::OutputDebugString(itemID);
|
||||
// TreeViewMessageHeader &treeViewMessageHeader=*((TreeViewMessageHeader*)someCallbackData.lParam());
|
||||
// setDisplay(someCallbackData.loWord()-1);
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType POPDlg::rightButtonUpHandler(CallbackData &someCallbackData)
|
||||
{
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType POPDlg::rightButtonDownHandler(CallbackData &someCallbackData)
|
||||
{
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType POPDlg::folderBeginDragHandler(CallbackData &someCallbackData)
|
||||
{
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
void POPDlg::handleFolderDrag(void)
|
||||
{
|
||||
HTREEITEM hItemDrop;
|
||||
HitTestInfo hitInfo;
|
||||
GDIPoint ptAction;
|
||||
|
||||
::GetCursorPos(&((POINT&)ptAction));
|
||||
::ScreenToClient((HWND)(*mFolderTree),&((POINT&)ptAction));
|
||||
hitInfo.point(ptAction);
|
||||
if(0!=(hItemDrop=mFolderTree->hitTest(hitInfo)))
|
||||
{
|
||||
mImageList.dragLeave(*this);
|
||||
mFolderTree->selectDropTarget(hItemDrop);
|
||||
mhItemDrop=hItemDrop;
|
||||
::GetCursorPos(&((POINT&)ptAction));
|
||||
::ScreenToClient(*this,&((POINT&)ptAction));
|
||||
ptAction.y(ptAction.y()+::GetSystemMetrics(SM_CYCAPTION));
|
||||
mImageList.dragEnter(*this,ptAction);
|
||||
}
|
||||
}
|
||||
|
||||
void POPDlg::copyItem(HTREEITEM hDragItem,HTREEITEM hDropItem)
|
||||
{
|
||||
TreeViewInsert tvInsert;
|
||||
TreeViewItem tvItem;
|
||||
String strItem;
|
||||
|
||||
strItem.length(String::MaxString);
|
||||
tvItem.item(hDragItem);
|
||||
tvItem.maxText(String::MaxString);
|
||||
tvItem.text(strItem);
|
||||
tvItem.mask(TreeViewItem::MaskChildren|TreeViewItem::MaskHandle|TreeViewItem::MaskImage|TreeViewItem::MaskSelectedImage|TreeViewItem::MaskText);
|
||||
mMailTree->getItem(tvItem);
|
||||
tvInsert.parent(hDropItem);
|
||||
tvInsert.insertAfter(TreeViewInsert::InsertSort);
|
||||
tvInsert.viewItem(tvItem);
|
||||
mFolderTree->insertItem(tvInsert);
|
||||
mMailTree->invalidate();
|
||||
mMailTree->update();
|
||||
mFolderTree->invalidate();
|
||||
mFolderTree->update();
|
||||
return;
|
||||
}
|
||||
|
||||
void POPDlg::handleServer(CallbackData &someCallbackData)
|
||||
{
|
||||
ServerDialog serverDialog(*this);
|
||||
serverDialog.performDialog();
|
||||
}
|
||||
|
||||
void POPDlg::getMail(void)
|
||||
{
|
||||
retrieveMail();
|
||||
populateMail();
|
||||
populateFolders();
|
||||
}
|
||||
|
||||
#if 0
|
||||
void POPDlg::retrieveMail(void)
|
||||
{
|
||||
mMailBlock.remove();
|
||||
|
||||
for(int itemIndex=0;itemIndex<20;itemIndex++)
|
||||
{
|
||||
String strIndex;
|
||||
Block<String> mailBlock;
|
||||
::sprintf(strIndex,"(%d)",itemIndex);
|
||||
mailBlock.insert(&String(String("From: Sean Kessler")+strIndex+String("<europa@li.net>")));
|
||||
mailBlock.insert(&String(" "));
|
||||
mailBlock.insert(&String("Sean Kessler wrote:"));
|
||||
mailBlock.insert(&strIndex);
|
||||
mMailBlock.insert(&Mail(mailBlock));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
void POPDlg::retrieveMail(void)
|
||||
{
|
||||
POPClient popClient;
|
||||
ServerReg serverReg;
|
||||
WORD messages;
|
||||
WORD octets;
|
||||
|
||||
mMailBlock.remove();
|
||||
if(!handleLoginParams(serverReg)){userMessage("Incorrect Login.");return;}
|
||||
if(!popClient.open(serverReg.serverName())){userMessage("Connect Failed..");return;}
|
||||
if(!popClient.authenticate(serverReg.userName(),serverReg.password()))
|
||||
{
|
||||
popClient.quit();
|
||||
popClient.close();
|
||||
userMessage("Authentication Failed.");
|
||||
return;
|
||||
}
|
||||
popClient.stat(messages,octets);
|
||||
if(!messages){userMessage("No Messages.");return;}
|
||||
for(int msgIndex=1;msgIndex<=messages;msgIndex++)
|
||||
{
|
||||
mMailBlock.insert(&Mail());
|
||||
Block<String> &msgLines=mMailBlock[mMailBlock.size()-1];
|
||||
Header &mailHeader=mMailBlock[mMailBlock.size()-1];
|
||||
popClient.retrieve(msgIndex,msgLines);
|
||||
mailHeader=msgLines;
|
||||
if(!msgLines.size())continue;
|
||||
}
|
||||
popClient.quit();
|
||||
popClient.close();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void POPDlg::retrieveMail(void)
|
||||
{
|
||||
POPClient popClient;
|
||||
ServerReg serverReg;
|
||||
WORD messages;
|
||||
WORD octets;
|
||||
|
||||
mMailBlock.remove();
|
||||
if(!handleLoginParams(serverReg)){userMessage("Incorrect Login.");return;}
|
||||
if(!popClient.open(serverReg.serverName())){userMessage("Connect Failed..");return;}
|
||||
if(!popClient.authenticate(serverReg.userName(),serverReg.password()))
|
||||
{
|
||||
popClient.quit();
|
||||
popClient.close();
|
||||
userMessage("Authentication Failed.");
|
||||
return;
|
||||
}
|
||||
popClient.stat(messages,octets);
|
||||
if(!messages)::MessageBox(*this,"No Messages","POPCLIENT",MB_OK);
|
||||
else
|
||||
{
|
||||
String strCount;
|
||||
::sprintf(strCount,"%d message(s)",messages);
|
||||
::MessageBox(*this,strCount,"POPCLIENT",MB_OK);
|
||||
}
|
||||
// for(int msgIndex=1;msgIndex<=messages;msgIndex++)
|
||||
// {
|
||||
// mMailBlock.insert(&Mail());
|
||||
// Block<String> &msgLines=mMailBlock[mMailBlock.size()-1];
|
||||
// Header &mailHeader=mMailBlock[mMailBlock.size()-1];
|
||||
// popClient.retrieve(msgIndex,msgLines);
|
||||
// mailHeader=msgLines;
|
||||
// if(!msgLines.size())continue;
|
||||
// }
|
||||
popClient.quit();
|
||||
popClient.close();
|
||||
}
|
||||
|
||||
BOOL POPDlg::handleLoginParams(ServerReg &serverReg)
|
||||
{
|
||||
if(serverReg.serverName().isNull()){::MessageBox(*this,(LPSTR)"No Server Defined",(LPSTR)"SERVER ERROR",MB_ICONSTOP);return FALSE;}
|
||||
if(serverReg.userName().isNull()||serverReg.password().isNull())
|
||||
{
|
||||
String userName;
|
||||
String password;
|
||||
LoginDialog loginDialog;
|
||||
if(!loginDialog.performLogin())return FALSE;
|
||||
userName=loginDialog.userName();
|
||||
password=loginDialog.password();
|
||||
serverReg.userName(userName);
|
||||
serverReg.password(password);
|
||||
}
|
||||
if(serverReg.userName().isNull()||serverReg.password().isNull())return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void POPDlg::populateMail(void)
|
||||
{
|
||||
String strMailBox(STRING_MAILBOXNAME);
|
||||
|
||||
mMailTree->setRedraw(FALSE);
|
||||
mMailTree->remove();
|
||||
mMailTree->addRootNode(FolderTree::FolderClosed,strMailBox,makeItemID(NullNode,RootID));
|
||||
for(int itemIndex=0;itemIndex<mMailBlock.size();itemIndex++)
|
||||
{
|
||||
TreeViewItem insertItem(0,0,0,0,(LPSTR)mMailBlock[itemIndex].from(),mMailBlock[itemIndex].from().length(),3,3,0,makeItemID(MailNode,itemIndex+1));
|
||||
mMailTree->addNode(TreeView::NodeChild,insertItem,strMailBox);
|
||||
}
|
||||
mMailTree->setRedraw(TRUE);
|
||||
}
|
||||
|
||||
void POPDlg::populateFolders(void)
|
||||
{
|
||||
String strUserFolder(STRING_USERFOLDERNAME);
|
||||
String strMainFolder("Main Folder");
|
||||
|
||||
mFolderTree->setRedraw(FALSE);
|
||||
mFolderTree->remove();
|
||||
mFolderTree->addRootNode(FolderTree::FolderClosed,strUserFolder,makeItemID(NullNode,RootID));
|
||||
TreeViewItem insertItem(0,0,0,0,(LPSTR)strMainFolder,strMainFolder.length(),3,3,0,makeItemID(MailNode,1));
|
||||
mFolderTree->addNode(TreeView::NodeChild,insertItem,strUserFolder);
|
||||
mFolderTree->setRedraw(TRUE);
|
||||
}
|
||||
|
||||
void POPDlg::setDisplay(int itemID)
|
||||
{
|
||||
String lineItem;
|
||||
Block<String> &mailList=mMailBlock[itemID];
|
||||
|
||||
if(itemID<0)return;
|
||||
for(int itemIndex=0;itemIndex<mailList.size();itemIndex++)
|
||||
{
|
||||
lineItem+=mailList[itemIndex];
|
||||
lineItem+="\r\n";
|
||||
}
|
||||
setText(EditControl,(LPSTR)lineItem);
|
||||
}
|
||||
|
||||
void POPDlg::userMessage(const String &message)
|
||||
{
|
||||
::MessageBox(*this,(LPSTR)(String&)message,(LPSTR)"POPClient",MB_OK);
|
||||
}
|
||||
|
||||
// **************** virtuals
|
||||
|
||||
void POPDlg::message(const String &messageString)
|
||||
{
|
||||
if(!mStatusBar.isOkay())return;
|
||||
mStatusBar->setText(messageString);
|
||||
}
|
||||
|
||||
void POPDlg::message(Block<String> &messageStrings)
|
||||
{
|
||||
if(!mStatusBar.isOkay())return;
|
||||
for(int lineIndex=0;lineIndex<messageStrings.size();lineIndex++)
|
||||
mStatusBar->setText(messageStrings[lineIndex]);
|
||||
}
|
||||
98
pop/POPDLG.HPP
Normal file
98
pop/POPDLG.HPP
Normal file
@@ -0,0 +1,98 @@
|
||||
#ifndef _POP_POPDLG_HPP_
|
||||
#define _POP_POPDLG_HPP_
|
||||
#ifndef _COMMON_DWINDOW_HPP_
|
||||
#include <common/dwindow.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_SMARTPOINTER_HPP_
|
||||
#include <common/pointer.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_RECTANGLE_HPP_
|
||||
#include <common/rect.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_GDIPOINT_HPP_
|
||||
#include <common/gdipoint.hpp>
|
||||
#endif
|
||||
#ifndef _POP_POP_HPP_
|
||||
#include <pop/pop.hpp>
|
||||
#endif
|
||||
#ifndef _IMAGELIST_IMAGELIST_HPP_
|
||||
#include <imagelst/imagelst.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_PUREBITMAP_HPP_
|
||||
#include <common/purebmp.hpp>
|
||||
#endif
|
||||
|
||||
class StatusBar;
|
||||
class FolderTree;
|
||||
class ServerReg;
|
||||
class Mail;
|
||||
|
||||
class POPDlg : public DWindow
|
||||
{
|
||||
public:
|
||||
POPDlg(void);
|
||||
virtual ~POPDlg();
|
||||
BOOL perform(void);
|
||||
protected:
|
||||
virtual void message(const String &messageString);
|
||||
virtual void message(Block<String> &messageStrings);
|
||||
private:
|
||||
enum DlgControls{Server=PC_SERVER,GetMail=PC_GETMAIL,EditControl=PC_EDIT};
|
||||
enum FolderCoords{xFolder=5,yFolder=50,cxFolder=235,cyFolder=150};
|
||||
enum MailCoords{xMail=245,yMail=50,cxMail=235,cyMail=150};
|
||||
enum {RootID=0};
|
||||
enum NodeType{NullNode=0x0000,MailNode=0x0001};
|
||||
POPDlg &operator=(const POPDlg &someMailDlg);
|
||||
CallbackData::ReturnType initHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType destroyHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType commandHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType closeHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType dlgCodeHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType mailSelChangedHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType mailBeginDragHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType folderBeginDragHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType mouseMoveHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType leftButtonUpHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType rightButtonUpHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType rightButtonDownHandler(CallbackData &someCallbackData);
|
||||
|
||||
void handleServer(CallbackData &someCallbackData);
|
||||
void userMessage(const String &message);
|
||||
void retrieveMail(void);
|
||||
void populateFolders(void);
|
||||
void populateMail(void);
|
||||
void getMail(void);
|
||||
void setDisplay(int itemID);
|
||||
BOOL handleLoginParams(ServerReg &serverReg);
|
||||
LPARAM makeItemID(NodeType nodeType,WORD itemID);
|
||||
void handleFolderDrag(void);
|
||||
void copyItem(HTREEITEM hDragItem,HTREEITEM hDropItem);
|
||||
|
||||
Callback<POPDlg> mInitHandler;
|
||||
Callback<POPDlg> mDestroyHandler;
|
||||
Callback<POPDlg> mCommandHandler;
|
||||
Callback<POPDlg> mCloseHandler;
|
||||
Callback<POPDlg> mDlgCodeHandler;
|
||||
Callback<POPDlg> mMailSelChangedHandler;
|
||||
Callback<POPDlg> mMailBeginDragHandler;
|
||||
Callback<POPDlg> mFolderBeginDragHandler;
|
||||
Callback<POPDlg> mMouseMoveHandler;
|
||||
Callback<POPDlg> mLeftButtonUpHandler;
|
||||
Callback<POPDlg> mRightButtonDownHandler;
|
||||
Callback<POPDlg> mRightButtonUpHandler;
|
||||
SmartPointer<StatusBar> mStatusBar;
|
||||
SmartPointer<FolderTree> mFolderTree;
|
||||
SmartPointer<FolderTree> mMailTree;
|
||||
Block<Mail> mMailBlock;
|
||||
BOOL mIsInDrag;
|
||||
HTREEITEM mhItemDrag;
|
||||
HTREEITEM mhItemDrop;
|
||||
ImageList mImageList;
|
||||
};
|
||||
|
||||
inline
|
||||
LPARAM POPDlg::makeItemID(NodeType nodeType,WORD itemID)
|
||||
{
|
||||
return MAKELPARAM(itemID,nodeType);
|
||||
}
|
||||
#endif
|
||||
168
pop/Pop.001
Normal file
168
pop/Pop.001
Normal file
@@ -0,0 +1,168 @@
|
||||
# Microsoft Developer Studio Project File - Name="pop" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 5.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
CFG=pop - Win32 Release
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "Pop.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "Pop.mak" CFG="pop - Win32 Release"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "pop - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "pop - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "pop - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir ".\Release"
|
||||
# PROP BASE Intermediate_Dir ".\Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir ".\Release"
|
||||
# PROP Intermediate_Dir ".\Release"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
|
||||
|
||||
!ELSEIF "$(CFG)" == "pop - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir ".\Debug"
|
||||
# PROP BASE Intermediate_Dir ".\Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir ".\msvcobj"
|
||||
# PROP Intermediate_Dir ".\msvcobj"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
|
||||
# ADD CPP /nologo /Zp1 /MTd /Gm /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__FLAT__" /D "STRICT" /Fp"c:\work\exe\msvc42.pch" /YX"windows.h" /FD /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib wsock32.lib comctl32.lib /nologo /subsystem:windows /debug /machine:I386
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "pop - Win32 Release"
|
||||
# Name "pop - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Header.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Logindlg.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Main.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Exe\mscommon.lib
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\exe\msdialog.lib
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\exe\msimglst.lib
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Exe\mssocket.lib
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Pop.rc
|
||||
|
||||
!IF "$(CFG)" == "pop - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "pop - Win32 Debug"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Popclnt.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Popdlg.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Srvrdlg.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\exe\statbar.lib
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Main.hpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Mainwnd.hpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Pop.hpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
142
pop/Pop.dsp
Normal file
142
pop/Pop.dsp
Normal file
@@ -0,0 +1,142 @@
|
||||
# Microsoft Developer Studio Project File - Name="pop" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
CFG=pop - Win32 Release
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "Pop.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "Pop.mak" CFG="pop - Win32 Release"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "pop - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "pop - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "pop - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir ".\Release"
|
||||
# PROP BASE Intermediate_Dir ".\Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir ".\Release"
|
||||
# PROP Intermediate_Dir ".\Release"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
|
||||
|
||||
!ELSEIF "$(CFG)" == "pop - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir ".\Debug"
|
||||
# PROP BASE Intermediate_Dir ".\Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir ".\msvcobj"
|
||||
# PROP Intermediate_Dir ".\msvcobj"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
|
||||
# ADD CPP /nologo /Zp1 /MTd /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__FLAT__" /D "STRICT" /Fp"d:\work\exe\msvc42.pch" /YX"windows.h" /FD /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib wsock32.lib comctl32.lib /nologo /subsystem:windows /debug /machine:I386
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "pop - Win32 Release"
|
||||
# Name "pop - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Header.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Logindlg.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Main.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Pop.rc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Popclnt.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Popdlg.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Srvrdlg.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Main.hpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Mainwnd.hpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Pop.hpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
BIN
pop/RCA19935
Normal file
BIN
pop/RCA19935
Normal file
Binary file not shown.
BIN
pop/RDA19935
Normal file
BIN
pop/RDA19935
Normal file
Binary file not shown.
435
pop/SCRAPS.TXT
Normal file
435
pop/SCRAPS.TXT
Normal file
@@ -0,0 +1,435 @@
|
||||
|
||||
// BOOL helo(const String &domainName);
|
||||
// BOOL mail(const String &reversePath);
|
||||
// BOOL rcpt(const String &forwardPath);
|
||||
// BOOL data(const Block<String> &mailData);
|
||||
// BOOL verify(const String &forwardPath);
|
||||
// BOOL expand(const String &mailList);
|
||||
// BOOL send(const String &reversePath);
|
||||
// BOOL sendOrMail(const String &reversePath);
|
||||
// BOOL sendAndMail(const String &reversePath);
|
||||
// BOOL help(const String &commandName=String());
|
||||
// BOOL noop(void);
|
||||
// BOOL reset(void);
|
||||
// BOOL turn(void);
|
||||
// BOOL quit(void);
|
||||
|
||||
BOOL SMTPClient::helo(const String &domainName)
|
||||
{
|
||||
String controlData;
|
||||
Block<String> responseLines;
|
||||
|
||||
if(!mSMTPControl.isConnected()||domainName.isNull())return FALSE;
|
||||
controlData=mSMTPCmds[Helo];
|
||||
controlData+=mSpace;
|
||||
controlData+=domainName;
|
||||
if(!putControlData(controlData,FALSE))return FALSE;
|
||||
if(!mSMTPControl.receive(responseLines))return FALSE;
|
||||
message(responseLines);
|
||||
if(!responseLines.size()||!isInResponse(responseLines.size()>1?responseLines[0].betweenString(0,'-'):responseLines[0].betweenString(0,' '),SMTPResponse::AckHelo))return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL SMTPClient::quit(void)
|
||||
{
|
||||
String controlData;
|
||||
Block<String> responseLines;
|
||||
|
||||
if(!mSMTPControl.isConnected())return FALSE;
|
||||
controlData=mSMTPCmds[Quit];
|
||||
if(!putControlData(controlData,FALSE))return FALSE;
|
||||
if(!mSMTPControl.receive(responseLines))return FALSE;
|
||||
message(responseLines);
|
||||
if(!responseLines.size()||!isInResponse(responseLines.size()>1?responseLines[0].betweenString(0,'-'):responseLines[0].betweenString(0,' '),SMTPResponse::AckQuit))return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL SMTPClient::mail(const String &reversePath)
|
||||
{
|
||||
String controlData;
|
||||
Block<String> responseLines;
|
||||
|
||||
if(!mSMTPControl.isConnected()||reversePath.isNull())return FALSE;
|
||||
controlData=mSMTPCmds[Mail];
|
||||
controlData+=mSpace;
|
||||
controlData+=mSMTPCmds[From];
|
||||
controlData+=reversePath;
|
||||
if(!putControlData(controlData,FALSE))return FALSE;
|
||||
if(!mSMTPControl.receive(responseLines))return FALSE;
|
||||
message(responseLines);
|
||||
if(!responseLines.size()||!isInResponse(responseLines.size()>1?responseLines[0].betweenString(0,'-'):responseLines[0].betweenString(0,' '),SMTPResponse::AckMail))return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL SMTPClient::rcpt(const String &forwardPath)
|
||||
{
|
||||
String controlData;
|
||||
Block<String> responseLines;
|
||||
|
||||
if(!mSMTPControl.isConnected()||forwardPath.isNull())return FALSE;
|
||||
controlData=mSMTPCmds[Recipient];
|
||||
controlData+=mSpace;
|
||||
controlData+=mSMTPCmds[To];
|
||||
controlData+=forwardPath;
|
||||
if(!putControlData(controlData,FALSE))return FALSE;
|
||||
if(!mSMTPControl.receive(responseLines))return FALSE;
|
||||
message(responseLines);
|
||||
if(!responseLines.size()||!isInResponse(responseLines.size()>1?responseLines[0].betweenString(0,'-'):responseLines[0].betweenString(0,' '),SMTPResponse::AckRecipient))return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL SMTPClient::data(const Block<String> &mailData)
|
||||
{
|
||||
String controlData;
|
||||
Block<String> responseLines;
|
||||
|
||||
if(!mSMTPControl.isConnected()||!mailData.size())return FALSE;
|
||||
controlData=mSMTPCmds[Data];
|
||||
if(!putControlData(controlData,FALSE))return FALSE;
|
||||
if(!mSMTPControl.receive(responseLines))return FALSE;
|
||||
message(responseLines);
|
||||
if(!responseLines.size()||!isInResponse(responseLines.size()>1?responseLines[0].betweenString(0,'-'):responseLines[0].betweenString(0,' '),SMTPResponse::AckData))return FALSE;
|
||||
for(int lineIndex=0;lineIndex<mailData.size();lineIndex++)mSMTPControl.send(((Block<String>&)mailData)[lineIndex]);
|
||||
mSMTPControl.send(".");
|
||||
if(!mSMTPControl.receive(responseLines))return FALSE;
|
||||
message(responseLines);
|
||||
if(!responseLines.size()||!isInResponse(responseLines.size()>1?responseLines[0].betweenString(0,'-'):responseLines[0].betweenString(0,' '),SMTPResponse::AckData))return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL SMTPClient::verify(const String &forwardPath)
|
||||
{
|
||||
String controlData;
|
||||
Block<String> responseLines;
|
||||
|
||||
if(!mSMTPControl.isConnected()||forwardPath.isNull())return FALSE;
|
||||
controlData=mSMTPCmds[Verify];
|
||||
controlData+=mSpace;
|
||||
controlData+=forwardPath;
|
||||
if(!putControlData(controlData,FALSE))return FALSE;
|
||||
if(!mSMTPControl.receive(responseLines))return FALSE;
|
||||
message(responseLines);
|
||||
if(!responseLines.size()||!isInResponse(responseLines.size()>1?responseLines[0].betweenString(0,'-'):responseLines[0].betweenString(0,' '),SMTPResponse::AckVerify))return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL SMTPClient::expand(const String &mailList)
|
||||
{
|
||||
String controlData;
|
||||
Block<String> responseLines;
|
||||
|
||||
if(!mSMTPControl.isConnected()||mailList.isNull())return FALSE;
|
||||
controlData=mSMTPCmds[Verify];
|
||||
controlData+=mSpace;
|
||||
controlData+=mailList;
|
||||
if(!putControlData(controlData,FALSE))return FALSE;
|
||||
if(!mSMTPControl.receive(responseLines))return FALSE;
|
||||
message(responseLines);
|
||||
if(!responseLines.size()||!isInResponse(responseLines.size()>1?responseLines[0].betweenString(0,'-'):responseLines[0].betweenString(0,' '),SMTPResponse::AckExpand))return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL SMTPClient::send(const String &reversePath)
|
||||
{
|
||||
String controlData;
|
||||
Block<String> responseLines;
|
||||
|
||||
if(!mSMTPControl.isConnected()||reversePath.isNull())return FALSE;
|
||||
controlData=mSMTPCmds[Send];
|
||||
controlData+=mSpace;
|
||||
controlData+=mSMTPCmds[From];
|
||||
controlData+=reversePath;
|
||||
if(!putControlData(controlData,FALSE))return FALSE;
|
||||
if(!mSMTPControl.receive(responseLines))return FALSE;
|
||||
message(responseLines);
|
||||
if(!responseLines.size()||!isInResponse(responseLines.size()>1?responseLines[0].betweenString(0,'-'):responseLines[0].betweenString(0,' '),SMTPResponse::AckSend))return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL SMTPClient::sendOrMail(const String &reversePath)
|
||||
{
|
||||
String controlData;
|
||||
Block<String> responseLines;
|
||||
|
||||
if(!mSMTPControl.isConnected()||reversePath.isNull())return FALSE;
|
||||
controlData=mSMTPCmds[SendOrMail];
|
||||
controlData+=mSpace;
|
||||
controlData+=mSMTPCmds[From];
|
||||
controlData+=reversePath;
|
||||
if(!putControlData(controlData,FALSE))return FALSE;
|
||||
if(!mSMTPControl.receive(responseLines))return FALSE;
|
||||
message(responseLines);
|
||||
if(!responseLines.size()||!isInResponse(responseLines.size()>1?responseLines[0].betweenString(0,'-'):responseLines[0].betweenString(0,' '),SMTPResponse::AckSendOrMail))return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL SMTPClient::sendAndMail(const String &reversePath)
|
||||
{
|
||||
String controlData;
|
||||
Block<String> responseLines;
|
||||
|
||||
if(!mSMTPControl.isConnected()||reversePath.isNull())return FALSE;
|
||||
controlData=mSMTPCmds[SendAndMail];
|
||||
controlData+=mSpace;
|
||||
controlData+=mSMTPCmds[From];
|
||||
controlData+=reversePath;
|
||||
if(!putControlData(controlData,FALSE))return FALSE;
|
||||
if(!mSMTPControl.receive(responseLines))return FALSE;
|
||||
message(responseLines);
|
||||
if(!responseLines.size()||!isInResponse(responseLines.size()>1?responseLines[0].betweenString(0,'-'):responseLines[0].betweenString(0,' '),SMTPResponse::AckSendAndMail))return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL SMTPClient::reset(void)
|
||||
{
|
||||
String controlData;
|
||||
Block<String> responseLines;
|
||||
|
||||
if(!mSMTPControl.isConnected())return FALSE;
|
||||
controlData=mSMTPCmds[Reset];
|
||||
if(!putControlData(controlData,FALSE))return FALSE;
|
||||
if(!mSMTPControl.receive(responseLines))return FALSE;
|
||||
message(responseLines);
|
||||
if(!responseLines.size()||!isInResponse(responseLines.size()>1?responseLines[0].betweenString(0,'-'):responseLines[0].betweenString(0,' '),SMTPResponse::AckReset))return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL SMTPClient::help(const String &commandName)
|
||||
{
|
||||
String controlData;
|
||||
Block<String> responseLines;
|
||||
|
||||
if(!mSMTPControl.isConnected())return FALSE;
|
||||
controlData=mSMTPCmds[Help];
|
||||
if(!commandName.isNull())
|
||||
{
|
||||
controlData+=mSpace;
|
||||
controlData+=commandName;
|
||||
}
|
||||
if(!putControlData(controlData,FALSE))return FALSE;
|
||||
if(!mSMTPControl.receive(responseLines))return FALSE;
|
||||
message(responseLines);
|
||||
if(!responseLines.size()||!isInResponse(responseLines.size()>1?responseLines[0].betweenString(0,'-'):responseLines[0].betweenString(0,' '),SMTPResponse::AckHelp))return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL SMTPClient::noop(void)
|
||||
{
|
||||
String controlData;
|
||||
Block<String> responseLines;
|
||||
|
||||
if(!mSMTPControl.isConnected())return FALSE;
|
||||
controlData=mSMTPCmds[Noop];
|
||||
if(!putControlData(controlData,FALSE))return FALSE;
|
||||
if(!mSMTPControl.receive(responseLines))return FALSE;
|
||||
message(responseLines);
|
||||
if(!responseLines.size()||!isInResponse(responseLines.size()>1?responseLines[0].betweenString(0,'-'):responseLines[0].betweenString(0,' '),SMTPResponse::AckNoop))return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL SMTPClient::turn(void)
|
||||
{
|
||||
String controlData;
|
||||
Block<String> responseLines;
|
||||
|
||||
if(!mSMTPControl.isConnected())return FALSE;
|
||||
controlData=mSMTPCmds[Turn];
|
||||
if(!putControlData(controlData,FALSE))return FALSE;
|
||||
if(!mSMTPControl.receive(responseLines))return FALSE;
|
||||
message(responseLines);
|
||||
if(!responseLines.size()||!isInResponse(responseLines.size()>1?responseLines[0].betweenString(0,'-'):responseLines[0].betweenString(0,' '),SMTPResponse::AckTurn))return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// BOOL isInResponse(const String &responseString,SMTPResponse::RspType responseType);
|
||||
//inline
|
||||
//BOOL SMTPClient::isInResponse(const String &responseString,SMTPResponse::RspType responseType)
|
||||
//{
|
||||
// return mSMTPResponse.isInResponse(responseString,responseType);
|
||||
//}
|
||||
|
||||
|
||||
|
||||
|
||||
void POPDlg::retrieveMail(void)
|
||||
{
|
||||
POPClient popClient;
|
||||
ServerReg serverReg;
|
||||
WORD messages;
|
||||
WORD octets;
|
||||
|
||||
mMailBlock.remove();
|
||||
if(!handleLoginParams(serverReg))return;
|
||||
if(!popClient.open(serverReg.serverName()))return;
|
||||
if(!popClient.authenticate(serverReg.userName(),serverReg.password()))
|
||||
{
|
||||
popClient.quit();
|
||||
popClient.close();
|
||||
return;
|
||||
}
|
||||
popClient.stat(messages,octets);
|
||||
if(!messages)::MessageBox(*this,(LPSTR)"No Messages On Server",(LPSTR)"MAIL",MB_OK);
|
||||
// sendMessage(ListBox,WM_SETREDRAW,FALSE,0L);
|
||||
// sendMessage(ListBox,LB_RESETCONTENT,0,0L);
|
||||
for(int msgIndex=1;msgIndex<=messages;msgIndex++)
|
||||
{
|
||||
mMailBlock.insert(&Block<String>());
|
||||
Block<String> &msgLines=mMailBlock[mMailBlock.size()-1];
|
||||
popClient.retrieve(msgIndex,msgLines);
|
||||
if(!msgLines.size())continue;
|
||||
// for(int msgLine=0;msgLine<msgLines.size();msgLine++)
|
||||
// {
|
||||
// if(msgLines[msgLine].strstr("From:"))sendMessage(ListBox,LB_ADDSTRING,0,(LPARAM)(LPSTR)msgLines[msgLine]);
|
||||
// }
|
||||
// popClient.top(msgLines,msgIndex);
|
||||
// if(!msgLines.size())continue;
|
||||
// for(int msgLine=0;msgLine<msgLines.size();msgLine++)
|
||||
// {
|
||||
// if(msgLines[msgLine].strstr("From:"))sendMessage(ListBox,LB_ADDSTRING,0,(LPARAM)(LPSTR)msgLines[msgLine]);
|
||||
// }
|
||||
}
|
||||
// sendMessage(ListBox,WM_SETREDRAW,TRUE,0L);
|
||||
// for(int msgIndex=1;msgIndex<=messages;msgIndex++)popClient.retrieve(msgIndex,msgLines);
|
||||
popClient.quit();
|
||||
popClient.close();
|
||||
}
|
||||
|
||||
|
||||
CallbackData::ReturnType POPDlg::mouseMoveHandler(CallbackData &someCallbackData)
|
||||
{
|
||||
if(!mIsInDrag)return (CallbackData::ReturnType)FALSE;
|
||||
PureDevice displayDevice(*this);
|
||||
mDragSprite.setDevice(displayDevice);
|
||||
mDragSprite.moveSprite(Point(someCallbackData.loWord(),someCallbackData.hiWord()));
|
||||
|
||||
// if(!mImageList.dragMove(GDIPoint(someCallbackData.loWord(),someCallbackData.hiWord())))::OutputDebugString("DragMove Failed\n");
|
||||
// if(!ImageList_DragMove(someCallbackData.loWord(),someCallbackData.hiWord()))::OutputDebugString("ImageList_DragMove failed\n");
|
||||
// ::OutputDebugString("MouseMove\n");
|
||||
// PureDevice displayDevice(*this);
|
||||
// Point cursorPoint(someCallbackData.loWord(),someCallbackData.hiWord());
|
||||
// cursorPoint.x(cursorPoint.x()-mRelPoint.x());
|
||||
// cursorPoint.y(cursorPoint.y()-mRelPoint.y());
|
||||
|
||||
// cursorPoint.x(mItemRect.left());
|
||||
// cursorPoint.y(mItemRect.top());
|
||||
|
||||
|
||||
// mImageList.drawImage(displayDevice,cursorPoint,0,ImageList::DrawOverlayMask);
|
||||
// enum DrawFlag{DrawNormal=ILD_NORMAL,DrawTransparent=ILD_TRANSPARENT,DrawMask=ILD_MASK,
|
||||
// DrawImage=ILD_IMAGE,DrawBlend25=ILD_BLEND25,DrawBlend50=ILD_BLEND50,
|
||||
// DrawOverlayMask=ILD_OVERLAYMASK};
|
||||
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType POPDlg::leftButtonUpHandler(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
if(!mIsInDrag)return (CallbackData::ReturnType)FALSE;
|
||||
// mImageList.endDrag();
|
||||
// ImageList_EndDrag();
|
||||
::ReleaseCapture();
|
||||
::ShowCursor(TRUE);
|
||||
mIsInDrag=FALSE;
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
#include <pop/drgsprt.hpp>
|
||||
CallbackData::ReturnType POPDlg::mailBeginDragHandler(CallbackData &someCallbackData)
|
||||
{
|
||||
mIsInDrag=TRUE;
|
||||
TreeViewMessageHeader &treeViewMessageHeader=*((TreeViewMessageHeader*)someCallbackData.lParam());
|
||||
mImageList=mMailTree->createDragImage(treeViewMessageHeader.itemNew().item());
|
||||
|
||||
PureDevice displayDevice(*this);
|
||||
ImageInfo imageInfo;
|
||||
mImageList.imageInfo(0,imageInfo);
|
||||
mDragSprite.setDevice(displayDevice);
|
||||
mDragSprite.setBitmap(imageInfo.colorBitmap());
|
||||
//DragSprite dragSprite(imageInfo.colorBitmap());
|
||||
// dragSprite.moveSprite(treeViewMessageHeader.pointDrag());
|
||||
Point movePoint(treeViewMessageHeader.pointDrag().x(),treeViewMessageHeader.pointDrag().y());
|
||||
mDragSprite.moveSprite(movePoint);
|
||||
|
||||
// mMailTree->getItemRect(mItemRect,treeViewMessageHeader.itemNew().item(),FALSE);
|
||||
// GDIPoint pointDrag(treeViewMessageHeader.pointDrag());
|
||||
// GDIPoint cursorPos;
|
||||
// ::GetCursorPos(&((POINT&)cursorPos));
|
||||
// pointDrag.x(cursorPos.x());
|
||||
// pointDrag.y(cursorPos.y());
|
||||
// ImageList_DragEnter(NULL,pointDrag.x(),pointDrag.y());
|
||||
// if(!mImageList.beginDrag(0,pointDrag))::OutputDebugString("BeginDrag Failed.\n");
|
||||
// if(!mImageList.beginDrag(0,GDIPoint()))::OutputDebugString("BeginDrag Failed.\n");
|
||||
::ShowCursor(FALSE);
|
||||
::SetCapture(*this);
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// mMailTree->getItemRect(mItemRect,treeViewMessageHeader.itemNew().item(),FALSE);
|
||||
// mMailTree->getItemRect(mItemRect,treeViewMessageHeader.itemNew().item(),FALSE);
|
||||
// GDIPoint pointDrag(treeViewMessageHeader.pointDrag());
|
||||
// GDIPoint cursorPos;
|
||||
// ::GetCursorPos(&((POINT&)cursorPos));
|
||||
// pointDrag.x(cursorPos.x());
|
||||
// pointDrag.y(cursorPos.y());
|
||||
// ImageList_DragEnter(NULL,pointDrag.x(),pointDrag.y());
|
||||
// if(!mImageList.beginDrag(0,pointDrag))::OutputDebugString("BeginDrag Failed.\n");
|
||||
// if(!mImageList.beginDrag(0,GDIPoint()))::OutputDebugString("BeginDrag Failed.\n");
|
||||
|
||||
|
||||
#if 0
|
||||
ImageInfo imageInfo;
|
||||
mImageList.imageInfo(0,imageInfo);
|
||||
mDragSprite.setDevice(displayDevice);
|
||||
mDragSprite.setBitmap(imageInfo.colorBitmap());
|
||||
mMailTree->getItemRect(mItemRect,treeViewMessageHeader.itemNew().item(),TRUE);
|
||||
Point movePoint(mItemRect.left(),mItemRect.top());
|
||||
mDragSprite.moveSprite(movePoint);
|
||||
#endif
|
||||
|
||||
|
||||
#if 0
|
||||
PureDevice displayDevice(*this);
|
||||
PureDevice memDevice(displayDevice);
|
||||
PureBitmap pureBitmap(imageInfo.colorBitmap());
|
||||
PureBitmap pureList(processInstance(),"LIST");
|
||||
PureBitmap pureBitmap(pureList);
|
||||
memDevice.select((GDIObj)pureBitmap);
|
||||
Rect dstRect(0,0,pureBitmap.width(),pureBitmap.height());
|
||||
Point srcPoint(0,0);
|
||||
if(!displayDevice.bitBlt(dstRect,memDevice,srcPoint))::OutputDebugString("BitBlt failed/n");
|
||||
#endif
|
||||
|
||||
// BITMAP bmBitmap;
|
||||
// memDevice.select(imageInfo.colorBitmap());
|
||||
// ::GetObject(imageInfo.maskBitmap(),sizeof(BITMAP),(LPSTR)&bmBitmap);
|
||||
// Rect dstRect(0,0,bmBitmap.bmWidthBytes,bmBitmap.bmHeight);
|
||||
// Rect dstRect(0,0,pureBitmap.widthBytes(),pureBitmap.height());
|
||||
|
||||
// BITMAP bm;
|
||||
// HDC hDC=::GetDC(*this);
|
||||
// HDC hMemDC=::CreateCompatibleDC(hDC);
|
||||
// HBITMAP hBitmap(imageInfo.colorBitmap());
|
||||
// PureBitmap hBitmap(processInstance(),"LIST");
|
||||
// ::GetObject(hBitmap,sizeof(BITMAP),(LPSTR)&bm);
|
||||
// ::SelectObject(hMemDC,hBitmap);
|
||||
// ::BitBlt(hDC,0,0,bm.bmWidth,bm.bmHeight,hMemDC,0,0,SRCCOPY);
|
||||
// ::BitBlt(hDC,0,0,hBitmap.width(),hBitmap.height(),hMemDC,0,0,SRCCOPY);
|
||||
// ::ReleaseDC(*this,hDC);
|
||||
// ::DeleteDC(hMemDC);
|
||||
|
||||
|
||||
// if(!mBitmapScratch.isOkay())mBitmapScratch=new PureBitmap();
|
||||
// mMailTree->getItemRect(mItemRect,treeViewMessageHeader.itemNew().item(),FALSE);
|
||||
// mImageList.imageInfo(0,imageInfo);
|
||||
// mImageList.drawImage(pureDevice,Point(),0);
|
||||
|
||||
|
||||
#if 0
|
||||
TreeViewMessageHeader &treeViewMessageHeader=*((TreeViewMessageHeader*)someCallbackData.lParam());
|
||||
NM_TREEVIEW *pNMHeader=(NM_TREEVIEW*)&treeViewMessageHeader;
|
||||
#endif
|
||||
89
pop/SPRITE.CPP
Normal file
89
pop/SPRITE.CPP
Normal file
@@ -0,0 +1,89 @@
|
||||
#include <common/purehdc.hpp>
|
||||
#include <common/rgbcolor.hpp>
|
||||
#include <pop/sprite.hpp>
|
||||
|
||||
//PureSprite::PureSprite(PureDevice &displayDevice,Point startPoint)
|
||||
//: mDisplayDevice(displayDevice)
|
||||
//{
|
||||
//}
|
||||
|
||||
PureSprite::PureSprite(void)
|
||||
{
|
||||
}
|
||||
|
||||
PureSprite::~PureSprite()
|
||||
{
|
||||
}
|
||||
|
||||
PureSprite::operator PureBitmap&(void)
|
||||
{
|
||||
return mBitmapNothing;
|
||||
}
|
||||
|
||||
void PureSprite::moveSprite(const Point &newPoint)
|
||||
{
|
||||
// PureBitmap currImage((PureBitmap&)*this);
|
||||
PureBitmap bitmapNew;
|
||||
PureBitmap bitmapMask;
|
||||
PureBitmap bitmapCache;
|
||||
PureBitmap bitmapScratch;
|
||||
PureDevice memoryDevice;
|
||||
PureDevice bkCurrDevice;
|
||||
PureDevice bkPrevDevice;
|
||||
PureDevice maskDevice;
|
||||
PureDevice cacheDevice;
|
||||
PureDevice scratchDevice;
|
||||
RGBColor rgbColor;
|
||||
Point deltaPoint;
|
||||
Point currPoint;
|
||||
Point currDimPoint(width(),height());
|
||||
// Point currDimPoint(currImage.width(),currImage.height());
|
||||
|
||||
currPoint=newPoint;
|
||||
if(mPrevPoint==Point(0,0))mPrevPoint=currPoint;
|
||||
deltaPoint.x(mPrevPoint.x()-currPoint.x());
|
||||
deltaPoint.y(mPrevPoint.y()-currPoint.y());
|
||||
mPrevPoint=currPoint;
|
||||
|
||||
scratchDevice.compatibleDevice(mDisplayDevice);
|
||||
memoryDevice.compatibleDevice(mDisplayDevice);
|
||||
bkCurrDevice.compatibleDevice(mDisplayDevice);
|
||||
bkPrevDevice.compatibleDevice(mDisplayDevice);
|
||||
maskDevice.compatibleDevice(mDisplayDevice);
|
||||
cacheDevice.compatibleDevice(mDisplayDevice);
|
||||
|
||||
rgbColor=::SetBkColor(memoryDevice,RGBColor(0,0,0));
|
||||
|
||||
bitmapScratch.compatibleBitmap(mDisplayDevice,currDimPoint.x(),currDimPoint.y());
|
||||
bitmapNew.compatibleBitmap(mDisplayDevice,currDimPoint.x(),currDimPoint.y());
|
||||
bitmapCache.compatibleBitmap(mDisplayDevice,currDimPoint.x(),currDimPoint.y());
|
||||
bitmapMask.compatibleBitmap(maskDevice,currDimPoint.x(),currDimPoint.y());
|
||||
|
||||
memoryDevice.select(currImage);
|
||||
scratchDevice.select(bitmapScratch);
|
||||
bkCurrDevice.select(bitmapNew);
|
||||
bkPrevDevice.select(mBitmapBkGnd);
|
||||
maskDevice.select(bitmapMask);
|
||||
cacheDevice.select(bitmapCache);
|
||||
|
||||
// ::StretchBlt(scratchDevice,0,0,bitmapScratch.width(),bitmapScratch.height(),memoryDevice,0,0,currImage.width(),currImage.height(),SRCCOPY);
|
||||
// ::StretchBlt(maskDevice,0,0,bitmapMask.width(),bitmapMask.height(),memoryDevice,0,0,currImage.width(),currImage.height(),SRCCOPY);
|
||||
::BitBlt(bkCurrDevice,0,0,bitmapNew.width(),bitmapNew.height(),mDisplayDevice,currPoint.x(),currPoint.y(),SRCCOPY);
|
||||
::BitBlt(bkCurrDevice,deltaPoint.x(),deltaPoint.y(),mBitmapBkGnd.width(),mBitmapBkGnd.height(),bkPrevDevice,0,0,SRCCOPY);
|
||||
::BitBlt(bkPrevDevice,-deltaPoint.x(),-deltaPoint.y(),mBitmapBkGnd.width(),mBitmapBkGnd.height(),maskDevice,0,0,SRCAND);
|
||||
::BitBlt(bkPrevDevice,-deltaPoint.x(),-deltaPoint.y(),mBitmapBkGnd.width(),mBitmapBkGnd.height(),scratchDevice,0,0,SRCPAINT);
|
||||
::BitBlt(cacheDevice,0,0,bitmapCache.width(),bitmapCache.height(),bkCurrDevice,0,0,SRCCOPY);
|
||||
// ::BitBlt(cacheDevice,0,0,bitmapCache.width(),bitmapCache.height(),maskDevice,0,0,SRCAND);
|
||||
// ::BitBlt(cacheDevice,0,0,bitmapCache.width(),bitmapCache.height(),scratchDevice,0,0,SRCPAINT);
|
||||
// ::BitBlt(mDisplayDevice,currPoint.x(),currPoint.y(),currDimPoint.x(),currDimPoint.y(),cacheDevice,0,0,SRCCOPY);
|
||||
// ::BitBlt(mDisplayDevice,currPoint.x()+deltaPoint.x(),currPoint.y()+deltaPoint.y(),mBitmapBkGnd.width(),mBitmapBkGnd.height(),bkPrevDevice,0,0,SRCCOPY);
|
||||
|
||||
memoryDevice.select(currImage,FALSE);
|
||||
bkCurrDevice.select(bitmapNew,FALSE);
|
||||
bkPrevDevice.select(mBitmapBkGnd,FALSE);
|
||||
maskDevice.select(bitmapMask,FALSE);
|
||||
cacheDevice.select(bitmapCache,FALSE);
|
||||
::SetBkColor(memoryDevice,rgbColor);
|
||||
mBitmapBkGnd=bitmapNew;
|
||||
}
|
||||
|
||||
71
pop/SPRITE.HPP
Normal file
71
pop/SPRITE.HPP
Normal file
@@ -0,0 +1,71 @@
|
||||
#ifndef _SPRITE_PURESPRITE_HPP_
|
||||
#define _SPRITE_PURESPRITE_HPP_
|
||||
#ifndef _COMMON_WINDOW_HPP_
|
||||
#include <common/window.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_POINT_HPP_
|
||||
#include <common/point.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_STRING_HPP_
|
||||
#include <common/string.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_PUREBITMAP_HPP_
|
||||
#include <common/purebmp.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_BITMAP_HPP_
|
||||
#include <common/bitmap.hpp>
|
||||
#endif
|
||||
|
||||
class PureSprite
|
||||
{
|
||||
public:
|
||||
PureSprite(void);
|
||||
virtual ~PureSprite();
|
||||
void moveSprite(const Point &newPos);
|
||||
void setDevice(PureDevice &pureDevice);
|
||||
void width(WORD width);
|
||||
WORD width(void)const;
|
||||
void height(WORD height);
|
||||
WORD height(void)const;
|
||||
protected:
|
||||
virtual operator PureBitmap&(void);
|
||||
private:
|
||||
Point mPrevPoint;
|
||||
PureDevice mDisplayDevice;
|
||||
PureBitmap mBitmapBkGnd;
|
||||
PureBitmap mBitmapNothing;
|
||||
WORD mWidth;
|
||||
WORD mHeight;
|
||||
};
|
||||
|
||||
inline
|
||||
void PureSprite::setDevice(PureDevice &pureDevice)
|
||||
{
|
||||
mDisplayDevice=pureDevice;
|
||||
}
|
||||
|
||||
inline
|
||||
void PureSprite::width(WORD width)
|
||||
{
|
||||
mWidth=width;
|
||||
}
|
||||
|
||||
inline
|
||||
WORD PureSprite::width(void)const
|
||||
{
|
||||
return mWidth;
|
||||
}
|
||||
|
||||
inline
|
||||
void PureSprite::height(WORD height)
|
||||
{
|
||||
mHeight=height;
|
||||
}
|
||||
|
||||
inline
|
||||
WORD PureSprite::height(void)const
|
||||
{
|
||||
return mHeight;
|
||||
}
|
||||
#endif
|
||||
|
||||
38
pop/SRVRDLG.CPP
Normal file
38
pop/SRVRDLG.CPP
Normal file
@@ -0,0 +1,38 @@
|
||||
#include <pop/srvrdlg.hpp>
|
||||
#include <common/regkey.hpp>
|
||||
|
||||
WORD ServerDialog::performDialog(void)
|
||||
{
|
||||
::DialogBoxParam(processInstance(),(LPSTR)"ServerDialog",mhParent,(DLGPROC)DWindow::DlgProc,(LONG)((DWindow*)this));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType ServerDialog::initDialogHandler(CallbackData &someCallbackData)
|
||||
{
|
||||
if(!mServerReg.serverName().isNull())setText(ServerName,mServerReg.serverName());
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
void ServerDialog::getServerName(void)
|
||||
{
|
||||
String serverName;
|
||||
|
||||
getText(ServerName,serverName);
|
||||
if(serverName.isNull())return;
|
||||
mServerReg.serverName(serverName);
|
||||
}
|
||||
|
||||
CallbackData::ReturnType ServerDialog::commandHandler(CallbackData &someCallbackData)
|
||||
{
|
||||
switch(someCallbackData.wmCommandID())
|
||||
{
|
||||
case IDOK :
|
||||
getServerName();
|
||||
endDialog(TRUE);
|
||||
break;
|
||||
case IDCANCEL :
|
||||
endDialog(TRUE);
|
||||
break;
|
||||
}
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
68
pop/SRVRDLG.HPP
Normal file
68
pop/SRVRDLG.HPP
Normal file
@@ -0,0 +1,68 @@
|
||||
#ifndef _POP_SERVERDLG_HPP_
|
||||
#define _POP_SERVERDLG_HPP_
|
||||
#ifndef _COMMON_DWINDOW_HPP_
|
||||
#include <common/dwindow.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_WINDOW_HPP_
|
||||
#include <common/window.hpp>
|
||||
#endif
|
||||
#ifndef _POP_POP_HPP_
|
||||
#include <pop/pop.hpp>
|
||||
#endif
|
||||
#ifndef _POP_SERVERREG_HPP_
|
||||
#include <pop/srvrreg.hpp>
|
||||
#endif
|
||||
|
||||
class String;
|
||||
|
||||
class ServerDialog : private DWindow
|
||||
{
|
||||
public:
|
||||
ServerDialog(const GUIWindow &parentWindow);
|
||||
virtual ~ServerDialog();
|
||||
WORD performDialog(void);
|
||||
private:
|
||||
enum{ServerName=NS_SERVERNAME};
|
||||
ServerDialog(const ServerDialog &someServerDialog);
|
||||
ServerDialog &operator=(const ServerDialog &someServerDialog);
|
||||
CallbackData::ReturnType initDialogHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType commandHandler(CallbackData &someCallbackData);
|
||||
void getServerName(void);
|
||||
|
||||
Callback<ServerDialog> mInitDialogHandler;
|
||||
Callback<ServerDialog> mCommandHandler;
|
||||
ServerReg mServerReg;
|
||||
HWND mhParent;
|
||||
};
|
||||
|
||||
inline
|
||||
ServerDialog::ServerDialog(const GUIWindow &parentWindow)
|
||||
: mhParent(parentWindow)
|
||||
{
|
||||
mInitDialogHandler.setCallback(this,&ServerDialog::initDialogHandler);
|
||||
mCommandHandler.setCallback(this,&ServerDialog::commandHandler);
|
||||
insertHandler(VectorHandler::CommandHandler,&mCommandHandler);
|
||||
insertHandler(VectorHandler::InitDialogHandler,&mInitDialogHandler);
|
||||
}
|
||||
|
||||
inline
|
||||
ServerDialog::ServerDialog(const ServerDialog &someServerDialog)
|
||||
: mhParent(someServerDialog.mhParent)
|
||||
{ // no implementation
|
||||
mInitDialogHandler.setCallback(this,&ServerDialog::initDialogHandler);
|
||||
mCommandHandler.setCallback(this,&ServerDialog::commandHandler);
|
||||
}
|
||||
|
||||
inline
|
||||
ServerDialog::~ServerDialog()
|
||||
{
|
||||
removeHandler(VectorHandler::CommandHandler,&mCommandHandler);
|
||||
removeHandler(VectorHandler::InitDialogHandler,&mInitDialogHandler);
|
||||
}
|
||||
|
||||
inline
|
||||
ServerDialog &ServerDialog::operator=(const ServerDialog &/*someServerDialog*/)
|
||||
{ // no implementation
|
||||
return *this;
|
||||
}
|
||||
#endif
|
||||
142
pop/SRVRREG.HPP
Normal file
142
pop/SRVRREG.HPP
Normal file
@@ -0,0 +1,142 @@
|
||||
#ifndef _POP_SERVERREG_HPP_
|
||||
#define _POP_SERVERREG_HPP_
|
||||
#ifndef _COMMON_WINDOWS_HPP_
|
||||
#include <common/windows.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_REGKEY_HPP_
|
||||
#include <common/regkey.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_STRING_HPP_
|
||||
#include <common/string.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_DISKINFO_HPP_
|
||||
#include <common/diskinfo.hpp>
|
||||
#endif
|
||||
#ifndef _POP_POP_HPP_
|
||||
#include <pop/pop.hpp>
|
||||
#endif
|
||||
|
||||
class ServerReg
|
||||
{
|
||||
public:
|
||||
ServerReg(void);
|
||||
ServerReg(const ServerReg &someServerReg);
|
||||
virtual ~ServerReg();
|
||||
ServerReg &operator=(const ServerReg &someServerReg);
|
||||
const String &serverName(void)const;
|
||||
void serverName(const String &hostName);
|
||||
const String &userName(void)const;
|
||||
void userName(const String &userName);
|
||||
const String &password(void)const;
|
||||
void password(const String &password);
|
||||
const String &mailDir(void)const;
|
||||
void mailDir(const String &mailDirectory);
|
||||
private:
|
||||
RegKey mRegKey;
|
||||
|
||||
String mServerName;
|
||||
String mMailDir;
|
||||
String mUserName;
|
||||
String mPassword;
|
||||
String mRegEntryKey;
|
||||
String mServerNameKey;
|
||||
String mMailDirKey;
|
||||
String mUserNameKey;
|
||||
String mPasswordKey;
|
||||
};
|
||||
|
||||
inline
|
||||
ServerReg::ServerReg(void)
|
||||
: mRegKey(RegKey::CurrentUser), mRegEntryKey(STRING_REGENTRYKEY),
|
||||
mServerNameKey(STRING_SERVERNAMEKEY), mMailDirKey(STRING_MAILDIRKEY),
|
||||
mUserNameKey(STRING_USERNAMEKEY), mPasswordKey(STRING_PASSWORDKEY)
|
||||
{
|
||||
if(!mRegKey.openKey(mRegEntryKey))
|
||||
{
|
||||
mRegKey.createKey(mRegEntryKey,"");
|
||||
mRegKey.openKey(mRegEntryKey);
|
||||
}
|
||||
mRegKey.queryValue(mMailDirKey,mMailDir);
|
||||
if(mMailDir.isNull())
|
||||
{
|
||||
DiskInfo diskInfo;
|
||||
diskInfo.getCurrentDirectory(mMailDir);
|
||||
mRegKey.setValue(mMailDirKey,mMailDir);
|
||||
}
|
||||
mRegKey.queryValue(mServerNameKey,mServerName);
|
||||
mRegKey.queryValue(mUserNameKey,mUserName);
|
||||
mRegKey.queryValue(mPasswordKey,mPassword);
|
||||
}
|
||||
|
||||
inline
|
||||
ServerReg::ServerReg(const ServerReg &someServerReg)
|
||||
: mRegKey(RegKey::CurrentUser), mRegEntryKey(STRING_REGENTRYKEY),
|
||||
mServerNameKey(STRING_SERVERNAMEKEY), mMailDirKey(STRING_MAILDIRKEY),
|
||||
mUserNameKey(STRING_USERNAMEKEY), mPasswordKey(STRING_PASSWORDKEY)
|
||||
{
|
||||
*this=someServerReg;
|
||||
}
|
||||
|
||||
inline
|
||||
ServerReg::~ServerReg()
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
ServerReg &ServerReg::operator=(const ServerReg &someServerReg)
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &ServerReg::serverName(void)const
|
||||
{
|
||||
return mServerName;
|
||||
}
|
||||
|
||||
inline
|
||||
void ServerReg::serverName(const String &serverName)
|
||||
{
|
||||
mServerName=serverName;
|
||||
mRegKey.setValue(mServerNameKey,mServerName);
|
||||
}
|
||||
|
||||
inline
|
||||
const String &ServerReg::mailDir(void)const
|
||||
{
|
||||
return mMailDir;
|
||||
}
|
||||
|
||||
inline
|
||||
void ServerReg::mailDir(const String &mailDir)
|
||||
{
|
||||
mMailDir=mailDir;
|
||||
mRegKey.setValue(mMailDirKey,mMailDir);
|
||||
}
|
||||
|
||||
inline
|
||||
const String &ServerReg::userName(void)const
|
||||
{
|
||||
return mUserName;
|
||||
}
|
||||
|
||||
inline
|
||||
void ServerReg::userName(const String &userName)
|
||||
{
|
||||
mUserName=userName;
|
||||
mRegKey.setValue(mUserNameKey,mUserName);
|
||||
}
|
||||
|
||||
inline
|
||||
const String &ServerReg::password(void)const
|
||||
{
|
||||
return mPassword;
|
||||
}
|
||||
|
||||
inline
|
||||
void ServerReg::password(const String &password)
|
||||
{
|
||||
mPassword=password;
|
||||
mRegKey.setValue(mPasswordKey,mPassword);
|
||||
}
|
||||
#endif
|
||||
BIN
pop/SSTRIP.BMP
Normal file
BIN
pop/SSTRIP.BMP
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
BIN
pop/STRIP.BMP
Normal file
BIN
pop/STRIP.BMP
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
13
pop/SUBCLASS.HPP
Normal file
13
pop/SUBCLASS.HPP
Normal file
@@ -0,0 +1,13 @@
|
||||
#ifndef _COMMON_SUBCLASS_HPP_
|
||||
#define _COMMON_SUBCLASS_HPP_
|
||||
|
||||
class SubClass
|
||||
{
|
||||
public:
|
||||
SubClass(void);
|
||||
virtual ~SubClass();
|
||||
BOOL subClass();
|
||||
private:
|
||||
String mSubClassName;
|
||||
};
|
||||
#endif
|
||||
120
pop/old/Header.cpp
Normal file
120
pop/old/Header.cpp
Normal file
@@ -0,0 +1,120 @@
|
||||
#include <pop/header.hpp>
|
||||
#include <common/openfile.hpp>
|
||||
#include <common/filemap.hpp>
|
||||
#include <common/pview.hpp>
|
||||
#include <common/block.hpp>
|
||||
|
||||
Header &Header::operator=(const Header &someHeader)
|
||||
{
|
||||
path(someHeader.path());
|
||||
from(someHeader.from());
|
||||
newsGroups(someHeader.newsGroups());
|
||||
subject(someHeader.subject());
|
||||
date(someHeader.date());
|
||||
organization(someHeader.organization());
|
||||
lines(someHeader.lines());
|
||||
messageID(someHeader.messageID());
|
||||
replyTo(someHeader.replyTo());
|
||||
postingHost(someHeader.postingHost());
|
||||
newsReader(someHeader.newsReader());
|
||||
crossReference(someHeader.crossReference());
|
||||
contentType(someHeader.contentType());
|
||||
xMailer(someHeader.xMailer());
|
||||
return *this;
|
||||
}
|
||||
|
||||
Header &Header::operator=(Block<String> &headerLines)
|
||||
{
|
||||
UINT lineCount(headerLines.size());
|
||||
for(int lineIndex=0;lineIndex<lineCount;lineIndex++)
|
||||
{
|
||||
String lineItem(headerLines[lineIndex].betweenString(' ',0));
|
||||
String &headerLine=headerLines[lineIndex];
|
||||
if(headerLine.isNull())continue;
|
||||
if(isPath(headerLine))path(lineItem);
|
||||
else if(isFrom(headerLine))from(lineItem);
|
||||
else if(isNewsGroups(headerLine))newsGroups(lineItem);
|
||||
else if(isSubject(headerLine))subject(lineItem);
|
||||
else if(isDate(headerLine))date(lineItem);
|
||||
else if(isOrganization(headerLine))organization(lineItem);
|
||||
else if(isLines(headerLine))lines(lineItem);
|
||||
else if(isMessageID(headerLine))messageID(lineItem);
|
||||
else if(isReplyTo(headerLine))replyTo(lineItem);
|
||||
else if(isNNTPPostingHost(headerLine))postingHost(lineItem);
|
||||
else if(isNewsReader(headerLine))newsReader(lineItem);
|
||||
else if(isCrossReference(headerLine))crossReference(lineItem);
|
||||
else if(isContentType(headerLine))contentType(lineItem);
|
||||
else if(isMailer(headerLine))xMailer(lineItem);
|
||||
}
|
||||
if(replyTo().isNull())replyTo(from());
|
||||
return *this;
|
||||
}
|
||||
|
||||
Header &Header::operator=(const String &pathFileName)
|
||||
{
|
||||
FileHandle headerFile(pathFileName,FileHandle::Read,FileHandle::ShareRead);
|
||||
FileMap headerMap(headerFile);
|
||||
PureViewOfFile headerView(headerMap);
|
||||
String headerLine;
|
||||
String lineItem;
|
||||
|
||||
if(!headerFile.isOkay())return *this;
|
||||
while(headerView.getLine(headerLine))
|
||||
{
|
||||
if(headerLine.isNull()||!headerLine.length())break;
|
||||
lineItem=(headerLine.betweenString(' ',0));
|
||||
if(isPath(headerLine))path(lineItem);
|
||||
else if(isFrom(headerLine))from(lineItem);
|
||||
else if(isNewsGroups(headerLine))newsGroups(lineItem);
|
||||
else if(isSubject(headerLine))subject(lineItem);
|
||||
else if(isDate(headerLine))date(lineItem);
|
||||
else if(isOrganization(headerLine))organization(lineItem);
|
||||
else if(isLines(headerLine))lines(lineItem);
|
||||
else if(isMessageID(headerLine))messageID(lineItem);
|
||||
else if(isReplyTo(headerLine))replyTo(lineItem);
|
||||
else if(isNNTPPostingHost(headerLine))postingHost(lineItem);
|
||||
else if(isNewsReader(headerLine))newsReader(lineItem);
|
||||
else if(isCrossReference(headerLine))crossReference(lineItem);
|
||||
else if(isContentType(headerLine))contentType(lineItem);
|
||||
else if(isMailer(headerLine))xMailer(lineItem);
|
||||
}
|
||||
if(replyTo().isNull())replyTo(from());
|
||||
return *this;
|
||||
}
|
||||
|
||||
SystemTime Header::systemTime(void)
|
||||
{
|
||||
SystemTime systemTime;
|
||||
char *ptrString;
|
||||
|
||||
if(mDate.isNull())return systemTime;
|
||||
String tmpDate(mDate.betweenString(',',0));
|
||||
if(tmpDate.isNull())return systemTime;
|
||||
ptrString=(LPSTR)tmpDate;
|
||||
ptrString=::strtok(ptrString," ");
|
||||
if(!ptrString)return systemTime;
|
||||
systemTime.day(::atoi(ptrString));
|
||||
ptrString=::strtok(0," ");
|
||||
if(!ptrString)return systemTime;
|
||||
if(!::strcmp(ptrString,"Jan"))systemTime.month(SystemTime::January);
|
||||
else if(!::strcmp(ptrString,"Feb"))systemTime.month(SystemTime::February);
|
||||
else if(!::strcmp(ptrString,"Mar"))systemTime.month(SystemTime::March);
|
||||
else if(!::strcmp(ptrString,"Apr"))systemTime.month(SystemTime::April);
|
||||
else if(!::strcmp(ptrString,"May"))systemTime.month(SystemTime::May);
|
||||
else if(!::strcmp(ptrString,"Jun"))systemTime.month(SystemTime::June);
|
||||
else if(!::strcmp(ptrString,"Jul"))systemTime.month(SystemTime::July);
|
||||
else if(!::strcmp(ptrString,"Aug"))systemTime.month(SystemTime::August);
|
||||
else if(!::strcmp(ptrString,"Sep"))systemTime.month(SystemTime::September);
|
||||
else if(!::strcmp(ptrString,"Oct"))systemTime.month(SystemTime::October);
|
||||
else if(!::strcmp(ptrString,"Nov"))systemTime.month(SystemTime::November);
|
||||
else if(!::strcmp(ptrString,"Dec"))systemTime.month(SystemTime::December);
|
||||
else systemTime.month(SystemTime::None);
|
||||
ptrString=::strtok(0," ");
|
||||
if(!ptrString)return systemTime;
|
||||
systemTime.year(::atoi(ptrString));
|
||||
systemTime.hour(0);
|
||||
systemTime.minute(0);
|
||||
systemTime.second(0);
|
||||
systemTime.milliseconds(0);
|
||||
return systemTime;
|
||||
}
|
||||
366
pop/old/Header.hpp
Normal file
366
pop/old/Header.hpp
Normal file
@@ -0,0 +1,366 @@
|
||||
#ifndef _POP_HEADER_HPP_
|
||||
#define _POP_HEADER_HPP_
|
||||
#ifndef _COMMON_STRING_HPP_
|
||||
#include <common/string.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_SYSTEMTIME_HPP_
|
||||
#include <common/systime.hpp>
|
||||
#endif
|
||||
|
||||
template <class T>
|
||||
class Block;
|
||||
|
||||
class Header
|
||||
{
|
||||
public:
|
||||
Header(void);
|
||||
Header(Block<String> &headerLines);
|
||||
Header(const Header &someHeader);
|
||||
Header(const String &pathFileName);
|
||||
virtual ~Header();
|
||||
Header &operator=(const Header &someHeader);
|
||||
Header &operator=(Block<String> &headerLines);
|
||||
Header &operator=(const String &pathFileName);
|
||||
const String &path(void)const;
|
||||
const String &from(void)const;
|
||||
const String &newsGroups(void)const;
|
||||
const String &subject(void)const;
|
||||
const String &date(void)const;
|
||||
SystemTime systemTime(void);
|
||||
const String &organization(void)const;
|
||||
const String &lines(void)const;
|
||||
const String &messageID(void)const;
|
||||
const String &replyTo(void)const;
|
||||
const String &postingHost(void)const;
|
||||
const String &newsReader(void)const;
|
||||
const String &crossReference(void)const;
|
||||
const String &contentType(void)const;
|
||||
const String &xMailer(void)const;
|
||||
private:
|
||||
void path(const String &path);
|
||||
void from(const String &from);
|
||||
void newsGroups(const String &newsGroups);
|
||||
void subject(const String &subject);
|
||||
void date(const String &date);
|
||||
void organization(const String &organization);
|
||||
void lines(const String &lines);
|
||||
void messageID(const String &messageID);
|
||||
void replyTo(const String &replyTo);
|
||||
void postingHost(const String &postingHost);
|
||||
void newsReader(const String &newsReader);
|
||||
void crossReference(const String &crossReference);
|
||||
void contentType(const String &contentType);
|
||||
void xMailer(const String &xMailer);
|
||||
WORD isPath(const String &stringLine)const;
|
||||
WORD isFrom(const String &stringLine)const;
|
||||
WORD isNewsGroups(const String &stringLine)const;
|
||||
WORD isSubject(const String &stringLine)const;
|
||||
WORD isDate(const String &stringLine)const;
|
||||
WORD isOrganization(const String &stringLine)const;
|
||||
WORD isLines(const String &stringLine)const;
|
||||
WORD isMessageID(const String &stringLine)const;
|
||||
WORD isReplyTo(const String &stringLine)const;
|
||||
WORD isNNTPPostingHost(const String &stringLine)const;
|
||||
WORD isNewsReader(const String &stringLine)const;
|
||||
WORD isCrossReference(const String &stringLine)const;
|
||||
WORD isContentType(const String &stringLine)const;
|
||||
WORD isMailer(const String &stringLine)const;
|
||||
|
||||
String mPath;
|
||||
String mFrom;
|
||||
String mNewsGroups;
|
||||
String mSubject;
|
||||
String mDate;
|
||||
String mOrganization;
|
||||
String mLines;
|
||||
String mMessageID;
|
||||
String mReplyTo;
|
||||
String mPostingHost;
|
||||
String mContentType;
|
||||
String mXMailer;
|
||||
String mNewsReader;
|
||||
String mCrossReference;
|
||||
};
|
||||
|
||||
inline
|
||||
Header::Header(void)
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
Header::Header(Block<String> &headerLines)
|
||||
{
|
||||
*this=headerLines;
|
||||
}
|
||||
|
||||
inline
|
||||
Header::Header(const Header &someHeader)
|
||||
{
|
||||
*this=someHeader;
|
||||
}
|
||||
|
||||
inline
|
||||
Header::Header(const String &pathFileName)
|
||||
{
|
||||
*this=pathFileName;
|
||||
}
|
||||
|
||||
inline
|
||||
Header::~Header()
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Header::path(void)const
|
||||
{
|
||||
return mPath;
|
||||
}
|
||||
|
||||
inline
|
||||
void Header::path(const String &path)
|
||||
{
|
||||
mPath=path;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Header::from(void)const
|
||||
{
|
||||
return mFrom;
|
||||
}
|
||||
|
||||
inline
|
||||
void Header::from(const String &from)
|
||||
{
|
||||
mFrom=from;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Header::newsGroups(void)const
|
||||
{
|
||||
return mNewsGroups;
|
||||
}
|
||||
|
||||
inline
|
||||
void Header::newsGroups(const String &newsGroups)
|
||||
{
|
||||
mNewsGroups=newsGroups;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Header::subject(void)const
|
||||
{
|
||||
return mSubject;
|
||||
}
|
||||
|
||||
inline
|
||||
void Header::subject(const String &subject)
|
||||
{
|
||||
mSubject=subject;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Header::date(void)const
|
||||
{
|
||||
return mDate;
|
||||
}
|
||||
|
||||
inline
|
||||
void Header::date(const String &date)
|
||||
{
|
||||
mDate=date;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Header::organization(void)const
|
||||
{
|
||||
return mOrganization;
|
||||
}
|
||||
|
||||
inline
|
||||
void Header::organization(const String &organization)
|
||||
{
|
||||
mOrganization=organization;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Header::lines(void)const
|
||||
{
|
||||
return mLines;
|
||||
}
|
||||
|
||||
inline
|
||||
void Header::lines(const String &lines)
|
||||
{
|
||||
mLines=lines;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Header::messageID(void)const
|
||||
{
|
||||
return mMessageID;
|
||||
}
|
||||
|
||||
inline
|
||||
void Header::messageID(const String &messageID)
|
||||
{
|
||||
mMessageID=messageID;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Header::replyTo(void)const
|
||||
{
|
||||
return mReplyTo;
|
||||
}
|
||||
|
||||
inline
|
||||
void Header::replyTo(const String &replyTo)
|
||||
{
|
||||
mReplyTo=replyTo;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Header::postingHost(void)const
|
||||
{
|
||||
return mPostingHost;
|
||||
}
|
||||
|
||||
inline
|
||||
void Header::postingHost(const String &postingHost)
|
||||
{
|
||||
mPostingHost=postingHost;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Header::newsReader(void)const
|
||||
{
|
||||
return mNewsReader;
|
||||
}
|
||||
|
||||
inline
|
||||
void Header::newsReader(const String &newsReader)
|
||||
{
|
||||
mNewsReader=newsReader;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Header::crossReference(void)const
|
||||
{
|
||||
return mCrossReference;
|
||||
}
|
||||
|
||||
inline
|
||||
void Header::crossReference(const String &crossReference)
|
||||
{
|
||||
mCrossReference=crossReference;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Header::contentType(void)const
|
||||
{
|
||||
return mContentType;
|
||||
}
|
||||
|
||||
inline
|
||||
void Header::contentType(const String &contentType)
|
||||
{
|
||||
mContentType=contentType;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Header::xMailer(void)const
|
||||
{
|
||||
return mXMailer;
|
||||
}
|
||||
|
||||
inline
|
||||
void Header::xMailer(const String &xMailer)
|
||||
{
|
||||
mXMailer=xMailer;
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Header::isPath(const String &stringLine)const
|
||||
{
|
||||
return (!::strncmp(stringLine,"Path: ",6)?TRUE:FALSE);
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Header::isFrom(const String &stringLine)const
|
||||
{
|
||||
return (!::strncmp(stringLine,"From: ",6)?TRUE:FALSE);
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Header::isNewsGroups(const String &stringLine)const
|
||||
{
|
||||
return (!::strncmp(stringLine,"Newsgroups: ",12)?TRUE:FALSE);
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Header::isSubject(const String &stringLine)const
|
||||
{
|
||||
return (!::strncmp(stringLine,"Subject: ",9)?TRUE:FALSE);
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Header::isDate(const String &stringLine)const
|
||||
{
|
||||
return (!::strncmp(stringLine,"Date: ",6)?TRUE:FALSE);
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Header::isOrganization(const String &stringLine)const
|
||||
{
|
||||
return (!::strncmp(stringLine,"Organization: ",14)?TRUE:FALSE);
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Header::isLines(const String &stringLine)const
|
||||
{
|
||||
return (!::strncmp(stringLine,"Lines: ",7)?TRUE:FALSE);
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Header::isMessageID(const String &stringLine)const
|
||||
{
|
||||
return (!::strncmp(stringLine,"Message-ID: ",12)?TRUE:FALSE);
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Header::isReplyTo(const String &stringLine)const
|
||||
{
|
||||
return (!::strncmp(stringLine,"Reply-To: ",10)?TRUE:FALSE);
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Header::isNNTPPostingHost(const String &stringLine)const
|
||||
{
|
||||
return (!::strncmp(stringLine,"NNTP-Posting-Host",17)?TRUE:FALSE);
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Header::isNewsReader(const String &stringLine)const
|
||||
{
|
||||
return (!::strncmp(stringLine,"X-Newsreader: ",14)?TRUE:FALSE);
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Header::isCrossReference(const String &stringLine)const
|
||||
{
|
||||
return (!::strncmp(stringLine,"Xref: ",6)?TRUE:FALSE);
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Header::isContentType(const String &stringLine)const
|
||||
{
|
||||
return (!::strncmp(stringLine,"Content-Type: ",14)?TRUE:FALSE);
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Header::isMailer(const String &stringLine)const
|
||||
{
|
||||
return (!::strncmp(stringLine,"X-Mailer: ",10)?TRUE:FALSE);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
77
pop/old/LOGINDLG.CPP
Normal file
77
pop/old/LOGINDLG.CPP
Normal file
@@ -0,0 +1,77 @@
|
||||
#include <pop/logindlg.hpp>
|
||||
|
||||
WORD LoginDialog::performLogin(void)
|
||||
{
|
||||
DialogTemplate dlgTemplate;
|
||||
DialogItemTemplate userEdit;
|
||||
DialogItemTemplate passEdit;
|
||||
DialogItemTemplate userStatic;
|
||||
DialogItemTemplate passStatic;
|
||||
|
||||
dlgTemplate.titleText("Login to host...");
|
||||
dlgTemplate.posRect(Rect(8,19,197,76));
|
||||
dlgTemplate.pointSize(8);
|
||||
dlgTemplate.typeFace("Helv");
|
||||
dlgTemplate.style(DS_MODALFRAME|WS_TABSTOP|WS_VISIBLE|WS_CAPTION|WS_SYSMENU|DS_3DLOOK|DS_SETFONT|WS_POPUP);
|
||||
|
||||
userEdit.className("EDIT");
|
||||
userEdit.titleText("");
|
||||
userEdit.style(WS_BORDER|WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_AUTOHSCROLL);
|
||||
userEdit.posRect(Rect(56,19,98,12));
|
||||
userEdit.itemID(UserNameID);
|
||||
|
||||
passEdit.className("EDIT");
|
||||
passEdit.style(WS_BORDER|WS_TABSTOP|ES_PASSWORD|WS_CHILD|WS_VISIBLE);
|
||||
passEdit.posRect(Rect(56,35,98,12));
|
||||
passEdit.itemID(PasswordID);
|
||||
|
||||
userStatic.className("STATIC");
|
||||
userStatic.titleText("User Name :");
|
||||
userStatic.style(WS_CHILD|WS_VISIBLE);
|
||||
userStatic.posRect(Rect(2,20,39,8));
|
||||
userStatic.itemID(-1);
|
||||
|
||||
passStatic.className("STATIC");
|
||||
passStatic.titleText("Password :");
|
||||
passStatic.style(WS_CHILD|WS_VISIBLE);
|
||||
passStatic.posRect(Rect(2,36,39,8));
|
||||
passStatic.itemID(-1);
|
||||
|
||||
dlgTemplate+=userEdit;
|
||||
dlgTemplate+=passEdit;
|
||||
dlgTemplate+=userStatic;
|
||||
dlgTemplate+=passStatic;
|
||||
|
||||
createDialog(::GetTopWindow((HWND)0),dlgTemplate);
|
||||
if(userName().isNull()&&password().isNull())return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD LoginDialog::dlgCommand(DWORD commandID,CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
switch(commandID)
|
||||
{
|
||||
case IDOK :
|
||||
getText(UserNameID,mUserName);
|
||||
getText(PasswordID,mPassword);
|
||||
if(mUserName.isNull()||mPassword.isNull()){::MessageBeep(0);return TRUE;}
|
||||
break;
|
||||
case IDCANCEL :
|
||||
mUserName.reserve(String::MaxString);
|
||||
mPassword.reserve(String::MaxString);
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void LoginDialog::dlgInitDialog(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
if(!userName().isNull())setText(UserNameID,userName());
|
||||
if(!password().isNull())setText(PasswordID,password());
|
||||
setFocus();
|
||||
}
|
||||
|
||||
void LoginDialog::dlgDestroyDialog(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
}
|
||||
|
||||
69
pop/old/LOGINDLG.HPP
Normal file
69
pop/old/LOGINDLG.HPP
Normal file
@@ -0,0 +1,69 @@
|
||||
#ifndef _POP_LOGINDIALOG_HPP_
|
||||
#define _POP_LOGINDIALOG_HPP_
|
||||
#ifndef _COMMON_WINDOWS_HPP_
|
||||
#include <common/windows.hpp>
|
||||
#endif
|
||||
#ifndef _DIALOG_DYNAMICDIALOG_HPP_
|
||||
#include <dialog/dyndlg.hpp>
|
||||
#endif
|
||||
|
||||
class LoginDialog : public DynamicDialog
|
||||
{
|
||||
public:
|
||||
LoginDialog(void);
|
||||
virtual ~LoginDialog();
|
||||
WORD performLogin(void);
|
||||
String userName(void)const;
|
||||
void userName(const String &userName);
|
||||
String password(void)const;
|
||||
void password(const String &password);
|
||||
private:
|
||||
enum {UserNameID=101,PasswordID=102};
|
||||
LoginDialog(const LoginDialog &loginDialog);
|
||||
WORD dlgCommand(DWORD commandID,CallbackData &someCallbackData);
|
||||
void dlgInitDialog(CallbackData &someCallbackData);
|
||||
void dlgDestroyDialog(CallbackData &someCallbackData);
|
||||
String mUserName;
|
||||
String mPassword;
|
||||
};
|
||||
|
||||
inline
|
||||
LoginDialog::LoginDialog(void)
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
LoginDialog::LoginDialog(const LoginDialog &/*loginDialog*/)
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
LoginDialog::~LoginDialog()
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
String LoginDialog::userName(void)const
|
||||
{
|
||||
return mUserName;
|
||||
}
|
||||
|
||||
inline
|
||||
void LoginDialog::userName(const String &userName)
|
||||
{
|
||||
mUserName=userName;
|
||||
}
|
||||
|
||||
inline
|
||||
String LoginDialog::password(void)const
|
||||
{
|
||||
return mPassword;
|
||||
}
|
||||
|
||||
inline
|
||||
void LoginDialog::password(const String &password)
|
||||
{
|
||||
mPassword=password;
|
||||
}
|
||||
#endif
|
||||
|
||||
48
pop/old/Main.cpp
Normal file
48
pop/old/Main.cpp
Normal file
@@ -0,0 +1,48 @@
|
||||
#include <pop/main.hpp>
|
||||
#include <pop/popdlg.hpp>
|
||||
|
||||
HINSTANCE Main::smhInstance=0;
|
||||
HINSTANCE Main::smhPrevInstance=0;
|
||||
int Main::smnCmdShow=0;
|
||||
|
||||
int PASCAL WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR /*lpszCmdLine*/,int nCmdShow)
|
||||
{
|
||||
Main::processInstance(hInstance);
|
||||
Main::previousProcessInstance(hPrevInstance);
|
||||
Main::cmdShow(nCmdShow);
|
||||
POPDlg popDialog;
|
||||
return popDialog.perform();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#if 0
|
||||
#include <common/string.hpp>
|
||||
#include <pop/main.hpp>
|
||||
#include <pop/mainwnd.hpp>
|
||||
|
||||
HINSTANCE Main::smhInstance=0;
|
||||
HINSTANCE Main::smhPrevInstance=0;
|
||||
int Main::smnCmdShow=0;
|
||||
|
||||
int PASCAL WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR /*lpszCmdLine*/,int nCmdShow)
|
||||
{
|
||||
Main::processInstance(hInstance);
|
||||
Main::previousProcessInstance(hPrevInstance);
|
||||
Main::cmdShow(nCmdShow);
|
||||
if(Main::previousProcessInstance())
|
||||
{
|
||||
HWND hWnd=::FindWindow(MainWindow::className(),MainWindow::className());
|
||||
if(!hWnd)
|
||||
{
|
||||
::MessageBox(::GetFocus(),(LPSTR)"Failed to maximize previous instance",(LPSTR)"Error",MB_ICONSTOP|MB_SYSTEMMODAL);
|
||||
return FALSE;
|
||||
}
|
||||
::PostMessage(hWnd,WM_REACTIVATE,0,0L);
|
||||
return FALSE;
|
||||
}
|
||||
MainWindow applicationWindow(Main::processInstance());
|
||||
return applicationWindow.messageLoop();
|
||||
}
|
||||
#endif
|
||||
68
pop/old/Main.hpp
Normal file
68
pop/old/Main.hpp
Normal file
@@ -0,0 +1,68 @@
|
||||
#ifndef _POP_MAIN_HPP_
|
||||
#define _POP_MAIN_HPP_
|
||||
#ifndef _COMMON_WINDOWS_HPP_
|
||||
#include <common/windows.hpp>
|
||||
#endif
|
||||
|
||||
class Main
|
||||
{
|
||||
public:
|
||||
static HINSTANCE processInstance(HWND hWnd);
|
||||
static HINSTANCE processInstance(void);
|
||||
static HINSTANCE previousProcessInstance(void);
|
||||
static void processInstance(HINSTANCE processInstance);
|
||||
static void previousProcessInstance(HINSTANCE previousProcessInstance);
|
||||
static void cmdShow(int nCmdShow);
|
||||
private:
|
||||
static HINSTANCE smhInstance;
|
||||
static HINSTANCE smhPrevInstance;
|
||||
static int smnCmdShow;
|
||||
};
|
||||
|
||||
inline
|
||||
void Main::processInstance(HINSTANCE hProcessInstance)
|
||||
{
|
||||
smhInstance=hProcessInstance;
|
||||
}
|
||||
|
||||
inline
|
||||
void Main::previousProcessInstance(HINSTANCE previousProcessInstance)
|
||||
{
|
||||
smhPrevInstance=previousProcessInstance;
|
||||
}
|
||||
|
||||
inline
|
||||
void Main::cmdShow(int nCmdShow)
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
HINSTANCE Main::processInstance(void)
|
||||
{
|
||||
return smhInstance;
|
||||
}
|
||||
|
||||
inline
|
||||
HINSTANCE Main::previousProcessInstance(void)
|
||||
{
|
||||
return smhPrevInstance;
|
||||
}
|
||||
|
||||
#if defined(__FLAT__)
|
||||
inline
|
||||
HINSTANCE Main::processInstance(HWND hWnd)
|
||||
{
|
||||
return (HINSTANCE)::GetWindowLong(hWnd,GWL_HINSTANCE);
|
||||
}
|
||||
#else
|
||||
inline
|
||||
HINSTANCE Main::processInstance(HWND hWnd)
|
||||
{
|
||||
return (HINSTANCE)::GetWindowWord(hWnd,GWW_HINSTANCE);
|
||||
}
|
||||
#endif
|
||||
#define WM_REACTIVATE WM_USER+1
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
140
pop/old/Mainwnd.cpp
Normal file
140
pop/old/Mainwnd.cpp
Normal file
@@ -0,0 +1,140 @@
|
||||
#include <pop/mainwnd.hpp>
|
||||
#include <pop/pop.hpp>
|
||||
|
||||
char MainWindow::szClassName[]="POP3 client v1.00";
|
||||
char MainWindow::szMenuName[]="POP3";
|
||||
|
||||
MainWindow::MainWindow(HINSTANCE hInstance)
|
||||
: mPaintHandler(this,&MainWindow::paintHandler),
|
||||
mDestroyHandler(this,&MainWindow::destroyHandler),
|
||||
mCommandHandler(this,&MainWindow::commandHandler),
|
||||
mKeyDownHandler(this,&MainWindow::keyDownHandler),
|
||||
mSizeHandler(this,&MainWindow::sizeHandler),
|
||||
mCreateHandler(this,&MainWindow::createHandler),
|
||||
mTimerHandler(this,&MainWindow::timerHandler),
|
||||
mSetFocusHandler(this,&MainWindow::setFocusHandler),
|
||||
mhInstance(hInstance)
|
||||
{
|
||||
insertHandlers();
|
||||
registerClass();
|
||||
::CreateWindow(szClassName,szClassName,
|
||||
WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_SIZEBOX|WS_MINIMIZEBOX|WS_MAXIMIZEBOX|WS_DLGFRAME|WS_CLIPCHILDREN,
|
||||
CW_USEDEFAULT,CW_USEDEFAULT,
|
||||
CW_USEDEFAULT,CW_USEDEFAULT,
|
||||
NULL,NULL,mhInstance,(LPSTR)this);
|
||||
show(SW_SHOW);
|
||||
update();
|
||||
|
||||
Block<String> msgLines;
|
||||
WORD messages;
|
||||
WORD octets;
|
||||
|
||||
POPClient popClient;
|
||||
popClient.open("mailhost.li.net");
|
||||
if(!popClient.authenticate("europa","cygnus-x1"))
|
||||
{
|
||||
popClient.quit();
|
||||
popClient.close();
|
||||
return;
|
||||
}
|
||||
popClient.stat(messages,octets);
|
||||
popClient.top(msgLines,1);
|
||||
// for(int msgIndex=1;msgIndex<=messages;msgIndex++)popClient.retrieve(msgIndex,msgLines);
|
||||
popClient.quit();
|
||||
popClient.close();
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
destroy();
|
||||
}
|
||||
|
||||
void MainWindow::insertHandlers(void)
|
||||
{
|
||||
insertHandler(VectorHandler::DestroyHandler,&mDestroyHandler);
|
||||
insertHandler(VectorHandler::PaintHandler,&mPaintHandler);
|
||||
insertHandler(VectorHandler::CommandHandler,&mCommandHandler);
|
||||
insertHandler(VectorHandler::SizeHandler,&mSizeHandler);
|
||||
insertHandler(VectorHandler::KeyDownHandler,&mKeyDownHandler);
|
||||
insertHandler(VectorHandler::CreateHandler,&mCreateHandler);
|
||||
insertHandler(VectorHandler::TimerHandler,&mTimerHandler);
|
||||
insertHandler(VectorHandler::SetFocusHandler,&mSetFocusHandler);
|
||||
}
|
||||
|
||||
void MainWindow::removeHandlers(void)
|
||||
{
|
||||
removeHandler(VectorHandler::DestroyHandler,&mDestroyHandler);
|
||||
removeHandler(VectorHandler::PaintHandler,&mPaintHandler);
|
||||
removeHandler(VectorHandler::CommandHandler,&mCommandHandler);
|
||||
removeHandler(VectorHandler::SizeHandler,&mSizeHandler);
|
||||
removeHandler(VectorHandler::KeyDownHandler,&mKeyDownHandler);
|
||||
removeHandler(VectorHandler::CreateHandler,&mCreateHandler);
|
||||
removeHandler(VectorHandler::TimerHandler,&mTimerHandler);
|
||||
removeHandler(VectorHandler::SetFocusHandler,&mSetFocusHandler);
|
||||
}
|
||||
|
||||
void MainWindow::registerClass(void)const
|
||||
{
|
||||
WNDCLASS wndClass;
|
||||
|
||||
if(::GetClassInfo(mhInstance,className(),(WNDCLASS FAR*)&wndClass))return;
|
||||
wndClass.style =CS_HREDRAW|CS_VREDRAW|CS_DBLCLKS|CS_OWNDC;
|
||||
wndClass.lpfnWndProc =(WNDPROC)Window::WndProc;
|
||||
wndClass.cbClsExtra =0;
|
||||
wndClass.cbWndExtra =sizeof(MainWindow*);
|
||||
wndClass.hInstance =mhInstance;
|
||||
wndClass.hIcon =::LoadIcon(NULL,IDI_APPLICATION);
|
||||
wndClass.hCursor =::LoadCursor(NULL,IDC_ARROW);
|
||||
wndClass.hbrBackground =(HBRUSH)::GetStockObject(BLACK_BRUSH);
|
||||
wndClass.lpszMenuName =szMenuName;
|
||||
wndClass.lpszClassName =szClassName;
|
||||
::RegisterClass(&wndClass);
|
||||
assert(0!=::GetClassInfo(mhInstance,className(),(WNDCLASS FAR*)&wndClass));
|
||||
}
|
||||
|
||||
CallbackData::ReturnType MainWindow::destroyHandler(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
removeHandlers();
|
||||
::PostQuitMessage(0);
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType MainWindow::sizeHandler(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType MainWindow::commandHandler(CallbackData &someCallbackData)
|
||||
{
|
||||
switch(someCallbackData.wParam())
|
||||
{
|
||||
default :
|
||||
break;
|
||||
}
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType MainWindow::keyDownHandler(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType MainWindow::paintHandler(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType MainWindow::createHandler(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType MainWindow::timerHandler(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType MainWindow::setFocusHandler(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
56
pop/old/Mainwnd.hpp
Normal file
56
pop/old/Mainwnd.hpp
Normal file
@@ -0,0 +1,56 @@
|
||||
#ifndef _POP_MAINWINDOW_HPP_
|
||||
#define _POP_MAINWINDOW_HPP_
|
||||
#ifndef _COMMON_WINDOW_HPP_
|
||||
#include <common/window.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_STRING_HPP_
|
||||
#include <common/string.hpp>
|
||||
#endif
|
||||
#ifndef _SOCKET_WSADATA_HPP_
|
||||
#include <socket/wsadata.hpp>
|
||||
#endif
|
||||
|
||||
class MainWindow : public Window
|
||||
{
|
||||
public:
|
||||
MainWindow(HINSTANCE hInstance);
|
||||
virtual ~MainWindow();
|
||||
static String className(void);
|
||||
private:
|
||||
enum{TimerID=0};
|
||||
void registerClass(void)const;
|
||||
void insertHandlers(void);
|
||||
void removeHandlers(void);
|
||||
void message(const String &messageString);
|
||||
void message(Block<String> &messageStrings);
|
||||
CallbackData::ReturnType paintHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType destroyHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType commandHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType keyDownHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType sizeHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType createHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType timerHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType setFocusHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType lineHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType completionHandler(CallbackData &someCallbackData);
|
||||
|
||||
Callback<MainWindow> mPaintHandler;
|
||||
Callback<MainWindow> mDestroyHandler;
|
||||
Callback<MainWindow> mCommandHandler;
|
||||
Callback<MainWindow> mKeyDownHandler;
|
||||
Callback<MainWindow> mSizeHandler;
|
||||
Callback<MainWindow> mCreateHandler;
|
||||
Callback<MainWindow> mTimerHandler;
|
||||
Callback<MainWindow> mSetFocusHandler;
|
||||
static char szClassName[];
|
||||
static char szMenuName[];
|
||||
HINSTANCE mhInstance;
|
||||
WSASystem mWSASystem;
|
||||
};
|
||||
|
||||
inline
|
||||
String MainWindow::className(void)
|
||||
{
|
||||
return String(szClassName);
|
||||
}
|
||||
#endif
|
||||
188
pop/old/POP.CPP
Normal file
188
pop/old/POP.CPP
Normal file
@@ -0,0 +1,188 @@
|
||||
#include <pop/pop.hpp>
|
||||
#include <socket/hostent.hpp>
|
||||
#include <socket/servent.hpp>
|
||||
|
||||
POPClient::POPClient(void)
|
||||
: mSpace(" "), mIsLoggedIn(FALSE)
|
||||
{
|
||||
createCmds();
|
||||
createStats();
|
||||
}
|
||||
|
||||
POPClient::~POPClient()
|
||||
{
|
||||
}
|
||||
|
||||
BOOL POPClient::open(const String &hostName)
|
||||
{
|
||||
HostEnt hostEntry;
|
||||
ServEnt serverEntry;
|
||||
Block<String> responseLines;
|
||||
INETSocketAddress internetSocketAddress;
|
||||
|
||||
if(hostName.isNull())return FALSE;
|
||||
if(mPOPControl.isConnected())mPOPControl.closeSocket();
|
||||
message(String("trying ")+hostName+String("..."));
|
||||
if(!mWSASystem.isInitialized()){message("WINSOCK initialization failure.");return FALSE;}
|
||||
InternetAddress internetAddress(hostName);
|
||||
if(!internetAddress.isZero()){if(!hostEntry.hostByAddress(internetAddress)){return FALSE;}}
|
||||
else if(!hostEntry.hostByName(hostName)){return FALSE;}
|
||||
if(!internetAddress.isZero()){if(!hostEntry.hostByAddress(internetAddress)){message(String("no DNS entry for ")+hostName);return FALSE;}}
|
||||
else if(!hostEntry.hostByName(hostName)){message(String("no DNS entry for ")+hostName);return FALSE;}
|
||||
message(String("connect...")+String("'")+hostEntry.hostName()+String("' (")+(String)(hostEntry.addresses())[0]+String(")"));
|
||||
internetSocketAddress.internetAddress((hostEntry.addresses())[0]);
|
||||
if(serverEntry.serviceByName("pop3","tcp"))
|
||||
{
|
||||
if(!mPOPControl.openSocket()){message("unable to create socket.");return FALSE;}
|
||||
internetSocketAddress.family(PF_INET);
|
||||
internetSocketAddress.port(serverEntry.port());
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!mPOPControl.openSocket()){message("unable to create socket.");return FALSE;}
|
||||
internetSocketAddress.family(PF_INET);
|
||||
internetSocketAddress.port(htons(POPPort));
|
||||
}
|
||||
if(!mPOPControl.connect(internetSocketAddress)){message("unable to connect to pop3 server");return FALSE;}
|
||||
mPOPControl.getSocketName(internetSocketAddress);
|
||||
if(!mPOPControl.isConnected())return FALSE;
|
||||
// if(!mPOPControl.receive(responseLines)) //||!responseLines.size()||!
|
||||
if(!mPOPControl.receive(responseLines)||!isInAckResponse(responseLines))
|
||||
{
|
||||
mPOPControl.closeSocket();
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL POPClient::quit(void)
|
||||
{
|
||||
Block<String> responseLines;
|
||||
|
||||
if(!isConnected())return FALSE;
|
||||
isLoggedIn(FALSE);
|
||||
if(!putControlData(mPOPCmds[Quit],FALSE))return FALSE;
|
||||
mPOPControl.receive(responseLines);
|
||||
mPOPControl.closeSocket();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL POPClient::authenticate(const String &user,const String &password)
|
||||
{
|
||||
Block<String> responseLines;
|
||||
|
||||
if(!isConnected())return FALSE;
|
||||
if(!putControlData(mPOPCmds[User]+String(" ")+user,FALSE))return FALSE;
|
||||
if(!mPOPControl.receive(responseLines))return FALSE;
|
||||
if(!isInAckResponse(responseLines))return FALSE;
|
||||
if(!putControlData(mPOPCmds[Pass]+String(" ")+password,FALSE))return FALSE;
|
||||
if(!mPOPControl.receive(responseLines))return FALSE;
|
||||
if(!isInAckResponse(responseLines))return FALSE;
|
||||
isLoggedIn(TRUE);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL POPClient::stat(WORD &messages,WORD &octets)
|
||||
{
|
||||
Block<String> responseLines;
|
||||
String strItem;
|
||||
|
||||
if(!isConnected()||!isLoggedIn())return FALSE;
|
||||
if(!putControlData(mPOPCmds[Stat],FALSE))return FALSE;
|
||||
if(!mPOPControl.receive(responseLines))return FALSE;
|
||||
if(!isInAckResponse(responseLines))return FALSE;
|
||||
strItem=responseLines[0].betweenString(' ',' ');
|
||||
messages=::atoi((char*)strItem);
|
||||
strItem=responseLines[0].betweenString(' ',0);
|
||||
strItem=strItem.betweenString(' ',0);
|
||||
octets=::atoi((char*)strItem);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL POPClient::retrieve(WORD msgNum,Block<String> &messageLines)
|
||||
{
|
||||
Block<String> responseLines;
|
||||
String strMsg;
|
||||
|
||||
if(!isConnected()||!isLoggedIn())return FALSE;
|
||||
::sprintf(strMsg,"%d",msgNum);
|
||||
if(!putControlData(mPOPCmds[Retr]+String(" ")+strMsg,FALSE))return FALSE;
|
||||
if(!mPOPControl.receive(responseLines))return FALSE;
|
||||
if(!isInAckResponse(responseLines))return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void POPClient::createStats(void)
|
||||
{
|
||||
mPOPStatus.insert(&String("+OK"));
|
||||
mPOPStatus.insert(&String("-ERR"));
|
||||
}
|
||||
|
||||
void POPClient::createCmds(void)
|
||||
{
|
||||
mPOPCmds.remove();
|
||||
mPOPCmds.insert(&String("QUIT"));
|
||||
mPOPCmds.insert(&String("USER"));
|
||||
mPOPCmds.insert(&String("PASS"));
|
||||
mPOPCmds.insert(&String("STAT"));
|
||||
mPOPCmds.insert(&String("RETR"));
|
||||
}
|
||||
|
||||
WORD POPClient::putControlData(const String &stringData,WORD waitForResponse)
|
||||
{
|
||||
if(!mPOPControl.isConnected())return FALSE;
|
||||
if(!mPOPControl.send(stringData))
|
||||
{
|
||||
mPOPControl.closeSocket();
|
||||
String errorString(String("error sending '")+stringData+String("' to POP server."));
|
||||
message(errorString);
|
||||
errorString+="\n";
|
||||
::OutputDebugString(errorString);
|
||||
return FALSE;
|
||||
}
|
||||
if(waitForResponse&&!getControlData())
|
||||
{
|
||||
mPOPControl.closeSocket();
|
||||
String errorString(String("error reading result of '")+stringData+String("' command from NNTP server."));
|
||||
message(errorString);
|
||||
errorString+="\n";
|
||||
::OutputDebugString(errorString);
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD POPClient::getControlData(void)
|
||||
{
|
||||
Block<String> responseStrings;
|
||||
mPOPControl.receive(responseStrings);
|
||||
return responseStrings.size();
|
||||
}
|
||||
|
||||
BOOL POPClient::isInAckResponse(Block<String> &responseLines)
|
||||
{
|
||||
if(!responseLines.size())return FALSE;
|
||||
if(responseLines[0].substr(0,2)==mPOPStatus[Ok])return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL POPClient::isInNakResponse(Block<String> &responseLines)
|
||||
{
|
||||
if(!responseLines.size())return FALSE;
|
||||
if(responseLines[0].substr(0,3)==mPOPStatus[Error])return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
// virtuals
|
||||
|
||||
void POPClient::message(const String &messageString)
|
||||
{
|
||||
::OutputDebugString(messageString+String("\n"));
|
||||
}
|
||||
|
||||
void POPClient::message(Block<String> &messageStrings)
|
||||
{
|
||||
for(int itemIndex=0;itemIndex<messageStrings.size();itemIndex++)
|
||||
::OutputDebugString(messageStrings[itemIndex]+String("\n"));
|
||||
}
|
||||
38
pop/old/SRVRDLG.CPP
Normal file
38
pop/old/SRVRDLG.CPP
Normal file
@@ -0,0 +1,38 @@
|
||||
#include <pop/srvrdlg.hpp>
|
||||
#include <common/regkey.hpp>
|
||||
|
||||
WORD ServerDialog::performDialog(void)
|
||||
{
|
||||
::DialogBoxParam(processInstance(),(LPSTR)"ServerDialog",mhParent,(DLGPROC)DWindow::DlgProc,(LONG)((DWindow*)this));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType ServerDialog::initDialogHandler(CallbackData &someCallbackData)
|
||||
{
|
||||
if(!mServerReg.serverName().isNull())setText(ServerName,mServerReg.serverName());
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
void ServerDialog::getServerName(void)
|
||||
{
|
||||
String serverName;
|
||||
|
||||
getText(ServerName,serverName);
|
||||
if(serverName.isNull())return;
|
||||
mServerReg.serverName(serverName);
|
||||
}
|
||||
|
||||
CallbackData::ReturnType ServerDialog::commandHandler(CallbackData &someCallbackData)
|
||||
{
|
||||
switch(someCallbackData.wmCommandID())
|
||||
{
|
||||
case IDOK :
|
||||
getServerName();
|
||||
endDialog(TRUE);
|
||||
break;
|
||||
case IDCANCEL :
|
||||
endDialog(TRUE);
|
||||
break;
|
||||
}
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
68
pop/old/Srvrdlg.hpp
Normal file
68
pop/old/Srvrdlg.hpp
Normal file
@@ -0,0 +1,68 @@
|
||||
#ifndef _POP_SERVERDLG_HPP_
|
||||
#define _POP_SERVERDLG_HPP_
|
||||
#ifndef _COMMON_DWINDOW_HPP_
|
||||
#include <common/dwindow.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_WINDOW_HPP_
|
||||
#include <common/window.hpp>
|
||||
#endif
|
||||
#ifndef _POP_POP_HPP_
|
||||
#include <pop/pop.hpp>
|
||||
#endif
|
||||
#ifndef _POP_SERVERREG_HPP_
|
||||
#include <pop/srvrreg.hpp>
|
||||
#endif
|
||||
|
||||
class String;
|
||||
|
||||
class ServerDialog : private DWindow
|
||||
{
|
||||
public:
|
||||
ServerDialog(const GUIWindow &parentWindow);
|
||||
virtual ~ServerDialog();
|
||||
WORD performDialog(void);
|
||||
private:
|
||||
enum{ServerName=NS_SERVERNAME};
|
||||
ServerDialog(const ServerDialog &someServerDialog);
|
||||
ServerDialog &operator=(const ServerDialog &someServerDialog);
|
||||
CallbackData::ReturnType initDialogHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType commandHandler(CallbackData &someCallbackData);
|
||||
void getServerName(void);
|
||||
|
||||
Callback<ServerDialog> mInitDialogHandler;
|
||||
Callback<ServerDialog> mCommandHandler;
|
||||
ServerReg mServerReg;
|
||||
HWND mhParent;
|
||||
};
|
||||
|
||||
inline
|
||||
ServerDialog::ServerDialog(const GUIWindow &parentWindow)
|
||||
: mhParent(parentWindow)
|
||||
{
|
||||
mInitDialogHandler.setCallback(this,&ServerDialog::initDialogHandler);
|
||||
mCommandHandler.setCallback(this,&ServerDialog::commandHandler);
|
||||
insertHandler(VectorHandler::CommandHandler,&mCommandHandler);
|
||||
insertHandler(VectorHandler::InitDialogHandler,&mInitDialogHandler);
|
||||
}
|
||||
|
||||
inline
|
||||
ServerDialog::ServerDialog(const ServerDialog &someServerDialog)
|
||||
: mhParent(someServerDialog.mhParent)
|
||||
{ // no implementation
|
||||
mInitDialogHandler.setCallback(this,&ServerDialog::initDialogHandler);
|
||||
mCommandHandler.setCallback(this,&ServerDialog::commandHandler);
|
||||
}
|
||||
|
||||
inline
|
||||
ServerDialog::~ServerDialog()
|
||||
{
|
||||
removeHandler(VectorHandler::CommandHandler,&mCommandHandler);
|
||||
removeHandler(VectorHandler::InitDialogHandler,&mInitDialogHandler);
|
||||
}
|
||||
|
||||
inline
|
||||
ServerDialog &ServerDialog::operator=(const ServerDialog &/*someServerDialog*/)
|
||||
{ // no implementation
|
||||
return *this;
|
||||
}
|
||||
#endif
|
||||
46
pop/old/mail.hpp
Normal file
46
pop/old/mail.hpp
Normal file
@@ -0,0 +1,46 @@
|
||||
#ifndef _POP_MAILMESSAGE_HPP_
|
||||
#define _POP_MAILMESSAGE_HPP_
|
||||
#ifndef _POP_HEADER_HPP_
|
||||
#include <pop/header.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_BLOCK_HPP_
|
||||
#include <common/block.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_STRING_HPP_
|
||||
#include <common/string.hpp>
|
||||
#endif
|
||||
|
||||
class Mail : public Block<String>, public Header
|
||||
{
|
||||
public:
|
||||
Mail(void);
|
||||
Mail(Block<String> &msgLines);
|
||||
virtual ~Mail();
|
||||
Mail &operator=(Block<String> &msgLines);
|
||||
private:
|
||||
};
|
||||
|
||||
inline
|
||||
Mail::Mail(void)
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
Mail::Mail(Block<String> &msgLines)
|
||||
: Block<String>(msgLines), Header(msgLines)
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
Mail::~Mail()
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
Mail &Mail::operator=(Block<String> &msgLines)
|
||||
{
|
||||
(Block<String>&)*this=msgLines;
|
||||
(Header&)*this=msgLines;
|
||||
return *this;
|
||||
}
|
||||
#endif
|
||||
4
pop/old/pop.hpp
Normal file
4
pop/old/pop.hpp
Normal file
@@ -0,0 +1,4 @@
|
||||
#ifndef _POP_POP_HPP_
|
||||
#define _POP_POP_HPP_
|
||||
#include <pop/pop.h>
|
||||
#endif
|
||||
263
pop/old/popclnt.Cpp
Normal file
263
pop/old/popclnt.Cpp
Normal file
@@ -0,0 +1,263 @@
|
||||
#include <pop/popclnt.hpp>
|
||||
#include <socket/hostent.hpp>
|
||||
#include <socket/servent.hpp>
|
||||
|
||||
POPClient::POPClient(void)
|
||||
: mSpace(" "), mIsLoggedIn(FALSE)
|
||||
{
|
||||
createCmds();
|
||||
createStats();
|
||||
}
|
||||
|
||||
POPClient::~POPClient()
|
||||
{
|
||||
}
|
||||
|
||||
BOOL POPClient::open(const String &hostName)
|
||||
{
|
||||
HostEnt hostEntry;
|
||||
ServEnt serverEntry;
|
||||
Block<String> responseLines;
|
||||
INETSocketAddress internetSocketAddress;
|
||||
|
||||
if(hostName.isNull())return FALSE;
|
||||
if(mPOPControl.isConnected())mPOPControl.closeSocket();
|
||||
message(String("trying ")+hostName+String("..."));
|
||||
if(!mWSASystem.isInitialized()){message("WINSOCK initialization failure.");return FALSE;}
|
||||
InternetAddress internetAddress(hostName);
|
||||
if(!internetAddress.isZero()){if(!hostEntry.hostByAddress(internetAddress)){return FALSE;}}
|
||||
else if(!hostEntry.hostByName(hostName)){return FALSE;}
|
||||
if(!internetAddress.isZero()){if(!hostEntry.hostByAddress(internetAddress)){message(String("no DNS entry for ")+hostName);return FALSE;}}
|
||||
else if(!hostEntry.hostByName(hostName)){message(String("no DNS entry for ")+hostName);return FALSE;}
|
||||
message(String("connect...")+String("'")+hostEntry.hostName()+String("' (")+(String)(hostEntry.addresses())[0]+String(")"));
|
||||
internetSocketAddress.internetAddress((hostEntry.addresses())[0]);
|
||||
if(serverEntry.serviceByName("pop3","tcp"))
|
||||
{
|
||||
if(!mPOPControl.openSocket()){message("unable to create socket.");return FALSE;}
|
||||
internetSocketAddress.family(PF_INET);
|
||||
internetSocketAddress.port(serverEntry.port());
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!mPOPControl.openSocket()){message("unable to create socket.");return FALSE;}
|
||||
internetSocketAddress.family(PF_INET);
|
||||
internetSocketAddress.port(htons(POPPort));
|
||||
}
|
||||
if(!mPOPControl.connect(internetSocketAddress)){message("unable to connect to pop3 server");return FALSE;}
|
||||
mPOPControl.getSocketName(internetSocketAddress);
|
||||
if(!mPOPControl.isConnected())return FALSE;
|
||||
if(!receive(responseLines)||!isInAckResponse(responseLines))
|
||||
{
|
||||
mPOPControl.closeSocket();
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL POPClient::quit(void)
|
||||
{
|
||||
Block<String> responseLines;
|
||||
|
||||
if(!isConnected())return FALSE;
|
||||
isLoggedIn(FALSE);
|
||||
if(!putControlData(mPOPCmds[Quit],FALSE))return FALSE;
|
||||
receive(responseLines);
|
||||
mPOPControl.closeSocket();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL POPClient::authenticate(const String &user,const String &password)
|
||||
{
|
||||
Block<String> responseLines;
|
||||
|
||||
if(!isConnected())return FALSE;
|
||||
if(!putControlData(mPOPCmds[User]+String(" ")+user,FALSE))return FALSE;
|
||||
if(!receive(responseLines))return FALSE;
|
||||
if(!isInAckResponse(responseLines))return FALSE;
|
||||
if(!putControlData(mPOPCmds[Pass]+String(" ")+password,FALSE))return FALSE;
|
||||
if(!receive(responseLines))return FALSE;
|
||||
isLoggedIn(TRUE);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL POPClient::stat(WORD &messages,WORD &octets)
|
||||
{
|
||||
Block<String> responseLines;
|
||||
String strItem;
|
||||
|
||||
if(!isConnected()||!isLoggedIn())return FALSE;
|
||||
if(!putControlData(mPOPCmds[Stat],FALSE))return FALSE;
|
||||
if(!receive(responseLines))return FALSE;
|
||||
if(!isInAckResponse(responseLines))return FALSE;
|
||||
strItem=responseLines[0].betweenString(' ',' ');
|
||||
messages=::atoi((char*)strItem);
|
||||
strItem=responseLines[0].betweenString(' ',0);
|
||||
strItem=strItem.betweenString(' ',0);
|
||||
octets=::atoi((char*)strItem);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL POPClient::retrieve(WORD msgNum,Block<String> &messageLines)
|
||||
{
|
||||
Block<String> responseLines;
|
||||
String strMsg;
|
||||
|
||||
messageLines.remove();
|
||||
if(!isConnected()||!isLoggedIn())return FALSE;
|
||||
::sprintf(strMsg,"%d",msgNum);
|
||||
if(!putControlData(mPOPCmds[Retr]+String(" ")+strMsg,FALSE))return FALSE;
|
||||
if(!receive(responseLines))return FALSE;
|
||||
if(!isInAckResponse(responseLines))return FALSE;
|
||||
receiveLines(messageLines);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL POPClient::dele(WORD msgNum)
|
||||
{
|
||||
Block<String> responseLines;
|
||||
String strMsg;
|
||||
if(!isConnected()||!isLoggedIn())return FALSE;
|
||||
::sprintf(strMsg,"%d",msgNum);
|
||||
if(!putControlData(mPOPCmds[Dele]+String(" ")+strMsg,FALSE))return FALSE;
|
||||
if(!receive(responseLines))return FALSE;
|
||||
if(!isInAckResponse(responseLines))return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL POPClient::noop(void)
|
||||
{
|
||||
Block<String> responseLines;
|
||||
|
||||
if(!isConnected()||!isLoggedIn())return FALSE;
|
||||
if(!putControlData(mPOPCmds[Noop],FALSE))return FALSE;
|
||||
if(!receive(responseLines))return FALSE;
|
||||
if(!isInAckResponse(responseLines))return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL POPClient::rset(void)
|
||||
{
|
||||
Block<String> responseLines;
|
||||
|
||||
if(!isConnected()||!isLoggedIn())return FALSE;
|
||||
if(!putControlData(mPOPCmds[Rset],FALSE))return FALSE;
|
||||
if(!receive(responseLines))return FALSE;
|
||||
if(!isInAckResponse(responseLines))return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL POPClient::top(Block<String> &msgLines,WORD msgNum,WORD lineCount)
|
||||
{
|
||||
Block<String> responseLines;
|
||||
String strMsg;
|
||||
|
||||
if(!isConnected()||!isLoggedIn())return FALSE;
|
||||
::sprintf(strMsg,"%d %d",msgNum,lineCount);
|
||||
if(!putControlData(mPOPCmds[Top]+String(" ")+strMsg,FALSE))return FALSE;
|
||||
if(!receive(responseLines))return FALSE;
|
||||
if(!isInAckResponse(responseLines))return FALSE;
|
||||
if(!receiveLines(msgLines))return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void POPClient::createStats(void)
|
||||
{
|
||||
mPOPStatus.insert(&String("+OK"));
|
||||
mPOPStatus.insert(&String("-ERR"));
|
||||
}
|
||||
|
||||
void POPClient::createCmds(void)
|
||||
{
|
||||
mPOPCmds.remove();
|
||||
mPOPCmds.insert(&String("QUIT"));
|
||||
mPOPCmds.insert(&String("USER"));
|
||||
mPOPCmds.insert(&String("PASS"));
|
||||
mPOPCmds.insert(&String("STAT"));
|
||||
mPOPCmds.insert(&String("RETR"));
|
||||
mPOPCmds.insert(&String("RSET"));
|
||||
mPOPCmds.insert(&String("DELE"));
|
||||
mPOPCmds.insert(&String("NOOP"));
|
||||
mPOPCmds.insert(&String("TOP"));
|
||||
}
|
||||
|
||||
WORD POPClient::putControlData(const String &stringData,WORD waitForResponse)
|
||||
{
|
||||
if(!mPOPControl.isConnected())return FALSE;
|
||||
if(!mPOPControl.send(stringData))
|
||||
{
|
||||
mPOPControl.closeSocket();
|
||||
String errorString(String("error sending '")+stringData+String("' to POP server."));
|
||||
message(errorString);
|
||||
errorString+="\n";
|
||||
::OutputDebugString(errorString);
|
||||
return FALSE;
|
||||
}
|
||||
if(waitForResponse&&!getControlData())
|
||||
{
|
||||
mPOPControl.closeSocket();
|
||||
String errorString(String("error reading result of '")+stringData+String("' command from NNTP server."));
|
||||
message(errorString);
|
||||
errorString+="\n";
|
||||
::OutputDebugString(errorString);
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD POPClient::getControlData(void)
|
||||
{
|
||||
Block<String> responseStrings;
|
||||
mPOPControl.receive(responseStrings);
|
||||
return responseStrings.size();
|
||||
}
|
||||
|
||||
BOOL POPClient::isInAckResponse(Block<String> &responseLines)
|
||||
{
|
||||
if(!responseLines.size())return FALSE;
|
||||
if(responseLines[0].substr(0,2)==mPOPStatus[Ok])return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL POPClient::isInNakResponse(Block<String> &responseLines)
|
||||
{
|
||||
if(!responseLines.size())return FALSE;
|
||||
if(responseLines[0].substr(0,3)==mPOPStatus[Error])return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL POPClient::receive(Block<String> &responseLines)
|
||||
{
|
||||
if(!mPOPControl.receive(responseLines))return FALSE;
|
||||
// message(responseLines);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL POPClient::receiveLines(Block<String> &receiveStrings)
|
||||
{
|
||||
String stringData;
|
||||
String seriesItem;
|
||||
|
||||
receiveStrings.remove();
|
||||
while(TRUE)
|
||||
{
|
||||
if(!mPOPControl.receive(stringData))break;
|
||||
if(stringData==String("."))break;
|
||||
if(stringData==String(".."))stringData=".";
|
||||
receiveStrings.insert(&stringData);
|
||||
if(!isConnected())break;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// virtuals
|
||||
|
||||
void POPClient::message(const String &messageString)
|
||||
{
|
||||
::OutputDebugString(messageString+String("\n"));
|
||||
}
|
||||
|
||||
void POPClient::message(Block<String> &messageStrings)
|
||||
{
|
||||
for(int itemIndex=0;itemIndex<messageStrings.size();itemIndex++)
|
||||
::OutputDebugString(messageStrings[itemIndex]+String("\n"));
|
||||
}
|
||||
83
pop/old/popclnt.Hpp
Normal file
83
pop/old/popclnt.Hpp
Normal file
@@ -0,0 +1,83 @@
|
||||
#ifndef _POP_POPCLIENT_HPP_
|
||||
#define _POP_POPCLIENT_HPP_
|
||||
#ifndef _COMMON_WINDOWS_HPP_
|
||||
#include <common/windows.hpp>
|
||||
#endif
|
||||
#ifndef _SOCKET_SOCKET_HPP_
|
||||
#include <socket/socket.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_BLOCK_HPP_
|
||||
#include <common/block.hpp>
|
||||
#endif
|
||||
|
||||
class String;
|
||||
|
||||
class POPClient
|
||||
{
|
||||
public:
|
||||
POPClient(void);
|
||||
virtual ~POPClient();
|
||||
BOOL open(const String &hostName);
|
||||
void close(void);
|
||||
BOOL isConnected(void)const;
|
||||
BOOL isLoggedIn(void)const;
|
||||
BOOL quit(void);
|
||||
BOOL authenticate(const String &user,const String &password);
|
||||
BOOL retrieve(WORD msgNum,Block<String> &messageLines);
|
||||
BOOL top(Block<String> &messageLines,WORD msgNum,WORD lineCount=10);
|
||||
BOOL dele(WORD msgNum);
|
||||
BOOL rset(void);
|
||||
BOOL noop(void);
|
||||
BOOL stat(WORD &messages,WORD &octets);
|
||||
protected:
|
||||
virtual void message(const String &messageString);
|
||||
virtual void message(Block<String> &messageStrings);
|
||||
private:
|
||||
enum {POPPort=110};
|
||||
enum POPCmds{Quit,User,Pass,Stat,Retr,Rset,Dele,Noop,Top};
|
||||
enum POPStatus{Ok,Error};
|
||||
POPClient(const POPClient &somePOPClient);
|
||||
POPClient &operator=(const POPClient &somePOPClient);
|
||||
void isLoggedIn(BOOL isLoggedIn);
|
||||
WORD putControlData(const String &stringData,WORD waitForResponse=TRUE);
|
||||
BOOL isInNakResponse(Block<String> &responseLines);
|
||||
BOOL isInAckResponse(Block<String> &responseLines);
|
||||
BOOL receive(Block<String> &responseLines);
|
||||
BOOL receiveLines(Block<String> &receiveStrings);
|
||||
WORD getControlData(void);
|
||||
void createCmds(void);
|
||||
void createStats(void);
|
||||
|
||||
Socket mPOPControl;
|
||||
WSASystem mWSASystem;
|
||||
Block<String> mPOPCmds;
|
||||
Block<String> mPOPStatus;
|
||||
BOOL mIsLoggedIn;
|
||||
String mSpace;
|
||||
};
|
||||
|
||||
inline
|
||||
BOOL POPClient::isConnected(void)const
|
||||
{
|
||||
return mPOPControl.isConnected();
|
||||
}
|
||||
|
||||
inline
|
||||
BOOL POPClient::isLoggedIn(void)const
|
||||
{
|
||||
return mIsLoggedIn;
|
||||
}
|
||||
|
||||
inline
|
||||
void POPClient::isLoggedIn(BOOL isLoggedIn)
|
||||
{
|
||||
mIsLoggedIn=isLoggedIn;
|
||||
}
|
||||
|
||||
inline
|
||||
void POPClient::close(void)
|
||||
{
|
||||
mPOPControl.closeSocket();
|
||||
isLoggedIn(FALSE);
|
||||
}
|
||||
#endif
|
||||
241
pop/old/popdlg.cpp
Normal file
241
pop/old/popdlg.cpp
Normal file
@@ -0,0 +1,241 @@
|
||||
#include <pop/popdlg.hpp>
|
||||
#include <pop/srvrdlg.hpp>
|
||||
#include <pop/popclnt.hpp>
|
||||
#include <pop/srvrreg.hpp>
|
||||
#include <pop/logindlg.hpp>
|
||||
#include <pop/header.hpp>
|
||||
#include <pop/mail.hpp>
|
||||
#include <common/systime.hpp>
|
||||
#include <common/opendlg.hpp>
|
||||
#include <statbar/statbar.hpp>
|
||||
#include <imagelst/ftree.hpp>
|
||||
|
||||
POPDlg::POPDlg(void)
|
||||
{
|
||||
mInitHandler.setCallback(this,&POPDlg::initHandler);
|
||||
mDestroyHandler.setCallback(this,&POPDlg::destroyHandler);
|
||||
mCommandHandler.setCallback(this,&POPDlg::commandHandler);
|
||||
mCloseHandler.setCallback(this,&POPDlg::closeHandler);
|
||||
mDlgCodeHandler.setCallback(this,&POPDlg::dlgCodeHandler);
|
||||
mMailSelChangedHandler.setCallback(this,&POPDlg::mailSelChangedHandler);
|
||||
DWindow::insertHandler(VectorHandler::InitDialogHandler,&mInitHandler);
|
||||
DWindow::insertHandler(VectorHandler::DestroyHandler,&mDestroyHandler);
|
||||
DWindow::insertHandler(VectorHandler::CommandHandler,&mCommandHandler);
|
||||
DWindow::insertHandler(VectorHandler::CloseHandler,&mCloseHandler);
|
||||
DWindow::insertHandler(VectorHandler::DialogCodeHandler,&mDlgCodeHandler);
|
||||
}
|
||||
|
||||
POPDlg::~POPDlg()
|
||||
{
|
||||
DWindow::removeHandler(VectorHandler::InitDialogHandler,&mInitHandler);
|
||||
DWindow::removeHandler(VectorHandler::DestroyHandler,&mDestroyHandler);
|
||||
DWindow::removeHandler(VectorHandler::CommandHandler,&mCommandHandler);
|
||||
DWindow::removeHandler(VectorHandler::CloseHandler,&mCloseHandler);
|
||||
DWindow::insertHandler(VectorHandler::DialogCodeHandler,&mDlgCodeHandler);
|
||||
}
|
||||
|
||||
POPDlg &POPDlg::operator=(const POPDlg &/*somePOPDlg*/)
|
||||
{ // private implementation
|
||||
return *this;
|
||||
}
|
||||
|
||||
BOOL POPDlg::perform(void)
|
||||
{
|
||||
return ::DialogBoxParam(processInstance(),(LPSTR)"POPCLIENT",(HWND)0,DWindow::DlgProc,(LPARAM)(DWindow*)this);
|
||||
}
|
||||
|
||||
|
||||
CallbackData::ReturnType POPDlg::initHandler(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
mStatusBar=new StatusBar(*this);
|
||||
mFolderTree=new FolderTree(*this,Rect(xFolder,yFolder,cxFolder,cyFolder));
|
||||
mMailTree=new FolderTree(*this,Rect(xMail,yMail,cxMail,cyMail));
|
||||
mMailTree->insertHandler(FolderTree::SelChangedHandler,&mMailSelChangedHandler);
|
||||
|
||||
|
||||
|
||||
|
||||
mStatusBar.disposition(PointerDisposition::Delete);
|
||||
// getMail();
|
||||
// retrieveMail();
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType POPDlg::destroyHandler(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType POPDlg::dlgCodeHandler(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
return (CallbackData::ReturnType)DLGC_WANTARROWS|DLGC_WANTCHARS;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType POPDlg::commandHandler(CallbackData &someCallbackData)
|
||||
{
|
||||
switch(someCallbackData.wmCommandID())
|
||||
{
|
||||
case IDOK :
|
||||
break;
|
||||
case IDCANCEL :
|
||||
endDialog(FALSE);
|
||||
break;
|
||||
case Server :
|
||||
handleServer(someCallbackData);
|
||||
break;
|
||||
case GetMail :
|
||||
getMail();
|
||||
break;
|
||||
}
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType POPDlg::closeHandler(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType POPDlg::mailSelChangedHandler(CallbackData &someCallbackData)
|
||||
{
|
||||
setDisplay(someCallbackData.loWord());
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
void POPDlg::handleServer(CallbackData &someCallbackData)
|
||||
{
|
||||
ServerDialog serverDialog(*this);
|
||||
serverDialog.performDialog();
|
||||
}
|
||||
|
||||
void POPDlg::getMail(void)
|
||||
{
|
||||
retrieveMail();
|
||||
populateMail();
|
||||
populateFolders();
|
||||
}
|
||||
|
||||
void POPDlg::retrieveMail(void)
|
||||
{
|
||||
mMailBlock.remove();
|
||||
|
||||
for(int itemIndex=0;itemIndex<20;itemIndex++)
|
||||
{
|
||||
Block<String> mailBlock;
|
||||
mailBlock.insert(&String("From: Sean Kessler<europa@li.net>"));
|
||||
mailBlock.insert(&String(" "));
|
||||
mailBlock.insert(&String("Sean Kessler wrote:"));
|
||||
mailBlock.insert(&String("hello"));
|
||||
mMailBlock.insert(&Mail(mailBlock));
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
void POPDlg::retrieveMail(void)
|
||||
{
|
||||
POPClient popClient;
|
||||
ServerReg serverReg;
|
||||
WORD messages;
|
||||
WORD octets;
|
||||
|
||||
mMailBlock.remove();
|
||||
if(!handleLoginParams(serverReg)){userMessage("Incorrect Login.");return;}
|
||||
if(!popClient.open(serverReg.serverName())){userMessage("Connect Failed..");return;}
|
||||
if(!popClient.authenticate(serverReg.userName(),serverReg.password()))
|
||||
{
|
||||
popClient.quit();
|
||||
popClient.close();
|
||||
userMessage("Authentication Failed.");
|
||||
return;
|
||||
}
|
||||
popClient.stat(messages,octets);
|
||||
if(!messages){userMessage("No Messages.");return;}
|
||||
for(int msgIndex=1;msgIndex<=messages;msgIndex++)
|
||||
{
|
||||
mMailBlock.insert(&Mail());
|
||||
Block<String> &msgLines=mMailBlock[mMailBlock.size()-1];
|
||||
Header &mailHeader=mMailBlock[mMailBlock.size()-1];
|
||||
popClient.retrieve(msgIndex,msgLines);
|
||||
mailHeader=msgLines;
|
||||
if(!msgLines.size())continue;
|
||||
}
|
||||
popClient.quit();
|
||||
popClient.close();
|
||||
}
|
||||
#endif
|
||||
|
||||
BOOL POPDlg::handleLoginParams(ServerReg &serverReg)
|
||||
{
|
||||
if(serverReg.serverName().isNull()){::MessageBox(*this,(LPSTR)"No Server Defined",(LPSTR)"SERVER ERROR",MB_ICONSTOP);return FALSE;}
|
||||
if(serverReg.userName().isNull()||serverReg.password().isNull())
|
||||
{
|
||||
String userName;
|
||||
String password;
|
||||
LoginDialog loginDialog;
|
||||
if(!loginDialog.performLogin())return FALSE;
|
||||
userName=loginDialog.userName();
|
||||
password=loginDialog.password();
|
||||
serverReg.userName(userName);
|
||||
serverReg.password(password);
|
||||
}
|
||||
if(serverReg.userName().isNull()||serverReg.password().isNull())return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void POPDlg::populateMail(void)
|
||||
{
|
||||
String strMailBox(STRING_MAILBOXNAME);
|
||||
|
||||
mMailTree->setRedraw(FALSE);
|
||||
mMailTree->remove();
|
||||
mMailTree->addRootNode(FolderTree::FolderClosed,strMailBox,makeItemID(NullNode,RootID));
|
||||
for(int itemIndex=0;itemIndex<mMailBlock.size();itemIndex++)
|
||||
{
|
||||
TreeViewItem insertItem(0,0,0,0,(LPSTR)mMailBlock[itemIndex].from(),mMailBlock[itemIndex].from().length(),FolderTree::FolderClosed,FolderTree::FolderOpen,0,makeItemID(MailNode,itemIndex));
|
||||
mMailTree->addNode(TreeView::NodeChild,insertItem,strMailBox);
|
||||
|
||||
}
|
||||
mMailTree->setRedraw(TRUE);
|
||||
}
|
||||
|
||||
void POPDlg::populateFolders(void)
|
||||
{
|
||||
String strUserFolder(STRING_USERFOLDERNAME);
|
||||
|
||||
mFolderTree->setRedraw(FALSE);
|
||||
mFolderTree->remove();
|
||||
mFolderTree->addRootNode(FolderTree::FolderClosed,strUserFolder,makeItemID(NullNode,RootID));
|
||||
mFolderTree->setRedraw(TRUE);
|
||||
}
|
||||
|
||||
void POPDlg::setDisplay(int itemID)
|
||||
{
|
||||
String lineItem;
|
||||
Block<String> &mailList=mMailBlock[itemID];
|
||||
|
||||
for(int itemIndex=0;itemIndex<mailList.size();itemIndex++)
|
||||
{
|
||||
lineItem=mailList[itemIndex];
|
||||
lineItem+="\n";
|
||||
}
|
||||
setText(EditControl,(LPSTR)lineItem);
|
||||
}
|
||||
|
||||
void POPDlg::userMessage(const String &message)
|
||||
{
|
||||
::MessageBox(*this,(LPSTR)(String&)message,(LPSTR)"POPClient",MB_OK);
|
||||
}
|
||||
|
||||
// **************** virtuals
|
||||
|
||||
void POPDlg::message(const String &messageString)
|
||||
{
|
||||
if(!mStatusBar.isOkay())return;
|
||||
mStatusBar->setText(messageString);
|
||||
}
|
||||
|
||||
void POPDlg::message(Block<String> &messageStrings)
|
||||
{
|
||||
if(!mStatusBar.isOkay())return;
|
||||
for(int lineIndex=0;lineIndex<messageStrings.size();lineIndex++)
|
||||
mStatusBar->setText(messageStrings[lineIndex]);
|
||||
}
|
||||
69
pop/old/popdlg.hpp
Normal file
69
pop/old/popdlg.hpp
Normal file
@@ -0,0 +1,69 @@
|
||||
#ifndef _POP_POPDLG_HPP_
|
||||
#define _POP_POPDLG_HPP_
|
||||
#ifndef _COMMON_DWINDOW_HPP_
|
||||
#include <common/dwindow.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_SMARTPOINTER_HPP_
|
||||
#include <common/pointer.hpp>
|
||||
#endif
|
||||
#ifndef _POP_POP_HPP_
|
||||
#include <pop/pop.hpp>
|
||||
#endif
|
||||
|
||||
class StatusBar;
|
||||
class FolderTree;
|
||||
class ServerReg;
|
||||
class Mail;
|
||||
|
||||
class POPDlg : public DWindow
|
||||
{
|
||||
public:
|
||||
POPDlg(void);
|
||||
virtual ~POPDlg();
|
||||
BOOL perform(void);
|
||||
protected:
|
||||
virtual void message(const String &messageString);
|
||||
virtual void message(Block<String> &messageStrings);
|
||||
private:
|
||||
enum DlgControls{Server=PC_SERVER,GetMail=PC_GETMAIL,EditControl=PC_EDIT};
|
||||
enum FolderCoords{xFolder=5,yFolder=50,cxFolder=235,cyFolder=150};
|
||||
enum MailCoords{xMail=245,yMail=50,cxMail=235,cyMail=150};
|
||||
enum {RootID=0};
|
||||
enum NodeType{NullNode=0x0000,MailNode=0x0001};
|
||||
POPDlg &operator=(const POPDlg &someMailDlg);
|
||||
CallbackData::ReturnType initHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType destroyHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType commandHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType closeHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType dlgCodeHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType mailSelChangedHandler(CallbackData &someCallbackData);
|
||||
|
||||
void handleServer(CallbackData &someCallbackData);
|
||||
void userMessage(const String &message);
|
||||
void retrieveMail(void);
|
||||
void populateFolders(void);
|
||||
void populateMail(void);
|
||||
void getMail(void);
|
||||
void setDisplay(int itemID);
|
||||
BOOL handleLoginParams(ServerReg &serverReg);
|
||||
LPARAM makeItemID(NodeType nodeType,WORD itemID);
|
||||
|
||||
Callback<POPDlg> mInitHandler;
|
||||
Callback<POPDlg> mDestroyHandler;
|
||||
Callback<POPDlg> mCommandHandler;
|
||||
Callback<POPDlg> mCloseHandler;
|
||||
Callback<POPDlg> mDlgCodeHandler;
|
||||
Callback<POPDlg> mMailSelChangedHandler;
|
||||
SmartPointer<StatusBar> mStatusBar;
|
||||
SmartPointer<FolderTree> mFolderTree;
|
||||
SmartPointer<FolderTree> mMailTree;
|
||||
Block<Mail> mMailBlock;
|
||||
};
|
||||
|
||||
|
||||
inline
|
||||
LPARAM POPDlg::makeItemID(NodeType nodeType,WORD itemID)
|
||||
{
|
||||
return MAKELPARAM(itemID,nodeType);
|
||||
}
|
||||
#endif
|
||||
142
pop/old/srvrreg.hpp
Normal file
142
pop/old/srvrreg.hpp
Normal file
@@ -0,0 +1,142 @@
|
||||
#ifndef _POP_SERVERREG_HPP_
|
||||
#define _POP_SERVERREG_HPP_
|
||||
#ifndef _COMMON_WINDOWS_HPP_
|
||||
#include <common/windows.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_REGKEY_HPP_
|
||||
#include <common/regkey.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_STRING_HPP_
|
||||
#include <common/string.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_DISKINFO_HPP_
|
||||
#include <common/diskinfo.hpp>
|
||||
#endif
|
||||
#ifndef _POP_POP_HPP_
|
||||
#include <pop/pop.hpp>
|
||||
#endif
|
||||
|
||||
class ServerReg
|
||||
{
|
||||
public:
|
||||
ServerReg(void);
|
||||
ServerReg(const ServerReg &someServerReg);
|
||||
virtual ~ServerReg();
|
||||
ServerReg &operator=(const ServerReg &someServerReg);
|
||||
const String &serverName(void)const;
|
||||
void serverName(const String &hostName);
|
||||
const String &userName(void)const;
|
||||
void userName(const String &userName);
|
||||
const String &password(void)const;
|
||||
void password(const String &password);
|
||||
const String &mailDir(void)const;
|
||||
void mailDir(const String &mailDirectory);
|
||||
private:
|
||||
RegKey mRegKey;
|
||||
|
||||
String mServerName;
|
||||
String mMailDir;
|
||||
String mUserName;
|
||||
String mPassword;
|
||||
String mRegEntryKey;
|
||||
String mServerNameKey;
|
||||
String mMailDirKey;
|
||||
String mUserNameKey;
|
||||
String mPasswordKey;
|
||||
};
|
||||
|
||||
inline
|
||||
ServerReg::ServerReg(void)
|
||||
: mRegKey(RegKey::CurrentUser), mRegEntryKey(STRING_REGENTRYKEY),
|
||||
mServerNameKey(STRING_SERVERNAMEKEY), mMailDirKey(STRING_MAILDIRKEY),
|
||||
mUserNameKey(STRING_USERNAMEKEY), mPasswordKey(STRING_PASSWORDKEY)
|
||||
{
|
||||
if(!mRegKey.openKey(mRegEntryKey))
|
||||
{
|
||||
mRegKey.createKey(mRegEntryKey,"");
|
||||
mRegKey.openKey(mRegEntryKey);
|
||||
}
|
||||
mRegKey.queryValue(mMailDirKey,mMailDir);
|
||||
if(mMailDir.isNull())
|
||||
{
|
||||
DiskInfo diskInfo;
|
||||
diskInfo.getCurrentDirectory(mMailDir);
|
||||
mRegKey.setValue(mMailDirKey,mMailDir);
|
||||
}
|
||||
mRegKey.queryValue(mServerNameKey,mServerName);
|
||||
mRegKey.queryValue(mUserNameKey,mUserName);
|
||||
mRegKey.queryValue(mPasswordKey,mPassword);
|
||||
}
|
||||
|
||||
inline
|
||||
ServerReg::ServerReg(const ServerReg &someServerReg)
|
||||
: mRegKey(RegKey::CurrentUser), mRegEntryKey(STRING_REGENTRYKEY),
|
||||
mServerNameKey(STRING_SERVERNAMEKEY), mMailDirKey(STRING_MAILDIRKEY),
|
||||
mUserNameKey(STRING_USERNAMEKEY), mPasswordKey(STRING_PASSWORDKEY)
|
||||
{
|
||||
*this=someServerReg;
|
||||
}
|
||||
|
||||
inline
|
||||
ServerReg::~ServerReg()
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
ServerReg &ServerReg::operator=(const ServerReg &someServerReg)
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &ServerReg::serverName(void)const
|
||||
{
|
||||
return mServerName;
|
||||
}
|
||||
|
||||
inline
|
||||
void ServerReg::serverName(const String &serverName)
|
||||
{
|
||||
mServerName=serverName;
|
||||
mRegKey.setValue(mServerNameKey,mServerName);
|
||||
}
|
||||
|
||||
inline
|
||||
const String &ServerReg::mailDir(void)const
|
||||
{
|
||||
return mMailDir;
|
||||
}
|
||||
|
||||
inline
|
||||
void ServerReg::mailDir(const String &mailDir)
|
||||
{
|
||||
mMailDir=mailDir;
|
||||
mRegKey.setValue(mMailDirKey,mMailDir);
|
||||
}
|
||||
|
||||
inline
|
||||
const String &ServerReg::userName(void)const
|
||||
{
|
||||
return mUserName;
|
||||
}
|
||||
|
||||
inline
|
||||
void ServerReg::userName(const String &userName)
|
||||
{
|
||||
mUserName=userName;
|
||||
mRegKey.setValue(mUserNameKey,mUserName);
|
||||
}
|
||||
|
||||
inline
|
||||
const String &ServerReg::password(void)const
|
||||
{
|
||||
return mPassword;
|
||||
}
|
||||
|
||||
inline
|
||||
void ServerReg::password(const String &password)
|
||||
{
|
||||
mPassword=password;
|
||||
mRegKey.setValue(mPasswordKey,mPassword);
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user