1 #ifndef __DALI_FEEDBACK_PLUGIN_H__
2 #define __DALI_FEEDBACK_PLUGIN_H__
5 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
23 #include <dali/public-api/common/dali-common.h>
29 * FeedbackPlugin is an abstract interface, used by Dali-adaptor to access haptic and audio feedback.
30 * A concrete implementation must be created for each platform and provided as a dynamic library which
31 * will be loaded at run time by the adaptor.
37 typedef void (*SoundStopCallBack)( void* ptr );
42 virtual ~FeedbackPlugin()
47 * Plays vibration in predefined patterns.
48 * @param[in] filePath Path to the file containing the effect.
50 virtual void PlayHaptic( const std::string& filePath ) = 0;
53 * Plays a monotone vibration.
54 * @param[in] duration The duration of the vibration.
56 virtual void PlayHapticMonotone( unsigned int duration ) = 0;
59 * Stops the currently playing vibration effects.
61 virtual void StopHaptic() = 0;
65 * @param[in] fileName Path to the sound file to play.
66 * @return A handle which can be used to stop the sound playback.
68 virtual int PlaySound( const std::string& fileName ) = 0;
71 * Stops a currently playing sound.
72 * @param[in] handle A handle to the currently playing sound.
74 virtual void StopSound( int handle ) = 0;
77 * Plays a feedback pattern.
78 * @param[in] type The type of feedback.
79 * @param[in] pattern The ID of the pattern to play.
81 virtual void PlayFeedbackPattern( int type, int pattern ) = 0;
83 // Types for plugin factories
86 * Function pointer called in adaptor to create a feedback plugin instance.
87 * @param [in] pluginName name of the plugin to load.
88 * @return Pointer to the newly created plugin object
90 typedef FeedbackPlugin* CreateFeedbackPlugin( void );
92 }; // class FeedbackPlugin
96 #endif // __DALI_FEEDBACK_PLUGIN_H__