device_management.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *                                                                         *
00003  *                         Powersave Daemon                                *
00004  *                                                                         *
00005  *          Copyright (C) 2004,2005 SUSE Linux Products GmbH               *
00006  *                                                                         *
00007  *               Author(s): Holger Macht <hmacht@suse.de>                  *
00008  *                                                                         *
00009  * This program is free software; you can redistribute it and/or modify it *
00010  * under the terms of the GNU General Public License as published by the   *
00011  * Free Software Foundation; either version 2 of the License, or (at you   *
00012  * option) any later version.                                              *
00013  *                                                                         *
00014  * This program is distributed in the hope that it will be useful, but     *
00015  * WITHOUT ANY WARRANTY; without even the implied warranty of              *
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU       *
00017  * General Public License for more details.                                *
00018  *                                                                         *
00019  * You should have received a copy of the GNU General Public License along *
00020  * with this program; if not, write to the Free Software Foundation, Inc., *
00021  * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA                  *
00022  *                                                                         *
00023  ***************************************************************************/
00024 
00025 #ifndef DEVICE_MANAGEMENT_H
00026 #define DEVICE_MANAGEMENT_H
00027 
00028 #include <string>
00029 #include <map>
00030 #include "device.h"
00031 
00032 
00034 class DeviceManagement {
00035 public:
00037         DeviceManagement();
00038 
00040         void init();
00041                 
00043         virtual ~DeviceManagement();
00044 
00055         bool suspend(DPM_DEVICE_CLASS device_class, int device_num = -1, bool force = false);
00056 
00065         bool resume(DPM_DEVICE_CLASS device_class, int device_num = -1);
00066 
00080         bool update(std::list< DPM_DEVICE_CLASS > rpm_classes, bool force = false);
00081 
00090         int getDevices(DPM_DEVICE_CLASS device_class,
00091                        std::list< std::string > &udis,
00092                        std::list< DPM_POWER_STATE > &power_states);
00093 
00098         void addWlanDevice(const std::string &udi);
00099 
00104         void addUsbDevice(const std::string &udi);
00105 
00110         void addSoundDevice(const std::string &udi);
00111 
00116         void addLanDevice(const std::string &udi);
00117         
00124         bool checkDeviceAdded(char *udi);
00125 
00132         bool checkDeviceRemoved(char *udi);
00133 
00134 private:
00136         std::list< Device* > _devices;
00137 };
00138 
00139 #endif // DEVICE_MANAGEMENT_H

Generated on Mon Mar 27 09:27:19 2006 for Powersave Daemon by  doxygen 1.4.6