1/*
2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Copyright 2013, Rene Gollent, rene@gollent.com.
4 * Distributed under the terms of the MIT License.
5 */
6#ifndef IMAGE_FUNCTIONS_VIEW_H
7#define IMAGE_FUNCTIONS_VIEW_H
8
9#include <GroupView.h>
10
11#include "table/TreeTable.h"
12#include "Team.h"
13
14
15class BTextControl;
16class FunctionInstance;
17
18
19class ImageFunctionsView : public BGroupView, private TreeTableListener {
20public:
21	class Listener;
22
23public:
24								ImageFunctionsView(Listener* listener);
25								~ImageFunctionsView();
26
27	static	ImageFunctionsView*	Create(Listener* listener);
28									// throws
29
30			void				UnsetListener();
31
32			void				SetImageDebugInfo(
33									ImageDebugInfo* imageDebugInfo);
34			void				SetFunction(FunctionInstance* function);
35	virtual	void				AttachedToWindow();
36	virtual	void				MessageReceived(BMessage* message);
37
38			void				LoadSettings(const BMessage& settings);
39			status_t			SaveSettings(BMessage& settings);
40
41private:
42			class FunctionsTableModel;
43			class HighlightingTableColumn;
44			class SourcePathComponentNode;
45
46private:
47	// TreeTableListener
48	virtual	void				TreeTableSelectionChanged(TreeTable* table);
49
50			void				_Init();
51
52			void				_ExpandFilteredNodes();
53
54private:
55			ImageDebugInfo*		fImageDebugInfo;
56			BTextControl*		fFilterField;
57			TreeTable*			fFunctionsTable;
58			FunctionsTableModel* fFunctionsTableModel;
59			Listener*			fListener;
60			HighlightingTableColumn* fHighlightingColumn;
61			bigtime_t			fLastFilterKeypress;
62};
63
64
65class ImageFunctionsView::Listener {
66public:
67	virtual						~Listener();
68
69	virtual	void				FunctionSelectionChanged(
70									FunctionInstance* function) = 0;
71};
72
73
74#endif	// IMAGE_FUNCTIONS_VIEW_H
75