00001 /*************************************************************************** 00002 * * 00003 * Powersave Daemon * 00004 * * 00005 * Copyright (C) 2004,2005,2006 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 CLIENTCONNECTION_H 00026 #define CLIENTCONNECTION_H 00027 00028 #include <list> 00029 #include <string> 00030 00031 class CPUFreq_Interface; 00032 struct PM_STATE; 00033 00035 typedef struct cNode { 00037 std::string name; 00039 int capabilities; 00040 } cNode; 00041 00052 class ClientConnection { 00053 public: 00055 ~ClientConnection(); 00056 00065 bool checkClientCapabilities(int capability); 00066 00074 int count(); 00075 00083 bool addClient(const char *name, int modes); 00084 00091 bool checkClientRemoval(const char *name); 00092 00098 void getClients(std::list< std::string > &names, std::list< int > &caps); 00099 00100 private: 00102 std::list < cNode > _clients; 00103 }; 00104 00105 #endif // CLIENTCONNECTION_H