xref: /haiku/src/apps/packageinstaller/PackageView.h (revision 820dca4df6c7bf955c46e8f6521b9408f50b2900)
1 /*
2  * Copyright 2007-2009, Haiku, Inc.
3  * Distributed under the terms of the MIT license.
4  *
5  * Author:
6  *		Łukasz 'Sil2100' Zemczak <sil2100@vexillium.org>
7  */
8 #ifndef PACKAGE_VIEW_H
9 #define PACKAGE_VIEW_H
10 
11 
12 #include "PackageInfo.h"
13 #include "PackageInstall.h"
14 #include "PackageStatus.h"
15 
16 #include <Box.h>
17 #include <Button.h>
18 #include <FilePanel.h>
19 #include <MenuField.h>
20 #include <View.h>
21 
22 class BPopUpMenu;
23 class BTextView;
24 
25 
26 enum {
27 	P_MSG_GROUP_CHANGED = 'gpch',
28 	P_MSG_PATH_CHANGED,
29 	P_MSG_OPEN_PANEL,
30 	P_MSG_INSTALL
31 };
32 
33 class PackageView : public BView {
34 	public:
35 		PackageView(BRect frame, const entry_ref *ref);
36 		~PackageView();
37 
38 		void AttachedToWindow();
39 		void MessageReceived(BMessage *msg);
40 
41 		int32 ItemExists(PackageItem &item, BPath &path, int32 &policy);
42 
43 		BPath *GetCurrentPath()          { return &fCurrentPath; }
44 		PackageInfo *GetPackageInfo()    { return &fInfo; }
45 		uint32 GetCurrentType()          { return fCurrentType; }
46 		PackageStatus *GetStatusWindow() { return fStatusWindow; }
47 
48 	private:
49 		void _InitView();
50 		void _InitProfiles();
51 
52 		status_t _GroupChanged(int32 index);
53 
54 		BPopUpMenu *fInstallTypes;
55 		BTextView *fInstallDesc;
56 		BPopUpMenu *fDestination;
57 		BMenuField *fDestField;
58 		BButton *fInstall;
59 
60 		BFilePanel *fOpenPanel;
61 		BPath fCurrentPath;
62 		uint32 fCurrentType;
63 
64 		PackageInfo fInfo;
65 		PackageStatus *fStatusWindow;
66 		PackageInstall fInstallProcess;
67 };
68 
69 #endif	// PACKAGE_VIEW_H
70 
71