1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /*
3  * Pan - A Newsreader for Gtk+
4  * Copyright (C) 2002-2006  Charles Kerr <charles@rebelbase.com>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; version 2 of the License.
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, see <http://www.gnu.org/licenses/>.
17  *
18  */
19 #ifndef _ScoreViewUI_h_
20 #define _ScoreViewUI_h_
21 
22 #include <vector>
23 #include "gtk-compat.h"
24 #include <pan/general/quark.h>
25 #include <pan/usenet-utils/scorefile.h>
26 #include <pan/data/article.h>
27 #include <pan/data/data.h>
28 
29 namespace pan
30 {
31   class Scorefile;
32 
33   /**
34    * Dialog that shows what Scorefile entries apply to a given Article.
35    * @ingroup GUI
36    */
37   class ScoreView
38   {
39     public:
40       ScoreView (Data& data, GtkWindow* parent,
41                  const Quark& group,
42                  const Article& article);
~ScoreView()43       ~ScoreView () {}
44 
45     public:
root()46       GtkWidget* root() { return _root; }
47 
48     private:
49       Data& _data;
50       const Quark _group;
51       const Article _article;
52       GtkWidget * _root;
53       GtkWidget * tree_view;
54       GtkListStore * _store;
55       typedef Scorefile::items_t items_t;
56       items_t _items;
57 
58     private:
59       void tree_view_refresh ();
60 
61     private:
62       static void remove_clicked_cb (GtkWidget*, gpointer);
63       void on_remove ();
64       static void add_clicked_cb (GtkWidget*, gpointer);
65       void on_add ();
66       static void add_destroy_cb (GtkWidget*, gpointer);
67   };
68 }
69 
70 #endif
71