calendarui/views/src/calennativeview.cpp
changeset 23 fd30d51f876b
parent 18 c198609911f9
child 26 a949c2543c15
child 45 b6db4fd4947b
--- a/calendarui/views/src/calennativeview.cpp	Fri Apr 16 14:57:40 2010 +0300
+++ b/calendarui/views/src/calennativeview.cpp	Mon May 03 12:30:32 2010 +0300
@@ -41,8 +41,8 @@
 /*!
  Default constructor.
  */
-CalenNativeView::CalenNativeView(MCalenServices& services) :
-	mServices(services), mPluginEnabled(false)//,mGoToDateForm(NULL)
+CalenNativeView::CalenNativeView(MCalenServices &services) :
+	mServices(services)
 {
 	setTitle(hbTrId("txt_calendar_title_calendar"));
 
@@ -51,6 +51,7 @@
 
 	notificationArray.Append(ECalenNotifySystemTimeChanged);
 	notificationArray.Append(ECalenNotifySystemLocaleChanged);
+	notificationArray.Append(ECalenNotifyContextChanged);
 
 	mServices.RegisterForNotificationsL(this, notificationArray);
 
@@ -65,38 +66,6 @@
 }
 
 /*!
- Checks to see if an info bar is available from a customisation plugin
- */
-void CalenNativeView::checkInfobarL()
-{
-	HbWidget* pluginInfobar = mServices.Infobar();
-
-	if (mInfobar && mInfobar != pluginInfobar) {
-		mServices.IssueNotificationL(ECalenNotifyCheckPluginUnloading);
-		mInfobar = NULL;
-	}
-
-	if (pluginInfobar) {
-		mInfobar = pluginInfobar;
-	}
-
-}
-
-/*!
- Returns true if infobar is there
- */
-bool CalenNativeView::isPlugin()
-{
-	HbWidget* pluginInfobar = mServices.Infobar();
-	if (pluginInfobar) {
-		return true;
-	} else {
-		return false;
-	}
-
-}
-
-/*!
  Issues populcaiton complete to the framework
  */
 void CalenNativeView::populationComplete()
@@ -106,22 +75,6 @@
 }
 
 /*!
- Returns a pointer to the available secondary control, or NULL if none is
- available. The secondary control may be either an info bar or a preview pane
- */
-HbWidget* CalenNativeView::ControlOrNull()
-{
-	HbWidget* pluginInfobar = NULL;
-	if (mInfobar) {
-		pluginInfobar = mInfobar;
-
-	} else {
-		pluginInfobar = mServices.Infobar();
-	}
-	return pluginInfobar;
-}
-
-/*!
  Slot for delete before date
  */
 void CalenNativeView::deleteBeforeDate()
@@ -182,8 +135,17 @@
 		//Set the selected date to contextDate.
 		contextDate.setDate(selectedDate);
 		context.setFocusDateAndTimeL(contextDate, KCalenMonthViewUidValue);
-		mServices.IssueCommandL(ECalenStartActiveStep);
 	}
+	refreshViewOnGoToDate();
+}
+
+/*!
+ Virtual function to refresh the current view upon selecting a date
+ from GoToDate popup
+ */
+void CalenNativeView::refreshViewOnGoToDate()
+{
+	mServices.IssueCommandL(ECalenStartActiveStep);
 }
 
 /*!
@@ -213,17 +175,31 @@
 			onLocaleChanged(EChangesLocale);
 		}
 			break;
+		case ECalenNotifyContextChanged: {
+			onContextChanged();
+		}
+		break;
 		default:
 			break;
 	}
 }
 
 /*!
- Returns true if plugin is enabled
+ Returns true if plugin is loaded
  */
 TBool CalenNativeView::pluginEnabled()
 {
-	return mPluginEnabled;
+	QString *pluginInfo = mServices.InfobarTextL();
+	if (!pluginInfo) {
+		return false;
+	} else {
+		return true;
+	}
+}
+
+QString *CalenNativeView::pluginText()
+{
+	return mServices.InfobarTextL();
 }
 
 //End Of File