Start of commands for mini cal

This commit is contained in:
sman%netscape.com 1998-11-03 16:26:42 +00:00
Родитель 867e0b2971
Коммит 5bf860aea9
4 изменённых файлов: 54 добавлений и 2 удалений

Просмотреть файл

@ -1283,8 +1283,48 @@ nsresult nsCalendarShell :: SendCommand(nsString& aCommand, nsString& aReply)
}
/*
* Find the canvas by this name
* MCC mini calendar controller
*/
if (target.EqualsIgnoreCase(CAL_STRING_CMD_MCC))
{
nsIXPFCCanvas * root = nsnull;
nsIXPFCCanvas * canvas = nsnull;
gXPFCToolkit->GetRootCanvas(&root);
canvas = root->CanvasFromName(name);
NS_RELEASE(root);
if (canvas == nsnull)
return NS_OK;
/*
* Send this command directly to the the canvas.
*/
static NS_DEFINE_IID(kCXPFCMethodInvokerCommandCID, NS_XPFC_METHODINVOKER_COMMAND_CID);
static NS_DEFINE_IID(kXPFCCommandIID, NS_IXPFC_COMMAND_IID);
static NS_DEFINE_IID(kCXPFCObserverIID, NS_IXPFC_OBSERVER_IID);
static NS_DEFINE_IID(kCXPFCSubjectIID, NS_IXPFC_SUBJECT_IID);
nsXPFCMethodInvokerCommand * command;
nsresult res = nsRepository::CreateInstance(kCXPFCMethodInvokerCommandCID, nsnull, kXPFCCommandIID, (void **)&command);
if (NS_OK != res)
return res ;
command->Init();
command->mMethod = method;
command->mParams = param;
/*
* Pass this Command onto the Observer interface of the target canvas directly.
* There is no need to go through the ObserverManager since we have the
* necessary info
*/
nsIXPFCObserver * observer = nsnull;
nsIXPFCSubject * subject = nsnull;
res = canvas->QueryInterface(kCXPFCObserverIID, (void **)&observer);
if (res == NS_OK)
observer->Update(subject,command);
aReply = command->mReply;
NS_IF_RELEASE(command);
NS_IF_RELEASE(observer);
}
if (target.EqualsIgnoreCase(XPFC_STRING_PANEL))
{
@ -1341,7 +1381,11 @@ nsresult nsCalendarShell :: SendCommand(nsString& aCommand, nsString& aReply)
NS_IF_RELEASE(command);
NS_IF_RELEASE(observer);
} else if (target.EqualsIgnoreCase(XPFC_STRING_HELP)) {
}
/*
* HELP
*/
else if (target.EqualsIgnoreCase(XPFC_STRING_HELP)) {
/*
* Return basic help?

Просмотреть файл

@ -13,6 +13,7 @@ EXPORTS = \
$(NULL)
PRIVATE_EXPORTS = \
nsCalMccCommand.h \
nsCalDurationCommand.h \
nsCalDayListCommand.h \
nsCalFetchEventsCommand.h \

Просмотреть файл

@ -78,6 +78,8 @@
#define CAL_STRING_PREF_USER_DISPLAY_NAME "cal.userDisplayName"
#define CAL_STRING_PREF_USER_DISPLAY_NAME_DEFAULT "$USERNAME"
#define CAL_STRING_CMD_MCC "mcc"
#endif

Просмотреть файл

@ -33,4 +33,9 @@
{ 0x80cb25a0, 0x223d, 0x11d2, \
{ 0x92, 0x46, 0x00, 0x80, 0x5f, 0x8a, 0x7a, 0xb6 } }
//cbf2f570-7335-11d2-b57e-0060088a4b1d
#define NS_MCC_CMD_CID \
{ 0xcbf2f570, 0x7335, 0x11d2, \
{ 0xb5, 0x7e, 0x00, 0x60, 0x08, 0x8a, 0x4b, 0x1d } }
#endif