6 Copyright (c) 1991-2000, Be Incorporated. All rights reserved.
8 Permission is hereby granted, free of charge, to any person obtaining a copy of
9 this software and associated documentation files (the "Software"), to deal in
10 the Software without restriction, including without limitation the rights to
11 use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
12 of the Software, and to permit persons to whom the Software is furnished to do
13 so, subject to the following conditions:
15 The above copyright notice and this permission notice applies to all licensees
16 and shall be included in all copies or substantial portions of the Software.
18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY,
20 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21 BE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
22 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION
23 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 Except as contained in this notice, the name of Be Incorporated shall not be
26 used in advertising or otherwise to promote the sale, use or other dealings in
27 this Software without prior written authorization from Be Incorporated.
29 Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
30 of Be Incorporated in the United States and other countries. Other brand product
31 names are registered trademarks or trademarks of their respective holders.
34 #ifndef _FAVORITES_MENU_H
35 #define _FAVORITES_MENU_H
40 #include <ObjectList.h>
51 #define kGoDirectory "Tracker/Go"
54 class FavoritesMenu
: public BSlowMenu
{
55 // FavoritesMenu is used in the FilePanel -
56 // displays recent files, recent folders and favorites items
58 FavoritesMenu(const char* title
, BMessage
* openFolderMessage
,
59 BMessage
* openFileMessage
, const BMessenger
&,
60 bool isSavePanel
, BRefFilter
* filter
= NULL
);
61 virtual ~FavoritesMenu();
63 void SetRefFilter(BRefFilter
* filter
);
66 // override the necessary SlowMenu hooks
67 virtual bool StartBuildingItemList();
68 virtual bool AddNextItem();
69 virtual void DoneBuildingItemList();
70 virtual void ClearMenuBuildingState();
72 bool ShouldShowModel(const Model
* model
);
74 BMessage
* fOpenFolderMessage
;
75 BMessage
* fOpenFileMessage
;
89 int32 fSectionItemCount
;
90 bool fAddedSeparatorForSection
;
91 // keeps track whether a separator will be needed before the
95 EntryListBase
* fContainer
;
96 BObjectList
<BMenuItem
>* fItemList
;
97 int32 fInitialItemCount
;
98 std::vector
<entry_ref
> fUniqueRefCheck
;
100 BRefFilter
* fRefFilter
;
102 typedef BSlowMenu _inherited
;
107 kRecentDocuments
= 0,
108 kRecentApplications
= 1,
113 class RecentsMenu
: public BNavMenu
{
115 RecentsMenu(const char* name
, int32 which
, uint32 what
,
118 void DetachedFromWindow();
120 int32
RecentsCount();
123 virtual bool StartBuildingItemList();
124 virtual bool AddNextItem();
125 bool AddRecents(int32 count
);
126 virtual void DoneBuildingItemList();
127 virtual void ClearMenuBuildingState();
134 BMessage fRecentList
;
137 } // namespace BPrivate
139 using namespace BPrivate
;
142 #endif // _FAVORITES_MENU_H