HaikuDepot: notify work status from main window
[haiku.git] / src / apps / text_search / InitialIterator.h
blobce67f5dc66bb095c7d7624a057b5c2e8a7b53921
1 /*
2 * Copyright (c) 2008 Stephan Aßmus <superstippi@gmx.de>
3 * Copyright (c) 1998-2007 Matthijs Hollemans
4 * All rights reserved. Distributed under the terms of the MIT License.
5 */
6 #ifndef INITIAL_ITERATOR_H
7 #define INITIAL_ITERATOR_H
9 #include <List.h>
10 #include <Message.h>
12 #include "FileIterator.h"
14 class BEntry;
15 class BDirectory;
16 class Model;
18 // TODO: split into Folder and MessageFileIterator (_GetTopEntry)
19 // This code either has an original folder to start iterating from,
20 // or it uses the refs in the message that contains the selected poses
21 // from the Tracker window that invoked us. But I think if folders are
22 // among those poses, it will then use the same code for examining sub
23 // folders.
25 // Provides an interface to retrieve the next file that should be grepped
26 // for the search string.
27 class InitialIterator : public FileIterator {
28 public:
29 InitialIterator(const Model* model);
30 virtual ~InitialIterator();
32 virtual bool IsValid() const;
33 virtual bool GetNextName(char* buffer);
34 virtual bool NotifyNegatives() const;
36 // Looks for the next entry in the top-level dir.
37 bool GetTopEntry(BEntry& entry);
39 // Should this subfolder be followed?
40 bool FollowSubdir(BEntry& entry) const;
42 private:
43 // Looks for the next entry.
44 bool _GetNextEntry(BEntry& entry);
46 // Looks for the next entry in a subdir.
47 bool _GetSubEntry(BEntry& entry);
49 // Determines whether we can add a subdir.
50 void _ExamineSubdir(BEntry& entry);
52 private:
53 // Contains pointers to BDirectory objects.
54 BList fDirectories;
56 // The directory we are currently looking at.
57 BDirectory* fCurrentDir;
59 // The ref number we are currently looking at.
60 int32 fCurrentRef;
62 // The current settings
63 BMessage fSelectedFiles;
65 bool fRecurseDirs : 1;
66 bool fRecurseLinks : 1;
67 bool fSkipDotDirs : 1;
68 bool fTextOnly : 1;
71 #endif // INITIAL_ITERATOR_H