xref: /haiku/headers/private/print/PrintPanel.h (revision b06a48ab8f30b45916a9c157b992827779182163)
1 /*
2  * Copyright 2008 Haiku Inc. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Julun, <host.haiku@gmx.de
7  */
8 #ifndef _PRINT_PANEL_H_
9 #define _PRINT_PANEL_H_
10 
11 
12 #include <MessageFilter.h>
13 #include <String.h>
14 #include <Window.h>
15 
16 
17 class BArchivable;
18 class BGroupView;
19 class BHandler;
20 class BMessage;
21 class BView;
22 
23 
24 namespace BPrivate {
25 	namespace Print {
26 
27 
28 class BPrintPanel : public BWindow {
29 public:
30 							BPrintPanel(const BString& title);
31 	virtual					~BPrintPanel();
32 
33 							BPrintPanel(BMessage* data);
34 	static	BArchivable*	Instantiate(BMessage* data);
35 	virtual	status_t		Archive(BMessage* data, bool deep = true) const;
36 
37 	virtual	status_t		Go() = 0;
38 
39 			BView*			Panel() const;
40 			void			AddPanel(BView* panel);
41 			bool			RemovePanel(BView* child);
42 
43 	virtual	void			MessageReceived(BMessage* message);
44 	virtual	void			FrameResized(float newWidth, float newHeight);
45 
46 	virtual BHandler*		ResolveSpecifier(BMessage* message, int32 index,
47 								BMessage* specifier, int32 form,
48 								const char* property);
49 	virtual	status_t		GetSupportedSuites(BMessage* data);
50 	virtual status_t		Perform(perform_code d, void* arg);
51 
52 	virtual	void			Quit();
53 	virtual	bool			QuitRequested();
54 	virtual void			DispatchMessage(BMessage* message, BHandler* handler);
55 
56 protected:
57 	virtual status_t		ShowPanel();
58 
59 private:
60 			void			AddChild(BView* child, BView* before = NULL);
61 			bool			RemoveChild(BView* child);
62 			BView*			ChildAt(int32 index) const;
63 
64 	class	_BPrintPanelFilter_ : public BMessageFilter {
65 	public:
66 							_BPrintPanelFilter_(BPrintPanel* panel);
67 			filter_result	Filter(BMessage* msg, BHandler** target);
68 
69 	private:
70 			BPrintPanel*	fPrintPanel;
71 	};
72 
73 private:
74 	virtual	void			_ReservedBPrintPanel1();
75 	virtual	void			_ReservedBPrintPanel2();
76 	virtual	void			_ReservedBPrintPanel3();
77 	virtual	void			_ReservedBPrintPanel4();
78 	virtual	void			_ReservedBPrintPanel5();
79 
80 private:
81 			BGroupView*		fPanel;
82 			sem_id			fPrintPanelSem;
83 			status_t		fPrintPanelResult;
84 
85 			uint32			_reserved[5];
86 };
87 
88 
89 	}	// namespace Print
90 }	// namespace BPrivate
91 
92 
93 #endif	// _PRINT_PANEL_H_
94