Add AllowTextPrediction/IsTextPredictionAllowed api
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / feedback-plugin.h
1 #ifndef __DALI_FEEDBACK_PLUGIN_H__
2 #define __DALI_FEEDBACK_PLUGIN_H__
3
4 /*
5  * Copyright (c) 2018 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <string>
23
24 // INTERNAL INCLUDES
25 #include <dali/public-api/dali-adaptor-common.h>
26
27 namespace Dali
28 {
29
30 /**
31  * FeedbackPlugin is an abstract interface, used by Dali-adaptor to access haptic and audio feedback.
32  * A concrete implementation must be created for each platform and provided as a dynamic library which
33  * will be loaded at run time by the adaptor.
34  */
35 class FeedbackPlugin
36 {
37 public:
38
39   typedef void (*SoundStopCallBack)( void* ptr );
40
41   /**
42    * Destructor.
43    */
44   virtual ~FeedbackPlugin()
45   {
46   }
47
48   /**
49    * Plays vibration in predefined patterns.
50    * @param[in] filePath Path to the file containing the effect.
51    */
52   virtual void PlayHaptic( const std::string& filePath ) = 0;
53
54   /**
55    * Plays a monotone vibration.
56    * @param[in]  duration  The duration of the vibration.
57    */
58   virtual void PlayHapticMonotone( unsigned int duration ) = 0;
59
60   /**
61    * Stops the currently playing vibration effects.
62    */
63   virtual void StopHaptic() = 0;
64
65   /**
66    * Plays a sound file.
67    * @param[in] fileName Path to the sound file to play.
68    * @return A handle which can be used to stop the sound playback.
69    */
70   virtual int PlaySound( const std::string& fileName ) = 0;
71
72   /**
73    * Stops a currently playing sound.
74    * @param[in] handle A handle to the currently playing sound.
75    */
76   virtual void StopSound( int handle ) = 0;
77
78   /**
79    * Plays a feedback pattern.
80    * @param[in] type The type of feedback.
81    * @param[in] pattern The ID of the pattern to play.
82    */
83   virtual void PlayFeedbackPattern( int type, int pattern ) = 0;
84
85   // Types for plugin factories
86
87   /**
88    * Function pointer called in adaptor to create a feedback plugin instance.
89    * @param [in] pluginName name of the plugin to load.
90    * @return Pointer to the newly created plugin object
91    */
92   typedef FeedbackPlugin* CreateFeedbackPlugin( void );
93
94 }; // class FeedbackPlugin
95
96 } // namespace Dali
97
98 #endif // __DALI_FEEDBACK_PLUGIN_H__