~ubuntu-branches/ubuntu/oneiric/psi/oneiric

« back to all changes in this revision

Viewing changes to src/message.h

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2005-01-10 17:41:43 UTC
  • mfrom: (1.2.1 upstream) (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050110174143-ltocv5zapl6blf5d
Tags: 0.9.3-1
* New upstream release
* Cleaned up debian/rules (some things are done by upstream Makefiles now)
* Fixed some lintian warnings:
  - removed executable bit from some .png files
  - moved psi.desktop to /usr/share/applications
* Updated menu files

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/****************************************************************************
2
 
** message.h - messages and history
3
 
** Copyright (C) 2001, 2002  Justin Karneges
4
 
**
5
 
** This program is free software; you can redistribute it and/or
6
 
** modify it under the terms of the GNU General Public License
7
 
** as published by the Free Software Foundation; either version 2
8
 
** of the License, or (at your option) any later version.
9
 
**
10
 
** This program is distributed in the hope that it will be useful,
11
 
** but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
** GNU General Public License for more details.
14
 
**
15
 
** You should have received a copy of the GNU General Public License
16
 
** along with this program; if not, write to the Free Software
17
 
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 
**
19
 
****************************************************************************/
20
 
 
21
 
#ifndef MESSAGE_H
22
 
#define MESSAGE_H
23
 
 
24
 
#include<qstring.h>
25
 
#include<qfile.h>
26
 
#include<qtextstream.h>
27
 
#include<qdatetime.h>
28
 
 
29
 
#define MESSAGE_NORM     0
30
 
#define MESSAGE_CHAT     1
31
 
#define MESSAGE_SYS      2
32
 
#define MESSAGE_AUTHREQ  3
33
 
#define MESSAGE_ERROR    4
34
 
#define MESSAGE_HEADLINE 5
35
 
 
36
 
#define HISTORY_NONE    0
37
 
#define HISTORY_READ    1
38
 
#define HISTORY_WRITE   2
39
 
#define HISTORY_FLAG    3
40
 
 
41
 
 
42
 
class Message
43
 
{
44
 
public:
45
 
        Message();
46
 
 
47
 
        QString to, from, text, subject;
48
 
        QString url, url_desc;
49
 
        int type;
50
 
        QDateTime timeStamp;
51
 
        bool originLocal;
52
 
        bool late;
53
 
 
54
 
        bool unread;
55
 
};
56
 
 
57
 
class MessageHistory
58
 
{
59
 
public:
60
 
        MessageHistory(const QString &jid, int mode);
61
 
        ~MessageHistory();
62
 
 
63
 
        Message *readEntry();
64
 
        void writeEntry(const Message &msg);
65
 
 
66
 
        Message *readCurrent();
67
 
        void stepForward();
68
 
        void stepBack();
69
 
        void setFlagsCurrent(const QString &);
70
 
 
71
 
private:
72
 
        int mode;
73
 
        QFile f;
74
 
        QString v_jid;
75
 
 
76
 
        Message *parseLine(const QString &line);
77
 
};
78
 
 
79
 
#endif