1 #ifndef __DALI_FEEDBACK_PLUGIN_H__
2 #define __DALI_FEEDBACK_PLUGIN_H__
5 * Copyright (c) 2014 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.
22 #include <dali/public-api/common/dali-common.h>
24 namespace Dali DALI_IMPORT_API
28 * FeedbackPlugin is an abstract interface, used by Dali-adaptor to access haptic and audio feedback.
29 * A concrete implementation must be created for each platform and provided as a dynamic library which
30 * will be loaded at run time by the adaptor.
36 typedef void (*SoundStopCallBack)( void* ptr );
41 virtual ~FeedbackPlugin()
46 * Plays vibration in predefined patterns.
47 * @param[in] filePath Path to the file containing the effect.
49 virtual void PlayHaptic( const std::string& filePath ) = 0;
52 * Plays a monotone vibration.
53 * @param[in] duration The duration of the vibration.
55 virtual void PlayHapticMonotone( unsigned int duration ) = 0;
58 * Stops the currently playing vibration effects.
60 virtual void StopHaptic() = 0;
64 * @param[in] fileName Path to the sound file to play.
65 * @return A handle which can be used to stop the sound playback.
67 virtual int PlaySound( const std::string& fileName ) = 0;
70 * Stops a currently playing sound.
71 * @param[in] handle A handle to the currently playing sound.
73 virtual void StopSound( int handle ) = 0;
76 * Plays a feedback pattern.
77 * @param[in] type The type of feedback.
78 * @param[in] pattern The ID of the pattern to play.
80 virtual void PlayFeedbackPattern( int type, int pattern ) = 0;
82 // Types for plugin factories
85 * Function pointer called in adaptor to create a feedback plugin instance.
86 * @param [in] pluginName name of the plugin to load.
87 * @return Pointer to the newly created plugin object
89 typedef FeedbackPlugin* CreateFeedbackPlugin( void );
91 }; // class FeedbackPlugin
95 #endif // __DALI_FEEDBACK_PLUGIN_H__