/* * This file is a part of Winix * and is not publicly distributed * * Copyright (c) 2008-2010, Tomasz Sowa * All rights reserved. * */ #ifndef headerfilecmslucoreitem #define headerfilecmslucoreitem #include #define WINIX_ITEM_FILETYPE_NONE 0 #define WINIX_ITEM_FILETYPE_IMAGE 1 #define WINIX_ITEM_FILETYPE_DOCUMENT 2 #define WINIX_ITEM_FILETYPE_UNKNOWN 3 struct Item { long id; long parent_id; long user_id; long group_id; std::wstring guest_name; // used as a user name when user_id is equal -1 long modification_user_id; // who has modified the item last (not taken into account when checking permissions) int privileges; tm date_creation; tm date_modification; std::wstring subject; std::wstring content; long content_id; // used by the database std::wstring url; enum ContentType { ct_text = 0, ct_formatted_text, ct_html, ct_bbcode, ct_raw }; ContentType content_type; enum Type { dir = 0, file = 1, none = 1000 // !! pozbyc sie tego }; Type type; long default_item; // static file (if exists) std::wstring file_path; // relative file path int file_fs; // file system type where the file was saved int file_type; // file type (none, image, doc, etc) bool has_thumb; std::wstring html_template; // methods Item(); void SetDateToNow(); void SetDateModifyToNow(); void Clear(); }; #endif