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 "PackageStatus.h" 14 15 #include <View.h> 16 #include <Box.h> 17 #include <Button.h> 18 #include <MenuField.h> 19 #include <FilePanel.h> 20 21 class BPopUpMenu; 22 class BTextView; 23 24 25 enum { 26 P_MSG_GROUP_CHANGED = 'gpch', 27 P_MSG_PATH_CHANGED, 28 P_MSG_OPEN_PANEL, 29 P_MSG_INSTALL 30 }; 31 32 class PackageView : public BView { 33 public: 34 PackageView(BRect frame, const entry_ref *ref); 35 ~PackageView(); 36 37 void AttachedToWindow(); 38 void MessageReceived(BMessage *msg); 39 40 status_t Install(); 41 42 private: 43 void _InitView(); 44 void _InitProfiles(); 45 int32 _ItemExists(PackageItem &item, BPath &path); 46 47 status_t _GroupChanged(int32 index); 48 49 BPopUpMenu *fInstallTypes; 50 BTextView *fInstallDesc; 51 BPopUpMenu *fDestination; 52 BMenuField *fDestField; 53 BButton *fInstall; 54 55 BFilePanel *fOpenPanel; 56 BPath fCurrentPath; 57 uint32 fCurrentType; 58 int32 fItemExistsPolicy; 59 60 PackageInfo fInfo; 61 PackageStatus *fStatusWindow; 62 }; 63 64 #endif // PACKAGE_VIEW_H 65 66