OSDN Git Service

reformat
[kita/kita.git] / kita / src / libkita / threadindex.h
1 /***************************************************************************
2 *   Copyright (C) 2004 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 KITATHREADINDEX_H
11 #define KITATHREADINDEX_H
12
13 #define USE_INDEX
14
15 #include <qstring.h>
16 #include <qvaluelist.h>
17
18 class KURL;
19 class KConfig;
20
21 namespace Kita
22 {
23     class Thread;
24
25     /**
26     @author Hideki Ikemoto
27     */
28     class ThreadIndex
29     {
30     public:
31         static QString getSubject( const KURL& url );
32         static void setSubject( const KURL& url, const QString& str );
33
34         static int getResNum( const KURL& url );
35         static void setResNum( const KURL& url, int resNum );
36
37         static int getReadNum( const KURL& url );
38         static void setReadNum( const KURL& url, int readNum );
39
40         static int getViewPos( const KURL& url );
41         static void setViewPos( const KURL& url, int viewPos );
42
43         static void setMarkList( const KURL& url, const QValueList< int >& markList );
44
45         /*---------------------------------*/
46
47         static void loadIndex( Kita::Thread* thread, const KURL& url, bool checkCached = TRUE );
48         static void saveIndex( const Kita::Thread* thread, const KURL& url );
49
50     private:
51
52         static QString getSubjectPrivate( KConfig& config );
53         static void setSubjectPrivate( const QString& str, KConfig& config );
54
55         static int getResNumPrivate( const KURL& url, KConfig& config );
56         static void setResNumPrivate( int resNum, KConfig& config );
57
58         static int getReadNumPrivate( const KURL& url, KConfig& config, bool checkCached );
59         static void setReadNumPrivate( int readNum, KConfig& config );
60
61         static int getViewPosPrivate( KConfig& config );
62         static void setViewPosPrivate( int viewPos, KConfig& config );
63
64         static QValueList< int > getMarkListPrivate( KConfig& config );
65         static void setMarkListPrivate( const QValueList< int >& markList, KConfig& config );
66     };
67 }
68
69 #endif