Mozilla/mozilla/embedding/tests/mfcembed/CCommandObserver.cpp
mjudge%netscape.com 4de829d793 BUG115229 files not in build yet. checking in new files to make tree landing of editor embedded work go more smoothely
git-svn-id: svn://10.0.0.236/trunk@113195 18797224-902f-48f8-a5cc-f745e15eee43
2002-01-30 04:46:54 +00:00

36 lines
797 B
C++

#include "stdafx.h"
#include "CCommandObserver.h"
NS_IMPL_ADDREF(CCommandObserver)
NS_IMPL_RELEASE(CCommandObserver)
NS_IMPL_QUERY_INTERFACE1(CCommandObserver, nsIObserver)
CCommandObserver::CCommandObserver()
{
NS_INIT_REFCNT();
mFrame = 0;
}
/* void observe (in nsISupports aSubject, in string aTopic, in wstring aData); */
NS_IMETHODIMP
CCommandObserver::Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *aData)
{
if (!mFrame)
return NS_ERROR_NOT_INITIALIZED;
mFrame->KillTimer(mTimerId);
mFrame->SetTimer(mTimerId,mDelay,0);//reset delay on update.
return NS_OK;
}
void
CCommandObserver::SetFrame(CFrameWnd *frame,UINT timerId,UINT delay) //update if 100 ticks goes by and no more changes
{
mFrame = frame;
mDelay = delay;
mTimerId = timerId;
}