2 * Copyright 2005, Jérôme DUVAL. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 #ifndef __PACKAGEVIEWS_H__
6 #define __PACKAGEVIEWS_H__
15 #include <StringView.h>
22 void SetGroupName(const char* group
)
23 { strcpy(fGroup
, group
); }
24 const char* GroupName() const
31 class Package
: public Group
{
33 Package(const char* folder
);
36 void SetFolder(const char* folder
)
37 { strcpy(fFolder
, folder
); }
38 void SetName(const char* name
)
39 { strcpy(fName
, name
); }
40 void SetDescription(const char* description
)
41 { strcpy(fDescription
, description
); }
42 void SetSize(const int32 size
)
44 void SetIcon(BBitmap
* icon
)
45 { delete fIcon
; fIcon
= icon
; }
46 void SetOnByDefault(bool onByDefault
)
47 { fOnByDefault
= onByDefault
; }
48 void SetAlwaysOn(bool alwaysOn
)
49 { fAlwaysOn
= alwaysOn
; }
50 const char* Folder() const
52 const char* Name() const
54 const char* Description() const
55 { return fDescription
; }
56 const int32
Size() const
58 void GetSizeAsString(char* string
,
60 const BBitmap
* Icon() const
62 bool OnByDefault() const
63 { return fOnByDefault
; }
67 static Package
* PackageFromEntry(BEntry
&dir
);
72 char fDescription
[64];
80 class PackageCheckBox
: public BCheckBox
{
82 PackageCheckBox(BRect rect
, Package
* item
);
83 virtual ~PackageCheckBox();
85 virtual void Draw(BRect updateRect
);
86 virtual void MouseMoved(BPoint point
, uint32 transit
,
87 const BMessage
* dragMessage
);
96 class GroupView
: public BStringView
{
98 GroupView(BRect rect
, Group
* group
);
106 class PackagesView
: public BView
{
108 PackagesView(BRect rect
, const char* name
);
109 PackagesView(const char* name
);
110 virtual ~PackagesView();
113 void AddPackages(BList
& list
, BMessage
* message
);
114 void GetTotalSizeAsString(char* string
,
116 void GetPackagesToInstall(BList
* list
, int32
* size
);
118 virtual void FrameResized(float width
, float height
);
119 virtual void Draw(BRect updateRect
);
120 virtual void GetPreferredSize(float* _width
, float* _height
);
121 virtual BSize
MaxSize();
127 #endif // __PACKAGEVIEWS_H__