xref: /haiku/src/apps/haikudepot/ui/PackageInfoView.h (revision 5ac9b506412b11afb993bb52d161efe7666958a5)
1 /*
2  * Copyright 2013-2014, Stephan Aßmus <superstippi@gmx.de>.
3  * All rights reserved. Distributed under the terms of the MIT License.
4  */
5 #ifndef PACKAGE_INFO_VIEW_H
6 #define PACKAGE_INFO_VIEW_H
7 
8 #include <GroupView.h>
9 
10 #include "PackageInfo.h"
11 #include "PackageInfoListener.h"
12 
13 
14 class BCardLayout;
15 class BLocker;
16 class OnePackageMessagePackageListener;
17 class PackageActionHandler;
18 class PackageActionView;
19 class PagesView;
20 class TitleView;
21 
22 enum {
23 	MSG_VOTE_UP			= 'vtup',
24 	MSG_VOTE_DOWN		= 'vtdn',
25 	MSG_RATE_PACKAGE	= 'rate',
26 	MSG_SHOW_SCREENSHOT = 'shws',
27 };
28 
29 
30 class PackageInfoView : public BView {
31 public:
32 								PackageInfoView(BLocker* modelLock,
33 									PackageActionHandler* handler);
34 	virtual						~PackageInfoView();
35 
36 	virtual void				AttachedToWindow();
37 	virtual	void				MessageReceived(BMessage* message);
38 
39 			void				SetPackage(const PackageInfoRef& package);
40 			const PackageInfoRef& Package() const
41 									{ return fPackage; }
42 			void				Clear();
43 
44 private:
45 			BLocker*			fModelLock;
46 
47 			BCardLayout*		fCardLayout;
48 			TitleView*			fTitleView;
49 			PackageActionView*	fPackageActionView;
50 			PagesView*			fPagesView;
51 
52 			PackageInfoRef		fPackage;
53 			OnePackageMessagePackageListener* fPackageListener;
54 };
55 
56 #endif // PACKAGE_INFO_VIEW_H
57