Imported version 0.2-1
[mstardict] / src / lib / treedict.hpp
1 #ifndef _TREEDICT_HPP_
2 #define _TREEDICT_HPP_
3
4 #include <gtk/gtk.h>
5
6 #include "common.hpp"
7 #include "data.hpp"
8
9 class TreeDict : public DictBase {
10 public:
11         TreeDict();
12         bool load(const std::string& ifofilename);
13         static GtkTreeStore *get_model() { return model; }
14 private:
15         static GtkTreeStore *model;
16
17         bool load_ifofile(const std::string& ifofilename, gulong *tdxfilesize);
18         void load_model(gchar **buffer, GtkTreeIter *parent, guint32 count);
19 };
20
21 class TreeDicts {
22 public:
23         TreeDicts();
24         ~TreeDicts();
25         void load_dict(const std::string& url);
26         GtkTreeStore* Load(const strlist_t& tree_dicts_dirs,
27                            const strlist_t& order_list,
28                            const strlist_t& disable_list);
29         gchar * poGetWordData(guint32 offset, guint32 size, int iTreeDict);
30 private:
31         std::vector<TreeDict *> oTreeDict;
32 };
33
34 #endif//!_TREEDICT_HPP_