#include <FBase.h>
#include <FShellNotificationManager.h>
+namespace Tizen { namespace Graphics
+{
+ class Color;
+}}
+
namespace Tizen { namespace Shell
{
*/
result SetBackgroundImageFilePath(const Tizen::Base::String& imagePath);
+ /**
+ * Gets the notification light operation properties.
+ *
+ * @since 2.2
+ *
+ * @param[out] color The light color
+ * @param[out] onTime The milliseconds for which the light is on
+ * @param[out] offTime The milliseconds for which the light is off
+ */
+ void GetLight(Tizen::Graphics::Color& color, int& onTime, int& offTime) const;
+
+ /**
+ * Sets the notification light operation properties.
+ *
+ * @since 2.2
+ *
+ * @return An error code
+ * @param[in] color The light color
+ * @param[in] onTime The milliseconds for which the light is on
+ * @param[in] offTime The milliseconds for which the light is off
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_INVALID_ARG The specified input parameter is invalid.
+ * @remarks This method has effects only on devices with notification light.
+ * @remarks The light flash continuously toggles on(@c onTime) and off(@c offTime).
+ * @remarks To turn the light off, set Color(0, 0, 0, 0) to color or set 0 to onTime.
+ */
+ result SetLight(const Tizen::Graphics::Color& color, int onTime, int offTime);
private:
class _NotificationRequestImpl* __pNotificationRequestImpl;
/usr/include/osp/base
/usr/include/osp/io
/usr/include/osp/security
+ /usr/include/osp/graphics
/usr/include/appfw
/usr/include/notification
TARGET_LINK_LIBRARIES(${this_target} "-lpthread" )
TARGET_LINK_LIBRARIES(${this_target} "-lchromium" )
TARGET_LINK_LIBRARIES(${this_target} "-L/usr/lib/osp -losp-appfw" )
+TARGET_LINK_LIBRARIES(${this_target} "-losp-uifw" )
TARGET_LINK_LIBRARIES(${this_target} "-lcapi-appfw-application" )
TARGET_LINK_LIBRARIES(${this_target} "-lcapi-appfw-app-manager" )
TARGET_LINK_LIBRARIES(${this_target} "-lnotification" )
#include <new>
#include <FBaseSysLog.h>
+#include <FGrpColor.h>
#include <FShellNotificationRequest.h>
#include "FShell_NotificationRequestImpl.h"
using namespace Tizen::Base;
using namespace Tizen::Security;
+using namespace Tizen::Graphics;
namespace Tizen { namespace Shell
{
return __pNotificationRequestImpl->GetHashCode();
}
+void
+NotificationRequest::GetLight(Color& color, int& onTime, int& offTime) const
+{
+ SysAssertf(__pNotificationRequestImpl != null, "Instance is not constructed properly.");
+
+ return __pNotificationRequestImpl->GetLight(color, onTime, offTime);
+}
+
+result
+NotificationRequest::SetLight(const Color& color, int onTime, int offTime)
+{
+ SysAssertf(__pNotificationRequestImpl != null, "Instance is not constructed properly.");
+
+ return __pNotificationRequestImpl->SetLight(color, onTime, offTime);
+}
+
int
NotificationRequest::GetBadgeNumber(void) const
{
#include <FBaseSysLog.h>
#include <FIoFile.h>
#include <FAppApp.h>
+#include <FGrpColor.h>
#include <FShellNotificationManager.h>
#include <FShellNotificationRequest.h>
#include <FShellIBadgeEventListener.h>
using namespace Tizen::Base::Collection;
using namespace Tizen::App;
using namespace Tizen::Io;
+using namespace Tizen::Graphics;
extern "C" int service_create_request(bundle *data, service_h *service);
extern "C" int service_to_bundle(service_h service, bundle** data);
: __notifyPrivateId(-1)
, __notifyPrivateIdForOngoing(-1)
, __lastNotifyPrivateId(-1)
+ , __lightActivated(false)
{
}
}
}
+ // light
+ Color lightColor;
+ int lightColor32 = 0;
+
// Set - service
int retVal = SERVICE_ERROR_NONE;
int previousDisplaySet = NOTIFICATION_DISPLAY_APP_ALL;
SysTryLog(NID_SHELL, !IsFailed(r), "[%s] Setting the notification area failed.", GetErrorMessage(r));
}
+ // Set LED
+ lightColor = pRequestImpl->GetColor();
+ lightColor32 = lightColor.GetRGB32();
+
+ if (lightColor32 == 0 || (pRequestImpl->GetOnTime() == 0))
+ { // Turn off case
+ if (needUpdate && __lightActivated)
+ { // Not for first insertion
+ r = ConvertNotificationResult(notification_set_led(notiHandle, NOTIFICATION_LED_OP_OFF, 0x00000000));
+ SysTryLog(NID_SHELL, !IsFailed(r), "[%s] Setting the notification led failed.", GetErrorMessage(r));
+ __lightActivated = false;
+ }
+ }
+ else
+ {
+ r = ConvertNotificationResult(notification_set_led(notiHandle, NOTIFICATION_LED_OP_ON_CUSTOM_COLOR, lightColor32));
+ SysTryLog(NID_SHELL, !IsFailed(r), "[%s] Setting the notification led failed.", GetErrorMessage(r));
+
+ r = ConvertNotificationResult(notification_set_led_time_period(notiHandle, pRequestImpl->GetOnTime(), pRequestImpl->GetOffTime()));
+ SysTryLog(NID_SHELL, !IsFailed(r), "[%s] Setting the notification led time period failed.", GetErrorMessage(r));
+ __lightActivated = true;
+ }
+
// insert for new notification
if (!needUpdate)
{ // new
#include <unique_ptr.h>
#include <FBaseSysLog.h>
#include <FIoFile.h>
+#include <FGrpColor.h>
#include <FShellNotificationRequest.h>
#include "FShell_NotificationRequestImpl.h"
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
using namespace Tizen::Io;
+using namespace Tizen::Graphics;
namespace Tizen { namespace Shell
{
, __notificationStyle(NOTIFICATION_STYLE_NORMAL)
, __pTextList(null)
, __pThumbnailPathList(null)
+ , __lightOnTime(0)
+ , __lightOffTime(0)
{
}
, __pThumbnailPathList(notificationMessage.__pThumbnailPathList)
, __notificationCountText(notificationMessage.__notificationCountText)
, __backgroundImagePath(notificationMessage.__backgroundImagePath)
+ , __lightColor(notificationMessage.__lightColor)
+ , __lightOnTime(notificationMessage.__lightOnTime)
+ , __lightOffTime(notificationMessage.__lightOffTime)
{
}
__pThumbnailPathList = notificationMessage.__pThumbnailPathList;
__notificationCountText = notificationMessage.__notificationCountText;
__backgroundImagePath = notificationMessage.__backgroundImagePath;
+
+ __lightColor = notificationMessage.__lightColor;
+ __lightOnTime = notificationMessage.__lightOnTime;
+ __lightOffTime = notificationMessage.__lightOffTime;
}
return *this;
}
{
return false;
}
+ if (__lightColor != pMsgImpl->__lightColor)
+ {
+ return false;
+ }
+ if (__lightOnTime != pMsgImpl->__lightOnTime)
+ {
+ return false;
+ }
+ if (__lightOffTime != pMsgImpl->__lightOffTime)
+ {
+ return false;
+ }
return true;
}
^ reinterpret_cast<int>(__pThumbnailPathList)
^ __notificationCountText.GetHashCode()
^ __backgroundImagePath.GetHashCode()
+ ^ __lightColor.GetHashCode()
+ ^ Integer(__lightOnTime).GetHashCode()
+ ^ Integer(__lightOffTime).GetHashCode()
;
}
+void
+_NotificationRequestImpl::GetLight(Color& color, int& onTime, int& offTime) const
+{
+ color = __lightColor;
+ onTime = __lightOnTime;
+ offTime = __lightOffTime;
+}
+
+Color
+_NotificationRequestImpl::GetColor(void) const
+{
+ return __lightColor;
+}
+
+int
+_NotificationRequestImpl::GetOnTime(void) const
+{
+ return __lightOnTime;
+}
+
+int
+_NotificationRequestImpl::GetOffTime(void) const
+{
+ return __lightOffTime;
+}
+
+result
+_NotificationRequestImpl::SetLight(const Color& color, int onTime, int offTime)
+{
+ SysTryReturnResult(NID_SHELL, onTime >= 0 && offTime >= 0, E_INVALID_ARG, "onTime or offTime are less than 0.");
+
+ __lightColor = color;
+ SysLog(NID_SHELL, "light color is %0X", __lightColor.GetRGB32());
+
+ __lightOnTime = onTime;
+ __lightOffTime = offTime;
+
+ return E_SUCCESS;
+}
+
int
_NotificationRequestImpl::GetBadgeNumber(void) const
{
int __lastNotifyPrivateId;
Tizen::Base::String __lastAppId;
Tizen::Base::Collection::LinkedListT<IBadgeEventListener*> __badgeEventListenerList;
+ bool __lightActivated;
+
}; //_NotificationManagerImpl
#include <FAppTypes.h>
#include <FOspConfig.h>
+namespace Tizen { namespace Graphics
+{
+ class Color;
+}}
+
namespace Tizen { namespace Shell
{
*/
result SetBackgroundImageFilePath(const Tizen::Base::String& imagePath);
+ /**
+ * Gets the notification light operation properties.
+ *
+ * @since 2.2
+ *
+ * @param[out] color The light color
+ * @param[out] onTime The milliseconds for which the light is on
+ * @param[out] offTime The milliseconds for which the light is off
+ */
+ void GetLight(Tizen::Graphics::Color& color, int& onTime, int& offTime) const;
+
+ /**
+ * Sets the notification light operation properties.
+ *
+ * @since 2.2
+ *
+ * @return An error code
+ * @param[in] color The light color
+ * @param[in] onTime The milliseconds for which the light is on
+ * @param[in] offTime The milliseconds for which the light is off
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_INVALID_ARG The specified input parameter is invalid.
+ * @remarks This method has effects only on devices with notification light.
+ * @remarks The light flash continuously toggles on(@c onTime) and off(@c offTime).
+ * @remarks To turn the light off, set Color(0, 0, 0, 0) to color or set 0 to onTime.
+ */
+ result SetLight(const Tizen::Graphics::Color& color, int onTime, int offTime);
/*
* Get internal pointer of TextList for internal reference
*/
const Tizen::Base::Collection::IList* GetMessageThumbnailFilePathList() const;
+ /*
+ * Get internal value for the light(color)
+ */
+ Tizen::Graphics::Color GetColor(void) const;
+
+ /*
+ * Get internal value for the light(onTime)
+ */
+ int GetOnTime(void) const;
+
+ /*
+ * Get internal value for the light(offTime)
+ */
+ int GetOffTime(void) const;
+
//
// Gets the implementation.
//
Tizen::Base::Collection::IList* __pThumbnailPathList;
Tizen::Base::String __notificationCountText;
Tizen::Base::String __backgroundImagePath;
+ // 2.2
+ Tizen::Graphics::Color __lightColor;
+ int __lightOnTime;
+ int __lightOffTime;
}; //_NotificationRequestImpl