From f2d2c237a9b1e287b895bedede427f0a387cc515 Mon Sep 17 00:00:00 2001 From: Young Ik Cho Date: Tue, 20 Nov 2012 09:08:05 +0900 Subject: [PATCH] osp-shell git deployment Change-Id: I4dfab2132e8b4c9054ce3ed8299dcc3e70406ece --- CMakeLists.txt | 48 ++++ LICENSE | 202 ++++++++++++++ NOTICE | 9 + inc/FShell.h | 53 ++++ osp-shell.manifest | 5 + osp-shell.pc.in | 13 + packaging/osp-shell.spec | 93 +++++++ src/CMakeLists.txt | 50 ++++ src/FShlNotificationManager.cpp | 239 ++++++++++++++++ src/inc/FShl_NotificationManagerImpl.h | 484 +++++++++++++++++++++++++++++++++ 10 files changed, 1196 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 LICENSE create mode 100644 NOTICE create mode 100644 inc/FShell.h create mode 100644 osp-shell.manifest create mode 100644 osp-shell.pc.in create mode 100644 packaging/osp-shell.spec create mode 100644 src/CMakeLists.txt create mode 100644 src/FShlNotificationManager.cpp create mode 100644 src/inc/FShl_NotificationManagerImpl.h diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..2daeaae --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,48 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) + +SET(CMAKE_INSTALL_PREFIX /usr) +SET(PREFIX ${CMAKE_INSTALL_PREFIX}) + +## OUTPUT PATHS +SET(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/cmake_build_tmp/output/osp) + + +## Disable build rpath +SET(CMAKE_SKIP_BUILD_RPATH TRUE) + +IF(SBS OR OBS) +ADD_DEFINITIONS("-D_EXCEPT_DEPENDENCY_") +ENDIF(SBS OR OBS) + +IF(SBS) +ADD_DEFINITIONS("-D_SBS_") +ENDIF(SBS) + +## Set Assembly Compiler +#SET(CMAKE_ASM_COMPILER "${CMAKE_C_COMPILER}") + +SET(CMAKE_ASM_COMPILER_ARG1 "${CPPFLAGS} -c") +ENABLE_LANGUAGE(ASM) + +## LIBRARY PATH +LINK_DIRECTORIES (${LIBRARY_OUTPUT_PATH}) + +ADD_SUBDIRECTORY(src) + +# pkgconfig file +CONFIGURE_FILE(osp-shell.pc.in ${CMAKE_SOURCE_DIR}/osp-shell.pc @ONLY) +INSTALL(FILES ${CMAKE_SOURCE_DIR}/osp-shell.pc DESTINATION lib/pkgconfig) + +INSTALL(DIRECTORY ${LIBRARY_OUTPUT_PATH}/ DESTINATION lib/osp + FILES_MATCHING PATTERN "*.so*" + PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ + GROUP_EXECUTE GROUP_READ + WORLD_EXECUTE WORLD_READ) +INSTALL(DIRECTORY ${LIBRARY_OUTPUT_PATH}/debug/ DESTINATION lib/osp/debug + FILES_MATCHING PATTERN "*" + PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ + GROUP_EXECUTE GROUP_READ + WORLD_EXECUTE WORLD_READ) + +INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/inc/ DESTINATION include/osp FILES_MATCHING PATTERN "*.h") +INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/src/inc/ DESTINATION include/osp/shell FILES_MATCHING PATTERN "*.h") diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/NOTICE b/NOTICE new file mode 100644 index 0000000..cca4178 --- /dev/null +++ b/NOTICE @@ -0,0 +1,9 @@ +Copyright (c) Samsung Electronics Co., Ltd. All rights reserved. +Except as noted, this software is licensed under Apache License, Version 2. +Please, see the LICENSE file for Apache License terms and conditions. + +Several source codes may have its original copyright owner and/or +be licensed under other than Apache License, Version 2, say, Flora License, Version 1. +Please, see copyright and license comments section in the header of each file, +and the LICENSE.Flora for Flora License terms and conditions. + diff --git a/inc/FShell.h b/inc/FShell.h new file mode 100644 index 0000000..1b79aeb --- /dev/null +++ b/inc/FShell.h @@ -0,0 +1,53 @@ +// +// Open Service Platform +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/** + * @file FShell.h + * @brief This is the header file for the %Shell namespace. + * + * This header file contains the declarations of the %Shell namespace. + */ + +#ifndef _FSHELL_H_ +#define _FSHELL_H_ + +#include +#include + +/** + * @namespace Osp::Shell + * @brief This namespace contains classes for phone shell management. + * @since 3.0 + * + * @remarks @b Header @b %file: @b \#include @b @n + * @b Library : @b osp-shell + * + * The %Shell namespace contains the classes for phone shell management, including posting notification, handling shortcut and using livebox. + * @n@n + * For more information on the %Shell namespace features, see Shell Guide. + * + * The following diagram illustrates the relationships between the classes belonging to the %Shell namespace. + * + * @image html shell_namespace_classdiagram.png + */ + +namespace Osp { namespace Shell +{ + +} } // Osp::Shell + +#endif // _FSHELL_H_ diff --git a/osp-shell.manifest b/osp-shell.manifest new file mode 100644 index 0000000..ae3e6f7 --- /dev/null +++ b/osp-shell.manifest @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/osp-shell.pc.in b/osp-shell.pc.in new file mode 100644 index 0000000..e0eedad --- /dev/null +++ b/osp-shell.pc.in @@ -0,0 +1,13 @@ +# Package Information for pkg-config + +prefix=@PREFIX@ +exec_prefix=/usr +libdir=/usr/lib/osp +includedir=/usr/include/osp + +Name: @PC_NAME@ +Description: @PACKAGE_DESCRIPTION@ +Version: @VERSION@ +Requires: @PC_REQUIRED@ +Libs: -L${libdir} @PC_LDFLAGS@ +Cflags: -I${includedir} diff --git a/packaging/osp-shell.spec b/packaging/osp-shell.spec new file mode 100644 index 0000000..d5a9015 --- /dev/null +++ b/packaging/osp-shell.spec @@ -0,0 +1,93 @@ +%define debug_package %{nil} +%define __strip /bin/true + +Name: osp-shell +Summary: The Shell library of OSP +Version: 1.3.0.0 +Release: 1 +Group: TO_BE/FILLED_IN +License: TO BE FILLED IN +Source0: %{name}-%{version}.tar.gz +BuildRequires: cmake +BuildRequires: pkgconfig(chromium) +BuildRequires: pkgconfig(osp-appfw) +BuildRequires: osp-appfw-internal-devel +BuildRequires: boost-devel + +# runtime requires +Requires: osp-appfw +Requires: chromium + +Provides: libosp-shell.so.1 + +Requires(post): /sbin/ldconfig +Requires(postun): /sbin/ldconfig + +%description +The Shell library of OSP + +%package devel +Summary: The Shell library of OSP (Development) +Group: TO_BE/FILLED_IN +Requires: %{name} = %{version}-%{release} + +%description devel +The Shell library of OSP (DEV) + +%package internal-devel +Summary: osp shell internel (Internal) +Group: TO_BE/FILLED_IN +Requires: %{name} = %{version}-%{release} + +%description internal-devel +The Shell library of OSP (Internal-DEV) + +%package debug +Summary: The Shell library of OSP (Development) +Group: TO_BE/FILLED_IN +Requires: %{name} = %{version}-%{release} + +%description debug +The Shell library of OSP (debug) + +%prep + +%setup -q + +%build +MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` +%ifarch %{ix86} +CXXFLAGS="$CXXFLAGS -D_OSP_DEBUG_ -D_OSP_X86_ -D_OSP_EMUL_" cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DOBS=1 -DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DARCH=x86 +%else +CXXFLAGS="-O2 -g -pipe -Wall -fno-exceptions -Wformat -Wformat-security -Wl,--as-needed -fmessage-length=0 -march=armv7-a -mtune=cortex-a8 -mlittle-endian -mfpu=neon -mfloat-abi=softfp -D__SOFTFP__ -mthumb -Wa,-mimplicit-it=thumb -D_OSP_DEBUG_ -D_OSP_ARMEL_" cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DOBS=1 -DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DARCH=arm +%endif + +# Call make instruction with smp support +make %{?jobs:-j%jobs} + +%install +rm -rf %{buildroot} +mkdir -p %{buildroot}/usr/share/license +cp %{_builddir}/%{name}-%{version}/LICENSE %{buildroot}/usr/share/license/%{name} + +%make_install + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%files +%manifest osp-shell.manifest +/usr/share/license/%{name} +%{_libdir}/osp/*.so* + +%files devel +%{_includedir}/osp/*.h +%{_libdir}/pkgconfig/osp-shell.pc + +%files internal-devel +%{_includedir}/osp/shell/* + +%files debug +%{_libdir}/osp/debug/*.so* + diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..24b06c4 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,50 @@ +SET (this_target osp-shell) + +INCLUDE_DIRECTORIES( + ${CMAKE_SOURCE_DIR}/inc + inc + /usr/include/chromium + /usr/include/osp + /usr/include/osp/app + /usr/include/osp/base + /usr/include/osp/io + /usr/include/osp/security + ) + +SET (${this_target}_SOURCE_FILES + FShlNotificationManager.cpp +) + +## Definitions +SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -Wall" ) + +## SET C COMPILER FLAGS +SET(CMAKE_C_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} ${OSP_COMPILER_FLAGS}") + +## SET CPP COMPILER FLAGS +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") +SET(CMAKE_CXX_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} ${OSP_COMPILER_FLAGS}") + +## Create Library +ADD_LIBRARY (${this_target} SHARED ${${this_target}_SOURCE_FILES}) + +## SET LINKER FLAGS +SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined -Wl,--as-needed") + +TARGET_LINK_LIBRARIES(${this_target} "-lchromium" ) +TARGET_LINK_LIBRARIES(${this_target} "-L/usr/lib/osp -losp-appfw" ) + +SET_TARGET_PROPERTIES(${this_target} + PROPERTIES + VERSION ${FULLVER} + SOVERSION ${MAJORVER} + CLEAN_DIRECT_OUTPUT 1 + ) + +ADD_CUSTOM_COMMAND(TARGET ${this_target} + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${LIBRARY_OUTPUT_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX} ${LIBRARY_OUTPUT_PATH}/debug/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX}.${FULLVER} + COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX}.${FULLVER} ${LIBRARY_OUTPUT_PATH}/debug/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX}.${MAJORVER} + COMMAND ${CMAKE_STRIP} --strip-unneeded ${LIBRARY_OUTPUT_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX} + COMMENT "strip ${this_target}" + ) diff --git a/src/FShlNotificationManager.cpp b/src/FShlNotificationManager.cpp new file mode 100644 index 0000000..212c322 --- /dev/null +++ b/src/FShlNotificationManager.cpp @@ -0,0 +1,239 @@ +// +// Open Service Platform +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/** + * @file FShlNotificationManager.cpp + * @brief This is the placeholder for NotificationManager class. + */ + +#if 0 +#include + +#include +#include + +#include + +using namespace Osp::Base; +using namespace Osp::Security; + +namespace Osp { namespace Shell +{ + +NotificationManager::NotificationManager() + : __pNotificationManagerImpl(null) +{ + //default constructor +} + +NotificationManager::~NotificationManager() +{ + delete __pNotificationManagerImpl; +} + +result +NotificationManager::Construct(void) +{ + SysAssertf(__pNotificationManagerImpl == null, + "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); + + __pNotificationManagerImpl = new (std::nothrow) _NotificationManagerImpl(); + SysTryReturnResult(NID_APP, __pNotificationManagerImpl != null, E_OUT_OF_MEMORY, "Allocation failed."); + + return __pNotificationManagerImpl->Construct(); +} + +int +NotificationManager::GetBadgeNumber(void) +{ + SysAssertf(__pNotificationManagerImpl != null, "Not yet constructed. Construct() should be called before use."); + + result r = _AccessController::CheckUserPrivilege(_PRV_NOTIFICATION); + SysTryReturnResult(NID_APP, !IsFailed(r), E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + + return __pNotificationManagerImpl->GetBadgeNumber(); +} + +result +NotificationManager::Notify(int badgeNumber) +{ + SysAssertf(__pNotificationManagerImpl != null, "Not yet constructed. Construct() should be called before use."); + + result r = _AccessController::CheckUserPrivilege(_PRV_NOTIFICATION); + SysTryReturnResult(NID_APP, !IsFailed(r), E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + + return __pNotificationManagerImpl->Notify(badgeNumber); +} + +result +NotificationManager::Notify(const String& messageText) +{ + SysAssertf(__pNotificationManagerImpl != null, "Not yet constructed. Construct() should be called before use."); + + result r = _AccessController::CheckUserPrivilege(_PRV_NOTIFICATION); + SysTryReturnResult(NID_APP, !IsFailed(r), E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + + return __pNotificationManagerImpl->Notify(messageText); +} + +result +NotificationManager::Notify(const String& messageText, int badgeNumber) +{ + SysAssertf(__pNotificationManagerImpl != null, "Not yet constructed. Construct() should be called before use."); + + result r = _AccessController::CheckUserPrivilege(_PRV_NOTIFICATION); + SysTryReturnResult(NID_APP, !IsFailed(r), E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + + return __pNotificationManagerImpl->Notify(messageText, badgeNumber); +} + +result +NotificationManager::Notify(const String& messageText, int badgeNumber, const String& launchArguments) +{ + SysAssertf(__pNotificationManagerImpl != null, "Not yet constructed. Construct() should be called before use."); + + result r = _AccessController::CheckUserPrivilege(_PRV_NOTIFICATION); + SysTryReturnResult(NID_APP, !IsFailed(r), E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + + return __pNotificationManagerImpl->Notify(messageText, badgeNumber, launchArguments); +} + +result +NotificationManager::Notify(const NotificationMessage& notiMessage) +{ + SysAssertf(__pNotificationManagerImpl != null, "Not yet constructed. Construct() should be called before use."); + + result r = _AccessController::CheckUserPrivilege(_PRV_NOTIFICATION); + SysTryReturnResult(NID_APP, !IsFailed(r), E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + + return __pNotificationManagerImpl->NotifyMessageImpl(notiMessage); +} + +result +NotificationManager::Notify(const AppId& appId,const NotificationMessage& notiMessage) +{ + SysAssertf(__pNotificationManagerImpl != null, "Not yet constructed. Construct() should be called before use."); + + result r = _AccessController::CheckUserPrivilege(_PRV_NOTIFICATION_SERVICE); + SysTryReturnResult(NID_APP, !IsFailed(r), E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + + return __pNotificationManagerImpl->NotifyMessageImpl(appId, notiMessage); +} + +int +NotificationManager::GetBadgeNumber(const AppId& appId) +{ + SysAssertf(__pNotificationManagerImpl != null, "Not yet constructed. Construct() should be called before use."); + + result r = _AccessController::CheckUserPrivilege(_PRV_NOTIFICATION); + SysTryReturnResult(NID_APP, !IsFailed(r), E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + + return __pNotificationManagerImpl->GetBadgeNumber(appId); +} + +result +NotificationManager::NotifyOngoingActivity(const String& messageText) +{ + SysAssertf(__pNotificationManagerImpl != null, "Not yet constructed. Construct() should be called before use."); + + result r = _AccessController::CheckUserPrivilege(_PRV_NOTIFICATION); + SysTryReturnResult(NID_APP, !IsFailed(r), E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + + return __pNotificationManagerImpl->NotifyOngoingActivity(messageText); +} + +result +NotificationManager::NotifyOngoingActivity(const String& messageText, const String& launchArguments) +{ + SysAssertf(__pNotificationManagerImpl != null, "Not yet constructed. Construct() should be called before use."); + + result r = _AccessController::CheckUserPrivilege(_PRV_NOTIFICATION); + SysTryReturnResult(NID_APP, !IsFailed(r), E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + + + return __pNotificationManagerImpl->NotifyOngoingActivity(messageText, launchArguments); +} + +result +NotificationManager::NotifyOngoingActivity(const NotificationMessage& notiMessage) +{ + SysAssertf(__pNotificationManagerImpl != null, "Not yet constructed. Construct() should be called before use."); + + result r = _AccessController::CheckUserPrivilege(_PRV_NOTIFICATION); + SysTryReturnResult(NID_APP, !IsFailed(r), E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + + return __pNotificationManagerImpl->NotifyMessageImpl(notiMessage, true); +} + +result +NotificationManager::NotifyOngoingActivity(const AppId& appId,const NotificationMessage& notiMessage) +{ + SysAssertf(__pNotificationManagerImpl != null, "Not yet constructed. Construct() should be called before use."); + + result r = _AccessController::CheckUserPrivilege(_PRV_NOTIFICATION_SERVICE); + SysTryReturnResult(NID_APP, !IsFailed(r), E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + + return __pNotificationManagerImpl->NotifyMessageImpl(appId, notiMessage, true); +} + +result +NotificationManager::RemoveOngoingActivityNotification(void) +{ + SysAssertf(__pNotificationManagerImpl != null, "Not yet constructed. Construct() should be called before use."); + + result r = _AccessController::CheckUserPrivilege(_PRV_NOTIFICATION); + SysTryReturnResult(NID_APP, !IsFailed(r), E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + + return __pNotificationManagerImpl->RemoveOngoingActivityNotification(); +} + +result +NotificationManager::RemoveOngoingActivityNotification(const AppId& appId) +{ + SysAssertf(__pNotificationManagerImpl != null, "Not yet constructed. Construct() should be called before use."); + + result r = _AccessController::CheckUserPrivilege(_PRV_NOTIFICATION_SERVICE); + SysTryReturnResult(NID_APP, !IsFailed(r), E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + + return __pNotificationManagerImpl->RemoveOngoingActivityNotificationOnBehalf(appId); +} + +result +NotificationManager::RemoveNotification(void) +{ + SysAssertf(__pNotificationManagerImpl != null, "Not yet constructed. Construct() should be called before use."); + + result r = _AccessController::CheckUserPrivilege(_PRV_NOTIFICATION); + SysTryReturnResult(NID_APP, !IsFailed(r), E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + + return __pNotificationManagerImpl->RemoveNotification(); +} + +result +NotificationManager::RemoveNotification(const AppId& appId) +{ + SysAssertf(__pNotificationManagerImpl != null, "Not yet constructed. Construct() should be called before use."); + + result r = _AccessController::CheckUserPrivilege(_PRV_NOTIFICATION_SERVICE); + SysTryReturnResult(NID_APP, !IsFailed(r), E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + + return __pNotificationManagerImpl->RemoveNotificationOnBehalf(appId); +} + +}; +}; // Osp::Shell +#endif diff --git a/src/inc/FShl_NotificationManagerImpl.h b/src/inc/FShl_NotificationManagerImpl.h new file mode 100644 index 0000000..bbe8982 --- /dev/null +++ b/src/inc/FShl_NotificationManagerImpl.h @@ -0,0 +1,484 @@ +// +// Open Service Platform +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/** + * @file FShl_NotificationManagerImpl.h + * @brief This is the header file for the %_NotificationManagerImpl class. + */ + +#ifndef _FSHELL_INTERNAL_NOTIFICATION_MANAGER_IMPL_H_ +#define _FSHELL_INTERNAL_NOTIFICATION_MANAGER_IMPL_H_ + +#include +#include +#include + +namespace Osp { namespace Shell +{ + +class NotificationManager; +class _NotificationManagerProxy; + +class _OSP_EXPORT_ _NotificationManagerImpl + : public Osp::Base::Object +{ + +public: + /** + * This is the default constructor for this class. + * + * @since 1.0 + */ + _NotificationManagerImpl(void); + + /** + * This is the destructor for this class. + * + * @since 1.0 + */ + virtual ~_NotificationManagerImpl(void); + + /** + * Initializes this instance of %_NotificationManagerImpl. + * + * @since 1.0 + * @return An error code + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + * @exception E_OUT_OF_MEMORY The memory is insufficient. + */ + result Construct(void); + + /** + * Gets the badge number of the application icon. + * + * @since 1.0 + * + * @return The current badge number + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + * @exception E_OBJ_NOT_FOUND The application is not installed. + * @exception E_INVALID_STATE This instance is in an invalid state. @n + * The Construct() method is not called. + * @remarks The specific error code can be accessed using the GetLastResult() method. @n + * In case of failure, this method returns @c -1. + */ + int GetBadgeNumber(void) const; + + /** + * Notifies the user using a badge number. + * + * @since 1.0 + * + * @return An error code + * @param[in] badgeNumber The badge number + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified input parameter is invalid, or + * the specified @c badgeNumber is less than @c 0. + * @exception E_SYSTEM A system error has occurred. + * @exception E_INVALID_OPERATION The type of application calling this method is invalid as per the Tizen platform policy. + * @exception E_INVALID_STATE This instance is in an invalid state. @n + * The Construct() method is not called. + */ + result Notify(int badgeNumber) const; + + /** + * Notifies the user using a message. + * + * @since 1.0 + * + * @return An error code + * @param[in] messageText The notification message + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified input parameter is invalid, or + * the length of @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH. + * @exception E_SYSTEM A system error has occurred. + * @exception E_INVALID_OPERATION The type of application calling this method is invalid as per the Tizen platform policy. + * @exception E_INVALID_STATE This instance is in an invalid state. @n + * The Construct() method is not called. + */ + result Notify(const Osp::Base::String& messageText) const; + + /** + * Notifies the user using a message and badge number. + * + * @since 1.0 + * + * @return An error code + * @param[in] messageText The notification message + * @param[in] badgeNumber The badge number + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c badgeNumber is less than @c 0, or + * the length of @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH. + * @exception E_SYSTEM A system error has occurred. + * @exception E_INVALID_OPERATION The type of application calling this method is invalid as per the Tizen platform policy. + * @exception E_INVALID_STATE This instance is in an invalid state. @n + * The Construct() method is not called. + */ + result Notify(const Osp::Base::String& messageText, int badgeNumber) const; + + /** + * Notifies the user using a message and badge number. @n + * If the user checks the message, @c launchArguments is delivered to the application. @n + * @c launchArguments is specified as input parameter for Application::OnUserEventReceivedN() or can be obtained by + * invoking Application::GetAppArgumentListN(), especially within Application::OnAppInitializing(). + * + * @since 1.0 + * + * @return An error code + * @param[in] messageText The notification message + * @param[in] badgeNumber The badge number + * @param[in] launchArguments The message for application + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG Either of the following conditions has occurred: @n + * - A specified input parameter is invalid. @n + * - The specified @c badgeNumber is less than @c 0. @n + * - The length of the specified @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH. @n + * - The length of the specified @c launchArguments is greater than App::MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH. + * @exception E_SYSTEM A system error has occurred. + * @exception E_INVALID_OPERATION The type of application calling this method is invalid as per the Tizen platform policy. + * @exception E_INVALID_STATE This instance is in an invalid state. @n + * The Construct() method is not called. + * @see Application::OnUserEventReceivedN(), Application::GetAppArgumentListN() + */ + result Notify(const Osp::Base::String& messageText, int badgeNumber, const Osp::Base::String& launchArguments) const; + + /** + * Notifies the user using a message. @n + * The message may have various information like alert text, title text, launch arguments, and so on. + * + * @since 3.0 + * + * @return An error code + * @param[in] message The notification message + * @param[in] isOngoing Ongoing Notification + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified input parameter is invalid, or + * @c message does not have alert text + * @exception E_SYSTEM A system error has occurred. + * @see App::NotificationMessage + */ + result NotifyMessageImpl(const NotificationMessage& message, bool isOngoing = false); + + + /** + * Notifies the user using a message. @n + * The message may have various information like alert text, title text, launch arguments, and so on. + * + * @since 3.0 + * + * @return An error code + * @param[in] appId The Application ID + * @param[in] message The notification message + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified input parameter is invalid, or + * @c message does not have alert text + * @exception E_SYSTEM A system error has occurred. + * @see App::NotificationMessage + */ + result NotifyMessageImpl(const AppId& appId, const NotificationMessage& message, bool isOngoing = false); + + /** + * Removes the notification message. + * + * @since 2.0 + * + * @return An error code + * @exception E_SUCCESS The method was successful. + * @exception E_SYSTEM A system error occurred. + * @exception E_INVALID_STATE This instance is in an invalid state: @n + * - The Construct() method is not called. @n + * @remarks The method returns E_SUCCESS when there is no outstanding notification. + */ + result RemoveNotification(void); + + /** + * Notifies the user about the ongoing activity using a message. + * + * @since 2.0 + * + * @return An error code + * @param[in] messageText The notification message + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified input parameter is invalid, or + * the length of @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH. + * @exception E_SYSTEM A system error has occurred. + * @exception E_INVALID_OPERATION The type of application calling this method is invalid as per the Tizen platform policy. + * @exception E_INVALID_STATE This instance is in an invalid state. @n + * The Construct() method is not called. + */ + result NotifyOngoingActivity(const Osp::Base::String& messageText) const; + + /** + * Notifies the user about the ongoing activity using a message. @n + * @c launchArguments is specified as input parameter for Application::OnUserEventReceivedN() or can be obtained by + * invoking Application::GetAppArgumentListN(), especially within Application::OnAppInitializing(). + * + * @since 2.0 + * + * @return An error code + * @param[in] messageText The notification message + * @param[in] launchArguments The launch arguments for the application + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG Either of the following conditions has occurred: @n + * - A specified input parameter is invalid. @n + * - The length of the specified @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH. @n + * - The length of the specified @c launchArguments is greater than App::MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH. + * @exception E_SYSTEM A system error has occurred. + * @exception E_INVALID_OPERATION The type of application calling this method is invalid as per the Tizen platform policy. + * @exception E_INVALID_STATE This instance is in an invalid state. @n + * The Construct() method is not called. + * @see Application::OnUserEventReceivedN(), Application::GetAppArgumentListN() + */ + result NotifyOngoingActivity(const Osp::Base::String& messageText, const Osp::Base::String& launchArguments) const; + + /** + * Removes the notification message for the ongoing activity. + * + * @since 2.0 + * + * @return An error code + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + * @exception E_INVALID_STATE This instance is in an invalid state. @n + * The Construct() method is not called. + * @remarks The method returns E_SUCCESS when there is no outstanding notification. + */ + result RemoveOngoingActivityNotification(void); + + /** + * Gets the badge number of the application icon. + * + * @since 1.0 + * + * @return The current badge number + * @param[in] appId The application ID + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + * @exception E_OBJ_NOT_FOUND The application is not installed. + * @exception E_INVALID_STATE This instance is in an invalid state. @n + * The Construct() method is not called. + * @remarks The specific error code can be accessed using the GetLastResult() method. @n + * In case of failure, this method returns @c -1. + */ + int GetBadgeNumber(const AppId& appId) const; + + /** + * Notifies the user using a badge number on behalf of the specified application. + * + * @since 1.0 + * + * @return An error code + * @param[in] appId The application ID + * @param[in] badgeNumber The badge number + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid, or + * the specified @c badgeNumber is less than @c 0. + * @exception E_APP_NOT_INSTALLED The application is not installed. + * @exception E_INVALID_OPERATION The target application with the specified application ID is not permitted to get any notification as per the Tizen platform policy. + * @exception E_SYSTEM A system error has occurred. + * @exception E_INVALID_STATE This instance is in an invalid state. @n + * The Construct() method is not called. + */ + result NotifyOnBehalf(const AppId& appId, int badgeNumber) const; + + /** + * Notifies the user using a message on behalf of the specified application. + * + * @since 1.0 + * + * @return An error code + * @param[in] appId The application ID + * @param[in] messageText The notification message + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid, or + * the length of @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH. + * @exception E_APP_NOT_INSTALLED The application is not installed. + * @exception E_INVALID_OPERATION The target application with the specified application ID is not permitted to receive any notification as per the Tizen platform policy. + * @exception E_SYSTEM A system error has occurred. + * @exception E_INVALID_STATE This instance is in an invalid state. @n + * The Construct() method is not called. + */ + result NotifyOnBehalf(const AppId& appId, const Osp::Base::String& messageText) const; + + /** + * Notifies the user using a message and badge number on behalf of the specified application. + * + * @since 1.0 + * + * @return An error code + * @param[in] appId The application ID + * @param[in] messageText The notification message + * @param[in] badgeNumber The badge number + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG Either of the following conditions has occurred: @n + * - A specified input parameter is invalid. @n + * - The specified @c badgeNumber is less than @c 0. @n + * - The length of @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH. + * @exception E_APP_NOT_INSTALLED The application is not installed. + * @exception E_INVALID_OPERATION The target application with the specified application ID is not permitted to receive any notification as per the Tizen platform policy. + * @exception E_SYSTEM A system error has occurred. + * @exception E_INVALID_STATE This instance is in an invalid state. @n + * The Construct() method is not called. + */ + result NotifyOnBehalf(const AppId& appId, const Osp::Base::String& messageText, int badgeNumber) const; + + /** + * Notifies the user using a message and badge number on behalf of the specified application. @n + * If the user checks the message, the @c launchArguments is delivered to the application. + * + * @since 2.0 + * + * @return An error code + * @param[in] appId The application ID + * @param[in] messageText The notification message + * @param[in] launchArguments The launch arguments for the application + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG Either of the following conditions has occurred: @n + * - A specified input parameter is invalid. @n + * - The length of the specified @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH. @n + * - The length of the specified @c launchArguments is greater than App::MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH. + * @exception E_APP_NOT_INSTALLED The application is not installed. + * @exception E_INVALID_OPERATION The target application with the specified application ID is not permitted to receive any notification as per the Tizen platform policy. + * @exception E_SYSTEM A system error has occurred. + * @exception E_INVALID_STATE This instance is in an invalid state. @n + * The Construct() method is not called. + */ + result NotifyOnBehalf(const AppId& appId, const Osp::Base::String& messageText, const Osp::Base::String& launchArguments) const; + + /** + * Notifies the user using a message and badge number on behalf of the specified application. @n + * If the user checks the message, the @c launchArguments is delivered to the application. + * + * @since 2.0 + * + * @return An error code + * @param[in] appId The application ID + * @param[in] messageText The notification message + * @param[in] badgeNumber The badge number + * @param[in] launchArguments The launch arguments for the application + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG Either of the following conditions has occurred: @n + * - A specified input parameter is invalid. @n + * - The specified @c badgeNumber is less than 0. @n + * - The length of the specified @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH. @n + * - The length of the specified @c launchArguments is greater than App::MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH. + * @exception E_APP_NOT_INSTALLED The application is not installed. + * @exception E_INVALID_OPERATION The target application with the specified application ID is not permitted to receive any notification as per the Tizen platform policy. + * @exception E_SYSTEM A system error has occurred. + * @exception E_INVALID_STATE This instance is in an invalid state. @n + * The Construct() method is not called. + */ + result NotifyOnBehalf(const AppId& appId, const Osp::Base::String& messageText, int badgeNumber, const Osp::Base::String& launchArguments) const; + + /** + * Notifies the user about the ongoing activity using a message on behalf of the specified application. + * + * @since 2.0 + * + * @return An error code + * @param[in] appId The application ID + * @param[in] messageText The notification message + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified input parameter is invalid, or + * the length of @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH. + * @exception E_APP_NOT_INSTALLED The application is not installed. + * @exception E_SYSTEM A system error has occurred. + * @exception E_INVALID_OPERATION The type of application calling this method is invalid as per the Tizen platform policy. + * @exception E_INVALID_STATE This instance is in an invalid state. @n + * The Construct() method is not called. + */ + result NotifyOngoingActivityOnBehalf(const AppId& appId, const Osp::Base::String& messageText) const; + + /** + * Notifies the user about the ongoing activity using a message on behalf of the specified application. + * + * @since 2.0 + * + * @return An error code + * @param[in] appId The application ID + * @param[in] messageText The notification message + * @param[in] launchArguments The launch arguments for application + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG Either of the following conditions has occurred: @n + * - A specified input parameter is invalid. @n + * - The length of @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH. @n + * - The length of @c launchArguments is greater than App::MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH. + * @exception E_APP_NOT_INSTALLED The application is not installed. + * @exception E_SYSTEM A system error has occurred. + * @exception E_INVALID_OPERATION The type of application calling this method is invalid as per the Tizen platform policy. + * @exception E_INVALID_STATE This instance is in an invalid state. @n + * The Construct() method is not called. + */ + result NotifyOngoingActivityOnBehalf(const AppId& appId, const Osp::Base::String& messageText, const Osp::Base::String& launchArguments) const; + + /** + * Removes the notification message for ongoing activity on behalf of the specified application. + * + * @since 2.0 + * + * @return An error code + * @param[in] appId The application ID + * @exception E_SUCCESS The method is successful. + * @exception E_APP_NOT_INSTALLED The application is not installed. + * @exception E_SYSTEM A system error has occurred. + * @exception E_INVALID_STATE This instance is in an invalid state. @n + * The Construct() method is not called. + * @remarks Although there is no outstanding notification for the calling application, this method returns E_SUCCESS. + */ + result RemoveOngoingActivityNotificationOnBehalf(const AppId& appId); + + /** + * Removes the notification message on behalf of the specified application. + * + * @since 2.0 + * + * @return An error code + * @param[in] appId The application ID + * @exception E_SUCCESS The method was successful. + * @exception E_APP_NOT_INSTALLED The application is not installed. + * @exception E_SYSTEM A system error occurred. + * @exception E_INVALID_STATE This instance is in an invalid state: @n + * - The Construct() method is not called. @n + * @remarks Although there is no outstanding notification for the calling application, this method returns E_SUCCESS. + */ + result RemoveNotificationOnBehalf(const AppId& appId); + + static const _NotificationManagerImpl* GetInstance(const NotificationManager& notiMgr); + + static _NotificationManagerImpl* GetInstance(NotificationManager& notiMgr); + +private: + result NotifyImpl(const Osp::Base::String& messageText, int badgeNumber, const Osp::Base::String& launchArguments, bool isOngoing = false) const; + + result NotifyImpl(const AppId& appId, const Osp::Base::String& messageText, int badgeNumber, const Osp::Base::String& launchArguments, bool isOngoing = false) const; + + inline result OngoingImpl(const Osp::Base::String& messageText, const Osp::Base::String& launchArguments) const; + + inline result OngoingImpl(const AppId& appId, const Osp::Base::String& messageText, const Osp::Base::String& launchArguments) const; + + _NotificationManagerImpl(const _NotificationManagerImpl& rhs); + + _NotificationManagerImpl& operator =(const _NotificationManagerImpl& rhs); + +private: + _NotificationManagerProxy* __pNotificationManager; +}; //_NotificationManagerImpl + +} } // Osp::Shell + +#endif // _FSHELL_INTERNAL_NOTIFICATION_MANAGER_IMPL_H_ -- 2.7.4