зеркало из https://github.com/mozilla/pjs.git
Start of commands for mini cal
This commit is contained in:
Родитель
db6315b1b1
Коммит
ec5dc0070b
|
@ -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?
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
#
|
||||
# CONFIDENTIAL AND PROPRIETARY SOURCE CODE OF
|
||||
# NETSCAPE COMMUNICATIONS CORPORATION
|
||||
# Copyright (C) 1996 Netscape Communications Corporation. All Rights
|
||||
# Reserved. Use of this Source Code is subject to the terms of the
|
||||
# applicable license agreement from Netscape Communications Corporation.
|
||||
# The copyright notice(s) in this Source Code does not indicate actual or
|
||||
# intended publication of this Source Code.
|
||||
#
|
||||
GDEPTH = ../../../../..
|
||||
|
||||
EXPORTS = \
|
||||
$(NULL)
|
||||
|
||||
PRIVATE_EXPORTS = \
|
||||
nsCalDurationCommand.h \
|
||||
nsCalDayListCommand.h \
|
||||
nsCalFetchEventsCommand.h \
|
||||
nsCalNewModelCommand.h \
|
||||
$(NULL)
|
||||
|
||||
MODULE = trex
|
||||
|
||||
REQUIRES = raptor
|
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче