vfs: check userland buffers before reading them.
[haiku.git] / src / servers / registrar / Clipboard.h
blob1696bd044f10e1879a9085456147a5d3dbabc347
1 // Clipboard.h
3 #ifndef CLIPBOARD_H
4 #define CLIPBOARD_H
6 #include <String.h>
7 #include <Message.h>
8 #include <Messenger.h>
9 #include "WatchingService.h"
11 class Clipboard {
12 public:
13 Clipboard(const char *name);
14 ~Clipboard();
16 void SetData(const BMessage *data, BMessenger dataSource);
18 const BMessage *Data() const;
19 BMessenger DataSource() const;
20 int32 Count() const;
22 bool AddWatcher(BMessenger watcher);
23 bool RemoveWatcher(BMessenger watcher);
24 void NotifyWatchers();
26 private:
27 BString fName;
28 BMessage fData;
29 BMessenger fDataSource;
30 int32 fCount;
31 WatchingService fWatchingService;
34 #endif // CLIPBOARD_H