Fix FreeBSD build.
[haiku.git] / headers / os / app / Invoker.h
blob74b6fa5e933018af043ef7f9e7b8b5f796ee20d0
1 /*
2 * Copyright 2001-2005, Haiku.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Frans van Nispen (xlr8@tref.nl)
7 */
8 #ifndef _INVOKER_H
9 #define _INVOKER_H
12 #include <BeBuild.h>
13 #include <Messenger.h>
16 class BHandler;
17 class BLooper;
18 class BMessage;
21 class BInvoker {
22 public:
23 BInvoker();
24 BInvoker(BMessage* message,
25 const BHandler* handler,
26 const BLooper* looper = NULL);
27 BInvoker(BMessage* message, BMessenger target);
28 virtual ~BInvoker();
30 virtual status_t SetMessage(BMessage* message);
31 BMessage* Message() const;
32 uint32 Command() const;
34 virtual status_t SetTarget(const BHandler* handler,
35 const BLooper* looper = NULL);
36 virtual status_t SetTarget(BMessenger messenger);
37 bool IsTargetLocal() const;
38 BHandler* Target(BLooper** _looper = NULL) const;
39 BMessenger Messenger() const;
41 virtual status_t SetHandlerForReply(BHandler* handler);
42 BHandler* HandlerForReply() const;
44 virtual status_t Invoke(BMessage* message = NULL);
45 status_t InvokeNotify(BMessage* message,
46 uint32 kind = B_CONTROL_INVOKED);
47 status_t SetTimeout(bigtime_t timeout);
48 bigtime_t Timeout() const;
50 protected:
51 uint32 InvokeKind(bool* _notify = NULL);
52 void BeginInvokeNotify(
53 uint32 kind = B_CONTROL_INVOKED);
54 void EndInvokeNotify();
56 private:
57 virtual void _ReservedInvoker1();
58 virtual void _ReservedInvoker2();
59 virtual void _ReservedInvoker3();
61 BInvoker(const BInvoker&);
62 BInvoker& operator=(const BInvoker&);
64 BMessage* fMessage;
65 BMessenger fMessenger;
66 BHandler* fReplyTo;
67 bigtime_t fTimeout;
68 uint32 fNotifyKind;
69 uint32 _reserved[1];
73 #endif // _INVOKER_H