-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFclipServer.h
64 lines (49 loc) · 1.87 KB
/
FclipServer.h
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef FCLIPSERVER_H
#define FCLIPSERVER_H
#include <string>
#include <vector>
#include <memory>
#include <algorithm>
#include <dbus-c++/dbus.h>
#include "Clipboard.h"
#include "Fclip_adaptor.h"
class FclipServer : public com::fclip::Fclip_adaptor,
public DBus::IntrospectableAdaptor,
public DBus::ObjectAdaptor {
public:
FclipServer (DBus::Connection &connection) :
DBus::ObjectAdaptor(connection, "/com/fclip/Fclip") {}
virtual void Add(const std::vector< std::string >& files,
const bool& recursive,
std::vector< std::string >& messages,
bool& success)
{ success = clip_.add(files, recursive, messages); }
virtual void Remove(const std::vector<std::string>& files,
const bool &recursive,
std::vector< std::string >& messages,
bool& success)
{ success = clip_.remove(files, recursive, messages); }
virtual void Clear() { clip_.clear(); }
virtual void ListFilesToStream(const std::string& directory,
const bool& absolute,
const std::string& stream);
virtual void DirectoryListing(const std::string& directory,
std::vector< ::DBus::Struct< std::string, bool, bool > >& files,
bool& recursive,
std::vector< std::string >& messages,
bool& success);
virtual std::string LowestCommonAncestor()
{ return clip_.lowestCommonAncestor().string(); }
virtual void Stash(std::vector< std::string >& messages, bool& success)
{ success = clip_.stash(messages); }
virtual void Unstash(const uint32_t& n, std::vector< std::string >& messages, bool& success)
{ success = clip_.unstash(n, messages); }
virtual std::vector<std::string> ListStash() { return clip_.listStash(); }
virtual void DropStash(const uint32_t& n, std::vector< std::string >& messages, bool& success)
{ success = clip_.dropStash(n, messages); }
virtual void ClearStash()
{ clip_.clearStash(); }
private:
Clipboard clip_;
};
#endif