2 * Copyright 2001-2009, Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
19 class _BZombieReplicantView_
;
24 class ShelfContainerViewFilter
;
28 class BShelf
: public BHandler
{
30 BShelf(BView
* view
, bool allowDrags
= true,
31 const char* shelfType
= NULL
);
32 BShelf(const entry_ref
* ref
, BView
* view
,
33 bool allowDrags
= true,
34 const char* shelfType
= NULL
);
35 BShelf(BDataIO
* stream
, BView
* view
,
36 bool allowDrags
= true,
37 const char* shelfType
= NULL
);
38 BShelf(BMessage
* archive
);
41 static BArchivable
* Instantiate(BMessage
* archive
);
42 virtual status_t
Archive(BMessage
* archive
,
43 bool deep
= true) const;
45 virtual void MessageReceived(BMessage
* message
);
47 virtual void SetDirty(bool state
);
50 virtual BHandler
* ResolveSpecifier(BMessage
* message
,
51 int32 index
, BMessage
* specifier
,
52 int32 form
, const char* property
);
53 virtual status_t
GetSupportedSuites(BMessage
* data
);
55 virtual status_t
Perform(perform_code code
, void* data
);
57 bool AllowsDragging() const;
58 void SetAllowsDragging(bool state
);
59 bool AllowsZombies() const;
60 void SetAllowsZombies(bool state
);
61 bool DisplaysZombies() const;
62 void SetDisplaysZombies(bool state
);
63 bool IsTypeEnforced() const;
64 void SetTypeEnforced(bool state
);
66 status_t
SetSaveLocation(BDataIO
* stream
);
67 status_t
SetSaveLocation(const entry_ref
* ref
);
68 BDataIO
* SaveLocation(entry_ref
* ref
) const;
70 status_t
AddReplicant(BMessage
* archive
,
72 status_t
DeleteReplicant(BView
* replicant
);
73 status_t
DeleteReplicant(BMessage
* archive
);
74 status_t
DeleteReplicant(int32 index
);
75 int32
CountReplicants() const;
76 BMessage
* ReplicantAt(int32 index
, BView
** view
= NULL
,
78 status_t
* perr
= NULL
) const;
79 int32
IndexOf(const BView
* replicantView
) const;
80 int32
IndexOf(const BMessage
* archive
) const;
81 int32
IndexOf(uint32 id
) const;
84 virtual bool CanAcceptReplicantMessage(
85 BMessage
* archive
) const;
86 virtual bool CanAcceptReplicantView(BRect
,
87 BView
*, BMessage
*) const;
88 virtual BPoint
AdjustReplicantBy(BRect
, BMessage
*) const;
90 virtual void ReplicantDeleted(int32 index
,
91 const BMessage
* archive
,
92 const BView
*replicant
);
95 // FBC padding and forbidden methods
96 virtual void _ReservedShelf2();
97 virtual void _ReservedShelf3();
98 virtual void _ReservedShelf4();
99 virtual void _ReservedShelf5();
100 virtual void _ReservedShelf6();
101 virtual void _ReservedShelf7();
102 virtual void _ReservedShelf8();
104 BShelf(const BShelf
& other
);
105 BShelf
& operator=(const BShelf
& other
);
108 friend class BPrivate::ShelfContainerViewFilter
;
110 status_t
_Archive(BMessage
* data
) const;
111 void _InitData(BEntry
* entry
, BDataIO
* stream
,
112 BView
* view
, bool allowDrags
);
113 status_t
_DeleteReplicant(
114 BPrivate::replicant_data
* replicant
);
115 status_t
_AddReplicant(BMessage
* data
,
116 BPoint
* location
, uint32 uniqueID
);
117 BView
* _GetReplicant(BMessage
* data
, BView
* view
,
118 const BPoint
& point
, BDragger
*& dragger
,
119 BDragger::relation
& relation
);
120 _BZombieReplicantView_
* _CreateZombie(BMessage
*data
,
123 status_t
_GetProperty(BMessage
* message
,
125 static void _GetReplicantData(BMessage
* message
,
126 BView
* view
, BView
*& replicant
,
128 BDragger::relation
& relation
);
129 static BArchivable
* _InstantiateObject(BMessage
* archive
,
133 BView
* fContainerView
;
137 BPrivate::ShelfContainerViewFilter
* fFilter
;
141 bool fDisplayZombies
;
148 #endif /* _SHELF_H */