Wt examples: /home/koen/project/wt/public-git/wt/examples/wt-homepage/FileItem.h Source File

Wt examples 3.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

/home/koen/project/wt/public-git/wt/examples/wt-homepage/FileItem.h
Go to the documentation of this file.

    00001 // This may look like C code, but it's really -*- C++ -*-
    00002 /*
    00003  * Copyright (C) 2009 Emweb bvba, Kessel-Lo, Belgium.
    00004  *
    00005  * See the LICENSE file for terms of use.
    00006  */
    00007
    00008 #ifndef EXAMPLE_ITEM_H
    00009 #define EXAMPLE_ITEM_H
    00010
    00011 #include <string.h>
    00012
    00013 #include "Wt/WStandardItem"
    00014 #include "Wt/WStandardItemModel"
    00015 #include "Wt/WString"
    00016
    00017 #include <boost/filesystem/operations.hpp>
    00018 #include <boost/filesystem/exception.hpp>
    00019
    00028 class FileItem : public Wt::WStandardItem
    00029 {
    00030 public:
    00031   static const int ContentsRole = Wt::UserRole;
    00032   static const int FilePathRole = Wt::UserRole + 1;
    00033   static const int FileNameRole = Wt::UserRole + 2;
    00034
    00035   FileItem(const std::string& iconUri, const Wt::WString& text,
    00036            const std::string& fileName)
    00037     : WStandardItem(iconUri, text)
    00038   {
    00039     setData(fileName, FileNameRole);
    00040     setData(fileName, FilePathRole);
    00041   }
    00042 };
    00043
    00044 #endif // FILE_ITEM_H