2 // Open Service Platform
3 // Copyright (c) 2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FShellIShortcutRequestListener.h
20 * @brief This is the header file for the %IShortcutRequestListener interface.
22 * This header file contains the declarations of the %IShortcutRequestListener interface.
25 #ifndef _FSHELL_ISHORTCUT_REQUEST_LISTENER_H_
26 #define _FSHELL_ISHORTCUT_REQUEST_LISTENER_H_
28 #include <FBaseString.h>
29 #include <FAppTypes.h>
30 #include <FBaseRtIEventListener.h>
32 namespace Tizen { namespace Shell
36 * @interface IShortcutRequestListener
37 * @brief This interface defines a listener for the Home application that receives request to add a shortcut.
41 * The %IShortcutRequestListener interface defines a listener for the Home application that receives request to add a shortcut.
43 * The following example demonstrates how to start the application when the added shortcut is selected by the user.
48 using namespace Tizen::Shell;
49 using namespace Tizen::App;
51 if( uriData.IsEmpty() )
53 AppManager::GetInstance()->LaunchApplication(appId, null);
57 AppControlpAc = AppManager::FindAppControlN(App::GetInstance()->GetAppId(), L"http://tizen.org/appcontrol/operation/view");
60 pAc->Start(*uriData, null, null, null);
66 class _OSP_EXPORT_ IShortcutRequestListener
67 : virtual public Tizen::Base::Runtime::IEventListener
71 * This polymorphic destructor should be overridden if required.
72 * This way, the destructors of the derived classes are called when the destructor of this interface is called.
76 virtual ~IShortcutRequestListener(void) {}
79 * Called when requested to add a shortcut.
83 * @param[in] appId The application ID
84 * @param[in] displayName The display name of shortcut
85 * @param[in] iconFilePath The icon file path
86 * @param[in] uriData Uri that will be delivered by IAppControlProviderEventListener::OnAppControlRequestReceived(), when the application is started using a shortcut.
88 * @remarks If @c uriData is specified, application should be started by AppControl with %http://tizen.org/appcontrol/operation/view operation, when it is launched from the Home application using a shortcut.
89 * Or else application should be started by AppControl with default operation (%http://tizen.org/appcontrol/operation/main).
90 * For more information on the AppControl class, see <a href="../org.tizen.native.appprogramming/html/guide/app/app_controls.htm">Application Controls</a>, and <a href="../org.tizen.native.appprogramming/html/guide/app/delivering_launch_arguments.htm">Delivering Launch Arguments</a>.
91 * @see ShortcutManager::AddShortcut()
93 virtual void OnShortcutAddRequested(const Tizen::App::AppId& appId, const Tizen::Base::String& displayName, const Tizen::Base::String& iconFilePath, const Tizen::Base::String& uriData) = 0;
96 * Called when requested to remove a shortcut.
100 * @param[in] appId The application ID
101 * @param[in] displayName The display name of shortcut
102 * @remarks If there are more than one shortcuts with duplicated @c appId and @c displayName, all of them should be removed.
103 * @see ShortcutManager::RemoveShortcut()
105 virtual void OnShortcutRemoveRequested(const Tizen::App::AppId& appId, const Tizen::Base::String& displayName) = 0;
109 // This method is for internal use only. Using this method can cause behavioral,
110 // security-related, and consistency-related issues in the application.
114 virtual void IShortcutReqeustListener_Reserved1(void) {}
117 // This method is for internal use only. Using this method can cause behavioral,
118 // security-related, and consistency-related issues in the application.
122 virtual void IShortcutReqeustListener_Reserved2(void) {}
125 // This method is for internal use only. Using this method can cause behavioral,
126 // security-related, and consistency-related issues in the application.
130 virtual void IShortcutReqeustListener_Reserved3(void) {}
135 #endif /* _FSHELL_ISHORTCUT_REQUEST_LISTENER_H_ */