1 // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
3 // Copyright (c) 2004, Haiku
5 // This software is part of the Haiku distribution and is covered
6 // by the Haiku license.
9 // File: MethodReplicant.h
10 // Authors: Jérôme Duval,
12 // Description: Input Server
13 // Created: October 13, 2004
15 // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
17 #ifndef METHOD_REPLICANT_H_
18 #define METHOD_REPLICANT_H_
20 #include <PopUpMenu.h>
22 #include "MethodMenuItem.h"
24 #define REPLICANT_CTL_NAME "MethodReplicant"
26 class _EXPORT MethodReplicant
;
28 class MethodReplicant
: public BView
{
30 MethodReplicant(const char* signature
);
32 MethodReplicant(BMessage
*);
33 // BMessage * based constructor needed to support archiving
34 virtual ~MethodReplicant();
36 // archiving overrides
37 static MethodReplicant
*Instantiate(BMessage
*data
);
38 virtual status_t
Archive(BMessage
*data
, bool deep
= true) const;
40 virtual void AttachedToWindow();
42 // misc BView overrides
43 virtual void MouseDown(BPoint
);
44 virtual void MouseUp(BPoint
);
46 virtual void Draw(BRect
);
48 virtual void MessageReceived(BMessage
*);
54 void UpdateMethod(BMessage
*);
55 void UpdateMethodIcon(BMessage
*);
56 void UpdateMethodMenu(BMessage
*);
57 void UpdateMethodName(BMessage
*);
58 void AddMethod(BMessage
*message
);
59 void RemoveMethod(BMessage
*message
);
60 MethodMenuItem
*FindItemByCookie(int32 cookie
);