btrfs: Attempt to fix GCC2 build.
[haiku.git] / src / apps / packageinstaller / PackageView.h
blob8ff6058d568e00ab973d20b19d3831778961fef7
1 /*
2 * Copyright 2007-2014, Haiku, Inc.
3 * Distributed under the terms of the MIT license.
5 * Author:
6 * Ɓukasz 'Sil2100' Zemczak <sil2100@vexillium.org>
7 */
8 #ifndef PACKAGE_VIEW_H
9 #define PACKAGE_VIEW_H
12 #include "PackageInfo.h"
13 #include "PackageInstall.h"
14 #include "PackageStatus.h"
16 #include <View.h>
18 class BBox;
19 class BButton;
20 class BFilePanel;
21 class BMenu;
22 class BMenuField;
23 class BPopUpMenu;
24 class BTextView;
27 enum {
28 P_MSG_INSTALL_TYPE_CHANGED = 'gpch',
29 P_MSG_PATH_CHANGED,
30 P_MSG_OPEN_PANEL,
31 P_MSG_INSTALL
34 class PackageView : public BView {
35 public:
36 PackageView(const entry_ref* ref);
37 virtual ~PackageView();
39 virtual void AttachedToWindow();
40 virtual void MessageReceived(BMessage* message);
42 int32 ItemExists(PackageItem& item,
43 BPath& path, int32& policy);
45 BPath* CurrentPath()
46 { return &fCurrentPath; }
47 PackageInfo* GetPackageInfo()
48 { return &fInfo; }
49 uint32 CurrentType() const
50 { return fCurrentType; }
51 PackageStatus* StatusWindow()
52 { return fStatusWindow; }
54 private:
55 void _InitView();
56 void _InitProfiles();
58 status_t _InstallTypeChanged(int32 index);
60 BString _NamePlusSizeString(BString name,
61 size_t size, const char* format) const;
62 BMenuItem* _AddInstallTypeMenuItem(BString baseName,
63 size_t size, int32 index) const;
64 BMenuItem* _AddDestinationMenuItem(BString baseName,
65 size_t size, const char* path) const;
66 BMenuItem* _AddMenuItem(const char* name,
67 BMessage* message, BMenu* menu) const;
69 bool _ValidateFilePanelMessage(BMessage* message);
71 private:
72 BPopUpMenu* fInstallTypes;
73 BTextView* fInstallTypeDescriptionView;
74 BPopUpMenu* fDestination;
75 BMenuField* fDestField;
76 BButton* fBeginButton;
78 BFilePanel* fOpenPanel;
79 bool fExpectingOpenPanelResult;
81 BPath fCurrentPath;
82 uint32 fCurrentType;
84 PackageInfo fInfo;
85 PackageStatus* fStatusWindow;
86 PackageInstall fInstallProcess;
89 #endif // PACKAGE_VIEW_H