~ubuntu-branches/ubuntu/maverick/newsbeuter/maverick

« back to all changes in this revision

Viewing changes to include/controller.h

  • Committer: Bazaar Package Importer
  • Author(s): Nico Golde
  • Date: 2007-04-21 19:44:35 UTC
  • Revision ID: james.westby@ubuntu.com-20070421194435-21g6134ws2yvarlt
Tags: upstream-0.3
ImportĀ upstreamĀ versionĀ 0.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef NEWSBEUTER_CONTROLLER__H
 
2
#define NEWSBEUTER_CONTROLLER__H
 
3
 
 
4
#include <urlreader.h>
 
5
#include <rss.h>
 
6
#include <cache.h>
 
7
#include <nxml.h>
 
8
#include <configcontainer.h>
 
9
 
 
10
namespace newsbeuter {
 
11
 
 
12
        class view;
 
13
 
 
14
        class controller {
 
15
                public:
 
16
                        controller();
 
17
                        ~controller();
 
18
                        void set_view(view * vv);
 
19
                        void run(int argc = 0, char * argv[] = NULL);
 
20
                        bool open_feed(unsigned int pos, bool auto_open);
 
21
                        bool open_item(rss_feed& feed, std::string guid);
 
22
                        void reload(unsigned int pos, unsigned int max = 0);
 
23
                        void reload_all();
 
24
                        void start_reload_all_thread();
 
25
                        rss_feed& get_feed(unsigned int pos);
 
26
                        rss_feed get_feed_by_url(const std::string& feedurl);
 
27
                        std::vector<rss_item> search_for_items(const std::string& query, const std::string& feedurl);
 
28
                        inline unsigned int get_feedcount() { return feeds.size(); }
 
29
                        inline void unlock_reload_mutex() { reload_mutex->unlock(); }
 
30
                        void update_feedlist();
 
31
                        void mark_all_read(unsigned int pos);
 
32
                        void catchup_all();
 
33
                        inline bool get_refresh_on_start() { return refresh_on_start; }
 
34
                        bool is_valid_podcast_type(const std::string& mimetype);
 
35
                        void enqueue_url(const std::string& url);
 
36
 
 
37
                private:
 
38
                        void usage(char * argv0);
 
39
                        void import_opml(const char * filename);
 
40
                        void export_opml();
 
41
                        void rec_find_rss_outlines(nxml_data_t * node, std::string tag);
 
42
 
 
43
                        view * v;
 
44
                        urlreader urlcfg;
 
45
                        cache * rsscache;
 
46
                        std::vector<rss_feed> feeds;
 
47
                        std::string config_dir;
 
48
                        std::string url_file;
 
49
                        std::string cache_file;
 
50
                        std::string config_file;
 
51
                        std::string queue_file;
 
52
                        bool refresh_on_start;
 
53
                        configcontainer * cfg;
 
54
 
 
55
                        mutex * reload_mutex;
 
56
        };
 
57
 
 
58
}
 
59
 
 
60
 
 
61
#endif