xref: /haiku/headers/private/interface/WindowStack.h (revision 220d04022750f40f8bac8f01fa551211e28d04f2)
1 /*
2  * Copyright 2010, Haiku, Inc. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef WINDOW_STACK_H
6 #define WINDOW_STACK_H
7 
8 
9 #include <Window.h>
10 
11 
12 class BWindowStack {
13 public:
14 								BWindowStack(BWindow* window);
15 								~BWindowStack();
16 
17 			status_t			AddWindow(const BWindow* window);
18 			status_t			AddWindow(const BMessenger& window);
19 			status_t			AddWindowAt(const BWindow* window,
20 									int32 position);
21 			status_t			AddWindowAt(const BMessenger& window,
22 									int32 position);
23 
24 			status_t			RemoveWindow(const BWindow* window);
25 			status_t			RemoveWindow(const BMessenger& window);
26 			status_t			RemoveWindowAt(int32 position,
27 									BMessenger* window = NULL);
28 
29 			int32				CountWindows();
30 
31 			status_t			WindowAt(int32 position,
32 								BMessenger& messenger);
33 			bool				HasWindow(const BWindow* window);
34 			bool				HasWindow(const BMessenger& window);
35 
36 private:
37 			status_t			_AttachMessenger(const BMessenger& window);
38 			status_t			_ReadMessenger(BMessenger& window);
39 			status_t			_StartMessage(int32 what);
40 
41 			BPrivate::PortLink*	fLink;
42 };
43 
44 
45 #endif
46