kdecore Library API Documentation

kuser.h

00001 /*
00002  *  KUser - represent a user/account
00003  *  Copyright (C) 2002-2003 Tim Jansen <tim@tjansen.de>
00004  *  Copyright (C) 2003 Oswald Buddenhagen <ossi@kde.org>
00005  *
00006  *  $Id: kuser.h,v 1.6 2003/10/31 17:23:56 ossi Exp $
00007  *
00008  *  This library is free software; you can redistribute it and/or
00009  *  modify it under the terms of the GNU Library General Public
00010  *  License as published by the Free Software Foundation; either
00011  *  version 2 of the License, or (at your option) any later version.
00012  *
00013  *  This library is distributed in the hope that it will be useful,
00014  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016  *  Library General Public License for more details.
00017  *
00018  *  You should have received a copy of the GNU Library General Public License
00019  *  along with this library; see the file COPYING.LIB.  If not, write to
00020  *  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00021  *  Boston, MA 02111-1307, USA.
00022  */
00023 #ifndef KUSER_H
00024 #define KUSER_H
00025 
00026 #include "ksharedptr.h"
00027 
00028 class QString;
00029 
00030 class KUserPrivate;
00031 struct passwd;
00032 
00044 class KUser {
00045 
00046 public:
00047 
00048   enum UIDMode { 
00049     UseEffectiveUID, 
00050     UseRealUserID    
00051   };
00052 
00063   KUser(UIDMode mode = UseEffectiveUID);
00064 
00070   KUser(long uid);
00071 
00078   KUser(const QString& name);
00079 
00086   KUser(const char *name);
00087 
00094   KUser(struct passwd *p);
00095 
00100   bool operator ==(const KUser& user) const;
00101 
00106   bool operator !=(const KUser &user) const;
00107 
00113   bool isValid() const;
00114 
00119   long uid() const;
00120 
00121 
00126   long gid() const;
00127 
00132   bool isSuperUser() const;
00133 
00138   QString loginName() const;
00139 
00144   QString fullName() const;
00145 
00151   QString roomNumber() const;
00152 
00158   QString workPhone() const;
00159 
00165   QString homePhone() const;
00166 
00172   QString homeDir() const;
00173 
00179   QString shell() const;
00180 
00184   ~KUser();
00185 
00186 private:
00187   KSharedPtr<KUserPrivate> d;
00188   void fillPasswd(struct passwd* p);
00189   void fillName(const char* name);
00190 };
00191 
00192 #endif
KDE Logo
This file is part of the documentation for kdecore Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Apr 21 18:42:59 2004 by doxygen 1.3.6-20040222 written by Dimitri van Heesch, © 1997-2003