2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 #ifndef WRTDEVICEAPIS_POWER_IMANAGER_H_
17 #define WRTDEVICEAPIS_POWER_IMANAGER_H_
20 #include <dpl/noncopyable.h>
21 #include <Power/IBattery.h>
22 #include <Power/IBacklight.h>
24 namespace WrtDeviceApis {
28 class IManager : private DPL::Noncopyable
31 static IManager& getInstance();
34 virtual ~IManager() = 0;
37 * Gets interface to battery.
38 * @param index Index of battery to get (1-based).
39 * @return Interface to battery.
40 * @throw PlatformException If platform error occurs.
41 * @throw OutOfRangeException If index is greater than available batteries.
42 * @remarks Ownership over result (IBattery*) is NOT passed to caller.
44 virtual IBattery* getBattery(std::size_t index) const = 0;
47 * Gets number of available batteries.
48 * @return Number of batteries.
50 virtual std::size_t getBatteriesCount() const = 0;
52 virtual IBacklightPtr getBacklight(void) = 0;
54 virtual std::size_t getBacklightCount() const = 0;
59 virtual void Release() = 0;
69 #endif // WRTDEVICEAPIS_POWER_IMANAGER_H_