1 #ifndef __DALI_INTERNAL_HAPTIC_PLAYER_H__
2 #define __DALI_INTERNAL_HAPTIC_PLAYER_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.
23 #include <dali/public-api/object/base-object.h>
26 #include <haptic-player.h>
27 #include <feedback/feedback-plugin-proxy.h>
38 class FeedbackPluginProxy;
41 * Plays haptic effects.
43 class HapticPlayer : public Dali::BaseObject
49 * Create a HapticPlayer.
50 * This should only be called once by the Adaptor class.
51 * @return A newly created HapticPlayer.
53 static Dali::HapticPlayer New();
56 * Retrieve a handle to the HapticPlayer. This creates an instance if none has been created.
57 * @return A handle to the HapticPlayer.
59 static Dali::HapticPlayer Get();
62 * @copydoc Dali::HapticPlayer::PlayMonotone()
64 void PlayMonotone(unsigned int duration);
67 * @copydoc Dali::HapticPlayer::PlayFile()
69 void PlayFile( const std::string& filePath );
72 * @copydoc Dali::HapticPlayer::Stop()
79 * Private Constructor; see also HapticPlayer::New()
86 virtual ~HapticPlayer();
89 HapticPlayer(const HapticPlayer&);
92 HapticPlayer& operator=(HapticPlayer&);
96 FeedbackPluginProxy mPlugin;
99 } // namespace Adaptor
101 } // namespace Internal
103 // Helpers for public-api forwarding methods
105 inline Internal::Adaptor::HapticPlayer& GetImplementation(Dali::HapticPlayer& player)
107 DALI_ASSERT_ALWAYS( player && "HapticPlayer handle is empty" );
109 BaseObject& handle = player.GetBaseObject();
111 return static_cast<Internal::Adaptor::HapticPlayer&>(handle);
114 inline const Internal::Adaptor::HapticPlayer& GetImplementation(const Dali::HapticPlayer& player)
116 DALI_ASSERT_ALWAYS( player && "HapticPlayer handle is empty" );
118 const BaseObject& handle = player.GetBaseObject();
120 return static_cast<const Internal::Adaptor::HapticPlayer&>(handle);
125 #endif // __DALI_INTERNAL_HAPTIC_PLAYER_H__