~ubuntu-branches/ubuntu/wily/kbibtex/wily

« back to all changes in this revision

Viewing changes to src/kbibtexnamespace.h

  • Committer: Package Import Robot
  • Author(s): Michael Hanke
  • Date: 2011-07-18 09:29:48 UTC
  • mfrom: (1.1.6) (2.1.5 sid)
  • Revision ID: package-import@ubuntu.com-20110718092948-ksxjmg7kdfamolmg
Tags: 0.3-1
* First upstream release for KDE4 (Closes: #634255). A number of search
  engines are still missing, in comparison to the 0.2 series.
* Bumped Standards-Version to 3.9.2, no changes necessary.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
*   Copyright (C) 2004-2010 by Thomas Fischer                             *
 
3
*   fischer@unix-ag.uni-kl.de                                             *
 
4
*                                                                         *
 
5
*   This program is free software; you can redistribute it and/or modify  *
 
6
*   it under the terms of the GNU General Public License as published by  *
 
7
*   the Free Software Foundation; either version 2 of the License, or     *
 
8
*   (at your option) any later version.                                   *
 
9
*                                                                         *
 
10
*   This program is distributed in the hope that it will be useful,       *
 
11
*   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 
12
*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 
13
*   GNU General Public License for more details.                          *
 
14
*                                                                         *
 
15
*   You should have received a copy of the GNU General Public License     *
 
16
*   along with this program; if not, write to the                         *
 
17
*   Free Software Foundation, Inc.,                                       *
 
18
*   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 
19
***************************************************************************/
 
20
#ifndef KBIBTEX_NAMESPACE_H
 
21
#define KBIBTEX_NAMESPACE_H
 
22
 
 
23
#include <QVariant>
 
24
 
 
25
namespace KBibTeX
 
26
{
 
27
 
 
28
enum Casing {
 
29
    cLowerCase,
 
30
    cInitialCapital,
 
31
    cUpperCamelCase,
 
32
    cLowerCamelCase,
 
33
    cUpperCase
 
34
};
 
35
 
 
36
enum FieldInputType {
 
37
    SingleLine = 1,
 
38
    MultiLine = 2,
 
39
    List = 3,
 
40
    URL = 4,
 
41
    Month = 5,
 
42
    Color = 6,
 
43
    PersonList = 7,
 
44
    UrlList = 8
 
45
};
 
46
 
 
47
enum TypeFlag {
 
48
    tfPlainText = 0x1,
 
49
    tfReference = 0x2,
 
50
    tfPerson = 0x4,
 
51
    tfKeyword = 0x8,
 
52
    tfVerbatim = 0x10,
 
53
    tfSource = 0x100
 
54
};
 
55
Q_DECLARE_FLAGS(TypeFlags, TypeFlag)
 
56
 
 
57
Q_DECLARE_OPERATORS_FOR_FLAGS(TypeFlags)
 
58
 
 
59
static const QString MonthsTriple[] = {
 
60
    QLatin1String("jan"), QLatin1String("feb"), QLatin1String("mar"), QLatin1String("apr"), QLatin1String("may"), QLatin1String("jun"), QLatin1String("jul"), QLatin1String("aug"), QLatin1String("sep"), QLatin1String("oct"), QLatin1String("nov"), QLatin1String("dec")
 
61
};
 
62
 
 
63
static const QRegExp fileListSeparatorRegExp("[ \\t]*[;\\n][ \\t]*");
 
64
static const QRegExp fileRegExp("(\\bfile:)?[^{}\\t]+\\.\\w{2,4}\\b", Qt::CaseInsensitive);
 
65
static const QRegExp urlRegExp("\\b(http|s?ftp|webdav|file)s?://[^ {}\"]+\\b", Qt::CaseInsensitive);
 
66
static const QRegExp doiRegExp("\\b10\\.\\d{4}/[-a-z0-9.()_:\\\\]+", Qt::CaseInsensitive);
 
67
static const QString doiUrlPrefix = QLatin1String("http://dx.doi.org/");
 
68
static const QRegExp domainNameRegExp("[a-z0-9.-]+\\.((a[cdefgilmnoqrstuwxz]|aero|arpa)|(b[abdefghijmnorstvwyz]|biz)|(c[acdfghiklmnorsuvxyz]|cat|com|coop)|d[ejkmoz]|(e[ceghrstu]|edu)|f[ijkmor]|(g[abdefghilmnpqrstuwy]|gov)|h[kmnrtu]|(i[delmnoqrst]|info|int)|(j[emop]|jobs)|k[eghimnprwyz]|l[abcikrstuvy]|(m[acdghklmnopqrstuvwxyz]|me|mil|mobi|museum)|(n[acefgilopruz]|name|net)|(om|org)|(p[aefghklmnrstwy]|pro)|qa|r[eouw]|s[abcdeghijklmnortvyz]|(t[cdfghjklmnoprtvwz]|travel)|u[agkmsyz]|v[aceginu]|w[fs]|y[etu]|z[amw])", Qt::CaseInsensitive);
 
69
 
 
70
}
 
71
 
 
72
#endif // KBIBTEX_NAMESPACE_H