File: DefinitionView.h

package info (click to toggle)
darkradiant 3.9.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 41,080 kB
  • sloc: cpp: 264,743; ansic: 10,659; python: 1,852; xml: 1,650; sh: 92; makefile: 21
file content (50 lines) | stat: -rw-r--r-- 970 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#pragma once

#include <string>
#include <wx/panel.h>
#include "wxutil/dialog/DialogBase.h"

class wxStaticText;

namespace wxutil
{

class SourceViewCtrl;

class DefinitionView :
	public DialogBase
{
private:
	wxStaticText* _declName;
	wxStaticText* _filename;

	wxPanel* _panel;

	// Will be created by subclasses
	SourceViewCtrl* _view;

public:
	DefinitionView(const std::string& title, wxWindow* parent = nullptr);

	int ShowModal() override;

protected:
	void update();

	// Whether there is anything to show. If false, the view will be disabled.
	virtual bool isEmpty() const = 0;

	// Get the name of the declaration
	virtual std::string getDeclName() = 0;

	// Get the file name the declaration is defined in
	virtual std::string getDeclFileName() = 0;

	// Provide the definition without the name and the outermost curly braces
	virtual std::string getDefinition() = 0;

	wxWindow* getMainPanel();
	void setSourceView(SourceViewCtrl* view);
};

} // namespace