#ifndef DEFS_H
#define DEFS_H

#include <QtGlobal>

#if QT_VERSION >= 0x050000
#include <qwebkitglobal.h>
#else
#include <qwebkitversion.h>
#endif

#define CMAKE_VERSION       "@CMAKE_VERSION@"
#define CMAKE_SYSTEM        "@CMAKE_SYSTEM@"

#define APP_NAME            "@APP_NAME@"
#define APP_LOW_NAME        "@APP_LOW_NAME@"
#define APP_LOW_H_NAME      ".@APP_LOW_NAME@"
#define APP_LONG_NAME       "@APP_NAME@ @APP_VERSION@"
#define APP_AUTHOR          "@APP_AUTHOR@"
#define APP_EMAIL           "@APP_EMAIL@"
#define APP_URL             "@APP_URL@"
#define APP_VERSION         "@APP_VERSION@"
#define APP_USERAGENT       QString("@APP_NAME@/@APP_VERSION@ (@APP_URL@) on @CMAKE_SYSTEM@; Webkit/") + qWebKitVersion()

#define TEXT_TITLE_LIMIT    30
#define MAX_ZOOM_FACTOR     10.0
#define ICON_SIZE_SETTINGS  16
#define DATABASE_DRIVER     "QSQLITE"
#define NO_PARENT_FEED      -1
#define NO_PARENT_CATEGORY  -1

#define APP_DB_INIT_FILE    "db_init.sql"
#define APP_DB_INIT_SPLIT   "-- !\n"
#define APP_DB_PATH         "data/database/local"
#define APP_DB_FILE         "database.db"
#define APP_DB_WEB_PATH     "data/database/web"

#define APP_CFG_PATH        "data/config"
#define APP_CFG_FILE        "config.ini"
#define APP_CFG_GUI         "gui"
#define APP_CFG_GEN         "main"
#define APP_CFG_PROXY       "proxy"
#define APP_CFG_CUTS        "keyboard"
#define APP_CFG_BROWSER     "browser"
#define APP_CFG_MESSAGES    "messages"
#define APP_CFG_FEEDS       "feeds"

#define APP_PREFIX          "@CMAKE_INSTALL_PREFIX@"
#define APP_REVISION        "@APP_REVISION@"

#define APP_IS_RUNNING      "app_is_running"
#define APP_SKIN_DEFAULT    "base/vergilius.xml"
#define APP_THEME_DEFAULT   "mini-kfaenza"
#define APP_NO_THEME        "-"
#define APP_THEME_SUFFIX    ".png"

// Indexes of columns as they are DEFINED IN THE TABLE for MESSAGES.
#define MSG_DB_ID_INDEX           0
#define MSG_DB_READ_INDEX         1
#define MSG_DB_DELETED_INDEX      2
#define MSG_DB_IMPORTANT_INDEX    3
#define MSG_DB_FEED_INDEX         4
#define MSG_DB_TITLE_INDEX        5
#define MSG_DB_URL_INDEX          6
#define MSG_DB_AUTHOR_INDEX       7
#define MSG_DB_DCREATED_INDEX     8
#define MSG_DB_DUPDATED_INDEX     9
#define MSG_DB_CONTENTS_INDEX     10

// Indexes of columns as they are DEFINED IN THE TABLE for CATEGORIES.
#define CAT_DB_ID_INDEX           0
#define CAT_DB_PARENT_ID_INDEX    1
#define CAT_DB_TITLE_INDEX        2
#define CAT_DB_DESCRIPTION_INDEX  3
#define CAT_DB_DCREATED_INDEX     4
#define CAT_DB_ICON_INDEX         5
#define CAT_DB_TYPE_INDEX         6

// Indexes of columns as they are DEFINED IN THE TABLE for FEEDS.
#define FDS_DB_ID_INDEX           0
#define FDS_DB_TITLE_INDEX        1
#define FDS_DB_DESCRIPTION_INDEX  2
#define FDS_DB_DCREATED_INDEX     3
#define FDS_DB_ICON_INDEX         4
#define FDS_DB_CATEGORY_INDEX     5
#define FDS_DB_ENCODING_INDEX     6
#define FDS_DB_URL_INDEX          7
#define FDS_DB_LANGUAGE_INDEX     8
#define FDS_DB_TYPE_INDEX         9

// Indexes of columns for feed models.
#define FDS_MODEL_TITLE_INDEX           0
#define FDS_MODEL_COUNTS_INDEX          1

#if defined(Q_OS_LINUX)
#define APP_DESKTOP_ENTRY_PATH "@DESKTOP_ENTRY_PATH@"
#define APP_DESKTOP_ENTRY_FILE "@APP_LOW_NAME@.desktop"
#define APP_LANG_PATH APP_PREFIX + QString("/share/rssguard/l10n")
#define APP_SKIN_PATH APP_PREFIX + QString("/share/rssguard/skins")
#define APP_INFO_PATH APP_PREFIX + QString("/share/rssguard/information")
#define APP_THEME_PATH APP_PREFIX + QString("/share/rssguard/icons")
#define APP_MISC_PATH APP_PREFIX + QString("/share/rssguard/misc")
#define APP_HTML_PATH APP_PREFIX + QString("/share/rssguard/html")
#define APP_FLAGS_PATH APP_PREFIX + QString("/share/rssguard/flags")
#define APP_ICON_PATH APP_PREFIX + QString("/share/icons/hicolor/128x128/apps/@APP_LOW_NAME@.png")
#define APP_ICON_PLAIN_PATH APP_PREFIX + QString("/share/icons/hicolor/128x128/apps/@APP_LOW_NAME@_plain.png")
#elif defined(Q_OS_WIN) || defined(Q_OS_OS2)
#define APP_LANG_PATH QApplication::applicationDirPath() + QString("/l10n")
#define APP_SKIN_PATH QApplication::applicationDirPath() + QString("/skins")
#define APP_INFO_PATH QApplication::applicationDirPath()
#define APP_THEME_PATH QApplication::applicationDirPath() + QString("/icons")
#define APP_MISC_PATH QApplication::applicationDirPath() + QString("/misc")
#define APP_HTML_PATH QApplication::applicationDirPath() + QString("/html")
#define APP_FLAGS_PATH QApplication::applicationDirPath() + QString("/flags")
#define APP_ICON_PATH QApplication::applicationDirPath() + QString("/@APP_LOW_NAME@.png")
#define APP_ICON_PLAIN_PATH QApplication::applicationDirPath() + QString("/@APP_LOW_NAME@_plain.png")
#endif

#endif // DEFS_H
