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 for the Home application that receives request to add a shortcut.
43 * The following example demonstrates how to starts the application when added shortcut is selected by 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 the shortcut @n
81 * @param[in] appId The application ID
82 * @param[in] displayName The display name of shortcut
83 * @param[in] iconFilePath The icon file path
84 * @param]in] uriData Uri that will be delivered by IAppControlProviderEventListener::OnAppControlRequestReceived(), when the application is started via shortcut.
85 * @see ShortcutManager::AddShortcut()
87 * @remarks If uriData is specified, application should be started by AppControl with http://tizen.org/appcontrol/operation/view operation, when it's launched from the Home application via shortcut.
88 * Or else application should be started by AppControl with default opertaion (http://tizen.org/appcontrol/operation/main).
89 * 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 virtual void OnShortcutAddRequested(const Tizen::App::AppId& appId, const Tizen::Base::String& displayName, const Tizen::Base::String& iconFilePath, const Tizen::Base::String& uriData) = 0;
94 * Called when requested to remove the shortcut @n
96 * @param[in] appId The application ID
97 * @param[in] displayName The display name of shortcut
99 * @remarks If there are one more shortcuts with duplicated appId and displayName, all of them should be removed.
101 * @see ShortcutManager::RemoveShortcut()
103 virtual void OnShortcutRemoveRequested(const Tizen::App::AppId& appId, const Tizen::Base::String& displayName) = 0;
107 // This method is for internal use only. Using this method can cause behavioral,
108 // security-related, and consistency-related issues in the application.
112 virtual void IShortcutReqeustListener_Reserved1(void) {}
115 // This method is for internal use only. Using this method can cause behavioral,
116 // security-related, and consistency-related issues in the application.
120 virtual void IShortcutReqeustListener_Reserved2(void) {}
123 // This method is for internal use only. Using this method can cause behavioral,
124 // security-related, and consistency-related issues in the application.
128 virtual void IShortcutReqeustListener_Reserved3(void) {}
133 #endif /* _FSHELL_ISHORTCUT_REQUEST_LISTENER_H_ */