Wt examples  3.3.0
FileItem.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 bvba, Kessel-Lo, Belgium.
4  *
5  * See the LICENSE file for terms of use.
6  */
7 
8 #ifndef EXAMPLE_ITEM_H
9 #define EXAMPLE_ITEM_H
10 
11 #include <string.h>
12 
13 #include "Wt/WStandardItem"
14 #include "Wt/WStandardItemModel"
15 #include "Wt/WString"
16 
17 #include <boost/filesystem/operations.hpp>
18 #include <boost/filesystem/exception.hpp>
19 
29 {
30 public:
31  static const int ContentsRole = Wt::UserRole;
32  static const int FilePathRole = Wt::UserRole + 1;
33  static const int FileNameRole = Wt::UserRole + 2;
34 
35  FileItem(const std::string& iconUri, const Wt::WString& text,
36  const std::string& fileName)
37  : WStandardItem(iconUri, text)
38  {
39  setData(fileName, FileNameRole);
40  setData(fileName, FilePathRole);
41  }
42 };
43 
44 #endif // FILE_ITEM_H

Generated on Fri May 31 2013 for the C++ Web Toolkit (Wt) by doxygen 1.8.3.1