OSDN Git Service

Move the directories
[kita/kita.git] / src / libkita / bbs.h
1 /***************************************************************************
2  *   Copyright (C) 2006 by Kita Developers                                 *
3  *   ikemo@users.sourceforge.jp                                            *
4  *                                                                         *
5  *   This program is free software; you can redistribute it and/or modify  *
6  *   it under the terms of the GNU General Public License as published by  *
7  *   the Free Software Foundation; either version 2 of the License, or     *
8  *   (at your option) any later version.                                   *
9  ***************************************************************************/
10 #ifndef BBS_H
11 #define BBS_H
12
13 #include <kdemacros.h>
14
15 class QTextCodec;
16
17 namespace Kita {
18     class PostData;
19
20     class KDE_EXPORT Bbs {
21         public:
22             Bbs();
23             virtual ~Bbs() { }
24             virtual QString buildPostStr(const PostData& data) = 0;
25
26             QString datToUnicode(const QByteArray& ba) const;
27             QByteArray datFromUnicode(const QString& str) const;
28
29             QString postToUnicode(const QByteArray& ba) const;
30             QByteArray postFromUnicode(const QString& str) const;
31         protected:
32             static QString encodeString(const QString &str, int encoding_hint);
33
34             QTextCodec* m_readCodec;
35             QTextCodec* m_writeCodec;
36
37         private:
38             static QString encode(const QString& segment, int encoding_offset,
39                     int encoding_hint, bool isRawURI = false);
40     };
41 }
42
43 #endif
44