1/* 2 * Copyright 2013, Stephan A��mus <superstippi@gmx.de>. 3 * Copyright 2019-2020, Andrew Lindesay <apl@lindesay.co.nz>. 4 * All rights reserved. Distributed under the terms of the MIT License. 5 */ 6#ifndef FILTER_VIEW_H 7#define FILTER_VIEW_H 8 9#include <GroupView.h> 10 11 12class BCheckBox; 13class BMenu; 14class BMenuField; 15class BMenuItem; 16class BTextControl; 17class Model; 18 19 20enum { 21 MSG_CATEGORY_SELECTED = 'ctsl', 22 MSG_DEPOT_SELECTED = 'dpsl', 23 MSG_SEARCH_TERMS_MODIFIED = 'stmd', 24}; 25 26 27class FilterView : public BGroupView { 28public: 29 FilterView(); 30 virtual ~FilterView(); 31 32 virtual void AttachedToWindow(); 33 virtual void MessageReceived(BMessage* message); 34 35 void AdoptModel(Model& model); 36 37private: 38 static void _AddCategoriesToMenu(Model& model, BMenu* menu); 39 static bool _SelectCategoryCode(BMenu* menu, 40 const BString& code); 41 static bool _MatchesCategoryCode(BMenuItem* item, 42 const BString& code); 43 44private: 45 BMenuField* fShowField; 46 BTextControl* fSearchTermsText; 47}; 48 49#endif // FILTER_VIEW_H 50