tizen beta release
[framework/web/wrt-plugins-common.git] / src / modules / API / Haptics / IManager.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *    Licensed under the Apache License, Version 2.0 (the "License");
5  *    you may not use this file except in compliance with the License.
6  *    You may obtain a copy of the License at
7  *
8  *        http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *    Unless required by applicable law or agreed to in writing, software
11  *    distributed under the License is distributed on an "AS IS" BASIS,
12  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *    See the License for the specific language governing permissions and
14  *    limitations under the License.
15  */
16 #ifndef WRTDEVICEAPIS_HAPTICS_IMANAGER_H_
17 #define WRTDEVICEAPIS_HAPTICS_IMANAGER_H_
18
19 #include <cstddef>
20 #include <dpl/noncopyable.h>
21 #include "IMotor.h"
22
23 namespace WrtDeviceApis {
24 namespace Haptics {
25 namespace Api {
26 class IManager : public DPL::Noncopyable
27 {
28   public:
29     static IManager& getInstance();
30
31   public:
32     virtual ~IManager() = 0;
33
34     /**
35      * Gets specified haptic motor.
36      * @param index Index of a motor to get (1-based).
37      * @return Haptic motor.
38      * @throw OutOfRangeException If index is greater than available motors.
39      * @throw UnsupportedException If current platform doesn't support it.
40      * @remarks On some platforms passing 0 as index may return motor object
41      *          which represents all available motors as one.
42      */
43     virtual IMotor* getMotor(std::size_t index) const = 0;
44
45     /**
46      * Gets number of available haptic motors.
47      * @return Number of motors.
48      */
49     virtual std::size_t getMotorsCount() const = 0;
50 };
51 } // Api
52 } // Haptics
53 } // WrtDeviceApis
54
55 #endif /* WRTDEVICEAPIS_HAPTICS_IMANAGER_H_ */