Wt examples  3.7.1
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>
12 #include <Wt/WModelIndex>
13 #include <Wt/WMemoryResource>
14 
19 
27 {
28 public:
35  SourceView(int fileNameRole, int contentRole, int filePathRole);
36 
39  virtual ~SourceView();
40 
46  bool setIndex(const Wt::WModelIndex& index);
47 
53  virtual Wt::WWidget *renderView();
54 
55 private:
58 
63 
65 
66 private:
67  std::string imageExtension(const std::string& fileName);
68 };
69 
72 #endif //SOURCEVIEW_H
int contentRole_
Definition: SourceView.h:61
int fileNameRole_
The role that is currently displayed.
Definition: SourceView.h:60
SourceView(int fileNameRole, int contentRole, int filePathRole)
Constructor.
Definition: SourceView.C:20
int filePathRole_
Definition: SourceView.h:62
std::string imageExtension(const std::string &fileName)
Definition: SourceView.C:204
View class for source code.
Definition: SourceView.h:26
Wt::WMemoryResource * imageResource_
Definition: SourceView.h:64
bool setIndex(const Wt::WModelIndex &index)
Sets the model index.
Definition: SourceView.C:30
virtual Wt::WWidget * renderView()
Returns the widget that renders the view.
Definition: SourceView.C:95
Wt::WModelIndex index_
The index that is currently displayed.
Definition: SourceView.h:57
virtual ~SourceView()
Destructor.
Definition: SourceView.C:27

Generated on Tue Dec 15 2020 for the C++ Web Toolkit (Wt) by doxygen 1.8.13