summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/core/opimcontactfields.h
Unidiff
Diffstat (limited to 'libopie2/opiepim/core/opimcontactfields.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/core/opimcontactfields.h102
1 files changed, 102 insertions, 0 deletions
diff --git a/libopie2/opiepim/core/opimcontactfields.h b/libopie2/opiepim/core/opimcontactfields.h
new file mode 100644
index 0000000..3aa3894
--- a/dev/null
+++ b/libopie2/opiepim/core/opimcontactfields.h
@@ -0,0 +1,102 @@
1/*
2 This file is part of the Opie Project
3 Copyright (C) The Main Author <main-author@whereever.org>
4 =. Copyright (C) The Opie Team <opie-devel@handhelds.org>
5 .=l.
6 .>+-=
7 _;:, .> :=|. This program is free software; you can
8.> <`_, > . <= redistribute it and/or modify it under
9:`=1 )Y*s>-.-- : the terms of the GNU Library General Public
10.="- .-=="i, .._ License as published by the Free Software
11 - . .-<_> .<> Foundation; either version 2 of the License,
12 ._= =} : or (at your option) any later version.
13 .%`+i> _;_.
14 .i_,=:_. -<s. This program is distributed in the hope that
15 + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
16 : .. .:, . . . without even the implied warranty of
17 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
18 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
19..}^=.= = ; Library General Public License for more
20++= -. .` .: details.
21 : = ...= . :.=-
22 -. .:....=;==+<; You should have received a copy of the GNU
23 -_. . . )=. = Library General Public License along with
24 -- :-=` this library; see the file COPYING.LIB.
25 If not, write to the Free Software Foundation,
26 Inc., 59 Temple Place - Suite 330,
27 Boston, MA 02111-1307, USA.
28*/
29
30#ifndef OCONTACTFIELDS_H
31#define OCONTACTFIELDS_H
32
33class QStringList;
34
35/* OPIE */
36#include <opie2/opimcontact.h>
37
38/* QT */
39#include <qmap.h>
40#include <qstring.h>
41
42#define CONTACT_FIELD_ORDER_NAME "opie-contactfield-order"
43#define DEFAULT_FIELD_ORDER "__________"
44
45namespace Opie
46{
47class OPimContactFields
48{
49
50 public:
51 OPimContactFields();
52 ~OPimContactFields();
53 /** Set the index for combo boxes.
54 * Sets the <b>index</b> of combo <b>num</b>.
55 * @param num selects the number of the combo
56 * @param index sets the index in the combo
57 */
58 void setFieldOrder( int num, int index );
59
60 /** Get the index for combo boxes.
61 * Returns the index of combo <b>num</b> or defindex
62 * if none was defined..
63 * @param num Selects the number of the combo
64 * @param defIndex will be returned if none was defined (either
65 * globally in the config file, nor by the contact which was used
66 * by loadFromRecord() )
67 */
68 int getFieldOrder( int num, int defIndex );
69
70 /** Store fieldorder to contact. */
71 void saveToRecord( OPimContact& );
72 /** Get Fieldorder from contact. */
73 void loadFromRecord( const OPimContact& );
74
75 private:
76 QString fieldOrder;
77 QString globalFieldOrder;
78 bool changedFieldOrder;
79
80 public:
81 static QStringList personalfields( bool sorted = true, bool translated = false );
82 static QStringList phonefields( bool sorted = true, bool translated = false );
83 static QStringList detailsfields( bool sorted = true, bool translated = false );
84 static QStringList fields( bool sorted = true, bool translated = false );
85
86 static QStringList trpersonalfields( bool sorted = true );
87 static QStringList untrpersonalfields( bool sorted = true );
88 static QStringList trphonefields( bool sorted = true );
89 static QStringList untrphonefields( bool sorted = true );
90 static QStringList trdetailsfields( bool sorted = true );
91 static QStringList untrdetailsfields( bool sorted = true );
92 static QStringList trfields( bool sorted = true );
93 static QStringList untrfields( bool sorted = true );
94
95 static QMap<int, QString> idToTrFields();
96 static QMap<QString, int> trFieldsToId();
97 static QMap<int, QString> idToUntrFields();
98 static QMap<QString, int> untrFieldsToId();
99
100};
101}
102#endif