1
/***************************************************************************
2
* Copyright (C) 2004-2006 by Thomas Fischer *
3
* fischer@unix-ag.uni-kl.de *
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. *
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. *
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
***************************************************************************/
23
#include <qvaluelist.h>
29
class ValueTextInterface
32
ValueTextInterface( const ValueTextInterface* other );
33
ValueTextInterface( const QString& text );
34
virtual ~ValueTextInterface() {};
36
virtual void setText( const QString& text );
37
virtual QString text() const;
38
QString simplifiedText() const;
39
virtual void replace( const QString &before, const QString &after );
40
virtual bool containsPattern( const QString &pattern, bool caseSensitive );
46
class ValueItem: public ValueTextInterface
49
ValueItem( const QString& text );
51
virtual ValueItem *clone()
57
class Keyword: public ValueTextInterface
60
Keyword( Keyword *other );
61
Keyword( const QString& text );
66
class KeywordContainer: public ValueItem
70
KeywordContainer( const QString& text );
71
KeywordContainer( KeywordContainer *other );
72
KeywordContainer( const QStringList& list );
75
void setList( const QStringList& list );
76
void append( const QString& text );
77
void remove( const QString& text );
78
void setText( const QString& text );
80
void replace( const QString &before, const QString &after );
82
QValueList<Keyword*> keywords;
85
class Person: public ValueTextInterface
88
Person( const QString& text, bool firstNameFirst = FALSE );
89
Person( const QString& firstName, const QString& lastName, bool firstNameFirst = FALSE );
92
void setText( const QString& text );
94
QString text( bool firstNameFirst ) const;
102
bool m_firstNameFirst;
104
bool splitName( const QString& text, QStringList& segments );
107
class PersonContainer: public ValueItem
110
PersonContainer( bool firstNameFirst = FALSE );
111
PersonContainer( const QString& text, bool firstNameFirst = FALSE );
114
void setText( const QString& text );
115
QString text() const;
116
void replace( const QString &before, const QString &after );
118
QValueList<Person*> persons;
121
bool m_firstNameFirst;
124
class MacroKey: public ValueItem
128
bool isValidInternal();
131
MacroKey( const QString& text );
135
void setText( const QString& text );
139
class PlainText: public ValueItem
142
PlainText( const QString& text );
147
class Value: public ValueTextInterface
151
Value( const Value *other );
152
Value( const QString& text, bool isMacroKey = false );
154
void setText( const QString& text );
155
QString text() const;
156
void replace( const QString &before, const QString &after );
158
QValueList<ValueItem*> items;