Merge "Set proper locale to harfbuzz" into devel/master
[platform/core/uifw/dali-adaptor.git] / adaptors / common / feedback / feedback-plugin-proxy.h
1 #ifndef __DALI_INTERNAL_FEEDBACK_PLUGIN_PROXY_H__
2 #define __DALI_INTERNAL_FEEDBACK_PLUGIN_PROXY_H__
3
4 /*
5  * Copyright (c) 2014 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 <feedback-plugin.h>
26
27 namespace Dali
28 {
29
30 namespace Internal
31 {
32
33 namespace Adaptor
34 {
35
36 typedef Dali::FeedbackPlugin::SoundStopCallBack SoundStopCallBack;
37 typedef Dali::FeedbackPlugin::CreateFeedbackPlugin CreateFeedbackPlugin;
38
39 /**
40  * Proxy class to dynamically load, use and unload feedback plugin.
41  */
42 class FeedbackPluginProxy
43 {
44 public:
45
46   /**
47    * The default feedback plugin proxy.
48    */
49   static const char * const DEFAULT_OBJECT_NAME;
50
51 public:
52
53   /**
54    * Constructor.
55    */
56   FeedbackPluginProxy( const std::string& sharedObjectName );
57
58   /**
59    * The destructor
60    */
61   ~FeedbackPluginProxy();
62
63   /**
64    * @copydoc Dali::Integration::FeedbackPlugin::PlayHaptic()
65    */
66   void PlayHaptic( const std::string& filePath );
67
68   /**
69    * @copydoc Dali::FeedbackPlugin::PlayHapticMonotone()
70    */
71   void PlayHapticMonotone( unsigned int duration );
72
73   /**
74    * @copydoc Dali::FeedbackPlugin::StopHaptic()
75    */
76   void StopHaptic();
77
78   /**
79    * @copydoc Dali::FeedbackPlugin::PlaySound()
80    */
81   int PlaySound( const std::string& fileName );
82
83   /**
84    * @copydoc Dali::FeedbackPlugin::StopSound()
85    */
86   void StopSound( int handle );
87
88   /**
89    * @copydoc Dali::FeedbackPlugin::PlayFeedbackPattern()
90    */
91   void PlayFeedbackPattern( int type, int pattern );
92
93 private:
94
95   /**
96    * Dynamically loads the feedback plugin.
97    */
98   void Initialize();
99
100 private:
101
102   bool mInitializeAttempted;
103   void* mLibHandle;
104   std::string mSharedObjectName;
105   CreateFeedbackPlugin* mCreatePluginFunctionPtr;
106   Dali::FeedbackPlugin* mFeedbackPlugin;
107 };
108
109 } // namespace Adaptor
110
111 } // namespace Internal
112
113 } // namespace Dali
114
115 #endif // __DALI_INTERNAL_FEEDBACK_PLUGIN_PROXY_H__