Wt examples
4.3.0
builddir
build
BUILD
wt-4.3.0
examples
wt-homepage
SourceView.h
Go to the documentation of this file.
1
// This may look like C code, but it's really -*- C++ -*-
2
/*
3
* Copyright (C) 2009 Emweb bv, Herent, Belgium
4
*
5
* See the LICENSE file for terms of use.
6
*/
7
8
#ifndef SOURCEVIEW_H
9
#define SOURCEVIEW_H
10
11
#include <Wt/WViewWidget.h>
12
#include <Wt/WModelIndex.h>
13
#include <Wt/WMemoryResource.h>
14
15
using namespace
Wt
;
16
21
28
class
SourceView
:
public
WViewWidget
29
{
30
public
:
37
SourceView
(
ItemDataRole
fileNameRole,
38
ItemDataRole
contentRole,
39
ItemDataRole
filePathRole);
40
43
virtual
~
SourceView
();
44
50
bool
setIndex(
const
WModelIndex
& index);
51
57
virtual
std::unique_ptr<WWidget> renderView();
58
59
private
:
61
WModelIndex
index_
;
62
64
Wt::ItemDataRole
fileNameRole_
;
65
Wt::ItemDataRole
contentRole_
;
66
Wt::ItemDataRole
filePathRole_
;
67
68
std::shared_ptr<WMemoryResource>
imageResource_
;
69
70
private
:
71
std::string imageExtension(
const
std::string& fileName);
72
};
73
76
#endif //SOURCEVIEW_H
Wt
SourceView
View class for source code.
Definition:
SourceView.h:28
SourceView::index_
WModelIndex index_
The index that is currently displayed.
Definition:
SourceView.h:61
Wt::ItemDataRole
SourceView::contentRole_
Wt::ItemDataRole contentRole_
Definition:
SourceView.h:65
Wt::WViewWidget
SourceView::filePathRole_
Wt::ItemDataRole filePathRole_
Definition:
SourceView.h:66
SourceView::imageResource_
std::shared_ptr< WMemoryResource > imageResource_
Definition:
SourceView.h:68
SourceView::fileNameRole_
Wt::ItemDataRole fileNameRole_
The role that is currently displayed.
Definition:
SourceView.h:64
Wt::WModelIndex
Generated on Thu Mar 26 2020 for
the C++ Web Toolkit (Wt)
by
1.8.17