Line | |
---|
1 | |
---|
2 | #ifndef _LLX_APT_CACHE_ |
---|
3 | #define _LLX_APT_CACHE_ |
---|
4 | |
---|
5 | #include <functional> |
---|
6 | #include <string> |
---|
7 | |
---|
8 | #include <glibmm.h> |
---|
9 | #include <giomm.h> |
---|
10 | |
---|
11 | namespace net |
---|
12 | { |
---|
13 | namespace lliurex |
---|
14 | { |
---|
15 | namespace apt |
---|
16 | { |
---|
17 | class Cache |
---|
18 | { |
---|
19 | protected: |
---|
20 | |
---|
21 | std::function<void(int,std::string)> cb_progress; |
---|
22 | std::function<void(void)> cb_ready; |
---|
23 | |
---|
24 | Glib::RefPtr<Gio::DBus::Connection> connection; |
---|
25 | Glib::RefPtr<Gio::DBus::Proxy> transaction_proxy; |
---|
26 | |
---|
27 | int progress; |
---|
28 | bool cancel_request; |
---|
29 | |
---|
30 | Glib::RefPtr<Glib::MainLoop> loop; |
---|
31 | |
---|
32 | void OnSignal(const Glib::ustring& sender_name, |
---|
33 | const Glib::ustring& signal_name, const Glib::VariantContainerBase& parameters); |
---|
34 | |
---|
35 | void OnPropertiesChanged(const Gio::DBus::Proxy::MapChangedProperties& changed_properties, |
---|
36 | const std::vector<Glib::ustring>& invalidated_properties); |
---|
37 | |
---|
38 | |
---|
39 | |
---|
40 | void UpdateThread(); |
---|
41 | |
---|
42 | public: |
---|
43 | |
---|
44 | Cache(); |
---|
45 | Cache(std::function<void(int,std::string)> progress,std::function<void(void)> ready); |
---|
46 | virtual ~Cache(); |
---|
47 | |
---|
48 | void Update(); |
---|
49 | |
---|
50 | void Cancel(); |
---|
51 | }; |
---|
52 | } |
---|
53 | } |
---|
54 | } |
---|
55 | |
---|
56 | |
---|
57 | #endif |
---|
58 | |
---|
Note: See
TracBrowser
for help on using the repository browser.