Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

KMood.hh

Go to the documentation of this file.
00001 /*
00002  *   kmood - a mood indicator
00003  *   Copyright (C) 2003  Andreas Baumann
00004  *
00005  *   This program is free software; you can redistribute it and/or modify
00006  *   it under the terms of the GNU General Public License as published by
00007  *   the Free Software Foundation; either version 2 of the License, or
00008  *   (at your option) any later version.
00009  *
00010  *   This program is distributed in the hope that it will be useful,
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *   GNU General Public License for more details.
00014  *
00015  *   You should have received a copy of the GNU General Public License
00016  *   along with this program; if not, write to the Free Software
00017  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018  *
00019  */
00020 
00021 #ifndef __KMOOD_H__
00022 #define __KMOOD_H__
00023 
00024 // Qt includes
00025 #include <qobject.h>
00026 #include <qstring.h>
00027 
00028 // KMood includes
00029 #include "kmood.hh"
00030 #include "KMoodWidget.hh"
00031 
00041 class KMood : public QObject
00042 {
00043    Q_OBJECT
00044 
00045    public:
00046 
00051       enum Mood {
00052          VeryHappy = 1000,
00053          Happy,
00054          Cool,
00055          Sad,
00056          Angry
00057       };
00058 
00059       KMood( );
00060       KMood( QString userName );
00061       KMood( QString userName, Mood mood );
00062       KMood( QString userName, QString moodString );
00063       ~KMood( );
00064 
00065       void setView( KMoodWidget *widget );
00066       KMoodWidget *getView( );
00067       void setMood( Mood mood );
00068       Mood getMood( );
00069 
00070       void setAge( int ageMinutes );
00071       int getAge( );
00072       
00073       QString getMoodString( );
00074       QString getMoodForMessages( );
00075       
00076       static QString moodToString( Mood mood );
00077       static Mood stringToMood( QString string );
00078 
00087       void setCurrentUserName( );
00088 
00089       QString getCurrentUserName( );
00090 
00091    signals:
00095       void moodChanged( KMood *kmood );
00096 
00100       void ageChanged( KMood *kmood );
00101 
00102    protected:
00106       static void Init( KMood *kmood );
00107 
00108    private:
00113       Mood m_mood;
00114 
00119       int m_ageMinutes;
00120 
00126       QString m_userName;
00127  
00131       KMoodWidget *m_widget;
00132 };
00133 
00134 #endif
00135 

Generated on Wed Oct 8 21:52:18 2003 for kmood by doxygen1.2.18