WIP: Multi-User Canvas - some API changes and fixes for
Horizontal rendering git-svn-id: svn://10.0.0.236/trunk@12199 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -24,3 +24,4 @@ libs::
|
||||
$(INSTALL) julian_month_sum.cal $(DIST)/bin/res/ui
|
||||
$(INSTALL) julian_html.cal $(DIST)/bin/res/ui
|
||||
$(INSTALL) julian_html_blank.cal $(DIST)/bin/res/ui
|
||||
$(INSTALL) test.cal $(DIST)/bin/res/ui
|
||||
|
||||
19
mozilla/calendar/modules/parser/calxml/res/test.cal
Normal file
19
mozilla/calendar/modules/parser/calxml/res/test.cal
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" standalone="no" encoding="UTF-8"?>
|
||||
<!DOCTYPE julian SYSTEM "http://kirkwood.mcom.com/julian.dtd">
|
||||
<Calendar>
|
||||
|
||||
<!-- This is the MultiDayView and Command Bar -->
|
||||
<panel name="MultiDayViewRule">
|
||||
<multiuserviewcanvas layout="xbox" name="MultiCalendarEventWeekView" control="MiniCalendar" repeatable="DayContext">
|
||||
</panel>
|
||||
|
||||
|
||||
<!-- This is the root GUI panel. This is where life begins -->
|
||||
<panel id="MainCalendarPanel" label="Calendar UI">
|
||||
<control id="uhr" rule="MultiDayViewRule" layout="ybox"/>
|
||||
<ctx id="StartContext" default="today"/>
|
||||
</panel>
|
||||
|
||||
|
||||
</Calendar>
|
||||
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
NS_IMETHOD SetTimeContext(nsICalTimeContext * aContext);
|
||||
|
||||
// nsIXPFCCommandReceiver methods
|
||||
NS_IMETHOD Action(nsIXPFCCommand * aCommand);
|
||||
NS_IMETHOD_(nsEventStatus) Action(nsIXPFCCommand * aCommand);
|
||||
|
||||
protected:
|
||||
~nsCalMultiDayViewCanvas();
|
||||
|
||||
@@ -33,6 +33,7 @@ public:
|
||||
|
||||
NS_IMETHOD Init();
|
||||
NS_IMETHOD SetParameter(nsString& aKey, nsString& aValue) ;
|
||||
NS_IMETHOD SetTimeContext(nsICalTimeContext * aContext);
|
||||
|
||||
protected:
|
||||
~nsCalMultiUserViewCanvas();
|
||||
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
NS_IMETHOD_(PRBool) GetShowTimeScale();
|
||||
|
||||
NS_IMETHOD SetParameter(nsString& aKey, nsString& aValue) ;
|
||||
NS_IMETHOD Action(nsIXPFCCommand * aCommand);
|
||||
NS_IMETHOD_(nsEventStatus) Action(nsIXPFCCommand * aCommand);
|
||||
|
||||
NS_IMETHOD_(nsEventStatus) PaintBackground(nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect);
|
||||
|
||||
@@ -142,8 +142,8 @@ nsresult nsCalDayViewCanvas::PaintInterval(nsIRenderingContext& aRenderingContex
|
||||
*/
|
||||
PRUint32 iYStart = rect.y + INSET;
|
||||
PRUint32 iYStop = rect.y + rect.height - INSET;
|
||||
PRUint32 iXSpace = rect.height / aMinorInterval;
|
||||
PRUint32 iX = rect.x + iXSpace;
|
||||
PRUint32 iXSpace = rect.width / aMinorInterval;
|
||||
PRUint32 iX = rect.x + INSET + iXSpace;
|
||||
for (i = 1; i < (PRUint32) aMinorInterval; i++)
|
||||
{
|
||||
aRenderingContext.DrawLine(iX,iYStart, iX,iYStop);
|
||||
@@ -267,68 +267,129 @@ nsEventStatus nsCalDayViewCanvas :: PaintForeground(nsIRenderingContext& aRender
|
||||
GetBounds(rect);
|
||||
GetBounds(bounds);
|
||||
|
||||
/*
|
||||
* XXX: Subtract off the modulus of the area. This should not be so hardcoded!
|
||||
*/
|
||||
rect.height = rect.height - ((rect.height-2)%GetVisibleMajorIntervals());
|
||||
|
||||
PRUint32 vis_event_start_min = dstart.getHour() * 60 + dstart.getMinute();
|
||||
PRUint32 vis_event_end_min = dsend.getHour() * 60 + dsend.getMinute();
|
||||
|
||||
PRFloat64 sratio = ((PRFloat64)(vis_event_start_min - vis_start_min)) * (div_ratio);
|
||||
PRFloat64 eratio = ((PRFloat64)(vis_event_end_min - vis_start_min)) * (div_ratio);
|
||||
|
||||
rect.y += (int)(rect.height * sratio);
|
||||
rect.height = (int)((rect.height * eratio) - (rect.y - bounds.y));
|
||||
|
||||
aRenderingContext.SetColor(mComponentColor);
|
||||
|
||||
rect.x = rect.x + 2 * INSET ;
|
||||
rect.width = rect.width - 4*INSET ;
|
||||
rect.y = rect.y + INSET ;
|
||||
rect.height = rect.height - 2 * INSET;
|
||||
|
||||
|
||||
if (rect.y < bounds.y)
|
||||
rect.y = bounds.y+1;
|
||||
|
||||
if ((rect.y+rect.height) > (bounds.y+bounds.height))
|
||||
rect.height = (bounds.y+bounds.height)-1;
|
||||
|
||||
aRenderingContext.FillRect(rect);
|
||||
|
||||
/*
|
||||
* Render the highlights
|
||||
*/
|
||||
aRenderingContext.SetColor(nsLighter(mComponentColor));
|
||||
aRenderingContext.DrawLine(rect.x,rect.y,rect.x+rect.width,rect.y);
|
||||
aRenderingContext.DrawLine(rect.x,rect.y,rect.x,rect.y+rect.height);
|
||||
aRenderingContext.SetColor(nsDarker(mComponentColor));
|
||||
aRenderingContext.DrawLine(rect.x+rect.width,rect.y,rect.x+rect.width,rect.y+rect.height);
|
||||
aRenderingContext.DrawLine(rect.x,rect.y+rect.height,rect.x+rect.width,rect.y+rect.height);
|
||||
|
||||
aRenderingContext.GetFontMetrics()->GetHeight(fm_height);
|
||||
|
||||
if (rect.height > fm_height)
|
||||
if (GetTimeContext()->GetHorizontal() == PR_FALSE)
|
||||
{
|
||||
// rndctx->SetColor(GetForegroundColor());
|
||||
aRenderingContext.SetColor(NS_RGB(255,255,255)); /* XXX: This color should come from someplace else... */
|
||||
/*
|
||||
* XXX: Subtract off the modulus of the area. This should not be so hardcoded!
|
||||
*/
|
||||
rect.height = rect.height - ((rect.height-2)%GetVisibleMajorIntervals());
|
||||
|
||||
rect.y += (int)(rect.height * sratio);
|
||||
rect.height = (int)((rect.height * eratio) - (rect.y - bounds.y));
|
||||
|
||||
rect.x = rect.x + 2 * INSET ;
|
||||
rect.width = rect.width - 4*INSET ;
|
||||
rect.y = rect.y + INSET ;
|
||||
rect.height = rect.height - 2 * INSET;
|
||||
|
||||
|
||||
if (rect.y < bounds.y)
|
||||
rect.y = bounds.y+1;
|
||||
|
||||
if ((rect.y+rect.height) > (bounds.y+bounds.height))
|
||||
rect.height = (bounds.y+bounds.height)-1;
|
||||
|
||||
aRenderingContext.FillRect(rect);
|
||||
|
||||
/*
|
||||
* XXX. we need to handle '\n' in a format string...
|
||||
* This should not require two separate coding calls
|
||||
* we need to generalize this.
|
||||
*/
|
||||
psBuf = pEvent->toStringFmt(usFmt).toCString("");
|
||||
aRenderingContext.DrawString(psBuf,nsCRT::strlen(psBuf),rect.x+1,rect.y,0);
|
||||
delete psBuf;
|
||||
* Render the highlights
|
||||
*/
|
||||
aRenderingContext.SetColor(nsLighter(mComponentColor));
|
||||
aRenderingContext.DrawLine(rect.x,rect.y,rect.x+rect.width,rect.y);
|
||||
aRenderingContext.DrawLine(rect.x,rect.y,rect.x,rect.y+rect.height);
|
||||
aRenderingContext.SetColor(nsDarker(mComponentColor));
|
||||
aRenderingContext.DrawLine(rect.x+rect.width,rect.y,rect.x+rect.width,rect.y+rect.height);
|
||||
aRenderingContext.DrawLine(rect.x,rect.y+rect.height,rect.x+rect.width,rect.y+rect.height);
|
||||
|
||||
if (rect.height > (2 * fm_height))
|
||||
aRenderingContext.GetFontMetrics()->GetHeight(fm_height);
|
||||
|
||||
if (rect.height > fm_height)
|
||||
{
|
||||
psBuf = pEvent->getSummary().toCString("");
|
||||
aRenderingContext.DrawString(psBuf,nsCRT::strlen(psBuf),rect.x+1,rect.y+fm_height,0);
|
||||
// rndctx->SetColor(GetForegroundColor());
|
||||
aRenderingContext.SetColor(NS_RGB(255,255,255)); /* XXX: This color should come from someplace else... */
|
||||
|
||||
/*
|
||||
* XXX. we need to handle '\n' in a format string...
|
||||
* This should not require two separate coding calls
|
||||
* we need to generalize this.
|
||||
*/
|
||||
psBuf = pEvent->toStringFmt(usFmt).toCString("");
|
||||
aRenderingContext.DrawString(psBuf,nsCRT::strlen(psBuf),rect.x+1,rect.y,0);
|
||||
delete psBuf;
|
||||
|
||||
if (rect.height > (2 * fm_height))
|
||||
{
|
||||
psBuf = pEvent->getSummary().toCString("");
|
||||
aRenderingContext.DrawString(psBuf,nsCRT::strlen(psBuf),rect.x+1,rect.y+fm_height,0);
|
||||
delete psBuf;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
/*
|
||||
* XXX: Subtract off the modulus of the area. This should not be so hardcoded!
|
||||
*/
|
||||
rect.width = rect.width - ((rect.width-2)%GetVisibleMajorIntervals());
|
||||
|
||||
rect.x += (int)(rect.width * sratio);
|
||||
rect.width = (int)((rect.width * eratio) - (rect.x - bounds.x));
|
||||
|
||||
rect.y = rect.y + 2 * INSET ;
|
||||
rect.height = rect.height - 4*INSET ;
|
||||
rect.x = rect.x + INSET ;
|
||||
rect.width = rect.width - 2 * INSET;
|
||||
|
||||
|
||||
if (rect.x < bounds.x)
|
||||
rect.x = bounds.x+1;
|
||||
|
||||
if ((rect.x+rect.width) > (bounds.x+bounds.width))
|
||||
rect.width = (bounds.x+bounds.width)-1;
|
||||
|
||||
aRenderingContext.FillRect(rect);
|
||||
|
||||
/*
|
||||
* Render the highlights
|
||||
*/
|
||||
aRenderingContext.SetColor(nsLighter(mComponentColor));
|
||||
aRenderingContext.DrawLine(rect.x,rect.y,rect.x,rect.y+rect.height);
|
||||
aRenderingContext.DrawLine(rect.x,rect.y,rect.x+rect.width,rect.y);
|
||||
aRenderingContext.SetColor(nsDarker(mComponentColor));
|
||||
aRenderingContext.DrawLine(rect.x,rect.y+rect.height,rect.x+rect.width,rect.y+rect.height);
|
||||
aRenderingContext.DrawLine(rect.x+rect.width,rect.y,rect.x+rect.width,rect.y+rect.height);
|
||||
|
||||
aRenderingContext.GetFontMetrics()->GetHeight(fm_height);
|
||||
|
||||
if (rect.height > fm_height)
|
||||
{
|
||||
// rndctx->SetColor(GetForegroundColor());
|
||||
aRenderingContext.SetColor(NS_RGB(255,255,255)); /* XXX: This color should come from someplace else... */
|
||||
|
||||
/*
|
||||
* XXX. we need to handle '\n' in a format string...
|
||||
* This should not require two separate coding calls
|
||||
* we need to generalize this.
|
||||
*/
|
||||
psBuf = pEvent->toStringFmt(usFmt).toCString("");
|
||||
aRenderingContext.DrawString(psBuf,nsCRT::strlen(psBuf),rect.x+1,rect.y,0);
|
||||
delete psBuf;
|
||||
|
||||
if (rect.height > (2 * fm_height))
|
||||
{
|
||||
psBuf = pEvent->getSummary().toCString("");
|
||||
aRenderingContext.DrawString(psBuf,nsCRT::strlen(psBuf),rect.x+1,rect.y+fm_height,0);
|
||||
delete psBuf;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -263,7 +263,7 @@ nsIXPFCCanvas * nsCalMultiDayViewCanvas :: AddDayViewCanvas()
|
||||
}
|
||||
|
||||
|
||||
nsresult nsCalMultiDayViewCanvas::Action(nsIXPFCCommand * aCommand)
|
||||
nsEventStatus nsCalMultiDayViewCanvas::Action(nsIXPFCCommand * aCommand)
|
||||
{
|
||||
/*
|
||||
* If this is a DayList Command, modify our children as necessary
|
||||
@@ -291,7 +291,7 @@ nsresult nsCalMultiDayViewCanvas::Action(nsIXPFCCommand * aCommand)
|
||||
res = daylist_command->CreateIterator(&iterator);
|
||||
|
||||
if (NS_OK != res)
|
||||
return res;
|
||||
return nsEventStatus_eIgnore;
|
||||
|
||||
iterator->Init();
|
||||
|
||||
|
||||
@@ -200,3 +200,9 @@ nsresult nsCalMultiUserViewCanvas :: SetParameter(nsString& aKey, nsString& aVal
|
||||
|
||||
return (nsXPFCCanvas :: SetParameter(aKey, aValue));
|
||||
}
|
||||
|
||||
nsresult nsCalMultiUserViewCanvas :: SetTimeContext(nsICalTimeContext * aContext)
|
||||
{
|
||||
aContext->SetHorizontal(PR_TRUE); //XXX
|
||||
return (nsCalMultiViewCanvas :: SetTimeContext(aContext));
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ nsresult nsCalMultiViewCanvas :: SetShowTimeScale(PRBool aShowTimeScale)
|
||||
}
|
||||
|
||||
|
||||
nsresult nsCalMultiViewCanvas::Action(nsIXPFCCommand * aCommand)
|
||||
nsEventStatus nsCalMultiViewCanvas::Action(nsIXPFCCommand * aCommand)
|
||||
{
|
||||
return (nsCalTimebarComponentCanvas::Action(aCommand));
|
||||
}
|
||||
|
||||
@@ -171,8 +171,8 @@ nsEventStatus nsCalTimebarCanvas :: PaintBackground(nsIRenderingContext& aRender
|
||||
PRUint32 space_per_interval, start;
|
||||
|
||||
if (GetTimeContext()->GetHorizontal() == PR_TRUE) {
|
||||
space_per_interval = (rect.width) / major_intervals;
|
||||
start = rect.x;
|
||||
space_per_interval = ((rect.width-(2*LOCAL_INSET)) - ((rect.width-(2*LOCAL_INSET)) % major_intervals)) / major_intervals;
|
||||
start = rect.x+LOCAL_INSET;
|
||||
} else {
|
||||
space_per_interval = ((rect.height-(2*LOCAL_INSET)) - ((rect.height-(2*LOCAL_INSET)) % major_intervals)) / major_intervals;
|
||||
start = rect.y+LOCAL_INSET;
|
||||
@@ -211,13 +211,13 @@ nsresult nsCalTimebarCanvas::PaintInterval(nsIRenderingContext& aRenderingContex
|
||||
if (GetTimeContext()->GetHorizontal() == PR_TRUE) {
|
||||
rect.x = aStart;
|
||||
rect.width = aSpace;
|
||||
aRenderingContext.DrawLine(rect.x, rect.y+LOCAL_INSET, rect.x, rect.y+rect.height-LOCAL_INSET);
|
||||
} else {
|
||||
rect.y = aStart;
|
||||
rect.height = aSpace;
|
||||
aRenderingContext.DrawLine(rect.x+LOCAL_INSET, rect.y, rect.x+rect.width-LOCAL_INSET, rect.y);
|
||||
}
|
||||
|
||||
aRenderingContext.DrawLine(rect.x+LOCAL_INSET, rect.y, rect.x+rect.width-LOCAL_INSET, rect.y);
|
||||
|
||||
return NS_OK ;
|
||||
}
|
||||
|
||||
|
||||
@@ -95,6 +95,7 @@ public:
|
||||
);
|
||||
|
||||
NS_IMETHOD_(PRBool) GetHorizontal();
|
||||
NS_IMETHOD SetHorizontal(PRBool aHorizontal);
|
||||
|
||||
NS_IMETHOD SetPeriodFormat(nsCalPeriodFormat aPeriodFormat);
|
||||
NS_IMETHOD_(nsCalPeriodFormat) GetPeriodFormat();
|
||||
@@ -120,10 +121,10 @@ public:
|
||||
NS_IMETHOD SetDate(nsIDateTime * aDateTime) ;
|
||||
|
||||
// nsIXPFCObserver methods
|
||||
NS_IMETHOD Update(nsIXPFCSubject * aSubject, nsIXPFCCommand * aCommand);
|
||||
NS_IMETHOD_(nsEventStatus) Update(nsIXPFCSubject * aSubject, nsIXPFCCommand * aCommand);
|
||||
|
||||
// nsIXPFCCommandReceiver methods
|
||||
NS_IMETHOD Action(nsIXPFCCommand * aCommand);
|
||||
NS_IMETHOD_(nsEventStatus) Action(nsIXPFCCommand * aCommand);
|
||||
|
||||
// nsIXPFCSubject methods
|
||||
NS_IMETHOD Attach(nsIXPFCObserver * aObserver);
|
||||
@@ -141,8 +142,8 @@ protected:
|
||||
~nsCalTimeContext();
|
||||
|
||||
private:
|
||||
NS_IMETHOD HandleDurationCommand(nsCalDurationCommand * aDurationCommand);
|
||||
NS_IMETHOD HandleDayListCommand(nsCalDayListCommand * aDayListCommand);
|
||||
NS_IMETHOD_(nsEventStatus) HandleDurationCommand(nsCalDurationCommand * aDurationCommand);
|
||||
NS_IMETHOD_(nsEventStatus) HandleDayListCommand(nsCalDayListCommand * aDayListCommand);
|
||||
|
||||
private:
|
||||
nsIDateTime * mStartTime;
|
||||
|
||||
@@ -88,6 +88,8 @@ public:
|
||||
) = 0;
|
||||
|
||||
NS_IMETHOD_(PRBool) GetHorizontal() = 0;
|
||||
NS_IMETHOD SetHorizontal(PRBool aHorizontal) = 0;
|
||||
|
||||
|
||||
NS_IMETHOD_(nsIDateTime *) GetDTStart() = 0;
|
||||
NS_IMETHOD_(nsIDateTime *) GetDTEnd() = 0;
|
||||
|
||||
@@ -148,6 +148,12 @@ PRBool nsCalTimeContext::GetHorizontal()
|
||||
return mHorizontal;
|
||||
}
|
||||
|
||||
nsresult nsCalTimeContext::SetHorizontal(PRBool aHorizontal)
|
||||
{
|
||||
mHorizontal = aHorizontal;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsIDateTime * nsCalTimeContext::GetDate()
|
||||
{
|
||||
return (mDate);
|
||||
@@ -640,7 +646,7 @@ PRUint32 nsCalTimeContext::GetLastVisibleTime(nsCalPeriodFormat aFormat)
|
||||
* visual notification to all observers of us ...
|
||||
*/
|
||||
|
||||
nsresult nsCalTimeContext::Update(nsIXPFCSubject * aSubject, nsIXPFCCommand * aCommand)
|
||||
nsEventStatus nsCalTimeContext::Update(nsIXPFCSubject * aSubject, nsIXPFCCommand * aCommand)
|
||||
{
|
||||
|
||||
/*
|
||||
@@ -655,10 +661,10 @@ nsresult nsCalTimeContext::Update(nsIXPFCSubject * aSubject, nsIXPFCCommand * aC
|
||||
|
||||
Notify(aCommand);
|
||||
|
||||
return NS_OK;
|
||||
return (nsEventStatus_eIgnore);
|
||||
}
|
||||
|
||||
nsresult nsCalTimeContext::Action(nsIXPFCCommand * aCommand)
|
||||
nsEventStatus nsCalTimeContext::Action(nsIXPFCCommand * aCommand)
|
||||
{
|
||||
nsCalDurationCommand * duration_command = nsnull;
|
||||
nsCalDayListCommand * daylist_command = nsnull;
|
||||
@@ -685,10 +691,10 @@ nsresult nsCalTimeContext::Action(nsIXPFCCommand * aCommand)
|
||||
return (HandleDayListCommand(daylist_command));
|
||||
|
||||
|
||||
return res;
|
||||
return nsEventStatus_eIgnore;
|
||||
}
|
||||
|
||||
nsresult nsCalTimeContext::HandleDayListCommand(nsCalDayListCommand * aDayListCommand)
|
||||
nsEventStatus nsCalTimeContext::HandleDayListCommand(nsCalDayListCommand * aDayListCommand)
|
||||
{
|
||||
/*
|
||||
* Handle the DayList here...
|
||||
@@ -704,7 +710,7 @@ nsresult nsCalTimeContext::HandleDayListCommand(nsCalDayListCommand * aDayListCo
|
||||
res = aDayListCommand->CreateIterator(&iterator);
|
||||
|
||||
if (NS_OK != res)
|
||||
return res;
|
||||
return nsEventStatus_eIgnore;
|
||||
|
||||
iterator->Init();
|
||||
|
||||
@@ -719,17 +725,17 @@ nsresult nsCalTimeContext::HandleDayListCommand(nsCalDayListCommand * aDayListCo
|
||||
NS_IF_RELEASE(iterator);
|
||||
NS_IF_RELEASE(aDayListCommand);
|
||||
|
||||
return NS_OK;
|
||||
return nsEventStatus_eIgnore;
|
||||
}
|
||||
|
||||
nsresult nsCalTimeContext::HandleDurationCommand(nsCalDurationCommand * aDurationCommand)
|
||||
nsEventStatus nsCalTimeContext::HandleDurationCommand(nsCalDurationCommand * aDurationCommand)
|
||||
{
|
||||
nsDuration * dtDuration;
|
||||
|
||||
dtDuration = aDurationCommand->GetDuration();
|
||||
|
||||
if (nsnull == dtDuration)
|
||||
return NS_OK;
|
||||
return nsEventStatus_eIgnore;
|
||||
|
||||
switch (aDurationCommand->GetPeriodFormat())
|
||||
{
|
||||
@@ -781,7 +787,7 @@ nsresult nsCalTimeContext::HandleDurationCommand(nsCalDurationCommand * aDuratio
|
||||
|
||||
NS_IF_RELEASE(aDurationCommand);
|
||||
|
||||
return NS_OK;
|
||||
return nsEventStatus_eIgnore;
|
||||
}
|
||||
|
||||
nsresult nsCalTimeContext :: Attach(nsIXPFCObserver * aObserver)
|
||||
|
||||
@@ -258,10 +258,10 @@ public:
|
||||
|
||||
|
||||
// nsIXPFCObserver methods
|
||||
NS_IMETHOD Update(nsIXPFCSubject * aSubject, nsIXPFCCommand * aCommand);
|
||||
NS_IMETHOD_(nsEventStatus) Update(nsIXPFCSubject * aSubject, nsIXPFCCommand * aCommand);
|
||||
|
||||
// nsIXPFCCommandReceiver methods
|
||||
NS_IMETHOD Action(nsIXPFCCommand * aCommand);
|
||||
NS_IMETHOD_(nsEventStatus) Action(nsIXPFCCommand * aCommand);
|
||||
|
||||
void SetDefaults();
|
||||
|
||||
|
||||
@@ -1846,7 +1846,7 @@ nsEventStatus nsCalMonthContextController::OnMouseMove(nsGUIEvent *aEvent)
|
||||
return nsEventStatus_eConsumeNoDefault;
|
||||
}
|
||||
|
||||
nsresult nsCalMonthContextController::Update(nsIXPFCSubject * aSubject, nsIXPFCCommand * aCommand)
|
||||
nsEventStatus nsCalMonthContextController::Update(nsIXPFCSubject * aSubject, nsIXPFCCommand * aCommand)
|
||||
{
|
||||
return (nsXPFCCanvas::Update(aSubject,aCommand));
|
||||
}
|
||||
@@ -1857,7 +1857,7 @@ nsresult nsCalMonthContextController::Update(nsIXPFCSubject * aSubject, nsIXPFCC
|
||||
*
|
||||
*/
|
||||
|
||||
nsresult nsCalMonthContextController::Action(nsIXPFCCommand * aCommand)
|
||||
nsEventStatus nsCalMonthContextController::Action(nsIXPFCCommand * aCommand)
|
||||
{
|
||||
/*
|
||||
* Adjust the duration if this is a duration command
|
||||
@@ -1877,7 +1877,7 @@ nsresult nsCalMonthContextController::Action(nsIXPFCCommand * aCommand)
|
||||
{
|
||||
dtDuration = duration_command->GetDuration();
|
||||
if (nsnull == dtDuration)
|
||||
return NS_OK;
|
||||
return nsEventStatus_eIgnore;
|
||||
|
||||
DateTime d = GetDate();
|
||||
d.add(dtDuration->GetDuration());
|
||||
@@ -1886,7 +1886,7 @@ nsresult nsCalMonthContextController::Action(nsIXPFCCommand * aCommand)
|
||||
for (int i = 0; i < m_pDates->GetSize(); i++)
|
||||
((DateTime*)m_pDates->GetAt(i))->add(dtDuration->GetDuration());
|
||||
|
||||
return NS_OK;
|
||||
return nsEventStatus_eIgnore;
|
||||
}
|
||||
|
||||
|
||||
@@ -1903,7 +1903,7 @@ nsresult nsCalMonthContextController::Action(nsIXPFCCommand * aCommand)
|
||||
int iDateSet = 0;
|
||||
|
||||
if (NS_OK != res)
|
||||
return res;
|
||||
return nsEventStatus_eIgnore;
|
||||
iterator->Init();
|
||||
ClearDateList(); /* empty the current date list first */
|
||||
while(!(iterator->IsDone()))
|
||||
@@ -1926,7 +1926,7 @@ nsresult nsCalMonthContextController::Action(nsIXPFCCommand * aCommand)
|
||||
}
|
||||
iterator->Next();
|
||||
}
|
||||
return res;
|
||||
return nsEventStatus_eIgnore;
|
||||
}
|
||||
|
||||
return(nsXPFCCanvas::Action(aCommand));
|
||||
|
||||
@@ -186,11 +186,11 @@ public:
|
||||
NS_IMETHOD_(PRBool) PaintRequested();
|
||||
|
||||
// nsIXPFCObserver methods
|
||||
NS_IMETHOD Update(nsIXPFCSubject * aSubject, nsIXPFCCommand * aCommand);
|
||||
NS_IMETHOD_(nsEventStatus) Update(nsIXPFCSubject * aSubject, nsIXPFCCommand * aCommand);
|
||||
|
||||
|
||||
// nsIXPFCCommandReceiver methods
|
||||
NS_IMETHOD Action(nsIXPFCCommand * aCommand);
|
||||
NS_IMETHOD_(nsEventStatus) Action(nsIXPFCCommand * aCommand);
|
||||
|
||||
// nsIXMLParserObject methods
|
||||
NS_IMETHOD SetParameter(nsString& aKey, nsString& aValue) ;
|
||||
|
||||
@@ -1912,7 +1912,7 @@ nsresult nsXPFCCanvas :: DumpCanvas(FILE * f, PRUint32 indent)
|
||||
|
||||
|
||||
|
||||
nsresult nsXPFCCanvas::Update(nsIXPFCSubject * aSubject, nsIXPFCCommand * aCommand)
|
||||
nsEventStatus nsXPFCCanvas::Update(nsIXPFCSubject * aSubject, nsIXPFCCommand * aCommand)
|
||||
{
|
||||
|
||||
/*
|
||||
@@ -1921,7 +1921,7 @@ nsresult nsXPFCCanvas::Update(nsIXPFCSubject * aSubject, nsIXPFCCommand * aComma
|
||||
|
||||
Action(aCommand);
|
||||
|
||||
return NS_OK;
|
||||
return (Action(aCommand));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1944,7 +1944,7 @@ nsEventStatus nsXPFCCanvas::ProcessCommand(nsIXPFCCommand * aCommand)
|
||||
return (nsEventStatus_eIgnore);
|
||||
}
|
||||
|
||||
nsresult nsXPFCCanvas::Action(nsIXPFCCommand * aCommand)
|
||||
nsEventStatus nsXPFCCanvas::Action(nsIXPFCCommand * aCommand)
|
||||
{
|
||||
|
||||
/*
|
||||
@@ -1999,7 +1999,7 @@ nsresult nsXPFCCanvas::Action(nsIXPFCCommand * aCommand)
|
||||
|
||||
gXPFCToolkit->GetViewManager()->UpdateView(GetView(), bounds, NS_VMREFRESH_AUTO_DOUBLE_BUFFER | NS_VMREFRESH_NO_SYNC);
|
||||
|
||||
return NS_OK;
|
||||
return nsEventStatus_eIgnore;
|
||||
}
|
||||
|
||||
nsCursor nsXPFCCanvas::GetCursor()
|
||||
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
NS_IMETHOD Update() ;
|
||||
NS_IMETHOD SetShellContainer(nsIShellInstance * aShellInstance,nsIWebViewerContainer * aWebViewerContainer) ;
|
||||
NS_IMETHOD_(nsIXPFCMenuItem *) MenuItemFromID(PRUint32 aID) ;
|
||||
NS_IMETHOD Action(nsIXPFCCommand * aCommand) ;
|
||||
NS_IMETHOD_(nsEventStatus) Action(nsIXPFCCommand * aCommand) ;
|
||||
|
||||
private:
|
||||
NS_IMETHOD ProcessActionCommand(nsString& aAction);
|
||||
|
||||
@@ -214,7 +214,7 @@ nsIXPFCMenuItem * nsXPFCMenuContainer :: MenuItemFromID(PRUint32 aID)
|
||||
return item;
|
||||
}
|
||||
|
||||
nsresult nsXPFCMenuContainer :: Action(nsIXPFCCommand * aCommand)
|
||||
nsEventStatus nsXPFCMenuContainer :: Action(nsIXPFCCommand * aCommand)
|
||||
{
|
||||
|
||||
/*
|
||||
@@ -229,7 +229,7 @@ nsresult nsXPFCMenuContainer :: Action(nsIXPFCCommand * aCommand)
|
||||
res = aCommand->QueryInterface(kXPFCActionCommandCID,(void**)&action_command);
|
||||
|
||||
if (NS_OK != res)
|
||||
return res;
|
||||
return nsEventStatus_eIgnore;
|
||||
|
||||
|
||||
/*
|
||||
@@ -240,7 +240,7 @@ nsresult nsXPFCMenuContainer :: Action(nsIXPFCCommand * aCommand)
|
||||
|
||||
NS_RELEASE(action_command);
|
||||
|
||||
return NS_OK;
|
||||
return nsEventStatus_eIgnore;
|
||||
}
|
||||
|
||||
nsresult nsXPFCMenuContainer::ProcessActionCommand(nsString& aAction)
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
#include "nsISupports.h"
|
||||
#include "nsIXPFCCommand.h"
|
||||
#include "nsGUIEvent.h"
|
||||
|
||||
class nsIXPFCCommand;
|
||||
|
||||
@@ -36,7 +37,7 @@ public:
|
||||
|
||||
NS_IMETHOD Init() = 0;
|
||||
|
||||
NS_IMETHOD Action(nsIXPFCCommand * aCommand) = 0;
|
||||
NS_IMETHOD_(nsEventStatus) Action(nsIXPFCCommand * aCommand) = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -46,7 +46,8 @@ nsresult nsXPFCCommand::Init()
|
||||
|
||||
nsresult nsXPFCCommand::Execute()
|
||||
{
|
||||
return (mReceiver->Action(this));
|
||||
mReceiver->Action(this);
|
||||
return (NS_OK);
|
||||
}
|
||||
|
||||
nsIXPFCCommandReceiver * nsXPFCCommand::GetReceiver()
|
||||
|
||||
@@ -29,7 +29,7 @@ public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
NS_IMETHOD Init() ;
|
||||
NS_IMETHOD Update(nsIXPFCSubject * aSubject, nsIXPFCCommand * aCommand) ;
|
||||
NS_IMETHOD_(nsEventStatus) Update(nsIXPFCSubject * aSubject, nsIXPFCCommand * aCommand) ;
|
||||
|
||||
protected:
|
||||
~nsXPFCObserver();
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#define nsIXPFCObserver_h___
|
||||
|
||||
#include "nsISupports.h"
|
||||
#include "nsGUIEvent.h"
|
||||
|
||||
class nsIXPFCSubject;
|
||||
class nsIXPFCCommand;
|
||||
@@ -35,7 +36,7 @@ class nsIXPFCObserver : public nsISupports
|
||||
public:
|
||||
|
||||
NS_IMETHOD Init() = 0;
|
||||
NS_IMETHOD Update(nsIXPFCSubject * aSubject, nsIXPFCCommand * aCommand) = 0;
|
||||
NS_IMETHOD_(nsEventStatus) Update(nsIXPFCSubject * aSubject, nsIXPFCCommand * aCommand) = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ nsresult nsXPFCObserver::Init()
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult nsXPFCObserver::Update(nsIXPFCSubject * aSubject, nsIXPFCCommand * aCommand)
|
||||
nsEventStatus nsXPFCObserver::Update(nsIXPFCSubject * aSubject, nsIXPFCCommand * aCommand)
|
||||
{
|
||||
return NS_OK;
|
||||
return (nsEventStatus_eIgnore);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user