diff --git a/headers/private/tracker/NavMenu.h b/headers/private/tracker/NavMenu.h index 0726c36d94..e1c45d1475 100644 --- a/headers/private/tracker/NavMenu.h +++ b/headers/private/tracker/NavMenu.h @@ -49,6 +49,7 @@ All rights reserved. template class BObjectList; class BMenuItem; + namespace BPrivate { class Model; @@ -57,94 +58,94 @@ class ModelMenuItem; class EntryListBase; -class TrackingHookData { - public: - TrackingHookData() - : - fTrackingHook(NULL), - fDragMessage(NULL) - { - } +struct TrackingHookData { + TrackingHookData() + : + fTrackingHook(NULL), + fDragMessage(NULL) + { + } - bool (*fTrackingHook)(BMenu *, void *); - BMessenger fTarget; - const BMessage *fDragMessage; + bool (*fTrackingHook)(BMenu*, void*); + BMessenger fTarget; + const BMessage* fDragMessage; }; class BNavMenu : public BSlowMenu { - public: - BNavMenu(const char* title, uint32 message, const BHandler *, - BWindow *parentWindow = NULL, const BObjectList *list = NULL); - BNavMenu(const char* title, uint32 message, const BMessenger &, - BWindow *parentWindow = NULL, const BObjectList *list = NULL); - // parentWindow, if specified, will be closed if nav menu item invoked - // with option held down +public: + BNavMenu(const char* title, uint32 message, const BHandler*, + BWindow* parentWindow = NULL, const BObjectList* list = NULL); + BNavMenu(const char* title, uint32 message, const BMessenger&, + BWindow* parentWindow = NULL, const BObjectList* list = NULL); + // parentWindow, if specified, will be closed if nav menu item invoked + // with option held down - virtual ~BNavMenu(); + virtual ~BNavMenu(); - virtual void AttachedToWindow(); - virtual void DetachedFromWindow(); + virtual void AttachedToWindow(); + virtual void DetachedFromWindow(); - void SetNavDir(const entry_ref *); - void ForceRebuild(); - bool NeedsToRebuild() const; - // will cause menu to get rebuilt next time it is shown + void SetNavDir(const entry_ref*); + void ForceRebuild(); + bool NeedsToRebuild() const; + // will cause menu to get rebuilt next time it is shown - virtual void ResetTargets(); - void SetTarget(const BMessenger &); - BMessenger Target(); + virtual void ResetTargets(); + void SetTarget(const BMessenger&); + BMessenger Target(); - void SetTypesList(const BObjectList *list); - const BObjectList *TypesList() const; + void SetTypesList(const BObjectList* list); + const BObjectList* TypesList() const; - void AddNavDir(const Model *model, uint32 what, BHandler *target, - bool populateSubmenu); + void AddNavDir(const Model* model, uint32 what, BHandler* target, + bool populateSubmenu); - void AddNavParentDir(const char *name, const Model *model, uint32 what, BHandler *target); - void AddNavParentDir(const Model *model, uint32 what, BHandler *target); - void SetShowParent(bool show); + void AddNavParentDir(const char* name, const Model* model, uint32 what, + BHandler* target); + void AddNavParentDir(const Model* model, uint32 what, BHandler* target); + void SetShowParent(bool show); - static int32 GetMaxMenuWidth(); + static int32 GetMaxMenuWidth(); - static int CompareFolderNamesFirstOne(const BMenuItem *, const BMenuItem *); - static int CompareOne(const BMenuItem *, const BMenuItem *); + static int CompareFolderNamesFirstOne(const BMenuItem*, const BMenuItem*); + static int CompareOne(const BMenuItem*, const BMenuItem*); - static ModelMenuItem *NewModelItem(Model *, const BMessage *, const BMessenger &, - bool suppressFolderHierarchy=false, BContainerWindow * = NULL, - const BObjectList *typeslist = NULL, - TrackingHookData *hook = NULL); + static ModelMenuItem* NewModelItem(Model*, const BMessage*, + const BMessenger&, bool suppressFolderHierarchy = false, + BContainerWindow* = NULL, const BObjectList* typeslist = NULL, + TrackingHookData* hook = NULL); - TrackingHookData *InitTrackingHook(bool (*hookfunction)(BMenu *, void *), - const BMessenger *target, const BMessage *dragMessage); + TrackingHookData* InitTrackingHook(bool (*hookfunction)(BMenu*, void*), + const BMessenger* target, const BMessage* dragMessage); - protected: - virtual bool StartBuildingItemList(); - virtual bool AddNextItem(); - virtual void DoneBuildingItemList(); - virtual void ClearMenuBuildingState(); +protected: + virtual bool StartBuildingItemList(); + virtual bool AddNextItem(); + virtual void DoneBuildingItemList(); + virtual void ClearMenuBuildingState(); - void BuildVolumeMenu(); + void BuildVolumeMenu(); - void AddOneItem(Model *); - void AddRootItemsIfNeeded(); - void AddTrashItem(); - static void SetTrackingHookDeep(BMenu *, bool (*)(BMenu *, void *), void *); + void AddOneItem(Model*); + void AddRootItemsIfNeeded(); + void AddTrashItem(); + static void SetTrackingHookDeep(BMenu*, bool (*)(BMenu*, void*), void*); - entry_ref fNavDir; - BMessage fMessage; - BMessenger fMessenger; - BWindow *fParentWindow; + entry_ref fNavDir; + BMessage fMessage; + BMessenger fMessenger; + BWindow* fParentWindow; - // menu building state - uint8 fFlags; - BObjectList *fItemList; - EntryListBase *fContainer; - bool fIteratingDesktop; + // menu building state + uint8 fFlags; + BObjectList* fItemList; + EntryListBase* fContainer; + bool fIteratingDesktop; - BObjectList *fTypesList; + BObjectList* fTypesList; - TrackingHookData fTrackingHook; + TrackingHookData fTrackingHook; }; // Spring Loaded Folder convenience routines @@ -165,4 +166,5 @@ _IMPEXP_TRACKER void SpringLoadedFolderCacheDragData(const BMessage *incoming, using namespace BPrivate; + #endif // NAV_MENU_H