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 _RECENT_ITEMS_LIST_H
35 #define _RECENT_ITEMS_LIST_H
38 // BRecentItemsList classes allow creating an entire menu with
39 // recent files, folders, apps. If the user wishes to add items to
40 // their own menu, they can instead use the GetNextMenuItem call to
41 // get one menu at a time to add it to their app.
53 class BRecentItemsList
{
55 BRecentItemsList(int32 maxItems
, bool navMenuFolders
);
56 // if <navMenuFolders> passed, folder items get NavMenu-style
57 // subdirectories attached to them
59 virtual ~BRecentItemsList() {}
61 virtual void Rewind();
62 // resets the iteration
64 virtual BMenuItem
* GetNextMenuItem(const BMessage
* fileOpenMessage
= NULL
,
65 const BMessage
* containerOpenMessage
= NULL
,
66 BHandler
* target
= NULL
, entry_ref
* currentItemRef
= NULL
);
67 // if <fileOpenMessage> specified, the item for a file gets a copy
68 // with the item ref attached as "refs", otherwise a default
69 // B_REFS_RECEIVED message message gets attached
70 // if <containerOpenMessage> specified, the item for a folder, volume
71 // or query gets a copy with the item ref attached as "refs",
72 // otherwise a default B_REFS_RECEIVED message message gets attached
73 // if <currentItemRef> gets passed, the caller gets to look at the
74 // entry_ref corresponding to the item
76 virtual status_t
GetNextRef(entry_ref
*);
100 class BRecentFilesList
: public BRecentItemsList
{
102 // use one of the two constructors to set up next item iteration
103 BRecentFilesList(int32 maxItems
= 10, bool navMenuFolders
= false,
104 const char* ofType
= NULL
, const char* openedByAppSig
= NULL
);
105 BRecentFilesList(int32 maxItems
, bool navMenuFolders
,
106 const char* ofTypeList
[], int32 ofTypeListCount
,
107 const char* openedByAppSig
= NULL
);
108 virtual ~BRecentFilesList();
110 // use one of the two NewFileListMenu calls to get an entire menu
111 static BMenu
* NewFileListMenu(const char* title
,
112 BMessage
* openFileMessage
= NULL
, BMessage
* openFolderMessage
= NULL
,
113 BHandler
* target
= NULL
,
114 int32 maxItems
= 10, bool navMenuFolders
= false,
115 const char* ofType
= NULL
, const char* openedByAppSig
= NULL
);
117 static BMenu
* NewFileListMenu(const char* title
,
118 BMessage
* openFileMessage
, BMessage
* openFolderMessage
,
120 int32 maxItems
, bool navMenuFolders
,
121 const char* ofTypeList
[], int32 ofTypeListCount
,
122 const char* openedByAppSig
);
124 virtual status_t
GetNextRef(entry_ref
*);
142 virtual void _r110();
144 uint32 _reserved
[20];
148 class BRecentFoldersList
: public BRecentItemsList
{
150 // use the constructor to set up next item iteration
151 BRecentFoldersList(int32 maxItems
, bool navMenuFolders
= false,
152 const char* openedByAppSig
= NULL
);
154 // use NewFolderListMenu to get an entire menu
155 static BMenu
* NewFolderListMenu(const char* title
,
156 BMessage
* openMessage
= NULL
, BHandler
* target
= NULL
,
157 int32 maxItems
= 10, bool navMenuFolders
= false,
158 const char* openedByAppSig
= NULL
);
160 virtual status_t
GetNextRef(entry_ref
*);
175 virtual void _r210();
177 uint32 _reserved
[20];
181 class BRecentAppsList
: public BRecentItemsList
{
183 // use the constructor to set up next item iteration
184 BRecentAppsList(int32 maxItems
);
186 // use NewFolderListMenu to get an entire menu
187 static BMenu
* NewAppListMenu(const char* title
,
188 BMessage
* openMessage
= NULL
, BHandler
* target
= NULL
,
189 int32 maxItems
= 10);
191 virtual status_t
GetNextRef(entry_ref
*);
203 virtual void _r310();
205 uint32 _reserved
[20];
209 #endif // _RECENT_ITEMS_LIST_H