File: remote_api.h

package info (click to toggle)
newsbeuter 2.9-5+deb9u2
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 4,692 kB
  • ctags: 3,693
  • sloc: cpp: 18,663; ruby: 1,797; xml: 350; sh: 199; makefile: 171; perl: 101
file content (31 lines) | stat: -rw-r--r-- 863 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef NEWSBEUTER_REMOTE_API__H
#define NEWSBEUTER_REMOTE_API__H

#include <configcontainer.h>
#include <string>
#include <utility>
#include <vector>
#include <curl/curl.h>

namespace newsbeuter {

typedef std::pair<std::string, std::vector<std::string>> tagged_feedurl;

class remote_api {
	public:
		remote_api(configcontainer * c) : cfg(c) { }
		virtual ~remote_api() { }
		virtual bool authenticate() = 0;
		virtual std::vector<tagged_feedurl> get_subscribed_urls() = 0;
		virtual void configure_handle(curl_slist** custom_headers) = 0;
		virtual bool mark_all_read(const std::string& feedurl) = 0;
		virtual bool mark_article_read(const std::string& guid, bool read) = 0;
		virtual bool update_article_flags(const std::string& oldflags, const std::string& newflags, const std::string& guid) = 0;
		// TODO
	protected:
		configcontainer * cfg;
};

}

#endif