Finished unifying the Interface Kit headers:
* Fixed copyrights (puncuation and capitalization, removed authors from headers) * Updated indentation style * Unified pointer/reference style * Re-ordered some methods for better grouping where it could be done (abd adopted source accordingly) * Small coding style fixes here and there No functional change intended. +alphabranch git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32745 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+106
-87
@@ -1,15 +1,17 @@
|
||||
/*
|
||||
* Copyright 2001-2009, Haiku Inc.
|
||||
* Copyright 2001-2009, Haiku, Inc. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _SHELF_H
|
||||
#define _SHELF_H
|
||||
|
||||
|
||||
#include <Dragger.h>
|
||||
#include <Handler.h>
|
||||
#include <List.h>
|
||||
#include <Locker.h>
|
||||
|
||||
|
||||
class BDataIO;
|
||||
class BPoint;
|
||||
class BView;
|
||||
@@ -24,106 +26,123 @@ namespace BPrivate {
|
||||
|
||||
|
||||
class BShelf : public BHandler {
|
||||
public:
|
||||
BShelf(BView* view, bool allowDrags = true, const char* shelfType = NULL);
|
||||
BShelf(const entry_ref* ref, BView* view, bool allowDrags = true,
|
||||
const char* shelfType = NULL);
|
||||
BShelf(BDataIO* stream, BView* view, bool allowDrags = true,
|
||||
const char* shelfType = NULL);
|
||||
BShelf(BMessage *data);
|
||||
virtual ~BShelf();
|
||||
public:
|
||||
BShelf(BView* view, bool allowDrags = true,
|
||||
const char* shelfType = NULL);
|
||||
BShelf(const entry_ref* ref, BView* view,
|
||||
bool allowDrags = true,
|
||||
const char* shelfType = NULL);
|
||||
BShelf(BDataIO* stream, BView* view,
|
||||
bool allowDrags = true,
|
||||
const char* shelfType = NULL);
|
||||
BShelf(BMessage* archive);
|
||||
virtual ~BShelf();
|
||||
|
||||
virtual status_t Archive(BMessage* data, bool deep = true) const;
|
||||
static BArchivable* Instantiate(BMessage* archive);
|
||||
static BArchivable* Instantiate(BMessage* archive);
|
||||
virtual status_t Archive(BMessage* archive,
|
||||
bool deep = true) const;
|
||||
|
||||
virtual void MessageReceived(BMessage *msg);
|
||||
status_t Save();
|
||||
virtual void SetDirty(bool state);
|
||||
bool IsDirty() const;
|
||||
virtual void MessageReceived(BMessage* message);
|
||||
status_t Save();
|
||||
virtual void SetDirty(bool state);
|
||||
bool IsDirty() const;
|
||||
|
||||
virtual BHandler* ResolveSpecifier(BMessage *msg,
|
||||
int32 index, BMessage *specifier,
|
||||
int32 form, const char *property);
|
||||
virtual status_t GetSupportedSuites(BMessage* data);
|
||||
virtual BHandler* ResolveSpecifier(BMessage* message,
|
||||
int32 index, BMessage* specifier,
|
||||
int32 form, const char* property);
|
||||
virtual status_t GetSupportedSuites(BMessage* data);
|
||||
|
||||
virtual status_t Perform(perform_code d, void *arg);
|
||||
bool AllowsDragging() const;
|
||||
void SetAllowsDragging(bool state);
|
||||
bool AllowsZombies() const;
|
||||
void SetAllowsZombies(bool state);
|
||||
bool DisplaysZombies() const;
|
||||
void SetDisplaysZombies(bool state);
|
||||
bool IsTypeEnforced() const;
|
||||
void SetTypeEnforced(bool state);
|
||||
virtual status_t Perform(perform_code code, void* data);
|
||||
|
||||
status_t SetSaveLocation(BDataIO *data_io);
|
||||
status_t SetSaveLocation(const entry_ref *ref);
|
||||
BDataIO* SaveLocation(entry_ref *ref) const;
|
||||
bool AllowsDragging() const;
|
||||
void SetAllowsDragging(bool state);
|
||||
bool AllowsZombies() const;
|
||||
void SetAllowsZombies(bool state);
|
||||
bool DisplaysZombies() const;
|
||||
void SetDisplaysZombies(bool state);
|
||||
bool IsTypeEnforced() const;
|
||||
void SetTypeEnforced(bool state);
|
||||
|
||||
status_t AddReplicant(BMessage *data, BPoint location);
|
||||
status_t DeleteReplicant(BView *replicant);
|
||||
status_t DeleteReplicant(BMessage *data);
|
||||
status_t DeleteReplicant(int32 index);
|
||||
int32 CountReplicants() const;
|
||||
BMessage* ReplicantAt(int32 index,
|
||||
BView **view = NULL,
|
||||
uint32 *uid = NULL,
|
||||
status_t *perr = NULL) const;
|
||||
int32 IndexOf(const BView *replicantView) const;
|
||||
int32 IndexOf(const BMessage *archive) const;
|
||||
int32 IndexOf(uint32 id) const;
|
||||
status_t SetSaveLocation(BDataIO* stream);
|
||||
status_t SetSaveLocation(const entry_ref* ref);
|
||||
BDataIO* SaveLocation(entry_ref* ref) const;
|
||||
|
||||
protected:
|
||||
virtual bool CanAcceptReplicantMessage(BMessage*) const;
|
||||
virtual bool CanAcceptReplicantView(BRect, BView*, BMessage*) const;
|
||||
virtual BPoint AdjustReplicantBy(BRect, BMessage*) const;
|
||||
status_t AddReplicant(BMessage* archive,
|
||||
BPoint location);
|
||||
status_t DeleteReplicant(BView* replicant);
|
||||
status_t DeleteReplicant(BMessage* archive);
|
||||
status_t DeleteReplicant(int32 index);
|
||||
int32 CountReplicants() const;
|
||||
BMessage* ReplicantAt(int32 index, BView** view = NULL,
|
||||
uint32* uid = NULL,
|
||||
status_t* perr = NULL) const;
|
||||
int32 IndexOf(const BView* replicantView) const;
|
||||
int32 IndexOf(const BMessage* archive) const;
|
||||
int32 IndexOf(uint32 id) const;
|
||||
|
||||
virtual void ReplicantDeleted(int32 index, const BMessage *archive,
|
||||
const BView *replicant);
|
||||
protected:
|
||||
virtual bool CanAcceptReplicantMessage(
|
||||
BMessage* archive) const;
|
||||
virtual bool CanAcceptReplicantView(BRect,
|
||||
BView*, BMessage*) const;
|
||||
virtual BPoint AdjustReplicantBy(BRect, BMessage*) const;
|
||||
|
||||
private:
|
||||
friend class BPrivate::ShelfContainerViewFilter;
|
||||
virtual void ReplicantDeleted(int32 index,
|
||||
const BMessage* archive,
|
||||
const BView *replicant);
|
||||
|
||||
virtual void _ReservedShelf2();
|
||||
virtual void _ReservedShelf3();
|
||||
virtual void _ReservedShelf4();
|
||||
virtual void _ReservedShelf5();
|
||||
virtual void _ReservedShelf6();
|
||||
virtual void _ReservedShelf7();
|
||||
virtual void _ReservedShelf8();
|
||||
private:
|
||||
// FBC padding and forbidden methods
|
||||
virtual void _ReservedShelf2();
|
||||
virtual void _ReservedShelf3();
|
||||
virtual void _ReservedShelf4();
|
||||
virtual void _ReservedShelf5();
|
||||
virtual void _ReservedShelf6();
|
||||
virtual void _ReservedShelf7();
|
||||
virtual void _ReservedShelf8();
|
||||
|
||||
BShelf(const BShelf& other);
|
||||
BShelf& operator=(const BShelf& other);
|
||||
BShelf(const BShelf& other);
|
||||
BShelf& operator=(const BShelf& other);
|
||||
|
||||
status_t _Archive(BMessage* data) const;
|
||||
void _InitData(BEntry* entry, BDataIO* stream,
|
||||
BView* view, bool allowDrags);
|
||||
status_t _DeleteReplicant(BPrivate::replicant_data* replicant);
|
||||
status_t _AddReplicant(BMessage* data,
|
||||
BPoint* location, uint32 uniqueID);
|
||||
BView *_GetReplicant(BMessage *data, BView *view, const BPoint &point,
|
||||
BDragger *&dragger, BDragger::relation &relation);
|
||||
_BZombieReplicantView_ *_CreateZombie(BMessage *data, BDragger *&dragger);
|
||||
|
||||
status_t _GetProperty(BMessage* message, BMessage* reply);
|
||||
static void _GetReplicantData(BMessage *message, BView *view, BView *&replicant,
|
||||
BDragger *&dragger, BDragger::relation &relation);
|
||||
static BArchivable* _InstantiateObject(BMessage *archive, image_id *image);
|
||||
private:
|
||||
friend class BPrivate::ShelfContainerViewFilter;
|
||||
|
||||
private:
|
||||
BView* fContainerView;
|
||||
BDataIO* fStream;
|
||||
BEntry* fEntry;
|
||||
BList fReplicants;
|
||||
BPrivate::ShelfContainerViewFilter* fFilter;
|
||||
uint32 fGenCount;
|
||||
bool fAllowDragging;
|
||||
bool fDirty;
|
||||
bool fDisplayZombies;
|
||||
bool fAllowZombies;
|
||||
bool fTypeEnforced;
|
||||
status_t _Archive(BMessage* data) const;
|
||||
void _InitData(BEntry* entry, BDataIO* stream,
|
||||
BView* view, bool allowDrags);
|
||||
status_t _DeleteReplicant(
|
||||
BPrivate::replicant_data* replicant);
|
||||
status_t _AddReplicant(BMessage* data,
|
||||
BPoint* location, uint32 uniqueID);
|
||||
BView* _GetReplicant(BMessage* data, BView* view,
|
||||
const BPoint& point, BDragger*& dragger,
|
||||
BDragger::relation& relation);
|
||||
_BZombieReplicantView_* _CreateZombie(BMessage *data,
|
||||
BDragger *&dragger);
|
||||
|
||||
status_t _GetProperty(BMessage* message,
|
||||
BMessage* reply);
|
||||
static void _GetReplicantData(BMessage* message,
|
||||
BView* view, BView*& replicant,
|
||||
BDragger*& dragger,
|
||||
BDragger::relation& relation);
|
||||
static BArchivable* _InstantiateObject(BMessage* archive,
|
||||
image_id* image);
|
||||
|
||||
uint32 _reserved[8];
|
||||
private:
|
||||
BView* fContainerView;
|
||||
BDataIO* fStream;
|
||||
BEntry* fEntry;
|
||||
BList fReplicants;
|
||||
BPrivate::ShelfContainerViewFilter* fFilter;
|
||||
uint32 fGenCount;
|
||||
bool fAllowDragging;
|
||||
bool fDirty;
|
||||
bool fDisplayZombies;
|
||||
bool fAllowZombies;
|
||||
bool fTypeEnforced;
|
||||
|
||||
uint32 _reserved[8];
|
||||
};
|
||||
|
||||
#endif /* _SHELF_H */
|
||||
|
||||
Reference in New Issue
Block a user