/
imediabrowser.h
57 lines (48 loc) · 1.22 KB
/
imediabrowser.h
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
51
52
53
54
55
56
57
#pragma once
#include "imodule.h"
#include <string>
namespace ui
{
/**
* Interface to the MediaBrowser, which is displaying the
* available materials, accessible as a page in the
* GroupDialog's notebook.
*/
class IMediaBrowser :
public RegisterableModule
{
public:
virtual ~IMediaBrowser()
{}
/**
* Returns the texture name of the currently selected item.
* Will return an empty string if a folder is selected or
* nothing is selected at all.
*/
virtual std::string getSelection() = 0;
/** Set the given path as the current selection, highlighting it
* in the tree view.
*
* @param selection
* The fullname of the item to select, or the empty string if there
* should be no selection.
*/
virtual void setSelection(const std::string& selection) = 0;
// The tab name as registred in the GroupDialog
const char* const getGroupDialogTabName() const
{
return "mediabrowser";
}
};
}
const char* const MODULE_MEDIABROWSER = "MediaBrowser";
inline ui::IMediaBrowser& GlobalMediaBrowser()
{
// Cache the reference locally
static ui::IMediaBrowser& _mediaBrowser(
*std::static_pointer_cast<ui::IMediaBrowser>(
module::GlobalModuleRegistry().getModule(MODULE_MEDIABROWSER)
)
);
return _mediaBrowser;
}