summaryrefslogtreecommitdiffabout
path: root/kabc/vcard
authorzautrix <zautrix>2004-06-26 19:01:18 (UTC)
committer zautrix <zautrix>2004-06-26 19:01:18 (UTC)
commitb9aad1f15dc600e4dbe4c62d3fcced6363188ba3 (patch) (unidiff)
tree2c3d4004fb21c72cba65793859f9bcd8ffd3a49c /kabc/vcard
downloadkdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.zip
kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.gz
kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.bz2
Initial revision
Diffstat (limited to 'kabc/vcard') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/vcard/AdrParam.cpp126
-rw-r--r--kabc/vcard/AdrValue.cpp140
-rw-r--r--kabc/vcard/AgentParam.cpp103
-rw-r--r--kabc/vcard/AgentValue.cpp81
-rw-r--r--kabc/vcard/ClassValue.cpp120
-rw-r--r--kabc/vcard/ContentLine.cpp289
-rw-r--r--kabc/vcard/DateParam.cpp82
-rw-r--r--kabc/vcard/DateValue.cpp434
-rw-r--r--kabc/vcard/EmailParam.cpp116
-rw-r--r--kabc/vcard/Entity.cpp134
-rw-r--r--kabc/vcard/Enum.cpp482
-rw-r--r--kabc/vcard/FloatValue.cpp120
-rw-r--r--kabc/vcard/GeoValue.cpp100
-rw-r--r--kabc/vcard/ImageParam.cpp81
-rw-r--r--kabc/vcard/ImageValue.cpp81
-rw-r--r--kabc/vcard/ImgValue.cpp81
-rw-r--r--kabc/vcard/LangValue.cpp127
-rw-r--r--kabc/vcard/NValue.cpp128
-rw-r--r--kabc/vcard/OrgValue.cpp107
-rw-r--r--kabc/vcard/Param.cpp129
-rw-r--r--kabc/vcard/PhoneNumberValue.cpp81
-rw-r--r--kabc/vcard/README15
-rw-r--r--kabc/vcard/RToken.cpp88
-rw-r--r--kabc/vcard/SoundValue.cpp81
-rw-r--r--kabc/vcard/SourceParam.cpp112
-rw-r--r--kabc/vcard/TelParam.cpp81
-rw-r--r--kabc/vcard/TelValue.cpp81
-rw-r--r--kabc/vcard/TextBinParam.cpp81
-rw-r--r--kabc/vcard/TextBinValue.cpp104
-rw-r--r--kabc/vcard/TextListValue.cpp107
-rw-r--r--kabc/vcard/TextParam.cpp82
-rw-r--r--kabc/vcard/TextValue.cpp86
-rw-r--r--kabc/vcard/URIValue.cpp133
-rw-r--r--kabc/vcard/UTCValue.cpp110
-rw-r--r--kabc/vcard/VCardEntity.cpp119
-rw-r--r--kabc/vcard/VCardv.cpp282
-rw-r--r--kabc/vcard/Value.cpp82
-rw-r--r--kabc/vcard/include/VCard.h43
-rw-r--r--kabc/vcard/include/VCardAdrParam.h64
-rw-r--r--kabc/vcard/include/VCardAdrValue.h83
-rw-r--r--kabc/vcard/include/VCardAgentParam.h60
-rw-r--r--kabc/vcard/include/VCardAgentValue.h44
-rw-r--r--kabc/vcard/include/VCardClassValue.h56
-rw-r--r--kabc/vcard/include/VCardContentLine.h77
-rw-r--r--kabc/vcard/include/VCardDateParam.h44
-rw-r--r--kabc/vcard/include/VCardDateValue.h99
-rw-r--r--kabc/vcard/include/VCardDefines.h52
-rw-r--r--kabc/vcard/include/VCardEmailParam.h56
-rw-r--r--kabc/vcard/include/VCardEntity.h67
-rw-r--r--kabc/vcard/include/VCardEnum.h120
-rw-r--r--kabc/vcard/include/VCardFloatValue.h51
-rw-r--r--kabc/vcard/include/VCardGeoValue.h49
-rw-r--r--kabc/vcard/include/VCardGroup.h39
-rw-r--r--kabc/vcard/include/VCardImageParam.h44
-rw-r--r--kabc/vcard/include/VCardImageValue.h44
-rw-r--r--kabc/vcard/include/VCardImgValue.h39
-rw-r--r--kabc/vcard/include/VCardLangValue.h51
-rw-r--r--kabc/vcard/include/VCardNValue.h56
-rw-r--r--kabc/vcard/include/VCardOrgValue.h50
-rw-r--r--kabc/vcard/include/VCardParam.h59
-rw-r--r--kabc/vcard/include/VCardPhoneNumberValue.h39
-rw-r--r--kabc/vcard/include/VCardRToken.h38
-rw-r--r--kabc/vcard/include/VCardSndValue.h39
-rw-r--r--kabc/vcard/include/VCardSoundValue.h44
-rw-r--r--kabc/vcard/include/VCardSourceParam.h58
-rw-r--r--kabc/vcard/include/VCardTelParam.h51
-rw-r--r--kabc/vcard/include/VCardTelValue.h44
-rw-r--r--kabc/vcard/include/VCardTextBinParam.h44
-rw-r--r--kabc/vcard/include/VCardTextBinValue.h67
-rw-r--r--kabc/vcard/include/VCardTextListValue.h51
-rw-r--r--kabc/vcard/include/VCardTextParam.h44
-rw-r--r--kabc/vcard/include/VCardTextValue.h41
-rw-r--r--kabc/vcard/include/VCardURIValue.h52
-rw-r--r--kabc/vcard/include/VCardUTCValue.h58
-rw-r--r--kabc/vcard/include/VCardVCard.h63
-rw-r--r--kabc/vcard/include/VCardVCardEntity.h56
-rw-r--r--kabc/vcard/include/VCardValue.h46
-rw-r--r--kabc/vcard/include/generated/AdrParam-generated.h23
-rw-r--r--kabc/vcard/include/generated/AdrValue-generated.h23
-rw-r--r--kabc/vcard/include/generated/AgentParam-generated.h23
-rw-r--r--kabc/vcard/include/generated/AgentValue-generated.h23
-rw-r--r--kabc/vcard/include/generated/ClassValue-generated.h23
-rw-r--r--kabc/vcard/include/generated/ContentLine-generated.h23
-rw-r--r--kabc/vcard/include/generated/DateParam-generated.h23
-rw-r--r--kabc/vcard/include/generated/DateValue-generated.h23
-rw-r--r--kabc/vcard/include/generated/EmailParam-generated.h23
-rw-r--r--kabc/vcard/include/generated/FloatValue-generated.h23
-rw-r--r--kabc/vcard/include/generated/GeoValue-generated.h23
-rw-r--r--kabc/vcard/include/generated/Group-generated.h23
-rw-r--r--kabc/vcard/include/generated/ImageParam-generated.h23
-rw-r--r--kabc/vcard/include/generated/ImageValue-generated.h23
-rw-r--r--kabc/vcard/include/generated/ImgParam-generated.h23
-rw-r--r--kabc/vcard/include/generated/ImgValue-generated.h23
-rw-r--r--kabc/vcard/include/generated/LangValue-generated.h23
-rw-r--r--kabc/vcard/include/generated/NValue-generated.h23
-rw-r--r--kabc/vcard/include/generated/Name-generated.h22
-rw-r--r--kabc/vcard/include/generated/OrgValue-generated.h23
-rw-r--r--kabc/vcard/include/generated/Param-generated.h23
-rw-r--r--kabc/vcard/include/generated/ParamName-generated.h22
-rw-r--r--kabc/vcard/include/generated/ParamValue-generated.h22
-rw-r--r--kabc/vcard/include/generated/PhoneNumberValue-generated.h23
-rw-r--r--kabc/vcard/include/generated/SoundValue-generated.h23
-rw-r--r--kabc/vcard/include/generated/SourceParam-generated.h23
-rw-r--r--kabc/vcard/include/generated/TelParam-generated.h23
-rw-r--r--kabc/vcard/include/generated/TelValue-generated.h23
-rw-r--r--kabc/vcard/include/generated/TextBinParam-generated.h23
-rw-r--r--kabc/vcard/include/generated/TextBinValue-generated.h23
-rw-r--r--kabc/vcard/include/generated/TextListValue-generated.h23
-rw-r--r--kabc/vcard/include/generated/TextNSParam-generated.h23
-rw-r--r--kabc/vcard/include/generated/TextParam-generated.h23
-rw-r--r--kabc/vcard/include/generated/TextValue-generated.h23
-rw-r--r--kabc/vcard/include/generated/URIValue-generated.h23
-rw-r--r--kabc/vcard/include/generated/UTCValue-generated.h23
-rw-r--r--kabc/vcard/include/generated/VCard-generated.h23
-rw-r--r--kabc/vcard/include/generated/VCardEntity-generated.h23
-rw-r--r--kabc/vcard/include/generated/Value-generated.h23
-rw-r--r--kabc/vcard/include/generated/generate2
-rw-r--r--kabc/vcard/include/generated/generateHeaders.awk40
-rw-r--r--kabc/vcard/include/generated/headerBodies34
-rw-r--r--kabc/vcard/testread.cpp129
-rw-r--r--kabc/vcard/testwrite.cpp41
-rw-r--r--kabc/vcard/vCard-all.cpp37
122 files changed, 8145 insertions, 0 deletions
diff --git a/kabc/vcard/AdrParam.cpp b/kabc/vcard/AdrParam.cpp
new file mode 100644
index 0000000..fa46499
--- a/dev/null
+++ b/kabc/vcard/AdrParam.cpp
@@ -0,0 +1,126 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1998 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#include <VCardRToken.h>
25#include <VCardAdrParam.h>
26#include <VCardParam.h>
27
28using namespace VCARD;
29
30AdrParam::AdrParam()
31 :Param()
32{
33}
34
35AdrParam::AdrParam(const AdrParam & x)
36 :Param(x),
37 adrTypeList_(x.adrTypeList_)
38{
39}
40
41AdrParam::AdrParam(const QCString & s)
42 :Param(s)
43{
44}
45
46 AdrParam &
47AdrParam::operator = (AdrParam & x)
48{
49 if (*this == x) return *this;
50
51 adrTypeList_= x.adrTypeList();
52 textParam_ = x.textParam();
53
54 Param::operator = (x);
55 return *this;
56}
57
58 AdrParam &
59AdrParam::operator = (const QCString & s)
60{
61 Param::operator = (s);
62
63 adrTypeList_.clear();
64 textParam_.truncate(0);
65
66 return *this;
67}
68
69 bool
70AdrParam::operator == (AdrParam & x)
71{
72 parse();
73
74 if (!x.textParam().isEmpty())
75 return (x.textParam_ == textParam_);
76
77 if (x.adrTypeList().count() != adrTypeList_.count())
78 return false;
79
80 QStrListIterator it(x.adrTypeList_);
81
82 for (; it.current(); ++it)
83 if (!adrTypeList_.find(it.current()))
84 return false;
85
86 return true;
87}
88
89AdrParam::~AdrParam()
90{
91}
92
93 void
94AdrParam::_parse()
95{
96 adrTypeList_.clear();
97
98 if (strRep_.left(4) != "TYPE") {
99 textParam_ = strRep_;
100 return;
101 }
102
103 if (!strRep_.contains('='))
104 return;
105
106 RTokenise(strRep_, ",", adrTypeList_);
107}
108
109 void
110AdrParam::_assemble()
111{
112 if (!textParam_.isEmpty()) {
113 strRep_ = textParam_;
114 return;
115 }
116
117 QStrListIterator it(adrTypeList_);
118
119 for (; it.current(); ++it) {
120
121 strRep_ += it.current();
122
123 if (it.current() != adrTypeList_.last())
124 strRep_ += ',';
125 }
126}
diff --git a/kabc/vcard/AdrValue.cpp b/kabc/vcard/AdrValue.cpp
new file mode 100644
index 0000000..7ecef33
--- a/dev/null
+++ b/kabc/vcard/AdrValue.cpp
@@ -0,0 +1,140 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1998 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#include <VCardRToken.h>
25#include <VCardAdrValue.h>
26#include <VCardValue.h>
27#include <VCardDefines.h>
28
29using namespace VCARD;
30
31AdrValue::AdrValue()
32 :Value()
33{
34}
35
36AdrValue::AdrValue(const AdrValue & x)
37 :Value(x),
38 poBox_ (x.poBox_),
39 extAddress_(x.extAddress_),
40 street_ (x.street_),
41 locality_(x.locality_),
42 region_ (x.region_),
43 postCode_(x.postCode_),
44 countryName_(x.countryName_)
45{
46}
47
48AdrValue::AdrValue(const QCString & s)
49 :Value(s)
50{
51}
52
53 AdrValue &
54AdrValue::operator = (AdrValue & x)
55{
56 if (*this == x) return *this;
57
58 poBox_ = x.poBox_;
59 extAddress_= x.extAddress_;
60 street_ = x.street_;
61 locality_= x.locality_;
62 region_ = x.region_;
63 postCode_= x.postCode_;
64 countryName_= x.countryName_;
65
66 Value::operator = (x);
67 return *this;
68}
69
70 AdrValue &
71AdrValue::operator = (const QCString & s)
72{
73 Value::operator = (s);
74 return *this;
75}
76
77 bool
78AdrValue::operator == (AdrValue & x)
79{
80 parse();
81 x.parse();
82
83 return (
84 poBox_ == x.poBox_ &&
85 extAddress_ == x.extAddress_&&
86 street_ == x.street_ &&
87 locality_ == x.locality_ &&
88 region_ == x.region_ &&
89 postCode_ == x.postCode_ &&
90 countryName_== x.countryName_);
91}
92
93AdrValue::~AdrValue()
94{
95}
96
97 AdrValue *
98AdrValue::clone()
99{
100 return new AdrValue( *this );
101}
102
103 void
104AdrValue::_parse()
105{
106 vDebug("AdrValue::_parse()");
107
108 QStrList l;
109 RTokenise(strRep_, ";", l);
110
111 for (unsigned int i = 0; i < l.count(); i++) {
112
113 switch (i) {
114
115 case 0: poBox_ = l.at(0);break;
116 case 1: extAddress_ = l.at(1);break;
117 case 2: street_ = l.at(2);break;
118 case 3: locality_ = l.at(3);break;
119 case 4: region_ = l.at(4);break;
120 case 5: postCode_ = l.at(5);break;
121 case 6: countryName_ = l.at(6);break;
122 default: break;
123 }
124 }
125}
126
127 void
128AdrValue::_assemble()
129{
130 vDebug("AdrValue::_assemble");
131
132 strRep_ = poBox_;
133 strRep_ += ";" +extAddress_;
134 strRep_ += ";" +street_;
135 strRep_ += ";" +locality_;
136 strRep_ += ";" +region_;
137 strRep_ += ";" +postCode_;
138 strRep_ += ";" +countryName_;
139}
140
diff --git a/kabc/vcard/AgentParam.cpp b/kabc/vcard/AgentParam.cpp
new file mode 100644
index 0000000..5625e00
--- a/dev/null
+++ b/kabc/vcard/AgentParam.cpp
@@ -0,0 +1,103 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1998 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#include <VCardAgentParam.h>
25
26#include <VCardParam.h>
27
28using namespace VCARD;
29
30AgentParam::AgentParam()
31 :Param()
32{
33}
34
35AgentParam::AgentParam(const AgentParam & x)
36 :Param(x),
37 refer_(x.refer_),
38 uri_(x.uri_)
39{
40}
41
42AgentParam::AgentParam(const QCString & s)
43 :Param(s)
44{
45}
46
47 AgentParam &
48AgentParam::operator = (AgentParam & x)
49{
50 if (*this == x) return *this;
51
52 refer_= x.refer_;
53 uri_= x.uri_;
54
55 Param::operator = (x);
56 return *this;
57}
58
59 AgentParam &
60AgentParam::operator = (const QCString & s)
61{
62 Param::operator = (s);
63 return *this;
64}
65
66 bool
67AgentParam::operator == (AgentParam & x)
68{
69 parse();
70
71 if (refer_)
72 return (x.refer() && uri_ == x.uri_);
73
74 return !x.refer();
75}
76
77AgentParam::~AgentParam()
78{
79}
80
81 void
82AgentParam::_parse()
83{
84 if (strRep_.isEmpty()) {
85 refer_ = false;
86 return;
87 }
88
89 refer_= true;
90 uri_= strRep_;
91}
92
93 void
94AgentParam::_assemble()
95{
96 if (!refer_) {
97 strRep_.truncate(0);
98 return;
99 }
100
101 strRep_ = uri_.asString();
102 return;
103}
diff --git a/kabc/vcard/AgentValue.cpp b/kabc/vcard/AgentValue.cpp
new file mode 100644
index 0000000..bccde80
--- a/dev/null
+++ b/kabc/vcard/AgentValue.cpp
@@ -0,0 +1,81 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1998 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#include <VCardAgentValue.h>
25
26#include <VCardValue.h>
27
28using namespace VCARD;
29
30AgentValue::AgentValue()
31 :Value()
32{
33}
34
35AgentValue::AgentValue(const AgentValue & x)
36 :Value(x)
37{
38}
39
40AgentValue::AgentValue(const QCString & s)
41 :Value(s)
42{
43}
44
45 AgentValue &
46AgentValue::operator = (AgentValue & x)
47{
48 if (*this == x) return *this;
49
50 Value::operator = (x);
51 return *this;
52}
53
54 AgentValue &
55AgentValue::operator = (const QCString & s)
56{
57 Value::operator = (s);
58 return *this;
59}
60
61 bool
62AgentValue::operator == (AgentValue & x)
63{
64 x.parse();
65 return false;
66}
67
68AgentValue::~AgentValue()
69{
70}
71
72 void
73AgentValue::_parse()
74{
75}
76
77 void
78AgentValue::_assemble()
79{
80}
81
diff --git a/kabc/vcard/ClassValue.cpp b/kabc/vcard/ClassValue.cpp
new file mode 100644
index 0000000..f01e5a6
--- a/dev/null
+++ b/kabc/vcard/ClassValue.cpp
@@ -0,0 +1,120 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1998 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#include <VCardClassValue.h>
25
26#include <VCardValue.h>
27
28#include <kdebug.h>
29
30using namespace VCARD;
31
32ClassValue::ClassValue()
33 :Value()
34{
35}
36
37ClassValue::ClassValue(const ClassValue & x)
38 :Value(x),
39 classType_(x.classType_)
40{
41}
42
43ClassValue::ClassValue(const QCString & s)
44 :Value(s)
45{
46}
47
48 ClassValue &
49ClassValue::operator = (ClassValue & x)
50{
51 if (*this == x) return *this;
52 x.parse();
53
54 classType_ = x.classType_;
55
56 Value::operator = (x);
57 return *this;
58}
59
60 ClassValue &
61ClassValue::operator = (const QCString & s)
62{
63 Value::operator = (s);
64 return *this;
65}
66
67 bool
68ClassValue::operator == (ClassValue & x)
69{
70 x.parse();
71 return ( classType_ == x.classType_ );
72}
73
74ClassValue::~ClassValue()
75{
76}
77
78 ClassValue *
79ClassValue::clone()
80{
81 return new ClassValue( *this );
82}
83
84 void
85ClassValue::_parse()
86{
87 if (qstricmp(strRep_, "PUBLIC") == 0)
88 classType_ = Public;
89
90 else if (qstricmp(strRep_, "PRIVATE") == 0)
91 classType_ = Private;
92
93 else if (qstricmp(strRep_, "CONFIDENTIAL") == 0)
94 classType_ = Confidential;
95
96 else classType_ = Other;
97}
98
99 void
100ClassValue::_assemble()
101{
102 switch (classType_) {
103
104 case Public:
105 strRep_ = "PUBLIC";
106 break;
107
108 case Private:
109 strRep_ = "PRIVATE";
110 break;
111
112 case Confidential:
113 strRep_ = "CONFIDENTIAL";
114 break;
115
116 default:
117 break;
118 }
119}
120
diff --git a/kabc/vcard/ContentLine.cpp b/kabc/vcard/ContentLine.cpp
new file mode 100644
index 0000000..6fa1a8f
--- a/dev/null
+++ b/kabc/vcard/ContentLine.cpp
@@ -0,0 +1,289 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1999 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#include <qcstring.h>
25#include <qstrlist.h>
26#include <qregexp.h>
27
28#include <kdebug.h>
29
30#include <VCardAdrParam.h>
31#include <VCardAgentParam.h>
32#include <VCardDateParam.h>
33#include <VCardEmailParam.h>
34#include <VCardImageParam.h>
35#include <VCardSourceParam.h>
36#include <VCardTelParam.h>
37#include <VCardTextBinParam.h>
38#include <VCardTextParam.h>
39
40#include <VCardAdrValue.h>
41#include <VCardAgentValue.h>
42#include <VCardDateValue.h>
43#include <VCardImageValue.h>
44#include <VCardTextValue.h>
45#include <VCardTextBinValue.h>
46#include <VCardLangValue.h>
47#include <VCardNValue.h>
48#include <VCardURIValue.h>
49#include <VCardSoundValue.h>
50#include <VCardClassValue.h>
51#include <VCardFloatValue.h>
52#include <VCardOrgValue.h>
53#include <VCardTelValue.h>
54#include <VCardTextListValue.h>
55#include <VCardUTCValue.h>
56#include <VCardGeoValue.h>
57
58#include <VCardRToken.h>
59#include <VCardContentLine.h>
60
61#include <VCardEntity.h>
62#include <VCardEnum.h>
63#include <VCardDefines.h>
64
65using namespace VCARD;
66
67ContentLine::ContentLine()
68 :Entity(),
69 value_(0)
70{
71}
72
73ContentLine::ContentLine(const ContentLine & x)
74 :Entity(x),
75 group_ (x.group_),
76 name_ (x.name_),
77 paramList_(x.paramList_),
78 value_(x.value_->clone())
79{
80}
81
82ContentLine::ContentLine(const QCString & s)
83 :Entity(s),
84 value_(0)
85{
86}
87
88 ContentLine &
89ContentLine::operator = (ContentLine & x)
90{
91 if (*this == x) return *this;
92
93 paramList_ = x.paramList();
94 value_ = x.value_->clone();
95
96 Entity::operator = (x);
97 return *this;
98}
99
100 ContentLine &
101ContentLine::operator = (const QCString & s)
102{
103 Entity::operator = (s);
104 delete value_;
105 value_ = 0;
106 return *this;
107}
108
109 bool
110ContentLine::operator == (ContentLine & x)
111{
112 x.parse();
113
114 QPtrListIterator<Param> it(x.paramList());
115
116 if (!paramList_.find(it.current()))
117 return false;
118
119 return true;
120}
121
122ContentLine::~ContentLine()
123{
124 delete value_;
125 value_ = 0;
126}
127
128 void
129ContentLine::_parse()
130{
131 vDebug("parse");
132
133 // Unqote newlines
134 strRep_ = strRep_.replace( QRegExp( "\\\\n" ), "\n" );
135
136 int split = strRep_.find(':');
137
138 if (split == -1) { // invalid content line
139 vDebug("No ':'");
140 return;
141 }
142
143 QCString firstPart(strRep_.left(split));
144 QCString valuePart(strRep_.mid(split + 1));
145
146 split = firstPart.find('.');
147
148 if (split != -1) {
149 group_ = firstPart.left(split);
150 firstPart= firstPart.mid(split + 1);
151 }
152
153 vDebug("Group == " + group_);
154 vDebug("firstPart == " + firstPart);
155 vDebug("valuePart == " + valuePart);
156
157 // Now we have the group, the name and param list together and the value.
158
159 QStrList l;
160
161 RTokenise(firstPart, ";", l);
162
163 if (l.count() == 0) {// invalid - no name !
164 vDebug("No name for this content line !");
165 return;
166 }
167
168 name_ = l.at(0);
169
170 // Now we have the name, so the rest of 'l' is the params.
171 // Remove the name part.
172 l.remove(0u);
173
174 entityType_= EntityNameToEntityType(name_);
175 paramType_= EntityTypeToParamType(entityType_);
176
177 unsigned int i = 0;
178
179 // For each parameter, create a new parameter of the correct type.
180
181 QStrListIterator it(l);
182
183 for (; it.current(); ++it, i++) {
184
185 QCString str = *it;
186
187 split = str.find("=");
188 if (split < 0 ) {
189 vDebug("No '=' in paramter.");
190 continue;
191 }
192
193 QCString paraName = str.left(split);
194 QCString paraValue = str.mid(split + 1);
195
196 QStrList paraValues;
197 RTokenise(paraValue, ",", paraValues);
198
199 QStrListIterator it2( paraValues );
200
201 for(; it2.current(); ++it2) {
202
203 Param *p = new Param;
204 p->setName( paraName );
205 p->setValue( *it2 );
206
207 paramList_.append(p);
208 }
209 }
210
211 // Create a new value of the correct type.
212
213 valueType_ = EntityTypeToValueType(entityType_);
214
215 //kdDebug(5710) << "valueType: " << valueType_ << endl;
216
217 switch (valueType_) {
218
219 case ValueSound: value_ = new SoundValue;break;
220 case ValueAgent: value_ = new AgentValue;break;
221 case ValueAddress: value_ = new AdrValue; break;
222 case ValueTel: value_ = new TelValue; break;
223 case ValueTextBin: value_ = new TextBinValue;break;
224 case ValueOrg: value_ = new OrgValue; break;
225 case ValueN: value_ = new NValue; break;
226 case ValueUTC: value_ = new UTCValue; break;
227 case ValueURI: value_ = new URIValue; break;
228 case ValueClass: value_ = new ClassValue;break;
229 case ValueFloat: value_ = new FloatValue;break;
230 case ValueImage: value_ = new ImageValue;break;
231 case ValueDate: value_ = new DateValue; break;
232 case ValueTextList: value_ = new TextListValue;break;
233 case ValueGeo: value_ = new GeoValue; break;
234 case ValueText:
235 case ValueUnknown:
236 default: value_ = new TextValue; break;
237 }
238
239 *value_ = valuePart;
240}
241
242 void
243ContentLine::_assemble()
244{
245 vDebug("Assemble (argl) - my name is \"" + name_ + "\"");
246 strRep_.truncate(0);
247
248 QCString line;
249
250 if (!group_.isEmpty())
251 line += group_ + '.';
252
253 line += name_;
254
255 vDebug("Adding parameters");
256 ParamListIterator it(paramList_);
257
258 for (; it.current(); ++it)
259 line += ";" + it.current()->asString();
260
261 vDebug("Adding value");
262 if (value_ != 0)
263 line += ":" + value_->asString();
264 else
265 vDebug("No value");
266
267 // Quote newlines
268 line = line.replace( QRegExp( "\n" ), "\\n" );
269
270 // Fold lines longer than 72 chars
271 const int maxLen = 72;
272 uint cursor = 0;
273 while( line.length() > ( cursor + 1 ) * maxLen ) {
274 strRep_ += line.mid( cursor * maxLen, maxLen );
275 strRep_ += "\r\n ";
276 ++cursor;
277 }
278 strRep_ += line.mid( cursor * maxLen );
279}
280
281 void
282ContentLine::clear()
283{
284 group_.truncate(0);
285 name_.truncate(0);
286 paramList_.clear();
287 delete value_;
288 value_ = 0;
289}
diff --git a/kabc/vcard/DateParam.cpp b/kabc/vcard/DateParam.cpp
new file mode 100644
index 0000000..52af089
--- a/dev/null
+++ b/kabc/vcard/DateParam.cpp
@@ -0,0 +1,82 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1998 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#include <VCardDateParam.h>
25
26#include <VCardParam.h>
27
28using namespace VCARD;
29
30DateParam::DateParam()
31 :Param()
32{
33}
34
35DateParam::DateParam(const DateParam & x)
36 :Param(x)
37{
38}
39
40DateParam::DateParam(const QCString & s)
41 :Param(s)
42{
43}
44
45 DateParam &
46DateParam::operator = (DateParam & x)
47{
48 if (*this == x) return *this;
49
50 Param::operator = (x);
51 return *this;
52}
53
54 DateParam &
55DateParam::operator = (const QCString & s)
56{
57 Param::operator = (s);
58 return *this;
59}
60
61 bool
62DateParam::operator == (DateParam & x)
63{
64 x.parse();
65
66 return false;
67}
68
69DateParam::~DateParam()
70{
71}
72
73 void
74DateParam::_parse()
75{
76}
77
78 void
79DateParam::_assemble()
80{
81}
82
diff --git a/kabc/vcard/DateValue.cpp b/kabc/vcard/DateValue.cpp
new file mode 100644
index 0000000..c5c5c85
--- a/dev/null
+++ b/kabc/vcard/DateValue.cpp
@@ -0,0 +1,434 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1998 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#include <qregexp.h>
25
26#include <kdebug.h>
27
28#include <VCardDefines.h>
29#include <VCardDateValue.h>
30#include <VCardValue.h>
31
32using namespace VCARD;
33
34DateValue::DateValue()
35 :Value()
36{
37 vDebug("DateValue::DateValue()");
38}
39
40DateValue::DateValue(
41 unsigned intyear,
42 unsigned intmonth,
43 unsigned intday,
44 unsigned inthour,
45 unsigned intminute,
46 unsigned intsecond,
47 double secFrac,
48 bool zonePositive,
49 unsigned intzoneHour,
50 unsigned intzoneMinute)
51 : Value (),
52 year_ (year),
53 month_ (month),
54 day_ (day),
55 hour_ (hour),
56 minute_ (minute),
57 second_ (second),
58 zoneHour_ (zoneHour),
59 zoneMinute_ (zoneMinute),
60 secFrac_ (secFrac),
61 zonePositive_(zonePositive),
62 hasTime_(true)
63{
64 parsed_ = true;
65 assembled_ = false;
66}
67
68DateValue::DateValue(const QDate & d)
69 : Value (),
70 year_ (d.year()),
71 month_ (d.month()),
72 day_ (d.day()),
73 hasTime_(false)
74{
75 parsed_ = true;
76 assembled_ = false;
77}
78
79DateValue::DateValue(const QDateTime & d)
80 : Value (),
81 year_ (d.date().year()),
82 month_ (d.date().month()),
83 day_ (d.date().day()),
84 hour_ (d.time().hour()),
85 minute_ (d.time().minute()),
86 second_ (d.time().second()),
87 hasTime_(true)
88{
89 parsed_ = true;
90 assembled_ = false;
91}
92
93DateValue::DateValue(const DateValue & x)
94 :Value(x)
95{
96 year_ = x.year_;
97 month_ = x.month_;
98 day_ = x.day_;
99 hour_ = x.hour_;
100 minute_ = x.minute_;
101 second_ = x.second_;
102 zoneHour_ = x.zoneHour_;
103 zoneMinute_ = x.zoneMinute_;
104 secFrac_ = x.secFrac_;
105 hasTime_ = x.hasTime_;
106}
107
108DateValue::DateValue(const QCString & s)
109 :Value(s)
110{
111}
112
113 DateValue &
114DateValue::operator = (DateValue & x)
115{
116 if (*this == x) return *this;
117
118 Value::operator = (x);
119 return *this;
120}
121
122 DateValue &
123DateValue::operator = (const QCString & s)
124{
125 Value::operator = (s);
126 return *this;
127}
128
129 bool
130DateValue::operator == (DateValue & x)
131{
132 x.parse();
133 return false;
134}
135
136DateValue::~DateValue()
137{
138}
139
140 DateValue *
141DateValue::clone()
142{
143 return new DateValue( *this );
144}
145
146 void
147DateValue::_parse()
148{
149 vDebug("DateValue::_parse()");
150
151 // date = date-full-year ["-"] date-month ["-"] date-mday
152 // time = time-hour [":"] time-minute [":"] time-second [":"]
153 // [time-secfrac] [time-zone]
154
155 int timeSep = strRep_.find('T');
156
157 QCString dateStr;
158 QCString timeStr;
159
160 if (timeSep == -1) {
161
162 dateStr = strRep_;
163 vDebug("Has date string \"" + dateStr + "\"");
164
165 } else {
166
167 dateStr = strRep_.left(timeSep);
168 vDebug("Has date string \"" + dateStr + "\"");
169
170 timeStr = strRep_.mid(timeSep + 1);
171 vDebug("Has time string \"" + timeStr + "\"");
172 }
173
174 /////////////////////////////////////////////////////////////// DATE
175
176 dateStr.replace(QRegExp("-"), "");
177
178 kdDebug(5710) << "dateStr: " << dateStr << endl;
179
180 year_= dateStr.left(4).toInt();
181 month_= dateStr.mid(4, 2).toInt();
182 day_= dateStr.right(2).toInt();
183
184 if (timeSep == -1) {
185 hasTime_ = false;
186 return; // No time, done.
187 }
188 else
189 hasTime_ = true;
190
191 /////////////////////////////////////////////////////////////// TIME
192
193 /////////////////////////////////////////////////////////////// ZONE
194
195 int zoneSep = timeStr.find('Z');
196
197 if (zoneSep != -1 && timeStr.length() - zoneSep > 3) {
198
199 QCString zoneStr(timeStr.mid(zoneSep + 1));
200 vDebug("zoneStr == " + zoneStr);
201
202 zonePositive_= (zoneStr[0] == '+');
203 zoneHour_ = zoneStr.mid(1, 2).toInt();
204 zoneMinute_ = zoneStr.right(2).toInt();
205
206 timeStr.remove(zoneSep, timeStr.length() - zoneSep);
207 }
208
209 //////////////////////////////////////////////////// SECOND FRACTION
210
211 int secFracSep = timeStr.findRev(',');
212
213 if (secFracSep != -1 && zoneSep != -1) { // zoneSep checked to avoid errors.
214 QCString quirkafleeg = "0." + timeStr.mid(secFracSep + 1, zoneSep);
215 secFrac_ = quirkafleeg.toDouble();
216 }
217
218 /////////////////////////////////////////////////////////////// HMS
219
220 timeStr.replace(QRegExp(":"), "");
221
222 hour_= timeStr.left(2).toInt();
223 minute_= timeStr.mid(2, 2).toInt();
224 second_= timeStr.mid(4, 2).toInt();
225}
226
227 void
228DateValue::_assemble()
229{
230 vDebug("DateValue::_assemble");
231
232 QCString year;
233 QCString month;
234 QCString day;
235
236 year.setNum( year_ );
237 month.setNum( month_ );
238 day.setNum( day_ );
239
240 if ( month.length() < 2 ) month.prepend( "0" );
241 if ( day.length() < 2 ) day.prepend( "0" );
242
243 strRep_ = year + '-' + month + '-' + day;
244
245 if ( hasTime_ ) {
246 QCString hour;
247 QCString minute;
248 QCString second;
249
250 hour.setNum( hour_ );
251 minute.setNum( minute_ );
252 second.setNum( second_ );
253
254 if ( hour.length() < 2 ) hour.prepend( "0" );
255 if ( minute.length() < 2 ) minute.prepend( "0" );
256 if ( second.length() < 2 ) second.prepend( "0" );
257
258 strRep_ += 'T' + hour + ':' + minute + ':' + second + 'Z';
259 }
260}
261
262 unsigned int
263DateValue::year()
264{
265 parse();
266 return year_;
267}
268
269 unsigned int
270DateValue::month()
271{
272 parse();
273 return month_;
274}
275
276 unsigned int
277DateValue::day()
278{
279 parse();
280 return day_;
281}
282 unsigned int
283DateValue::hour()
284{
285 parse();
286 return hour_;
287}
288
289 unsigned int
290DateValue::minute()
291{
292 parse();
293 return minute_;
294}
295
296 unsigned int
297DateValue::second()
298{
299 parse();
300 return second_;
301}
302
303 double
304DateValue::secondFraction()
305{
306 parse();
307 return secFrac_;
308}
309
310 bool
311DateValue::zonePositive()
312{
313 parse();
314 return zonePositive_;
315}
316
317 unsigned int
318DateValue::zoneHour()
319{
320 parse();
321 return zoneHour_;
322}
323
324 unsigned int
325DateValue::zoneMinute()
326{
327 parse();
328 return zoneMinute_;
329}
330
331 void
332DateValue::setYear(unsigned int i)
333{
334 year_ = i;
335 assembled_ = false;
336}
337
338 void
339DateValue::setMonth(unsigned int i)
340{
341 month_ = i;
342 assembled_ = false;
343}
344
345 void
346DateValue::setDay(unsigned int i)
347{
348 day_ = i;
349 assembled_ = false;
350}
351
352 void
353DateValue::setHour(unsigned int i)
354{
355 hour_ = i;
356 assembled_ = false;
357}
358
359 void
360DateValue::setMinute(unsigned int i)
361{
362 minute_ = i;
363 assembled_ = false;
364}
365
366 void
367DateValue::setSecond(unsigned int i)
368{
369 second_ = i;
370 assembled_ = false;
371}
372
373 void
374DateValue::setSecondFraction(double d)
375{
376 secFrac_ = d;
377 assembled_ = false;
378}
379
380 void
381DateValue::setZonePositive(bool b)
382{
383 zonePositive_ = b;
384 assembled_ = false;
385 }
386
387 void
388DateValue::setZoneHour(unsigned int i)
389{
390 zoneHour_ = i;
391 assembled_ = false;
392}
393
394 void
395DateValue::setZoneMinute(unsigned int i)
396{
397 zoneMinute_ = i;
398 assembled_ = false;
399}
400
401 QDate
402DateValue::qdate()
403{
404 parse();
405 QDate d(year_, month_, day_);
406 return d;
407}
408
409 QTime
410DateValue::qtime()
411{
412 parse();
413 QTime t(hour_, minute_, second_);
414 //t.setMs(1 / secFrac_);
415 return t;
416}
417
418 QDateTime
419DateValue::qdt()
420{
421 parse();
422 QDateTime dt;
423 dt.setDate(qdate());
424 dt.setTime(qtime());
425 return dt;
426}
427
428 bool
429DateValue::hasTime()
430{
431 parse();
432 return hasTime_;
433}
434
diff --git a/kabc/vcard/EmailParam.cpp b/kabc/vcard/EmailParam.cpp
new file mode 100644
index 0000000..8c87477
--- a/dev/null
+++ b/kabc/vcard/EmailParam.cpp
@@ -0,0 +1,116 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1998 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#include <VCardEmailParam.h>
25#include <VCardParam.h>
26#include <VCardDefines.h>
27
28using namespace VCARD;
29
30EmailParam::EmailParam()
31 :Param()
32{
33 vDebug("ctor");
34}
35
36EmailParam::EmailParam(const EmailParam & x)
37 :Param(x),
38 emailType_(x.emailType_),
39 pref_ (x.pref_)
40{
41}
42
43EmailParam::EmailParam(const QCString & s)
44 :Param(s)
45{
46}
47
48 EmailParam &
49EmailParam::operator = (EmailParam & x)
50{
51 if (*this == x) return *this;
52
53 emailType_= x.emailType();
54 pref_ = x.pref_;
55
56 Param::operator = (x);
57 return *this;
58}
59
60 EmailParam &
61EmailParam::operator = (const QCString & s)
62{
63 Param::operator = (s);
64 return *this;
65}
66
67 bool
68EmailParam::operator == (EmailParam & x)
69{
70 parse();
71
72 if (pref_)
73 return (x.pref_ && x.emailType() == emailType_);
74
75 return !x.pref();
76}
77
78EmailParam::~EmailParam()
79{
80}
81
82 void
83EmailParam::_parse()
84{
85#if 0
86 Param::parseToList();
87
88 SubParamListIterator it(subParamList_);
89
90 pref_ = true;
91 emailType_ = "";
92
93 for (; it.current(); ++it) {
94
95 if (qstricmp(it.current()->name(), "TYPE") == 0) {
96 emailType_ = it.current()->value();
97 continue;
98 }
99
100 if (qstricmp(it.current()->name(), "PREF") == 0) {
101 pref_ = true;
102 }
103 }
104#endif
105}
106
107 void
108EmailParam::_assemble()
109{
110 strRep_ = "TYPE=";
111 strRep_ += emailType_;
112
113 if (pref_)
114 strRep_ += ",PREF";
115}
116
diff --git a/kabc/vcard/Entity.cpp b/kabc/vcard/Entity.cpp
new file mode 100644
index 0000000..b7d09e0
--- a/dev/null
+++ b/kabc/vcard/Entity.cpp
@@ -0,0 +1,134 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1999 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#include <VCardEntity.h>
25
26using namespace VCARD;
27
28Entity::Entity()
29 : parsed_ (false),
30 assembled_(true)
31{
32 // empty
33}
34
35Entity::Entity(const Entity & e)
36 : strRep_ (e.strRep_),
37 parsed_ (e.parsed_),
38 assembled_(e.assembled_)
39{
40 // empty
41}
42
43Entity::Entity(const QCString & s)
44 : strRep_ (s),
45 parsed_ (false),
46 assembled_(true)
47{
48 // empty
49}
50
51 Entity &
52Entity::operator = (const Entity & e)
53{
54 if (this == &e) return *this;
55
56 strRep_ = e.strRep_;
57 parsed_ = e.parsed_;
58 assembled_= e.assembled_;
59
60 return *this;
61}
62
63 Entity &
64Entity::operator = (const QCString & s)
65{
66 strRep_ = s;
67 parsed_ = false;
68 assembled_= true;
69
70 return *this;
71}
72
73 bool
74Entity::operator == (Entity & e)
75{
76 return asString() == e.asString();
77}
78
79 bool
80Entity::operator != (Entity & e)
81{
82 return !(*this == e);
83}
84
85 bool
86Entity::operator == (const QCString & s)
87{
88 return asString() == s;
89}
90
91 bool
92Entity::operator != (const QCString & s)
93{
94 return !(*this == s);
95}
96
97Entity::~Entity()
98{
99 // empty
100}
101
102 QCString
103Entity::asString()
104{
105 //vDebug("Entity::asString()");
106 assemble();
107
108 return strRep_;
109}
110
111 void
112Entity::parse()
113{
114 //vDebug( "Entity::parse()" );
115
116 if (!parsed_) _parse();
117
118 parsed_ = true;
119 assembled_= false;
120}
121
122 void
123Entity::assemble()
124{
125 //vDebug( "Entity::assemble()" );
126
127 if (assembled_) return;
128
129 parse();
130 _assemble();
131
132 assembled_= true;
133}
134
diff --git a/kabc/vcard/Enum.cpp b/kabc/vcard/Enum.cpp
new file mode 100644
index 0000000..cc48b5a
--- a/dev/null
+++ b/kabc/vcard/Enum.cpp
@@ -0,0 +1,482 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1998 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#include <qcstring.h>
25#include <ctype.h>
26
27#include <VCardEnum.h>
28
29using namespace VCARD;
30
31// There are 31 possible types, not including extensions.
32 const QCString
33VCARD::paramNames [] =
34{
35 "NAME",
36 "PROFILE",
37 "SOURCE",
38 "FN",
39 "N",
40 "NICKNAME",
41 "PHOTO",
42 "BDAY",
43 "ADR",
44 "LABEL",
45 "TEL",
46 "EMAIL",
47 "MAILER",
48 "TZ",
49 "GEO",
50 "TITLE",
51 "ROLE",
52 "LOGO",
53 "AGENT",
54 "ORG",
55 "CATEGORIES",
56 "NOTE",
57 "PRODID",
58 "REV",
59 "SORT-STRING",
60 "SOUND",
61 "UID",
62 "URL",
63 "VERSION",
64 "CLASS",
65 "KEY"
66};
67
68 const ParamType
69VCARD::paramTypesTable[] = {
70 ParamNone, // NAME
71 ParamNone, // PROFILE
72 ParamSource, // SOURCE
73 ParamText, // FN
74 ParamText, // N
75 ParamText, // NICKNAME
76 ParamImage, // PHOTO (inline/refer)
77 ParamDate, // BDAY ("VALUE = "date-time/date)
78 ParamAddrText, // ADR (adr-param/text-param)
79 ParamAddrText, // LABEL (adr-param/text-param)
80 ParamTel, // TEL
81 ParamEmail, // EMAIL
82 ParamText, // MAILER
83 ParamNone, // TZ
84 ParamNone, // GEO
85 ParamText, // TITLE
86 ParamText, // ROLE
87 ParamImage, // LOGO
88 ParamAgent, // AGENT
89 ParamText, // ORG
90 ParamText, // CATEGORIES
91 ParamText, // NOTE
92 ParamNone, // PRODID
93 ParamDate, // REV
94 ParamText, // SORT-STRING
95 ParamSound, // SOUND
96 ParamNone, // UID
97 ParamNone, // URL
98 ParamNone, // VERSION
99 ParamNone, // CLASS
100 ParamTextBin, // KEY
101 ParamTextNS // X
102};
103
104 ParamType
105VCARD::EntityTypeToParamType(EntityType e)
106{
107 ParamType t(ParamUnknown);
108
109 switch (e) {
110
111 //---------------------------------------------------------------//
112 case EntityAgent: t = ParamAgent; break;
113 //---------------------------------------------------------------//
114 case EntitySound: t = ParamSound; break;
115 //---------------------------------------------------------------//
116 case EntitySource: t = ParamSource;break;
117 //---------------------------------------------------------------//
118 case EntityTelephone: t = ParamTel; break;
119 //---------------------------------------------------------------//
120 case EntityEmail: t = ParamEmail; break;
121 //---------------------------------------------------------------//
122 case EntityKey: t = ParamTextBin;break;
123 //---------------------------------------------------------------//
124 case EntityExtension: t = ParamTextNS;break;
125 //---------------------------------------------------------------//
126 case EntityAddress:
127 case EntityLabel: t = ParamAddrText;break;
128 //---------------------------------------------------------------//
129 case EntityBirthday:
130 case EntityRevision: t = ParamDate; break;
131 //---------------------------------------------------------------//
132 case EntityPhoto:
133 case EntityLogo: t = ParamImage; break;
134 //---------------------------------------------------------------//
135 case EntityOrganisation:
136 case EntityTitle:
137 case EntityRole:
138 case EntityFullName:
139 case EntityMailer:
140 case EntityN:
141 case EntitySortString:
142 case EntityNickname:
143 case EntityCategories:
144 case EntityNote: t = ParamText; break;
145 //---------------------------------------------------------------//
146 case EntityProductID:
147 case EntityTimeZone:
148 case EntityUID:
149 case EntityURL:
150 case EntityClass:
151 case EntityGeo:
152 case EntityName:
153 case EntityVersion:
154 case EntityProfile:
155 default: t = ParamNone; break;
156 //---------------------------------------------------------------//
157
158 }
159
160 return t;
161}
162
163 ValueType
164VCARD::EntityTypeToValueType(EntityType e)
165{
166 ValueType t(ValueUnknown);
167
168 switch (e) {
169
170 //---------------------------------------------------------------//
171 case EntitySound: t = ValueSound; break;
172 //---------------------------------------------------------------//
173 case EntityAgent: t = ValueAgent; break;
174 //---------------------------------------------------------------//
175 case EntityAddress: t = ValueAddress;break;
176 //---------------------------------------------------------------//
177 case EntityTelephone: t = ValueTel; break;
178 //---------------------------------------------------------------//
179 case EntityKey: t = ValueTextBin;break;
180 //---------------------------------------------------------------//
181 case EntityOrganisation: t = ValueOrg; break;
182 //---------------------------------------------------------------//
183 case EntityN: t = ValueN; break;
184 //---------------------------------------------------------------//
185 case EntityTimeZone: t = ValueUTC; break;
186 //---------------------------------------------------------------//
187 case EntityClass: t = ValueClass; break;
188 //---------------------------------------------------------------//
189 case EntityGeo: t = ValueGeo; break;
190 //---------------------------------------------------------------//
191 case EntitySource:
192 case EntityURL: t = ValueURI; break;
193 //---------------------------------------------------------------//
194 case EntityPhoto:
195 case EntityLogo: t = ValueImage; break;
196 //---------------------------------------------------------------//
197 case EntityBirthday:
198 case EntityRevision: t = ValueDate; break;
199 //---------------------------------------------------------------//
200 case EntityCategories:
201 case EntityNickname: t = ValueTextList;break;
202 //---------------------------------------------------------------//
203 case EntityLabel:
204 case EntityExtension:
205 case EntityEmail:
206 case EntityTitle:
207 case EntityRole:
208 case EntityFullName:
209 case EntityMailer:
210 case EntityProductID:
211 case EntityName:
212 case EntitySortString:
213 case EntityVersion:
214 case EntityProfile:
215 case EntityUID:
216 case EntityNote:
217 default: t = ValueText; break;
218 //---------------------------------------------------------------//
219
220 }
221
222 return t;
223}
224
225 QCString
226VCARD::EntityTypeToParamName(EntityType e)
227{
228 if ( e > EntityUnknown ) e = EntityUnknown;
229 return paramNames[ int( e ) ];
230}
231
232 EntityType
233VCARD::EntityNameToEntityType(const QCString & s)
234{
235 if (s.isEmpty()) return EntityUnknown;
236
237 EntityType t(EntityUnknown);
238
239 switch (s[0]) {
240
241 case 'A':
242 if (s == "ADR")
243 t = EntityAddress;
244 else if (s == "AGENT")
245 t = EntityAgent;
246 break;
247
248 case 'B':
249 if (s == "BDAY")
250 t = EntityBirthday;
251 break;
252
253 case 'C':
254 if (s == "CATEGORIES")
255 t = EntityCategories;
256 else if (s == "CLASS")
257 t = EntityClass;
258 break;
259
260 case 'E':
261 if (s == "EMAIL")
262 t = EntityEmail;
263 break;
264
265 case 'F':
266 if (s == "FN")
267 t = EntityFullName;
268 break;
269
270 case 'G':
271 if (s == "GEO")
272 t = EntityGeo;
273 break;
274
275 case 'K':
276 if (s == "KEY")
277 t = EntityKey;
278 break;
279
280 case 'L':
281 if (s == "LABEL")
282 t = EntityLabel;
283 else if (s == "LOGO")
284 t = EntityLogo;
285 break;
286
287 case 'M':
288 if (s == "MAILER")
289 t = EntityMailer;
290 break;
291
292 case 'N':
293 if (s == "N")
294 t = EntityN;
295 else if (s == "NAME")
296 t = EntityName;
297 else if (s == "NICKNAME")
298 t = EntityNickname;
299 else if (s == "NOTE")
300 t = EntityNote;
301 break;
302
303 case 'O':
304 if (s == "ORG")
305 t = EntityOrganisation;
306 break;
307
308 case 'P':
309 if (s == "PHOTO")
310 t = EntityPhoto;
311 else if (s == "PRODID")
312 t = EntityProductID;
313 else if (s == "PROFILE")
314 t = EntityProfile;
315 break;
316
317 case 'R':
318 if (s == "REV")
319 t = EntityRevision;
320 else if (s == "ROLE")
321 t = EntityRole;
322 break;
323
324 case 'S':
325 if (s == "SORT-STRING")
326 t = EntitySortString;
327 else if (s == "SOUND")
328 t = EntitySound;
329 else if (s == "SOURCE")
330 t = EntitySource;
331 break;
332
333 case 'T':
334 if (s == "TEL")
335 t = EntityTelephone;
336 else if (s == "TITLE")
337 t = EntityTitle;
338 else if (s == "TZ")
339 t = EntityTimeZone;
340 break;
341
342 case 'U':
343 if (s == "UID")
344 t = EntityUID;
345 else if (s == "URL")
346 t = EntityURL;
347 case 'V':
348 if (s == "VERSION")
349 t = EntityVersion;
350 break;
351
352 case 'X':
353 if (s.left(2) == "X-")
354 t = EntityExtension;
355 break;
356
357 default:
358
359 t = EntityUnknown;
360 }
361
362 return t;
363}
364
365// The copyright notice below refers to the base64 codec functions used below,
366// which are modified from the original sources.
367
368/*
369 * Original version Copyright 1988 by The Leland Stanford Junior University
370 * Copyright 1998 by the University of Washington
371 *
372 * Permission to use, copy, modify, and distribute this software and its
373 * documentation for any purpose and without fee is hereby granted, provided
374 * that the above copyright notices appear in all copies and that both the
375 * above copyright notices and this permission notice appear in supporting
376 * documentation, and that the name of the University of Washington or The
377 * Leland Stanford Junior University not be used in advertising or publicity
378 * pertaining to distribution of the software without specific, written prior
379 * permission. This software is made available "as is", and
380 * THE UNIVERSITY OF WASHINGTON AND THE LELAND STANFORD JUNIOR UNIVERSITY
381 * DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD TO THIS SOFTWARE,
382 * INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
383 * FITNESS FOR A PARTICULAR PURPOSE, AND IN NO EVENT SHALL THE UNIVERSITY OF
384 * WASHINGTON OR THE LELAND STANFORD JUNIOR UNIVERSITY BE LIABLE FOR ANY
385 * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
386 * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
387 * CONTRACT, TORT (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF
388 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
389 *
390 */
391
392static char B64[] =
393 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
394
395// the mime base64 disctionary used for decoding
396static signed char b64dec[] = {
397 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 0
398 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 10
399 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 20
400 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 30
401 -1, -1, -1,-19, -1, -1, -1,-16, -4, -4, // 40 -19 == '+' -16 == '/'
402 -4, -4, -4, -4, -4, -4, -4, -4, -1, -1, // 50 -4 == '0'
403 -1, 0, -1, -1, -1, 65, 65, 65, 65, 65, // 60 0 == '=' 65 == 'A'
404 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, // 70
405 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, // 80
406 65, -1, -1, -1, -1, -1, -1, 71, 71, 71, // 90 71 == 'a'
407 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, // 100
408 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, // 110
409 71, 71, 71, -1, -1, -1, -1, -1, -1, -1, // 120
410 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 130
411 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 140
412 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 150
413 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 160
414 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 170
415 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 180
416 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 190
417 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 200
418 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 210
419 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 220
420 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 230
421 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 240
422 -1, -1, -1, -1, -1, -1, -1 // 250
423};
424
425 char *
426VCARD::decodeBase64(const char * s, unsigned long srcl, unsigned long & len)
427{
428 register unsigned char c;
429 register unsigned long e(0);
430 len = 0;
431 unsigned const char * src = (unsigned const char *)s;
432 char * ret = new char[srcl + (srcl / 4 + 1)];
433 register char *d = ret;
434 while (srcl--) { // Critical loop
435 c = *src++;
436 int dec = b64dec[c];
437 if (dec == -1) continue;
438 if (c == '=') {
439 switch (e++) {
440 case 3: e = 0; break;
441 case 2: if (*src == '=') break;
442 default: delete [] ret; ret = 0; return 0;break;
443 }
444 continue;
445 }
446 c -= dec;
447 if (e == 0) { *d = c << 2; ++e; continue; }
448 switch (e) {
449 case 1: *d |= c >> 4; *++d = c << 4;break;
450 case 2: *d |= c >> 2; *++d = c << 6;break;
451 case 3: *d++ |= c; e = 0; continue; break;
452 }
453 ++e;
454 }
455 len = d - (char *)ret;
456 return ret;
457}
458
459
460 char *
461VCARD::encodeBase64(const char * src, unsigned long srcl, unsigned long & destl)
462{
463 register const unsigned char *s = (unsigned char *)src;
464 register unsigned long i = ((srcl + 2) / 3) * 4;
465 destl = i += 2 * ((i / 60) + 1);
466 i = 0;
467 char * ret = new char[destl];
468 register unsigned char *d((unsigned char *)ret);
469 while (srcl != 0) { // Critical loop
470 *d++ = B64[s[0] >> 2];
471 *d++ = B64[((s[0] << 4) + (--srcl == 0 ? 0 : s[1] >> 4)) & 0x3f];
472 *d++ = srcl == 0 ? '=' :
473 B64[((s[1] << 2) + (--srcl == 0 ? 0 : s[2] >> 6)) & 0x3f];
474 *d++ = srcl == 0 ?'=' : B64[s[2] & 0x3f];
475 if (srcl != 0) srcl--;
476 if (++i == 15) { i = 0; *d++ = '\r'; *d++ = '\n'; }
477 s += 3;
478 }
479 *d = '\r'; *++d = '\n'; *++d = '\0';
480 return ret;
481}
482
diff --git a/kabc/vcard/FloatValue.cpp b/kabc/vcard/FloatValue.cpp
new file mode 100644
index 0000000..15bb664
--- a/dev/null
+++ b/kabc/vcard/FloatValue.cpp
@@ -0,0 +1,120 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1998 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#include <VCardFloatValue.h>
25
26#include <VCardValue.h>
27
28using namespace VCARD;
29
30FloatValue::FloatValue()
31 :Value()
32{
33}
34
35FloatValue::FloatValue(float f)
36 : Value(),
37 value_(f)
38{
39 parsed_ = true;
40}
41
42FloatValue::FloatValue(const FloatValue & x)
43 :Value(x)
44{
45 value_ = x.value_;
46}
47
48FloatValue::FloatValue(const QCString & s)
49 :Value(s)
50{
51}
52
53 FloatValue &
54FloatValue::operator = (FloatValue & x)
55{
56 if (*this == x) return *this;
57
58 x.parse();
59 value_ = x.value_;
60
61 Value::operator = (x);
62 return *this;
63}
64
65 FloatValue &
66FloatValue::operator = (const QCString & s)
67{
68 Value::operator = (s);
69 return *this;
70}
71
72 bool
73FloatValue::operator == (FloatValue & x)
74{
75 x.parse();
76 return (value_ == x.value_);
77}
78
79FloatValue::~FloatValue()
80{
81}
82
83 void
84FloatValue::_parse()
85{
86 bool negative(false);
87
88 if (strRep_[0] == '-' || strRep_[1] == '+') {
89
90 if (strRep_[0] == '-')
91 negative = true;
92
93 strRep_.remove(0, 1);
94 }
95
96 value_ = strRep_.toFloat();
97 if (negative)
98 value_ = -value_;
99}
100
101 void
102FloatValue::_assemble()
103{
104 strRep_ = QCString().setNum(value_);
105}
106
107 float
108FloatValue::value()
109{
110 parse();
111 return value_;
112}
113
114 void
115FloatValue::setValue(float f)
116{
117 parsed_ = true;
118 value_ = f;
119}
120
diff --git a/kabc/vcard/GeoValue.cpp b/kabc/vcard/GeoValue.cpp
new file mode 100644
index 0000000..e02b402
--- a/dev/null
+++ b/kabc/vcard/GeoValue.cpp
@@ -0,0 +1,100 @@
1/*
2 This file is part of libvcard.
3 Copyright (c) 2002 Tobias Koenig <tokoe@kde.org>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library 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 GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
19*/
20
21#include <VCardGeoValue.h>
22
23#include <VCardValue.h>
24
25#include <kdebug.h>
26
27using namespace VCARD;
28
29GeoValue::GeoValue()
30 :Value()
31{
32}
33
34GeoValue::GeoValue(const GeoValue & x)
35 :Value(x), latitude_(x.latitude_), longitude_(x.longitude_)
36{
37}
38
39GeoValue::GeoValue(const QCString & s)
40 :Value(s)
41{
42}
43
44 GeoValue &
45GeoValue::operator = (GeoValue & x)
46{
47 if (*this == x) return *this;
48
49 latitude_ = x.latitude_;
50 longitude_ = x.longitude_;
51
52 Value::operator = (x);
53 return *this;
54}
55
56 GeoValue &
57GeoValue::operator = (const QCString & s)
58{
59 Value::operator = (s);
60 return *this;
61}
62
63 bool
64GeoValue::operator == (GeoValue & x)
65{
66 x.parse();
67
68 if ( latitude_ != x.latitude_ ) return false;
69 if ( longitude_ != x.longitude_ ) return false;
70
71 return true;
72}
73
74GeoValue::~GeoValue()
75{
76}
77
78 GeoValue *
79GeoValue::clone()
80{
81 return new GeoValue( *this );
82}
83
84 void
85GeoValue::_parse()
86{
87 int semiColon = strRep_.find( ";" );
88
89 if ( semiColon == -1 ) // invalid
90 return;
91
92 latitude_ = strRep_.left( semiColon ).toFloat();
93 longitude_ = strRep_.mid( semiColon + 1, strRep_.length() - semiColon ).toFloat();
94}
95
96 void
97GeoValue::_assemble()
98{
99 strRep_.sprintf( "%.6f;%.6f", latitude_, longitude_ );
100}
diff --git a/kabc/vcard/ImageParam.cpp b/kabc/vcard/ImageParam.cpp
new file mode 100644
index 0000000..c9cf6fd
--- a/dev/null
+++ b/kabc/vcard/ImageParam.cpp
@@ -0,0 +1,81 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1998 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#include <VCardImageParam.h>
25
26#include <VCardParam.h>
27
28using namespace VCARD;
29
30ImageParam::ImageParam()
31 :Param()
32{
33}
34
35ImageParam::ImageParam(const ImageParam & x)
36 :Param(x)
37{
38}
39
40ImageParam::ImageParam(const QCString & s)
41 :Param(s)
42{
43}
44
45 ImageParam &
46ImageParam::operator = (ImageParam & x)
47{
48 if (*this == x) return *this;
49
50 Param::operator = (x);
51 return *this;
52}
53
54 ImageParam &
55ImageParam::operator = (const QCString & s)
56{
57 Param::operator = (s);
58 return *this;
59}
60
61 bool
62ImageParam::operator == (ImageParam & x)
63{
64 x.parse();
65 return false;
66}
67
68ImageParam::~ImageParam()
69{
70}
71
72 void
73ImageParam::_parse()
74{
75}
76
77 void
78ImageParam::_assemble()
79{
80}
81
diff --git a/kabc/vcard/ImageValue.cpp b/kabc/vcard/ImageValue.cpp
new file mode 100644
index 0000000..4630fac
--- a/dev/null
+++ b/kabc/vcard/ImageValue.cpp
@@ -0,0 +1,81 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1998 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#include <VCardImageValue.h>
25
26#include <VCardValue.h>
27
28using namespace VCARD;
29
30ImageValue::ImageValue()
31 :Value()
32{
33}
34
35ImageValue::ImageValue(const ImageValue & x)
36 :Value(x)
37{
38}
39
40ImageValue::ImageValue(const QCString & s)
41 :Value(s)
42{
43}
44
45 ImageValue &
46ImageValue::operator = (ImageValue & x)
47{
48 if (*this == x) return *this;
49
50 Value::operator = (x);
51 return *this;
52}
53
54 ImageValue &
55ImageValue::operator = (const QCString & s)
56{
57 Value::operator = (s);
58 return *this;
59}
60
61 bool
62ImageValue::operator == (ImageValue & x)
63{
64 x.parse();
65 return false;
66}
67
68ImageValue::~ImageValue()
69{
70}
71
72 void
73ImageValue::_parse()
74{
75}
76
77 void
78ImageValue::_assemble()
79{
80}
81
diff --git a/kabc/vcard/ImgValue.cpp b/kabc/vcard/ImgValue.cpp
new file mode 100644
index 0000000..7b961f8
--- a/dev/null
+++ b/kabc/vcard/ImgValue.cpp
@@ -0,0 +1,81 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1998 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#include <VCardImgValue.h>
25
26#include <VCardValue.h>
27
28using namespace VCARD;
29
30ImgValue::ImgValue()
31 :Value()
32{
33}
34
35ImgValue::ImgValue(const ImgValue & x)
36 :Value(x)
37{
38}
39
40ImgValue::ImgValue(const QCString & s)
41 :Value(s)
42{
43}
44
45 ImgValue &
46ImgValue::operator = (ImgValue & x)
47{
48 if (*this == x) return *this;
49
50 Value::operator = (x);
51 return *this;
52}
53
54 ImgValue &
55ImgValue::operator = (const QCString & s)
56{
57 Value::operator = (s);
58 return *this;
59}
60
61 bool
62ImgValue::operator == (ImgValue & x)
63{
64 x.parse();
65 return false;
66}
67
68ImgValue::~ImgValue()
69{
70}
71
72 void
73ImgValue::_parse()
74{
75}
76
77 void
78ImgValue::_assemble()
79{
80}
81
diff --git a/kabc/vcard/LangValue.cpp b/kabc/vcard/LangValue.cpp
new file mode 100644
index 0000000..edf1804
--- a/dev/null
+++ b/kabc/vcard/LangValue.cpp
@@ -0,0 +1,127 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1998 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#include <VCardRToken.h>
25
26#include <VCardLangValue.h>
27
28#include <VCardValue.h>
29
30using namespace VCARD;
31
32LangValue::LangValue()
33 :Value()
34{
35}
36
37LangValue::LangValue(const LangValue & x)
38 :Value(x)
39{
40}
41
42LangValue::LangValue(const QCString & s)
43 :Value(s)
44{
45}
46
47 LangValue &
48LangValue::operator = (LangValue & x)
49{
50 if (*this == x) return *this;
51
52 Value::operator = (x);
53 return *this;
54}
55
56 LangValue &
57LangValue::operator = (const QCString & s)
58{
59 Value::operator = (s);
60 return *this;
61}
62
63 bool
64LangValue::operator == (LangValue & x)
65{
66 x.parse();
67 return false;
68}
69
70LangValue::~LangValue()
71{
72}
73
74 void
75LangValue::_parse()
76{
77 QStrList l;
78 RTokenise(strRep_, "-", l);
79
80 if (l.count() == 0) return;
81
82 primary_ = l.at(0);
83
84 l.remove(0u);
85
86 subtags_ = l;
87}
88
89 void
90LangValue::_assemble()
91{
92 strRep_ = primary_;
93
94 QStrListIterator it(subtags_);
95
96 for (; it.current(); ++it)
97 strRep_ += QCString('-') + it.current();
98}
99
100 QCString
101LangValue::primary()
102{
103 parse();
104 return primary_;
105}
106
107 QStrList
108LangValue::subtags()
109{
110 parse();
111 return subtags_;
112}
113
114 void
115LangValue::setPrimary(const QCString & s)
116{
117 parse();
118 primary_ = s;
119}
120
121 void
122LangValue::setSubTags(const QStrList & l)
123{
124 parse();
125 subtags_ = l;
126}
127
diff --git a/kabc/vcard/NValue.cpp b/kabc/vcard/NValue.cpp
new file mode 100644
index 0000000..cdec621
--- a/dev/null
+++ b/kabc/vcard/NValue.cpp
@@ -0,0 +1,128 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1999 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#include <qstrlist.h>
25
26#include <VCardRToken.h>
27#include <VCardNValue.h>
28#include <VCardValue.h>
29#include <VCardDefines.h>
30
31using namespace VCARD;
32
33NValue::NValue()
34 :Value()
35{
36 vDebug("ctor");
37}
38
39NValue::NValue(const NValue & x)
40 :Value(x),
41 family_(x.family_),
42 given_(x.given_),
43 middle_(x.middle_),
44 prefix_(x.prefix_),
45 suffix_(x.suffix_)
46{
47}
48
49NValue::NValue(const QCString & s)
50 :Value(s)
51{
52 vDebug("ctor");
53}
54
55 NValue &
56NValue::operator = (NValue & x)
57{
58 if (*this == x) return *this;
59
60 family_= x.family_;
61 given_= x.given_;
62 middle_= x.middle_;
63 prefix_= x.prefix_;
64 suffix_= x.suffix_;
65
66 Value::operator = (x);
67 return *this;
68}
69
70 NValue &
71NValue::operator = (const QCString & s)
72{
73 Value::operator = (s);
74 return *this;
75}
76
77 bool
78NValue::operator == (NValue & x)
79{
80 x.parse();
81
82 return (
83 family_ == x.family_&&
84 given_ == x.given_&&
85 middle_ == x.middle_&&
86 prefix_ == x.prefix_&&
87 suffix_ == x.suffix_);
88}
89
90NValue::~NValue()
91{
92}
93
94 NValue *
95NValue::clone()
96{
97 return new NValue( *this );
98}
99
100 void
101NValue::_parse()
102{
103 QStrList l;
104 RTokenise(strRep_, ";", l);
105
106 for (unsigned int i = 0; i < l.count(); i++) {
107
108 switch (i) {
109 case 0: family_ = l.at(0);break;
110 case 1: given_ = l.at(1);break;
111 case 2: middle_ = l.at(2);break;
112 case 3: prefix_ = l.at(3);break;
113 case 4: suffix_ = l.at(4);break;
114 default: break;
115 }
116 }
117}
118
119 void
120NValue::_assemble()
121{
122 strRep_ = family_;
123 strRep_ += ";" +given_;
124 strRep_ += ";" +middle_;
125 strRep_ += ";" +prefix_;
126 strRep_ += ";" +suffix_;
127}
128
diff --git a/kabc/vcard/OrgValue.cpp b/kabc/vcard/OrgValue.cpp
new file mode 100644
index 0000000..c3134c8
--- a/dev/null
+++ b/kabc/vcard/OrgValue.cpp
@@ -0,0 +1,107 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1998 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#include <VCardRToken.h>
25
26#include <VCardOrgValue.h>
27
28#include <VCardValue.h>
29
30using namespace VCARD;
31
32OrgValue::OrgValue()
33 :Value()
34{
35}
36
37OrgValue::OrgValue(const OrgValue & x)
38 :Value(x)
39{
40}
41
42OrgValue::OrgValue(const QCString & s)
43 :Value(s)
44{
45}
46
47 OrgValue &
48OrgValue::operator = (OrgValue & x)
49{
50 if (*this == x) return *this;
51
52 Value::operator = (x);
53 return *this;
54}
55
56 OrgValue &
57OrgValue::operator = (const QCString & s)
58{
59 Value::operator = (s);
60 return *this;
61}
62
63 bool
64OrgValue::operator == (OrgValue & x)
65{
66 x.parse();
67 return false;
68}
69
70OrgValue::~OrgValue()
71{
72}
73
74 void
75OrgValue::_parse()
76{
77 RTokenise(strRep_, ";", valueList_);
78}
79
80 void
81OrgValue::_assemble()
82{
83 bool first(true);
84
85 QStrListIterator it(valueList_);
86
87 for (; it.current(); ++it) {
88 if (!first) strRep_ += ';';
89 strRep_ += it.current();
90 first = false;
91 }
92}
93
94 unsigned int
95OrgValue::numValues()
96{
97 parse();
98 return valueList_.count();
99}
100
101 QCString
102OrgValue::value(unsigned int i)
103{
104 parse();
105 return valueList_.at(i);
106}
107
diff --git a/kabc/vcard/Param.cpp b/kabc/vcard/Param.cpp
new file mode 100644
index 0000000..c513613
--- a/dev/null
+++ b/kabc/vcard/Param.cpp
@@ -0,0 +1,129 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1998 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#include <VCardParam.h>
25
26#include <VCardEntity.h>
27
28#include <VCardRToken.h>
29
30using namespace VCARD;
31
32Param::Param()
33 :Entity(),
34 name_(""),
35 value_("")
36{
37}
38
39Param::Param(const Param & x)
40 :Entity(x),
41 name_(x.name_),
42 value_(x.value_)
43{
44}
45
46Param::Param(const QCString & s)
47 :Entity(s),
48 name_(""),
49 value_("")
50{
51}
52
53 Param &
54Param::operator = (Param & x)
55{
56 if (*this == x) return *this;
57
58 Entity::operator = (x);
59 name_ = x.name_;
60 value_ = x.value_;
61
62 return *this;
63}
64
65 Param &
66Param::operator = (const QCString & s)
67{
68 Entity::operator = (s);
69 return *this;
70}
71
72 bool
73Param::operator == (Param & x)
74{
75 x.parse();
76 return false;
77}
78
79Param::~Param()
80{
81}
82
83 void
84Param::_parse()
85{
86}
87
88 void
89Param::_assemble()
90{
91 strRep_ = name_ + "=" + value_;
92}
93
94Param::Param(const QCString &name, const QCString &value)
95 :Entity(),
96 name_(name),
97 value_(value)
98{
99 parsed_ = true;
100 assembled_ = false;
101}
102
103 void
104Param::setName(const QCString & name)
105{
106 name_ = name;
107
108 assembled_ = false;
109}
110
111 void
112Param::setValue(const QCString & value)
113{
114 value_ = value;
115
116 assembled_ = false;
117}
118
119 QCString
120Param::name()
121{
122 return name_;
123}
124
125 QCString
126Param::value()
127{
128 return value_;
129}
diff --git a/kabc/vcard/PhoneNumberValue.cpp b/kabc/vcard/PhoneNumberValue.cpp
new file mode 100644
index 0000000..17b1400
--- a/dev/null
+++ b/kabc/vcard/PhoneNumberValue.cpp
@@ -0,0 +1,81 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1998 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#include <VCardPhoneNumberValue.h>
25
26#include <VCardValue.h>
27
28using namespace VCARD;
29
30PhoneNumberValue::PhoneNumberValue()
31 :Value()
32{
33}
34
35PhoneNumberValue::PhoneNumberValue(const PhoneNumberValue & x)
36 :Value(x)
37{
38}
39
40PhoneNumberValue::PhoneNumberValue(const QCString & s)
41 :Value(s)
42{
43}
44
45 PhoneNumberValue &
46PhoneNumberValue::operator = (PhoneNumberValue & x)
47{
48 if (*this == x) return *this;
49
50 Value::operator = (x);
51 return *this;
52}
53
54 PhoneNumberValue &
55PhoneNumberValue::operator = (const QCString & s)
56{
57 Value::operator = (s);
58 return *this;
59}
60
61 bool
62PhoneNumberValue::operator == (PhoneNumberValue & x)
63{
64 x.parse();
65 return false;
66}
67
68PhoneNumberValue::~PhoneNumberValue()
69{
70}
71
72 void
73PhoneNumberValue::_parse()
74{
75}
76
77 void
78PhoneNumberValue::_assemble()
79{
80}
81
diff --git a/kabc/vcard/README b/kabc/vcard/README
new file mode 100644
index 0000000..18a9daf
--- a/dev/null
+++ b/kabc/vcard/README
@@ -0,0 +1,15 @@
1libvcard (C) 1999 Rik Hemsley <rik@kde.org>
2Written for the KDE project.
3
4This software is licensed under the MIT license.
5
6A vCard 3.0 parser based on the same principles that librmm (from Empath) uses.
7
8It's small and very fast due to parsing and assembly of object being lazy.
9
10There is a base64 codec declared in Enum.h
11
12Feedback welcome.
13
14Rik <rik@kde.org>
15
diff --git a/kabc/vcard/RToken.cpp b/kabc/vcard/RToken.cpp
new file mode 100644
index 0000000..2a85820
--- a/dev/null
+++ b/kabc/vcard/RToken.cpp
@@ -0,0 +1,88 @@
1/*
2
3 libvcard - vCard parsing library for vCard version 3.0
4
5 Copyright (C) 1999 Rik Hemsley rik@kde.org
6
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software and associated documentation files (the "Software"), to
9 deal in the Software without restriction, including without limitation the
10 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
11 sell copies of the Software, and to permit persons to whom the Software is
12 furnished to do so, subject to the following conditions:
13
14 The above copyright notice and this permission notice shall be included in
15 all copies or substantial portions of the Software.
16
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
21 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23*/
24
25#include <string.h>
26#include <stddef.h>
27#include <qcstring.h>
28#include <qstrlist.h>
29
30namespace VCARD
31{
32
33 Q_UINT32
34RTokenise(const char * str, const char * delim, QStrList & l)
35{
36 // FIXME no stderr !
37 l.clear();
38
39 if (!delim || !str || strlen(delim) == 0 || strlen(str) == 0) return 0;
40
41 char * len = (char *)(str + strlen(str));// End of string.
42
43 register char * rstart = new char[strlen(str) + 1];
44 register char * r = rstart;
45
46
47 register const char * i = str;// Cursor.
48
49 while (i <= len) {
50
51 if (*i == '\\') { // Escaped chars go straight through.
52 *r++ = *i++;
53 if (i <= len)
54 *r++ = *i++;
55 continue;
56 }
57
58 if (strchr(delim, *i) != 0) {
59 // We hit a delimiter. If we have some text, make a new token.
60 // This has the effect that multiple delimiters are collapsed.
61 // cs: We mustn't collapse multiple delimiters, otherwise we
62 // lose empty fields.
63 *r = '\0';
64 // if (r != rstart) {
65 l.append(rstart);
66 // }
67 r = rstart;
68 ++i;
69 continue;
70 }
71
72 *r++ = *i++;
73 }
74
75 // Catch last token
76 //if (r != rstart) {
77 *r = '\0';
78 l.append(rstart);
79 //}
80
81 r = 0;
82
83 delete [] rstart;
84
85 return l.count();
86}
87
88}
diff --git a/kabc/vcard/SoundValue.cpp b/kabc/vcard/SoundValue.cpp
new file mode 100644
index 0000000..81040d1
--- a/dev/null
+++ b/kabc/vcard/SoundValue.cpp
@@ -0,0 +1,81 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1998 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#include <VCardSoundValue.h>
25
26#include <VCardValue.h>
27
28using namespace VCARD;
29
30SoundValue::SoundValue()
31 :Value()
32{
33}
34
35SoundValue::SoundValue(const SoundValue & x)
36 :Value(x)
37{
38}
39
40SoundValue::SoundValue(const QCString & s)
41 :Value(s)
42{
43}
44
45 SoundValue &
46SoundValue::operator = (SoundValue & x)
47{
48 if (*this == x) return *this;
49
50 Value::operator = (x);
51 return *this;
52}
53
54 SoundValue &
55SoundValue::operator = (const QCString & s)
56{
57 Value::operator = (s);
58 return *this;
59}
60
61 bool
62SoundValue::operator == (SoundValue & x)
63{
64 x.parse();
65 return false;
66}
67
68SoundValue::~SoundValue()
69{
70}
71
72 void
73SoundValue::_parse()
74{
75}
76
77 void
78SoundValue::_assemble()
79{
80}
81
diff --git a/kabc/vcard/SourceParam.cpp b/kabc/vcard/SourceParam.cpp
new file mode 100644
index 0000000..cd51cbd
--- a/dev/null
+++ b/kabc/vcard/SourceParam.cpp
@@ -0,0 +1,112 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1998 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#include <VCardSourceParam.h>
25
26#include <VCardParam.h>
27
28using namespace VCARD;
29
30SourceParam::SourceParam()
31 :Param(),
32 type_(SourceParam::TypeUnknown)
33{
34}
35
36SourceParam::SourceParam(const SourceParam & x)
37 :Param(x),
38 type_(x.type_),
39 par_(x.par_),
40 val_(x.val_)
41{
42}
43
44SourceParam::SourceParam(const QCString & s)
45 :Param(s),
46 type_(SourceParam::TypeUnknown)
47{
48}
49
50 SourceParam &
51SourceParam::operator = (SourceParam & x)
52{
53 if (*this == x) return *this;
54 type_= x.type();
55 par_= x.par();
56 val_= x.val();
57
58 Param::operator = (x);
59 return *this;
60}
61
62 SourceParam &
63SourceParam::operator = (const QCString & s)
64{
65 Param::operator = (s);
66 return *this;
67}
68
69 bool
70SourceParam::operator == (SourceParam & x)
71{
72 x.parse();
73 return false;
74}
75
76SourceParam::~SourceParam()
77{
78}
79
80 void
81SourceParam::_parse()
82{
83 int i = strRep_.find('=');
84 if (i == -1) // Invalid
85 return;
86
87 par_ = strRep_.left(i);
88 val_ = strRep_.right(strRep_.length() - i - 1);
89
90 if (qstricmp(par_, "VALUE") == 0 && qstricmp(val_, "uri") == 0)
91 type_ = TypeValue;
92 else if (qstricmp(par_, "CONTEXT") == 0 && qstricmp(val_, "word") == 0)
93 type_ = TypeContext;
94 else if (qstrnicmp(par_, "X-", 2) == 0) {
95 type_ = TypeX;
96 }
97 else type_ = TypeUnknown;
98
99}
100
101 void
102SourceParam::_assemble()
103{
104 if (type_ == TypeValue)
105 strRep_ = "VALUE=uri";
106 else if (type_ == TypeContext)
107 strRep_ = "CONTEXT=word";
108 else if (type_ == TypeX)
109 strRep_ = par_ + "=" + val_;
110 else strRep_ = "";
111}
112
diff --git a/kabc/vcard/TelParam.cpp b/kabc/vcard/TelParam.cpp
new file mode 100644
index 0000000..9d9fe4d
--- a/dev/null
+++ b/kabc/vcard/TelParam.cpp
@@ -0,0 +1,81 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1998 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#include <VCardTelParam.h>
25
26#include <VCardParam.h>
27
28using namespace VCARD;
29
30TelParam::TelParam()
31 :Param()
32{
33}
34
35TelParam::TelParam(const TelParam & x)
36 :Param(x)
37{
38}
39
40TelParam::TelParam(const QCString & s)
41 :Param(s)
42{
43}
44
45 TelParam &
46TelParam::operator = (TelParam & x)
47{
48 if (*this == x) return *this;
49
50 Param::operator = (x);
51 return *this;
52}
53
54 TelParam &
55TelParam::operator = (const QCString & s)
56{
57 Param::operator = (s);
58 return *this;
59}
60
61 bool
62TelParam::operator == (TelParam & x)
63{
64 x.parse();
65 return false;
66}
67
68TelParam::~TelParam()
69{
70}
71
72 void
73TelParam::_parse()
74{
75}
76
77 void
78TelParam::_assemble()
79{
80}
81
diff --git a/kabc/vcard/TelValue.cpp b/kabc/vcard/TelValue.cpp
new file mode 100644
index 0000000..349f99a
--- a/dev/null
+++ b/kabc/vcard/TelValue.cpp
@@ -0,0 +1,81 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1998 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#include <VCardTelValue.h>
25
26#include <VCardValue.h>
27
28using namespace VCARD;
29
30TelValue::TelValue()
31 :Value()
32{
33}
34
35TelValue::TelValue(const TelValue & x)
36 :Value(x)
37{
38}
39
40TelValue::TelValue(const QCString & s)
41 :Value(s)
42{
43}
44
45 TelValue &
46TelValue::operator = (TelValue & x)
47{
48 if (*this == x) return *this;
49
50 Value::operator = (x);
51 return *this;
52}
53
54 TelValue &
55TelValue::operator = (const QCString & s)
56{
57 Value::operator = (s);
58 return *this;
59}
60
61 bool
62TelValue::operator == (TelValue & x)
63{
64 x.parse();
65 return false;
66}
67
68TelValue::~TelValue()
69{
70}
71
72 void
73TelValue::_parse()
74{
75}
76
77 void
78TelValue::_assemble()
79{
80}
81
diff --git a/kabc/vcard/TextBinParam.cpp b/kabc/vcard/TextBinParam.cpp
new file mode 100644
index 0000000..66f2946
--- a/dev/null
+++ b/kabc/vcard/TextBinParam.cpp
@@ -0,0 +1,81 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1998 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#include <VCardTextBinParam.h>
25
26#include <VCardParam.h>
27
28using namespace VCARD;
29
30TextBinParam::TextBinParam()
31 :Param()
32{
33}
34
35TextBinParam::TextBinParam(const TextBinParam & x)
36 :Param(x)
37{
38}
39
40TextBinParam::TextBinParam(const QCString & s)
41 :Param(s)
42{
43}
44
45 TextBinParam &
46TextBinParam::operator = (TextBinParam & x)
47{
48 if (*this == x) return *this;
49
50 Param::operator = (x);
51 return *this;
52}
53
54 TextBinParam &
55TextBinParam::operator = (const QCString & s)
56{
57 Param::operator = (s);
58 return *this;
59}
60
61 bool
62TextBinParam::operator == (TextBinParam & x)
63{
64 x.parse();
65 return false;
66}
67
68TextBinParam::~TextBinParam()
69{
70}
71
72 void
73TextBinParam::_parse()
74{
75}
76
77 void
78TextBinParam::_assemble()
79{
80}
81
diff --git a/kabc/vcard/TextBinValue.cpp b/kabc/vcard/TextBinValue.cpp
new file mode 100644
index 0000000..c584009
--- a/dev/null
+++ b/kabc/vcard/TextBinValue.cpp
@@ -0,0 +1,104 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1998 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#include <kmdcodec.h>
25
26#include <VCardTextBinValue.h>
27#include <VCardValue.h>
28
29using namespace VCARD;
30
31TextBinValue::TextBinValue()
32 :Value()
33{
34}
35
36TextBinValue::TextBinValue(const TextBinValue & x)
37 :Value(x)
38{
39 mIsBinary_ = x.mIsBinary_;
40 mData_ = x.mData_;
41 mUrl_ = x.mUrl_;
42}
43
44TextBinValue::TextBinValue(const QCString & s)
45 :Value(s)
46{
47}
48
49 TextBinValue &
50TextBinValue::operator = (TextBinValue & x)
51{
52 if (*this == x) return *this;
53
54 mIsBinary_ = x.mIsBinary_;
55 mData_ = x.mData_;
56 mUrl_ = x.mUrl_;
57
58 Value::operator = (x);
59 return *this;
60}
61
62 TextBinValue &
63TextBinValue::operator = (const QCString & s)
64{
65 Value::operator = (s);
66 return *this;
67}
68
69 bool
70TextBinValue::operator == (TextBinValue & x)
71{
72 x.parse();
73
74 if ( mIsBinary_ != x.mIsBinary_ ) return false;
75 if ( mData_ != x.mData_ ) return false;
76 if ( mUrl_ != x.mUrl_ ) return false;
77
78 return true;
79}
80
81TextBinValue::~TextBinValue()
82{
83}
84
85 TextBinValue *
86TextBinValue::clone()
87{
88 return new TextBinValue( *this );
89}
90
91 void
92TextBinValue::_parse()
93{
94}
95
96 void
97TextBinValue::_assemble()
98{
99 if ( mIsBinary_ ) {
100 strRep_ = KCodecs::base64Encode( mData_ );
101 } else
102 strRep_ = mUrl_.utf8();
103}
104
diff --git a/kabc/vcard/TextListValue.cpp b/kabc/vcard/TextListValue.cpp
new file mode 100644
index 0000000..c4ac1e3
--- a/dev/null
+++ b/kabc/vcard/TextListValue.cpp
@@ -0,0 +1,107 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1998 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#include <VCardRToken.h>
25
26#include <VCardTextListValue.h>
27
28#include <VCardValue.h>
29
30using namespace VCARD;
31
32TextListValue::TextListValue()
33 :Value()
34{
35}
36
37TextListValue::TextListValue(const TextListValue & x)
38 :Value(x)
39{
40}
41
42TextListValue::TextListValue(const QCString & s)
43 :Value(s)
44{
45}
46
47 TextListValue &
48TextListValue::operator = (TextListValue & x)
49{
50 if (*this == x) return *this;
51
52 Value::operator = (x);
53 return *this;
54}
55
56 TextListValue &
57TextListValue::operator = (const QCString & s)
58{
59 Value::operator = (s);
60 return *this;
61}
62
63 bool
64TextListValue::operator == (TextListValue & x)
65{
66 x.parse();
67 return false;
68}
69
70TextListValue::~TextListValue()
71{
72}
73
74 void
75TextListValue::_parse()
76{
77 RTokenise(strRep_, ";", valueList_);
78}
79
80 void
81TextListValue::_assemble()
82{
83 bool first(true);
84
85 QStrListIterator it(valueList_);
86
87 for (; it.current(); ++it) {
88 if (!first) strRep_ += ';';
89 strRep_ += it.current();
90 first = false;
91 }
92}
93
94 unsigned int
95TextListValue::numValues()
96{
97 parse();
98 return valueList_.count();
99}
100
101 QCString
102TextListValue::value(unsigned int i)
103{
104 parse();
105 return valueList_.at(i);
106}
107
diff --git a/kabc/vcard/TextParam.cpp b/kabc/vcard/TextParam.cpp
new file mode 100644
index 0000000..7c68700
--- a/dev/null
+++ b/kabc/vcard/TextParam.cpp
@@ -0,0 +1,82 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1998 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#include <VCardTextParam.h>
25
26#include <VCardParam.h>
27
28using namespace VCARD;
29
30TextParam::TextParam()
31 :Param()
32{
33}
34
35TextParam::TextParam(const TextParam & x)
36 :Param(x)
37{
38}
39
40TextParam::TextParam(const QCString & s)
41 :Param(s)
42{
43}
44
45 TextParam &
46TextParam::operator = (TextParam & x)
47{
48 if (*this == x) return *this;
49
50 Param::operator = (x);
51 return *this;
52}
53
54 TextParam &
55TextParam::operator = (const QCString & s)
56{
57 Param::operator = (s);
58 return *this;
59}
60
61 bool
62TextParam::operator == (TextParam & x)
63{
64 x.parse();
65
66 return false;
67}
68
69TextParam::~TextParam()
70{
71}
72
73 void
74TextParam::_parse()
75{
76}
77
78 void
79TextParam::_assemble()
80{
81}
82
diff --git a/kabc/vcard/TextValue.cpp b/kabc/vcard/TextValue.cpp
new file mode 100644
index 0000000..09934fa
--- a/dev/null
+++ b/kabc/vcard/TextValue.cpp
@@ -0,0 +1,86 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1998 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#include <VCardTextValue.h>
25
26#include <VCardValue.h>
27
28using namespace VCARD;
29
30TextValue::TextValue()
31 :Value()
32{
33}
34
35TextValue::TextValue(const TextValue & x)
36 :Value(x)
37{
38}
39
40TextValue::TextValue(const QCString & s)
41 :Value(s)
42{
43}
44
45 TextValue &
46TextValue::operator = (TextValue & x)
47{
48 if (*this == x) return *this;
49
50 Value::operator = (x);
51 return *this;
52}
53
54 TextValue &
55TextValue::operator = (const QCString & s)
56{
57 Value::operator = (s);
58 return *this;
59}
60
61 bool
62TextValue::operator == (TextValue & x)
63{
64 return strRep_ = x.strRep_;
65}
66
67TextValue::~TextValue()
68{
69}
70
71 TextValue *
72TextValue::clone()
73{
74 return new TextValue( *this );
75}
76
77 void
78TextValue::_parse()
79{
80}
81
82 void
83TextValue::_assemble()
84{
85}
86
diff --git a/kabc/vcard/URIValue.cpp b/kabc/vcard/URIValue.cpp
new file mode 100644
index 0000000..c1d1022
--- a/dev/null
+++ b/kabc/vcard/URIValue.cpp
@@ -0,0 +1,133 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1998 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#include <VCardURIValue.h>
25
26#include <VCardValue.h>
27
28using namespace VCARD;
29
30URIValue::URIValue()
31 :Value()
32{
33}
34
35URIValue::URIValue(const QCString & scheme, const QCString & schemeSpecificPart)
36 :Value(),
37 scheme_ (scheme),
38 schemeSpecificPart_(schemeSpecificPart)
39{
40 parsed_ = true;
41}
42
43URIValue::URIValue(const URIValue & x)
44 : Value (x),
45 scheme_ (x.scheme_),
46 schemeSpecificPart_(x.schemeSpecificPart_)
47{
48}
49
50URIValue::URIValue(const QCString & s)
51 :Value(s)
52{
53}
54
55 URIValue &
56URIValue::operator = (URIValue & x)
57{
58 if (*this == x) return *this;
59
60 scheme_ = x.scheme_;
61 schemeSpecificPart_= x.schemeSpecificPart_;
62
63 Value::operator = (x);
64 return *this;
65}
66
67 URIValue &
68URIValue::operator = (const QCString & s)
69{
70 Value::operator = (s);
71 return *this;
72}
73
74 bool
75URIValue::operator == (URIValue & x)
76{
77 x.parse();
78 return (
79 (scheme_ == x.scheme_) &&
80 (schemeSpecificPart_== x.schemeSpecificPart_));
81
82 return false;
83}
84
85URIValue::~URIValue()
86{
87}
88
89 void
90URIValue::_parse()
91{
92 int split = strRep_.find(':');
93 if (split == -1)
94 return;
95
96 scheme_ = strRep_.left(split);
97 schemeSpecificPart_ = strRep_.mid(split + 1);
98}
99
100 void
101URIValue::_assemble()
102{
103 strRep_ = scheme_ + ':' + schemeSpecificPart_;
104}
105
106 QCString
107URIValue::scheme()
108{
109 parse();
110 return scheme_;
111}
112
113 QCString
114URIValue::schemeSpecificPart()
115{
116 parse();
117 return schemeSpecificPart_;
118}
119
120 void
121URIValue::setScheme(const QCString & s)
122{
123 parse();
124 scheme_ = s;
125}
126
127 void
128URIValue::setSchemeSpecificPart(const QCString & s)
129{
130 parse();
131 schemeSpecificPart_ = s;
132}
133
diff --git a/kabc/vcard/UTCValue.cpp b/kabc/vcard/UTCValue.cpp
new file mode 100644
index 0000000..374306c
--- a/dev/null
+++ b/kabc/vcard/UTCValue.cpp
@@ -0,0 +1,110 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1998 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#include <VCardUTCValue.h>
25
26#include <VCardValue.h>
27
28using namespace VCARD;
29
30UTCValue::UTCValue()
31 :Value()
32{
33}
34
35UTCValue::UTCValue(const UTCValue & x)
36 : Value(x),positive_(x.positive_), hour_(x.hour_), minute_(x.minute_)
37
38{
39}
40
41UTCValue::UTCValue(const QCString & s)
42 :Value(s)
43{
44}
45
46 UTCValue &
47UTCValue::operator = (UTCValue & x)
48{
49 if (*this == x) return *this;
50
51 positive_ = x.positive_;
52 hour_ = x.hour_;
53 minute_ = x.minute_;
54
55 Value::operator = (x);
56 return *this;
57}
58
59 UTCValue &
60UTCValue::operator = (const QCString & s)
61{
62 Value::operator = (s);
63 return *this;
64}
65
66 bool
67UTCValue::operator == (UTCValue & x)
68{
69 x.parse();
70
71 if (positive_ != x.positive_) return false;
72 if (hour_ != x.hour_) return false;
73 if (minute_ != x.minute_) return false;
74
75 return true;
76}
77
78UTCValue::~UTCValue()
79{
80}
81
82 UTCValue *
83UTCValue::clone()
84{
85 return new UTCValue( *this );
86}
87
88 void
89UTCValue::_parse()
90{
91 if ( strRep_.isEmpty() )
92 return;
93
94 positive_ = ( strRep_[0] == '+' );
95
96 int colon = strRep_.find( ':' );
97
98 if ( colon == -1 ) // Not valid.
99 return;
100
101 hour_= strRep_.mid( 1, 2 ).toInt();
102 minute_= strRep_.right( 2 ).toInt();
103}
104
105 void
106UTCValue::_assemble()
107{
108 strRep_.sprintf( "%c%.2i:%.2i", (positive_ ? '+' : '-'), hour_, minute_ );
109}
110
diff --git a/kabc/vcard/VCardEntity.cpp b/kabc/vcard/VCardEntity.cpp
new file mode 100644
index 0000000..0c21e2f
--- a/dev/null
+++ b/kabc/vcard/VCardEntity.cpp
@@ -0,0 +1,119 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1998 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#include <qregexp.h>
25
26#include <VCardDefines.h>
27#include <VCardVCardEntity.h>
28
29using namespace VCARD;
30
31VCardEntity::VCardEntity()
32 :Entity()
33{
34}
35
36VCardEntity::VCardEntity(const VCardEntity & x)
37 :Entity(x)
38{
39}
40
41VCardEntity::VCardEntity(const QCString & s)
42 :Entity(s)
43{
44}
45
46 VCardEntity &
47VCardEntity::operator = (VCardEntity & x)
48{
49 if (*this == x) return *this;
50
51 Entity::operator = (x);
52 return *this;
53}
54
55 VCardEntity &
56VCardEntity::operator = (const QCString & s)
57{
58 Entity::operator = (s);
59 return *this;
60}
61
62 bool
63VCardEntity::operator == (VCardEntity & x)
64{
65 x.parse();
66 return false;
67}
68
69VCardEntity::~VCardEntity()
70{
71}
72
73 void
74VCardEntity::_parse()
75{
76 vDebug("parse");
77 QCString s(strRep_);
78
79 int i = s.find(QRegExp("BEGIN:VCARD", false));
80
81 while (i != -1) {
82
83 i = s.find(QRegExp("BEGIN:VCARD", false), 11);
84
85 QCString cardStr(s.left(i));
86
87 VCard * v = new VCard(cardStr);
88
89 cardList_.append(v);
90
91 v->parse();
92
93 s.remove(0, i);
94 }
95}
96
97 void
98VCardEntity::_assemble()
99{
100 VCardListIterator it(cardList_);
101
102 for (; it.current(); ++it)
103 strRep_ += it.current()->asString() + "\r\n"; // One CRLF for luck.
104}
105
106 VCardList &
107VCardEntity::cardList()
108{
109 parse();
110 return cardList_;
111}
112
113 void
114VCardEntity::setCardList(const VCardList & l)
115{
116 parse();
117 cardList_ = l;
118}
119
diff --git a/kabc/vcard/VCardv.cpp b/kabc/vcard/VCardv.cpp
new file mode 100644
index 0000000..8d271f4
--- a/dev/null
+++ b/kabc/vcard/VCardv.cpp
@@ -0,0 +1,282 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1998 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#include <qcstring.h>
25#include <qstrlist.h>
26
27#include <VCardEntity.h>
28#include <VCardVCard.h>
29#include <VCardContentLine.h>
30#include <VCardRToken.h>
31
32#include <VCardDefines.h>
33
34using namespace VCARD;
35
36VCard::VCard()
37 :Entity()
38{
39}
40
41VCard::VCard(const VCard & x)
42 :Entity(x),
43 group_(x.group_),
44 contentLineList_(x.contentLineList_)
45{
46}
47
48VCard::VCard(const QCString & s)
49 :Entity(s)
50{
51}
52
53 VCard &
54VCard::operator = (VCard & x)
55{
56 if (*this == x) return *this;
57
58 group_ = x.group();
59 contentLineList_= x.contentLineList_;
60
61 Entity::operator = (x);
62 return *this;
63}
64
65 VCard &
66VCard::operator = (const QCString & s)
67{
68 Entity::operator = (s);
69 return *this;
70}
71
72 bool
73VCard::operator == (VCard & x)
74{
75 x.parse();
76 return false;
77}
78
79VCard::~VCard()
80{
81}
82
83 void
84VCard::_parse()
85{
86 vDebug("parse() called");
87 QStrList l;
88
89 RTokenise(strRep_, "\r\n", l);
90
91 if (l.count() < 3) { // Invalid VCARD !
92 vDebug("Invalid vcard");
93 return;
94 }
95
96 // Get the first line
97 QCString beginLine = QCString(l.at(0)).stripWhiteSpace();
98
99 vDebug("Begin line == \"" + beginLine + "\"");
100
101 // Remove extra blank lines
102 while (QCString(l.last()).isEmpty())
103 l.remove(l.last());
104
105 // Now we know this is the last line
106 QCString endLine = l.last();
107
108 // Trash the first and last lines as we have seen them.
109 l.remove(0u);
110 l.remove(l.last());
111
112 ///////////////////////////////////////////////////////////////
113 // FIRST LINE
114
115 int split = beginLine.find(':');
116
117 if (split == -1) { // invalid, no BEGIN
118 vDebug("No split");
119 return;
120 }
121
122 QCString firstPart(beginLine.left(split));
123 QCString valuePart(beginLine.mid(split + 1));
124
125 split = firstPart.find('.');
126
127 if (split != -1) {
128 group_ = firstPart.left(split);
129 firstPart= firstPart.right(firstPart.length() - split - 1);
130 }
131
132 if (qstrnicmp(firstPart, "BEGIN", 5) != 0) { // No BEGIN !
133 vDebug("No BEGIN");
134 return;
135 }
136
137 if (qstrnicmp(valuePart, "VCARD", 5) != 0) { // Not a vcard !
138 vDebug("No VCARD");
139 return;
140 }
141
142 ///////////////////////////////////////////////////////////////
143 // CONTENT LINES
144 //
145 vDebug("Content lines");
146
147 // Handle folded lines.
148
149 QStrList refolded;
150
151 QStrListIterator it(l);
152
153 QCString cur;
154
155 for (; it.current(); ++it) {
156
157 cur = it.current();
158
159 ++it;
160
161 while (
162 it.current() &&
163 it.current()[0] == ' '&&
164 strlen(it.current()) != 1)
165 {
166 cur += it.current() + 1;
167 ++it;
168 }
169
170 --it;
171
172 refolded.append(cur);
173 }
174
175 QStrListIterator it2(refolded);
176
177 for (; it2.current(); ++it2) {
178
179 vDebug("New contentline using \"" + QCString(it2.current()) + "\"");
180 ContentLine * cl = new ContentLine(it2.current());
181
182 cl->parse();
183
184 contentLineList_.append(cl);
185 }
186
187 ///////////////////////////////////////////////////////////////
188 // LAST LINE
189
190 split = endLine.find(':');
191
192 if (split == -1) // invalid, no END
193 return;
194
195 firstPart = endLine.left(split);
196 valuePart = endLine.right(firstPart.length() - split - 1);
197
198 split = firstPart.find('.');
199
200 if (split != -1) {
201 group_ = firstPart.left(split);
202 firstPart= firstPart.right(firstPart.length() - split - 1);
203 }
204
205 if (qstricmp(firstPart, "END") != 0) // No END !
206 return;
207
208 if (qstricmp(valuePart, "VCARD") != 0) // Not a vcard !
209 return;
210}
211
212 void
213VCard::_assemble()
214{
215 vDebug("Assembling vcard");
216 strRep_ = "BEGIN:VCARD\r\n";
217 strRep_ += "VERSION:3.0\r\n";
218
219 QPtrListIterator<ContentLine> it(contentLineList_);
220
221 for (; it.current(); ++it)
222 strRep_ += it.current()->asString() + "\r\n";
223
224 strRep_ += "END:VCARD\r\n";
225}
226
227 bool
228VCard::has(EntityType t)
229{
230 parse();
231 return contentLine(t) == 0 ? false : true;
232}
233
234 bool
235VCard::has(const QCString & s)
236{
237 parse();
238 return contentLine(s) == 0 ? false : true;
239}
240
241 void
242VCard::add(const ContentLine & cl)
243{
244 parse();
245 ContentLine * c = new ContentLine(cl);
246 contentLineList_.append(c);
247}
248
249 void
250VCard::add(const QCString & s)
251{
252 parse();
253 ContentLine * c = new ContentLine(s);
254 contentLineList_.append(c);
255}
256
257 ContentLine *
258VCard::contentLine(EntityType t)
259{
260 parse();
261 QPtrListIterator<ContentLine> it(contentLineList_);
262
263 for (; it.current(); ++it)
264 if (it.current()->entityType() == t)
265 return it.current();
266
267 return 0;
268}
269
270 ContentLine *
271VCard::contentLine(const QCString & s)
272{
273 parse();
274 QPtrListIterator<ContentLine> it(contentLineList_);
275
276 for (; it.current(); ++it)
277 if (it.current()->entityType() == EntityNameToEntityType(s))
278 return it.current();
279
280 return 0;
281}
282
diff --git a/kabc/vcard/Value.cpp b/kabc/vcard/Value.cpp
new file mode 100644
index 0000000..1978af2
--- a/dev/null
+++ b/kabc/vcard/Value.cpp
@@ -0,0 +1,82 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1998 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#include <VCardEntity.h>
25#include <VCardValue.h>
26
27using namespace VCARD;
28
29Value::Value()
30 :Entity()
31{
32}
33
34Value::Value(const Value & x)
35 :Entity(x)
36{
37}
38
39Value::Value(const QCString & s)
40 :Entity(s)
41{
42}
43
44 Value &
45Value::operator = (Value & x)
46{
47 if (*this == x) return *this;
48
49 Entity::operator = (x);
50 return *this;
51}
52
53 Value &
54Value::operator = (const QCString & s)
55{
56 Entity::operator = (s);
57 return *this;
58}
59
60 bool
61Value::operator == (Value & x)
62{
63 x.parse();
64 return false;
65}
66
67Value::~Value()
68{
69}
70
71 void
72Value::_parse()
73{
74}
75
76 void
77Value::_assemble()
78{
79 //USvDebug("Value::_assemble()");
80 qDebug("Value::_assemble()");
81}
82
diff --git a/kabc/vcard/include/VCard.h b/kabc/vcard/include/VCard.h
new file mode 100644
index 0000000..17b50e8
--- a/dev/null
+++ b/kabc/vcard/include/VCard.h
@@ -0,0 +1,43 @@
1#ifndef VCARD_H
2#define VCARD_H
3
4#include "VCardAdrParam.h"
5#include "VCardAdrValue.h"
6#include "VCardAgentParam.h"
7#include "VCardAgentValue.h"
8#include "VCardClassValue.h"
9#include "VCardContentLine.h"
10#include "VCardDateParam.h"
11#include "VCardDateValue.h"
12#include "VCardDefines.h"
13#include "VCardEmailParam.h"
14#include "VCardEntity.h"
15#include "VCardEnum.h"
16#include "VCardFloatValue.h"
17#include "VCardGeoValue.h"
18#include "VCardGroup.h"
19#include "VCardImageParam.h"
20#include "VCardImageValue.h"
21#include "VCardImgValue.h"
22#include "VCardLangValue.h"
23#include "VCardNValue.h"
24#include "VCardOrgValue.h"
25#include "VCardParam.h"
26#include "VCardPhoneNumberValue.h"
27#include "VCardRToken.h"
28#include "VCardSoundValue.h"
29#include "VCardSourceParam.h"
30#include "VCardTelParam.h"
31#include "VCardTelValue.h"
32#include "VCardTextBinParam.h"
33#include "VCardTextBinValue.h"
34#include "VCardTextListValue.h"
35#include "VCardTextParam.h"
36#include "VCardTextValue.h"
37#include "VCardURIValue.h"
38#include "VCardUTCValue.h"
39#include "VCardVCard.h"
40#include "VCardVCardEntity.h"
41#include "VCardValue.h"
42
43#endif
diff --git a/kabc/vcard/include/VCardAdrParam.h b/kabc/vcard/include/VCardAdrParam.h
new file mode 100644
index 0000000..89dcb64
--- a/dev/null
+++ b/kabc/vcard/include/VCardAdrParam.h
@@ -0,0 +1,64 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1999 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#ifndef ADRPARAM_H
25#define ADRPARAM_H
26
27#include <qcstring.h>
28#include <qstrlist.h>
29
30#include <VCardParam.h>
31
32namespace VCARD
33{
34
35class AdrParam : public Param
36{
37
38#include "AdrParam-generated.h"
39
40 QStrList adrTypeList()
41 { parse(); return adrTypeList_; }
42
43 QCString textParam()
44 { parse(); return textParam_; }
45
46 void setAdrTypeList(const QStrList & l)
47 { adrTypeList_ = l; assembled_ = false; }
48
49 void setTextParam(const QCString & s)
50 { textParam_ = s; assembled_ = false; }
51
52 enum AdrType {
53 AdrDom, AdrIntl, AdrPostal, AdrParcel, AdrHome, AdrWork, AdrPref,
54 AdrIANA, AdrX
55 };
56
57 private:
58
59 QStrListadrTypeList_;
60 QCStringtextParam_;
61};
62}
63
64#endif
diff --git a/kabc/vcard/include/VCardAdrValue.h b/kabc/vcard/include/VCardAdrValue.h
new file mode 100644
index 0000000..0731924
--- a/dev/null
+++ b/kabc/vcard/include/VCardAdrValue.h
@@ -0,0 +1,83 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1999 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#ifndef ADRVALUE_H
25#define ADRVALUE_H
26
27#include <qstrlist.h>
28#include <VCardValue.h>
29
30namespace VCARD
31{
32
33class AdrValue : public Value
34{
35
36#include "AdrValue-generated.h"
37
38 AdrValue *clone();
39
40 void setPOBox(const QCString & s)
41 { poBox_ = s; assembled_ = false; }
42
43 void setExtAddress(const QCString & s)
44 { extAddress_ = s; assembled_ = false; }
45
46 void setStreet(const QCString & s)
47 { street_ = s; assembled_ = false; }
48
49 void setLocality(const QCString & s)
50 { locality_ = s; assembled_ = false; }
51
52 void setRegion(const QCString & s)
53 { region_ = s; assembled_ = false; }
54
55 void setPostCode(const QCString & s)
56 { postCode_ = s; assembled_ = false; }
57
58 void setCountryName(const QCString & s)
59 { countryName_ = s; assembled_ = false; }
60
61 QCString poBox() { parse(); return poBox_;}
62 QCString extAddress() { parse(); return extAddress_;}
63 QCString street() { parse(); return street_;}
64 QCString locality() { parse(); return locality_;}
65 QCString region() { parse(); return region_;}
66 QCString postCode() { parse(); return postCode_;}
67 QCString countryName() { parse(); return countryName_;}
68
69 private:
70
71 QCString poBox_;
72 QCString extAddress_;
73 QCString street_;
74 QCString locality_;
75 QCString region_;
76 QCString postCode_;
77 QCString countryName_;
78};
79
80}
81
82#endif
83
diff --git a/kabc/vcard/include/VCardAgentParam.h b/kabc/vcard/include/VCardAgentParam.h
new file mode 100644
index 0000000..72a05db
--- a/dev/null
+++ b/kabc/vcard/include/VCardAgentParam.h
@@ -0,0 +1,60 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1999 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#ifndef AGENTPARAM_H
25#define AGENTPARAM_H
26
27#include <qcstring.h>
28
29#include <VCardParam.h>
30#include <VCardURIValue.h>
31
32namespace VCARD
33{
34
35class AgentParam : public Param
36{
37
38#include "AgentParam-generated.h"
39
40 bool refer()
41 { parse(); return refer_; }
42
43 URIValue uri()
44 { parse(); return uri_; }
45
46 void setRefer(bool b)
47 { refer_ = b; assembled_ = false; }
48
49 void setURI(const QCString & s)
50 { uri_ = s; assembled_ = false; }
51
52 private:
53
54 bool refer_;
55 URIValueuri_;
56};
57
58}
59
60#endif
diff --git a/kabc/vcard/include/VCardAgentValue.h b/kabc/vcard/include/VCardAgentValue.h
new file mode 100644
index 0000000..f655836
--- a/dev/null
+++ b/kabc/vcard/include/VCardAgentValue.h
@@ -0,0 +1,44 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1999 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#ifndef AGENTVALUE_H
25#define AGENTVALUE_H
26
27#include <qcstring.h>
28
29#include <VCardValue.h>
30
31namespace VCARD
32{
33
34class AgentValue : public Value
35{
36
37#include "AgentValue-generated.h"
38
39 private:
40};
41
42}
43
44#endif
diff --git a/kabc/vcard/include/VCardClassValue.h b/kabc/vcard/include/VCardClassValue.h
new file mode 100644
index 0000000..ff133c2
--- a/dev/null
+++ b/kabc/vcard/include/VCardClassValue.h
@@ -0,0 +1,56 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1999 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#ifndef CLASSVALUE_H
25#define CLASSVALUE_H
26
27#include <qcstring.h>
28
29#include <VCardValue.h>
30
31#include <kdebug.h>
32
33namespace VCARD
34{
35
36class ClassValue : public Value
37{
38
39#include "ClassValue-generated.h"
40
41 enum ClassType {
42 Public, Private, Confidential, Other
43 };
44
45 ClassValue *clone();
46
47 void setType( int type ) { classType_ = type; assembled_ = false; parsed_ = true; }
48 int type() { parse(); return classType_; }
49
50 private:
51 int classType_;
52};
53
54}
55
56#endif
diff --git a/kabc/vcard/include/VCardContentLine.h b/kabc/vcard/include/VCardContentLine.h
new file mode 100644
index 0000000..1c5f5be
--- a/dev/null
+++ b/kabc/vcard/include/VCardContentLine.h
@@ -0,0 +1,77 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1999 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#ifndef CONTENTLINE_H
25#define CONTENTLINE_H
26
27#include <qptrlist.h>
28
29#include "VCardEnum.h"
30#include "VCardEntity.h"
31#include "VCardParam.h"
32#include "VCardValue.h"
33
34namespace VCARD
35{
36
37class ContentLine : public Entity
38{
39
40#include "ContentLine-generated.h"
41
42 QCString group() { parse(); return group_;}
43 QCString name() { parse(); return name_;}
44 Value * value() { parse(); return value_;}
45 ParamList paramList() { parse(); return paramList_;}
46 ParamType paramType() { parse(); return paramType_;}
47 ValueType valueType() { parse(); return valueType_;}
48 EntityType entityType() { parse(); return entityType_;}
49
50 void setGroup (const QCString & s)
51 { group_ = s; assembled_ = false; }
52
53 void setName (const QCString & s)
54 { name_ = s; assembled_ = false; }
55
56 void setValue (Value *s)
57 { value_ = s; assembled_ = false; }
58
59 void setParamList(const ParamList & l)
60 { paramList_ = l; assembled_ = false; }
61
62 void clear ();
63
64 private:
65
66 QCString group_;
67 QCString name_;
68 QPtrList<Param> paramList_;
69 Value * value_;
70
71 ParamType paramType_;
72 ValueType valueType_;
73 EntityType entityType_;
74};
75}
76
77#endif
diff --git a/kabc/vcard/include/VCardDateParam.h b/kabc/vcard/include/VCardDateParam.h
new file mode 100644
index 0000000..21ac1f1
--- a/dev/null
+++ b/kabc/vcard/include/VCardDateParam.h
@@ -0,0 +1,44 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1999 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#ifndef DATEPARAM_H
25#define DATEPARAM_H
26
27#include <qcstring.h>
28
29#include <VCardParam.h>
30
31namespace VCARD
32{
33
34class DateParam : public Param
35{
36
37#include "DateParam-generated.h"
38
39 private:
40};
41
42}
43
44#endif
diff --git a/kabc/vcard/include/VCardDateValue.h b/kabc/vcard/include/VCardDateValue.h
new file mode 100644
index 0000000..c248966
--- a/dev/null
+++ b/kabc/vcard/include/VCardDateValue.h
@@ -0,0 +1,99 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1999 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#ifndef DATEVALUE_H
25#define DATEVALUE_H
26
27#include <qcstring.h>
28#include <qdatetime.h>
29
30#include <VCardValue.h>
31
32namespace VCARD
33{
34
35class DateValue : public Value
36{
37#include "DateValue-generated.h"
38
39 DateValue(
40 unsigned intyear,
41 unsigned intmonth,
42 unsigned intday,
43 unsigned inthour = 0,
44 unsigned intminute = 0,
45 unsigned intsecond = 0,
46 double secFrac = 0,
47 bool zonePositive = true,
48 unsigned intzoneHour = 0,
49 unsigned intzoneMinute = 0);
50
51 DateValue(const QDate &);
52 DateValue(const QDateTime &);
53
54 DateValue *clone();
55
56 bool hasTime();
57
58 unsigned intyear();
59 unsigned intmonth();
60 unsigned intday();
61 unsigned inthour();
62 unsigned intminute();
63 unsigned intsecond();
64 double secondFraction();
65 bool zonePositive();
66 unsigned intzoneHour();
67 unsigned intzoneMinute();
68
69 void setYear (unsigned int);
70 void setMonth (unsigned int);
71 void setDay (unsigned int);
72 void setHour (unsigned int);
73 void setMinute (unsigned int);
74 void setSecond (unsigned int);
75 void setSecondFraction(double);
76 void setZonePositive(bool);
77 void setZoneHour (unsigned int);
78 void setZoneMinute (unsigned int);
79
80 QDate qdate();
81 QTime qtime();
82 QDateTime qdt();
83
84 private:
85
86 unsigned intyear_, month_, day_,
87 hour_, minute_, second_,
88 zoneHour_, zoneMinute_;
89
90 double secFrac_;
91
92 bool zonePositive_;
93
94 bool hasTime_;
95};
96
97}
98
99#endif
diff --git a/kabc/vcard/include/VCardDefines.h b/kabc/vcard/include/VCardDefines.h
new file mode 100644
index 0000000..dd38ae2
--- a/dev/null
+++ b/kabc/vcard/include/VCardDefines.h
@@ -0,0 +1,52 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1998 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#ifndef VCARD_DEFINES_H
25#define VCARD_DEFINES_H
26
27#include <kdebug.h>
28
29#ifdef VCARD_DEBUG
30#define vDebug(a) kdDebug(5710) << a << endl;
31#else
32#define vDebug(a)
33#endif
34
35#if 0
36#ifndef NDEBUG
37 #include <qcstring.h>
38 #include <iostream>
39 #ifdef __GNUG__
40 # define vDebug(a) cerr << className() << ":" << __FUNCTION__ << " (" \
41 << __LINE__ << "): " << QCString((a)).data() << endl;
42 #else
43 # define vDebug(a) cerr << className() << ": " \
44 << QCString((a)).data() << endl;
45 #endif
46#else
47 #define vDebug(a)
48#endif
49#endif
50
51#endif // Included this file
52
diff --git a/kabc/vcard/include/VCardEmailParam.h b/kabc/vcard/include/VCardEmailParam.h
new file mode 100644
index 0000000..98d1b30
--- a/dev/null
+++ b/kabc/vcard/include/VCardEmailParam.h
@@ -0,0 +1,56 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1999 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#ifndef EMAILPARAM_H
25#define EMAILPARAM_H
26
27#include <qcstring.h>
28
29#include <VCardParam.h>
30
31namespace VCARD
32{
33
34class EmailParam : public Param
35{
36
37#include "EmailParam-generated.h"
38
39 QCString emailType() { parse(); return emailType_;}
40 bool pref() { parse(); return pref_; }
41
42 void setEmailType(const QCString & s)
43 { emailType_ = s; assembled_ = false; }
44
45 void setPref(bool b)
46 { pref_ = b; assembled_ = false; }
47
48 private:
49
50 QCStringemailType_;
51 bool pref_;
52};
53
54}
55
56#endif
diff --git a/kabc/vcard/include/VCardEntity.h b/kabc/vcard/include/VCardEntity.h
new file mode 100644
index 0000000..3c945b5
--- a/dev/null
+++ b/kabc/vcard/include/VCardEntity.h
@@ -0,0 +1,67 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1999 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#ifndef ENTITY_H
25#define ENTITY_H
26
27#include <qcstring.h>
28
29namespace VCARD
30{
31
32class Entity
33{
34 public:
35
36 Entity();
37 Entity(const Entity & e);
38 Entity(const QCString & s);
39
40 virtual Entity & operator = (const Entity & e);
41 virtual Entity & operator = (const QCString & s);
42
43 virtual bool operator == (Entity & e);
44 virtual bool operator != (Entity & e);
45 virtual bool operator == (const QCString & s);
46 virtual bool operator != (const QCString & s);
47
48 virtual ~Entity();
49
50 QCString asString();
51
52 virtual void parse();
53 virtual void assemble();
54
55 virtual void _parse() = 0;
56 virtual void _assemble() = 0;
57
58 protected:
59
60 QCString strRep_;
61 bool parsed_;
62 bool assembled_;
63};
64
65}
66
67#endif
diff --git a/kabc/vcard/include/VCardEnum.h b/kabc/vcard/include/VCardEnum.h
new file mode 100644
index 0000000..b4e4094
--- a/dev/null
+++ b/kabc/vcard/include/VCardEnum.h
@@ -0,0 +1,120 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1999 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#ifndef ENUM_H
25#define ENUM_H
26
27#include <qcstring.h>
28
29namespace VCARD
30{
31
32extern const QCString paramNames [];
33
34enum EntityType {
35 EntityName,
36 EntityProfile,
37 EntitySource,
38 EntityFullName,
39 EntityN,
40 EntityNickname,
41 EntityPhoto,
42 EntityBirthday,
43 EntityAddress,
44 EntityLabel,
45 EntityTelephone,
46 EntityEmail,
47 EntityMailer,
48 EntityTimeZone,
49 EntityGeo,
50 EntityTitle,
51 EntityRole,
52 EntityLogo,
53 EntityAgent,
54 EntityOrganisation,
55 EntityCategories,
56 EntityNote,
57 EntityProductID,
58 EntityRevision,
59 EntitySortString,
60 EntitySound,
61 EntityUID,
62 EntityURL,
63 EntityVersion,
64 EntityClass,
65 EntityKey,
66 EntityExtension,
67 EntityUnknown
68};
69
70enum ValueType {
71 ValueSound,
72 ValueAgent,
73 ValueAddress,
74 ValueTel,
75 ValueTextBin,
76 ValueOrg,
77 ValueN,
78 ValueUTC,
79 ValueURI,
80 ValueClass,
81 ValueFloat,
82 ValueImage,
83 ValueDate,
84 ValueTextList,
85 ValueText,
86 ValueGeo,
87 ValueUnknown
88};
89
90enum ParamType {
91 ParamUnknown,
92 ParamNone,
93 ParamSource,
94 ParamText,
95 ParamImage,
96 ParamDate,
97 ParamAddrText,
98 ParamTel,
99 ParamEmail,
100 ParamMailer,
101 ParamAgent,
102 ParamTextBin,
103 ParamTextNS,
104 ParamSound
105};
106
107extern const ParamType paramTypesTable[];
108
109ParamType EntityTypeToParamType(EntityType);
110ValueType EntityTypeToValueType(EntityType);
111QCString EntityTypeToParamName(EntityType);
112EntityType EntityNameToEntityType(const QCString &);
113
114char * encodeBase64(const char *, unsigned long, unsigned long &);
115char * decodeBase64(const char *, unsigned long, unsigned long &);
116
117}
118
119#endif
120
diff --git a/kabc/vcard/include/VCardFloatValue.h b/kabc/vcard/include/VCardFloatValue.h
new file mode 100644
index 0000000..69fdc22
--- a/dev/null
+++ b/kabc/vcard/include/VCardFloatValue.h
@@ -0,0 +1,51 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1999 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#ifndef FLOATVALUE_H
25#define FLOATVALUE_H
26
27#include <qcstring.h>
28
29#include <VCardValue.h>
30
31namespace VCARD
32{
33
34class FloatValue : public Value
35{
36
37#include "FloatValue-generated.h"
38
39 FloatValue(float);
40
41 float value();
42 void setValue(float);
43
44 private:
45
46 float value_;
47};
48
49}
50
51#endif
diff --git a/kabc/vcard/include/VCardGeoValue.h b/kabc/vcard/include/VCardGeoValue.h
new file mode 100644
index 0000000..662761c
--- a/dev/null
+++ b/kabc/vcard/include/VCardGeoValue.h
@@ -0,0 +1,49 @@
1/*
2 This file is part of libvcard.
3 Copyright (c) 2002 Tobias Koenig <tokoe@kde.org>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library 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 GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
19*/
20
21#ifndef GEOVALUE_H
22#define GEOVALUE_H
23
24#include <VCardValue.h>
25
26namespace VCARD
27{
28
29class GeoValue : public Value
30{
31
32#include "GeoValue-generated.h"
33
34 GeoValue *clone();
35
36 void setLatitude( float lat ) { latitude_ = lat; assembled_ = false; }
37 void setLongitude( float lon ) { longitude_ = lon; assembled_ = false; }
38
39 float latitude() { parse(); return latitude_; }
40 float longitude() { parse(); return longitude_; }
41
42 private:
43 float latitude_;
44 float longitude_;
45};
46
47}
48
49#endif
diff --git a/kabc/vcard/include/VCardGroup.h b/kabc/vcard/include/VCardGroup.h
new file mode 100644
index 0000000..ff775fb
--- a/dev/null
+++ b/kabc/vcard/include/VCardGroup.h
@@ -0,0 +1,39 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1999 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#ifndef GROUP_H
25#define GROUP_H
26
27#include <VCardEntity.h>
28
29namespace VCARD
30{
31
32class Group : public Entity
33{
34#include "Group-generated.h"
35};
36
37}
38
39#endif
diff --git a/kabc/vcard/include/VCardImageParam.h b/kabc/vcard/include/VCardImageParam.h
new file mode 100644
index 0000000..ce99ccc
--- a/dev/null
+++ b/kabc/vcard/include/VCardImageParam.h
@@ -0,0 +1,44 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1999 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#ifndef IMGPARAM_H
25#define IMGPARAM_H
26
27#include <qcstring.h>
28
29#include <VCardParam.h>
30
31namespace VCARD
32{
33
34class ImageParam : public Param
35{
36
37#include "ImageParam-generated.h"
38
39 private:
40};
41
42}
43
44#endif
diff --git a/kabc/vcard/include/VCardImageValue.h b/kabc/vcard/include/VCardImageValue.h
new file mode 100644
index 0000000..6ce0371
--- a/dev/null
+++ b/kabc/vcard/include/VCardImageValue.h
@@ -0,0 +1,44 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1999 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#ifndef IMAGEVALUE_H
25#define IMAGEVALUE_H
26
27#include <qcstring.h>
28
29#include <VCardValue.h>
30
31namespace VCARD
32{
33
34class ImageValue : public Value
35{
36
37#include "ImageValue-generated.h"
38
39 private:
40};
41
42}
43
44#endif
diff --git a/kabc/vcard/include/VCardImgValue.h b/kabc/vcard/include/VCardImgValue.h
new file mode 100644
index 0000000..b09ad64
--- a/dev/null
+++ b/kabc/vcard/include/VCardImgValue.h
@@ -0,0 +1,39 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1999 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#ifndef IMGVALUE_H
25#define IMGVALUE_H
26
27#include <VCardValue.h>
28
29namespace VCARD
30{
31
32class ImgValue : public Value
33{
34#include "ImgValue-generated.h"
35};
36
37}
38
39#endif
diff --git a/kabc/vcard/include/VCardLangValue.h b/kabc/vcard/include/VCardLangValue.h
new file mode 100644
index 0000000..991ceed
--- a/dev/null
+++ b/kabc/vcard/include/VCardLangValue.h
@@ -0,0 +1,51 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1999 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#ifndef LANGVALUE_H
25#define LANGVALUE_H
26
27#include <qcstring.h>
28#include <qstrlist.h>
29
30#include <VCardValue.h>
31
32namespace VCARD
33{
34
35class LangValue : public Value
36{
37#include "LangValue-generated.h"
38
39 QCString primary();
40 QStrList subtags();
41
42 void setPrimary(const QCString &);
43 void setSubTags(const QStrList &);
44
45 QCString primary_;
46 QStrList subtags_;
47};
48
49}
50
51#endif
diff --git a/kabc/vcard/include/VCardNValue.h b/kabc/vcard/include/VCardNValue.h
new file mode 100644
index 0000000..306821b
--- a/dev/null
+++ b/kabc/vcard/include/VCardNValue.h
@@ -0,0 +1,56 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1999 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#ifndef NVALUE_H
25#define NVALUE_H
26
27#include <VCardValue.h>
28
29namespace VCARD
30{
31
32class NValue : public Value
33{
34#include "NValue-generated.h"
35 NValue *clone();
36
37 QCString family() { parse(); return family_;}
38 QCString given() { parse(); return given_;}
39 QCString middle() { parse(); return middle_;}
40 QCString prefix() { parse(); return prefix_;}
41 QCString suffix() { parse(); return suffix_;}
42
43 void setFamily (const QCString & s) { family_= s; assembled_ = false; }
44 void setGiven (const QCString & s) { given_= s; assembled_ = false; }
45 void setMiddle (const QCString & s) { middle_= s; assembled_ = false; }
46 void setPrefix (const QCString & s) { prefix_= s; assembled_ = false; }
47 void setSuffix (const QCString & s) { suffix_= s; assembled_ = false; }
48
49 private:
50
51 QCString family_, given_, middle_, prefix_, suffix_;
52};
53
54}
55
56#endif
diff --git a/kabc/vcard/include/VCardOrgValue.h b/kabc/vcard/include/VCardOrgValue.h
new file mode 100644
index 0000000..c4f3f25
--- a/dev/null
+++ b/kabc/vcard/include/VCardOrgValue.h
@@ -0,0 +1,50 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1999 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#ifndef ORGVALUE_H
25#define ORGVALUE_H
26
27#include <qcstring.h>
28#include <qstrlist.h>
29
30#include <VCardValue.h>
31
32namespace VCARD
33{
34
35class OrgValue : public Value
36{
37
38#include "OrgValue-generated.h"
39
40 unsigned int numValues();
41 QCString value(unsigned int);
42
43 private:
44
45 QStrList valueList_;
46};
47
48}
49
50#endif
diff --git a/kabc/vcard/include/VCardParam.h b/kabc/vcard/include/VCardParam.h
new file mode 100644
index 0000000..b61ce5c
--- a/dev/null
+++ b/kabc/vcard/include/VCardParam.h
@@ -0,0 +1,59 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1999 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#ifndef PARAM_H
25#define PARAM_H
26
27#include <qcstring.h>
28#include <qptrlist.h>
29
30#include <VCardEntity.h>
31
32namespace VCARD
33{
34
35class Param : public Entity
36{
37
38#include "Param-generated.h"
39
40 Param(const QCString &name, const QCString &value);
41
42 void setName(const QCString &);
43 void setValue(const QCString &);
44
45 QCString name();
46 QCString value();
47
48 private:
49
50 QCString name_;
51 QCString value_;
52};
53
54typedef QPtrList<Param> ParamList;
55typedef QPtrListIterator<Param> ParamListIterator;
56
57}
58
59#endif
diff --git a/kabc/vcard/include/VCardPhoneNumberValue.h b/kabc/vcard/include/VCardPhoneNumberValue.h
new file mode 100644
index 0000000..a567bdc
--- a/dev/null
+++ b/kabc/vcard/include/VCardPhoneNumberValue.h
@@ -0,0 +1,39 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1999 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#ifndef PHONENUMBERVALUE_H
25#define PHONENUMBERVALUE_H
26
27#include <VCardValue.h>
28
29namespace VCARD
30{
31
32class PhoneNumberValue : public Value
33{
34#include "PhoneNumberValue-generated.h"
35};
36
37}
38
39#endif
diff --git a/kabc/vcard/include/VCardRToken.h b/kabc/vcard/include/VCardRToken.h
new file mode 100644
index 0000000..2f95f1b
--- a/dev/null
+++ b/kabc/vcard/include/VCardRToken.h
@@ -0,0 +1,38 @@
1/*
2
3 libvcard - vCard parsing library for vCard version 3.0
4
5 Copyright (C) 1999 Rik Hemsley rik@kde.org
6
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software and associated documentation files (the "Software"), to
9 deal in the Software without restriction, including without limitation the
10 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
11 sell copies of the Software, and to permit persons to whom the Software is
12 furnished to do so, subject to the following conditions:
13
14 The above copyright notice and this permission notice shall be included in
15 all copies or substantial portions of the Software.
16
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
21 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23*/
24
25#ifndef RTOKEN_H
26#define RTOKEN_H
27
28#include <qstrlist.h>
29
30namespace VCARD
31{
32
33Q_UINT32 RTokenise(const char * str, const char * delim, QStrList & l);
34
35}
36
37#endif
38
diff --git a/kabc/vcard/include/VCardSndValue.h b/kabc/vcard/include/VCardSndValue.h
new file mode 100644
index 0000000..ce56221
--- a/dev/null
+++ b/kabc/vcard/include/VCardSndValue.h
@@ -0,0 +1,39 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1999 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#ifndef SNDVALUE_H
25#define SNDVALUE_H
26
27#include <VCardValue.h>
28
29namespace VCARD
30{
31
32class SndValue : public Value
33{
34#include "SndValue-generated.h"
35};
36
37}
38
39#endif
diff --git a/kabc/vcard/include/VCardSoundValue.h b/kabc/vcard/include/VCardSoundValue.h
new file mode 100644
index 0000000..994f55e
--- a/dev/null
+++ b/kabc/vcard/include/VCardSoundValue.h
@@ -0,0 +1,44 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1999 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#ifndef SOUNDVALUE_H
25#define SOUNDVALUE_H
26
27#include <qcstring.h>
28
29#include <VCardValue.h>
30
31namespace VCARD
32{
33
34class SoundValue : public Value
35{
36
37#include "SoundValue-generated.h"
38
39 private:
40};
41
42}
43
44#endif
diff --git a/kabc/vcard/include/VCardSourceParam.h b/kabc/vcard/include/VCardSourceParam.h
new file mode 100644
index 0000000..887ea20
--- a/dev/null
+++ b/kabc/vcard/include/VCardSourceParam.h
@@ -0,0 +1,58 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1999 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#ifndef SOURCEPARAM_H
25#define SOURCEPARAM_H
26
27#include <qcstring.h>
28
29#include <VCardParam.h>
30
31namespace VCARD
32{
33
34class SourceParam : public Param
35{
36
37#include "SourceParam-generated.h"
38
39 enum SourceParamType { TypeUnknown, TypeValue, TypeContext, TypeX };
40
41 SourceParamType type(){ parse(); return type_;}
42 QCString par() { parse(); return par_; }
43 QCString val() { parse(); return val_; }
44
45 void setType(SourceParamType t) { type_= t; assembled_ = false; }
46 void setPar(const QCString & s) { par_= s; assembled_ = false; }
47 void setVal(const QCString & s) { val_= s; assembled_ = false; }
48
49 private:
50
51 SourceParamType type_;
52 // May be "VALUE = uri" or "CONTEXT = word" or "x-name = *SAFE-CHAR"
53 QCString par_, val_; // Sub-parameter, value
54};
55
56}
57
58#endif
diff --git a/kabc/vcard/include/VCardTelParam.h b/kabc/vcard/include/VCardTelParam.h
new file mode 100644
index 0000000..27d7dcc
--- a/dev/null
+++ b/kabc/vcard/include/VCardTelParam.h
@@ -0,0 +1,51 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1999 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#ifndef TELPARAM_H
25#define TELPARAM_H
26
27#include <qcstring.h>
28
29#include <VCardParam.h>
30
31namespace VCARD
32{
33
34class TelParam : public Param
35{
36#include "TelParam-generated.h"
37
38 enum TelType {
39 TelHome, TelWork, TelPref, TelVoice, TelFex, TelMsg, TelCell,
40 TelPager, TelBBS, TelModem, TelCar, TelISDN, TelVideo, TelPCS,
41 TelIANA, TelX
42 };
43
44 private:
45
46 QPtrList<TelType> types_;
47};
48
49}
50
51#endif
diff --git a/kabc/vcard/include/VCardTelValue.h b/kabc/vcard/include/VCardTelValue.h
new file mode 100644
index 0000000..9cf5a98
--- a/dev/null
+++ b/kabc/vcard/include/VCardTelValue.h
@@ -0,0 +1,44 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1999 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#ifndef TELVALUE_H
25#define TELVALUE_H
26
27#include <qcstring.h>
28
29#include <VCardValue.h>
30
31namespace VCARD
32{
33
34class TelValue : public Value
35{
36
37#include "TelValue-generated.h"
38
39 private:
40};
41
42}
43
44#endif
diff --git a/kabc/vcard/include/VCardTextBinParam.h b/kabc/vcard/include/VCardTextBinParam.h
new file mode 100644
index 0000000..31dec86
--- a/dev/null
+++ b/kabc/vcard/include/VCardTextBinParam.h
@@ -0,0 +1,44 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1999 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#ifndef TEXTBINPARAM_H
25#define TEXTBINPARAM_H
26
27#include <qcstring.h>
28
29#include <VCardParam.h>
30
31namespace VCARD
32{
33
34class TextBinParam : public Param
35{
36
37#include "TextBinParam-generated.h"
38
39 private:
40};
41
42}
43
44#endif
diff --git a/kabc/vcard/include/VCardTextBinValue.h b/kabc/vcard/include/VCardTextBinValue.h
new file mode 100644
index 0000000..8d44fdf
--- a/dev/null
+++ b/kabc/vcard/include/VCardTextBinValue.h
@@ -0,0 +1,67 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1999 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#ifndef TEXTBINVALUE_H
25#define TEXTBINVALUE_H
26
27#include <qcstring.h>
28
29#include <VCardValue.h>
30
31namespace VCARD
32{
33
34class TextBinValue : public Value
35{
36
37#include "TextBinValue-generated.h"
38
39 TextBinValue *clone();
40
41 bool isBinary() { parse(); return mIsBinary_; }
42 QByteArray data() { parse(); return mData_; }
43 QString url() { parse(); return mUrl_; }
44
45 void setData( const QByteArray &data )
46 {
47 mData_ = data;
48 mIsBinary_ = true;
49 assembled_ = false;
50 }
51
52 void setUrl( const QString &url )
53 {
54 mUrl_ = url;
55 mIsBinary_ = false;
56 assembled_ = false;
57 }
58
59 private:
60 int mIsBinary_;
61 QByteArray mData_;
62 QString mUrl_;
63};
64
65}
66
67#endif
diff --git a/kabc/vcard/include/VCardTextListValue.h b/kabc/vcard/include/VCardTextListValue.h
new file mode 100644
index 0000000..8e47af5
--- a/dev/null
+++ b/kabc/vcard/include/VCardTextListValue.h
@@ -0,0 +1,51 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1999 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#ifndef TEXTLISTVALUE_H
25#define TEXTLISTVALUE_H
26
27#include <qstrlist.h>
28
29#include <qcstring.h>
30
31#include <VCardValue.h>
32
33namespace VCARD
34{
35
36class TextListValue : public Value
37{
38
39#include "TextListValue-generated.h"
40
41 unsigned int numValues();
42 QCString value(unsigned int);
43
44 private:
45
46 QStrList valueList_;
47};
48
49}
50
51#endif
diff --git a/kabc/vcard/include/VCardTextParam.h b/kabc/vcard/include/VCardTextParam.h
new file mode 100644
index 0000000..08b5f57
--- a/dev/null
+++ b/kabc/vcard/include/VCardTextParam.h
@@ -0,0 +1,44 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1999 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#ifndef TEXTPARAM_H
25#define TEXTPARAM_H
26
27#include <qcstring.h>
28
29#include <VCardParam.h>
30
31namespace VCARD
32{
33
34class TextParam : public Param
35{
36
37#include "TextParam-generated.h"
38
39 private:
40};
41
42}
43
44#endif
diff --git a/kabc/vcard/include/VCardTextValue.h b/kabc/vcard/include/VCardTextValue.h
new file mode 100644
index 0000000..afe8753
--- a/dev/null
+++ b/kabc/vcard/include/VCardTextValue.h
@@ -0,0 +1,41 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1999 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#ifndef TEXTVALUE_H
25#define TEXTVALUE_H
26
27#include <VCardValue.h>
28
29namespace VCARD
30{
31
32class TextValue : public Value
33{
34#include "TextValue-generated.h"
35
36 TextValue *clone();
37};
38
39}
40
41#endif
diff --git a/kabc/vcard/include/VCardURIValue.h b/kabc/vcard/include/VCardURIValue.h
new file mode 100644
index 0000000..5fd7184
--- a/dev/null
+++ b/kabc/vcard/include/VCardURIValue.h
@@ -0,0 +1,52 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1999 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#ifndef URIVALUE_H
25#define URIVALUE_H
26
27#include <VCardValue.h>
28
29namespace VCARD
30{
31
32class URIValue : public Value
33{
34#include "URIValue-generated.h"
35
36 URIValue(const QCString & scheme, const QCString & schemeSpecificPart);
37
38 QCString scheme();
39 QCString schemeSpecificPart();
40
41 void setScheme (const QCString &);
42 void setSchemeSpecificPart(const QCString &);
43
44 private:
45
46 QCString scheme_;
47 QCString schemeSpecificPart_;
48};
49
50}
51
52#endif
diff --git a/kabc/vcard/include/VCardUTCValue.h b/kabc/vcard/include/VCardUTCValue.h
new file mode 100644
index 0000000..ff695e0
--- a/dev/null
+++ b/kabc/vcard/include/VCardUTCValue.h
@@ -0,0 +1,58 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1999 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#ifndef UTCVALUE_H
25#define UTCVALUE_H
26
27#include <qcstring.h>
28
29#include <VCardValue.h>
30
31namespace VCARD
32{
33
34class UTCValue : public Value
35{
36
37#include "UTCValue-generated.h"
38
39 UTCValue *clone();
40
41 void setPositive( int p ) { positive_ = p; assembled_ = false; }
42 void setHour( int h ) { hour_ = h; assembled_ = false; }
43 void setMinute( int m ) { minute_ = m; assembled_ = false; }
44
45 bool positive() { parse(); return positive_; }
46 unsigned int hour() { parse(); return hour_; }
47 unsigned int minute() { parse(); return minute_; }
48
49 private:
50
51 bool positive_;
52 unsigned int hour_;
53 unsigned int minute_;
54};
55
56}
57
58#endif
diff --git a/kabc/vcard/include/VCardVCard.h b/kabc/vcard/include/VCardVCard.h
new file mode 100644
index 0000000..5dec166
--- a/dev/null
+++ b/kabc/vcard/include/VCardVCard.h
@@ -0,0 +1,63 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1999 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#ifndef VCARD_VCARD_H
25#define VCARD_VCARD_H
26
27#include <qstring.h>
28#include <qptrlist.h>
29
30#include <VCardEnum.h>
31#include <VCardEntity.h>
32#include <VCardContentLine.h>
33
34namespace VCARD
35{
36
37class VCard : public Entity
38{
39
40#include "VCard-generated.h"
41
42 bool has(EntityType);
43 bool has(const QCString &);
44
45 void add(const ContentLine &);
46 void add(const QCString &);
47
48 ContentLine * contentLine(EntityType);
49 ContentLine * contentLine(const QCString &);
50
51 QCString group() { parse(); return group_; }
52
53 QPtrList<ContentLine>contentLineList() { parse(); return contentLineList_; }
54
55 private:
56
57 QCString group_;
58 QPtrList<ContentLine>contentLineList_;
59};
60
61}
62
63#endif
diff --git a/kabc/vcard/include/VCardVCardEntity.h b/kabc/vcard/include/VCardVCardEntity.h
new file mode 100644
index 0000000..47ba370
--- a/dev/null
+++ b/kabc/vcard/include/VCardVCardEntity.h
@@ -0,0 +1,56 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1999 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#ifndef VCARD_ENTITY_H
25#define VCARD_ENTITY_H
26
27#include <qstring.h>
28#include <qptrlist.h>
29
30#include <VCardEnum.h>
31#include <VCardVCard.h>
32#include <VCardEntity.h>
33
34namespace VCARD
35{
36
37typedef QPtrList<VCard> VCardList;
38typedef QPtrListIterator<VCard> VCardListIterator;
39
40class VCardEntity : public Entity
41{
42
43#include "VCardEntity-generated.h"
44
45 void setCardList(const VCardList & l);
46 VCardList & cardList();
47
48 private:
49
50 VCardList cardList_;
51
52};
53
54}
55
56#endif
diff --git a/kabc/vcard/include/VCardValue.h b/kabc/vcard/include/VCardValue.h
new file mode 100644
index 0000000..7cfe4a0
--- a/dev/null
+++ b/kabc/vcard/include/VCardValue.h
@@ -0,0 +1,46 @@
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1999 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#ifndef VALUE_H
25#define VALUE_H
26
27#include <qptrlist.h>
28
29#include <VCardEntity.h>
30
31namespace VCARD
32{
33
34class Value : public Entity
35{
36#include "Value-generated.h"
37
38 virtual Value *clone() { return new Value( *this ); }
39};
40
41typedef QPtrList<Value> ValueList;
42typedef QPtrListIterator<Value> ValueListIterator;
43
44}
45
46#endif
diff --git a/kabc/vcard/include/generated/AdrParam-generated.h b/kabc/vcard/include/generated/AdrParam-generated.h
new file mode 100644
index 0000000..3e265d8
--- a/dev/null
+++ b/kabc/vcard/include/generated/AdrParam-generated.h
@@ -0,0 +1,23 @@
1// XXX Automatically generated. DO NOT EDIT! XXX //
2
3public:
4AdrParam();
5AdrParam(const AdrParam&);
6AdrParam(const QCString&);
7AdrParam & operator = (AdrParam&);
8AdrParam & operator = (const QCString&);
9bool operator ==(AdrParam&);
10bool operator !=(AdrParam& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {AdrParam a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);}
13
14virtual ~AdrParam();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18
19void _parse();
20void _assemble();
21const char * className() const { return "AdrParam"; }
22
23// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/AdrValue-generated.h b/kabc/vcard/include/generated/AdrValue-generated.h
new file mode 100644
index 0000000..e1d93e4
--- a/dev/null
+++ b/kabc/vcard/include/generated/AdrValue-generated.h
@@ -0,0 +1,23 @@
1// XXX Automatically generated. DO NOT EDIT! XXX //
2
3public:
4AdrValue();
5AdrValue(const AdrValue&);
6AdrValue(const QCString&);
7AdrValue & operator = (AdrValue&);
8AdrValue & operator = (const QCString&);
9bool operator ==(AdrValue&);
10bool operator !=(AdrValue& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {AdrValue a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);}
13
14virtual ~AdrValue();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18
19void _parse();
20void _assemble();
21const char * className() const { return "AdrValue"; }
22
23// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/AgentParam-generated.h b/kabc/vcard/include/generated/AgentParam-generated.h
new file mode 100644
index 0000000..6423867
--- a/dev/null
+++ b/kabc/vcard/include/generated/AgentParam-generated.h
@@ -0,0 +1,23 @@
1// XXX Automatically generated. DO NOT EDIT! XXX //
2
3public:
4AgentParam();
5AgentParam(const AgentParam&);
6AgentParam(const QCString&);
7AgentParam & operator = (AgentParam&);
8AgentParam & operator = (const QCString&);
9bool operator ==(AgentParam&);
10bool operator !=(AgentParam& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {AgentParam a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);}
13
14virtual ~AgentParam();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18
19void _parse();
20void _assemble();
21const char * className() const { return "AgentParam"; }
22
23// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/AgentValue-generated.h b/kabc/vcard/include/generated/AgentValue-generated.h
new file mode 100644
index 0000000..76bb81c
--- a/dev/null
+++ b/kabc/vcard/include/generated/AgentValue-generated.h
@@ -0,0 +1,23 @@
1// XXX Automatically generated. DO NOT EDIT! XXX //
2
3public:
4AgentValue();
5AgentValue(const AgentValue&);
6AgentValue(const QCString&);
7AgentValue & operator = (AgentValue&);
8AgentValue & operator = (const QCString&);
9bool operator ==(AgentValue&);
10bool operator !=(AgentValue& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {AgentValue a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);}
13
14virtual ~AgentValue();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18
19void _parse();
20void _assemble();
21const char * className() const { return "AgentValue"; }
22
23// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/ClassValue-generated.h b/kabc/vcard/include/generated/ClassValue-generated.h
new file mode 100644
index 0000000..df4ed5f
--- a/dev/null
+++ b/kabc/vcard/include/generated/ClassValue-generated.h
@@ -0,0 +1,23 @@
1// XXX Automatically generated. DO NOT EDIT! XXX //
2
3public:
4ClassValue();
5ClassValue(const ClassValue&);
6ClassValue(const QCString&);
7ClassValue & operator = (ClassValue&);
8ClassValue & operator = (const QCString&);
9bool operator ==(ClassValue&);
10bool operator !=(ClassValue& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {ClassValue a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);}
13
14virtual ~ClassValue();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18
19void _parse();
20void _assemble();
21const char * className() const { return "ClassValue"; }
22
23// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/ContentLine-generated.h b/kabc/vcard/include/generated/ContentLine-generated.h
new file mode 100644
index 0000000..9efe273
--- a/dev/null
+++ b/kabc/vcard/include/generated/ContentLine-generated.h
@@ -0,0 +1,23 @@
1// XXX Automatically generated. DO NOT EDIT! XXX //
2
3public:
4ContentLine();
5ContentLine(const ContentLine&);
6ContentLine(const QCString&);
7ContentLine & operator = (ContentLine&);
8ContentLine & operator = (const QCString&);
9bool operator ==(ContentLine&);
10bool operator !=(ContentLine& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {ContentLine a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);}
13
14virtual ~ContentLine();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18
19void _parse();
20void _assemble();
21const char * className() const { return "ContentLine"; }
22
23// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/DateParam-generated.h b/kabc/vcard/include/generated/DateParam-generated.h
new file mode 100644
index 0000000..ff1da58
--- a/dev/null
+++ b/kabc/vcard/include/generated/DateParam-generated.h
@@ -0,0 +1,23 @@
1// XXX Automatically generated. DO NOT EDIT! XXX //
2
3public:
4DateParam();
5DateParam(const DateParam&);
6DateParam(const QCString&);
7DateParam & operator = (DateParam&);
8DateParam & operator = (const QCString&);
9bool operator ==(DateParam&);
10bool operator !=(DateParam& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {DateParam a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);}
13
14virtual ~DateParam();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18
19void _parse();
20void _assemble();
21const char * className() const { return "DateParam"; }
22
23// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/DateValue-generated.h b/kabc/vcard/include/generated/DateValue-generated.h
new file mode 100644
index 0000000..a382823
--- a/dev/null
+++ b/kabc/vcard/include/generated/DateValue-generated.h
@@ -0,0 +1,23 @@
1// XXX Automatically generated. DO NOT EDIT! XXX //
2
3public:
4DateValue();
5DateValue(const DateValue&);
6DateValue(const QCString&);
7DateValue & operator = (DateValue&);
8DateValue & operator = (const QCString&);
9bool operator ==(DateValue&);
10bool operator !=(DateValue& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {DateValue a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);}
13
14virtual ~DateValue();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18
19void _parse();
20void _assemble();
21const char * className() const { return "DateValue"; }
22
23// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/EmailParam-generated.h b/kabc/vcard/include/generated/EmailParam-generated.h
new file mode 100644
index 0000000..428a6fc
--- a/dev/null
+++ b/kabc/vcard/include/generated/EmailParam-generated.h
@@ -0,0 +1,23 @@
1// XXX Automatically generated. DO NOT EDIT! XXX //
2
3public:
4EmailParam();
5EmailParam(const EmailParam&);
6EmailParam(const QCString&);
7EmailParam & operator = (EmailParam&);
8EmailParam & operator = (const QCString&);
9bool operator ==(EmailParam&);
10bool operator !=(EmailParam& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {EmailParam a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);}
13
14virtual ~EmailParam();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18
19void _parse();
20void _assemble();
21const char * className() const { return "EmailParam"; }
22
23// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/FloatValue-generated.h b/kabc/vcard/include/generated/FloatValue-generated.h
new file mode 100644
index 0000000..cac55cf
--- a/dev/null
+++ b/kabc/vcard/include/generated/FloatValue-generated.h
@@ -0,0 +1,23 @@
1// XXX Automatically generated. DO NOT EDIT! XXX //
2
3public:
4FloatValue();
5FloatValue(const FloatValue&);
6FloatValue(const QCString&);
7FloatValue & operator = (FloatValue&);
8FloatValue & operator = (const QCString&);
9bool operator ==(FloatValue&);
10bool operator !=(FloatValue& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {FloatValue a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);}
13
14virtual ~FloatValue();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18
19void _parse();
20void _assemble();
21const char * className() const { return "FloatValue"; }
22
23// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/GeoValue-generated.h b/kabc/vcard/include/generated/GeoValue-generated.h
new file mode 100644
index 0000000..594f3ad
--- a/dev/null
+++ b/kabc/vcard/include/generated/GeoValue-generated.h
@@ -0,0 +1,23 @@
1// XXX Automatically generated. DO NOT EDIT! XXX //
2
3public:
4GeoValue();
5GeoValue(const GeoValue&);
6GeoValue(const QCString&);
7GeoValue & operator = (GeoValue&);
8GeoValue & operator = (const QCString&);
9bool operator ==(GeoValue&);
10bool operator !=(GeoValue& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {GeoValue a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);}
13
14virtual ~GeoValue();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18
19void _parse();
20void _assemble();
21const char * className() const { return "GeoValue"; }
22
23// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/Group-generated.h b/kabc/vcard/include/generated/Group-generated.h
new file mode 100644
index 0000000..f39302d
--- a/dev/null
+++ b/kabc/vcard/include/generated/Group-generated.h
@@ -0,0 +1,23 @@
1// XXX Automatically generated. DO NOT EDIT! XXX //
2
3public:
4Group();
5Group(const Group&);
6Group(const QCString&);
7Group & operator = (Group&);
8Group & operator = (const QCString&);
9bool operator ==(Group&);
10bool operator !=(Group& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {Group a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);}
13
14virtual ~Group();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18
19void _parse();
20void _assemble();
21const char * className() const { return "Group"; }
22
23// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/ImageParam-generated.h b/kabc/vcard/include/generated/ImageParam-generated.h
new file mode 100644
index 0000000..81edfd2
--- a/dev/null
+++ b/kabc/vcard/include/generated/ImageParam-generated.h
@@ -0,0 +1,23 @@
1// XXX Automatically generated. DO NOT EDIT! XXX //
2
3public:
4ImageParam();
5ImageParam(const ImageParam&);
6ImageParam(const QCString&);
7ImageParam & operator = (ImageParam&);
8ImageParam & operator = (const QCString&);
9bool operator ==(ImageParam&);
10bool operator !=(ImageParam& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {ImageParam a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);}
13
14virtual ~ImageParam();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18
19void _parse();
20void _assemble();
21const char * className() const { return "ImageParam"; }
22
23// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/ImageValue-generated.h b/kabc/vcard/include/generated/ImageValue-generated.h
new file mode 100644
index 0000000..5a2c493
--- a/dev/null
+++ b/kabc/vcard/include/generated/ImageValue-generated.h
@@ -0,0 +1,23 @@
1// XXX Automatically generated. DO NOT EDIT! XXX //
2
3public:
4ImageValue();
5ImageValue(const ImageValue&);
6ImageValue(const QCString&);
7ImageValue & operator = (ImageValue&);
8ImageValue & operator = (const QCString&);
9bool operator ==(ImageValue&);
10bool operator !=(ImageValue& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {ImageValue a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);}
13
14virtual ~ImageValue();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18
19void _parse();
20void _assemble();
21const char * className() const { return "ImageValue"; }
22
23// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/ImgParam-generated.h b/kabc/vcard/include/generated/ImgParam-generated.h
new file mode 100644
index 0000000..46a6ca0
--- a/dev/null
+++ b/kabc/vcard/include/generated/ImgParam-generated.h
@@ -0,0 +1,23 @@
1// XXX Automatically generated. DO NOT EDIT! XXX //
2
3public:
4ImgParam();
5ImgParam(const ImgParam&);
6ImgParam(const QCString&);
7ImgParam & operator = (ImgParam&);
8ImgParam & operator = (const QCString&);
9bool operator ==(ImgParam&);
10bool operator !=(ImgParam& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {ImgParam a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);}
13
14virtual ~ImgParam();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18
19void _parse();
20void _assemble();
21virtual const char * className() const { return "ImgParam"; }
22
23// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/ImgValue-generated.h b/kabc/vcard/include/generated/ImgValue-generated.h
new file mode 100644
index 0000000..d75d545
--- a/dev/null
+++ b/kabc/vcard/include/generated/ImgValue-generated.h
@@ -0,0 +1,23 @@
1// XXX Automatically generated. DO NOT EDIT! XXX //
2
3public:
4ImgValue();
5ImgValue(const ImgValue&);
6ImgValue(const QCString&);
7ImgValue & operator = (ImgValue&);
8ImgValue & operator = (const QCString&);
9bool operator ==(ImgValue&);
10bool operator !=(ImgValue& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {ImgValue a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);}
13
14virtual ~ImgValue();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18
19void _parse();
20void _assemble();
21virtual const char * className() const { return "ImgValue"; }
22
23// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/LangValue-generated.h b/kabc/vcard/include/generated/LangValue-generated.h
new file mode 100644
index 0000000..23e138b
--- a/dev/null
+++ b/kabc/vcard/include/generated/LangValue-generated.h
@@ -0,0 +1,23 @@
1// XXX Automatically generated. DO NOT EDIT! XXX //
2
3public:
4LangValue();
5LangValue(const LangValue&);
6LangValue(const QCString&);
7LangValue & operator = (LangValue&);
8LangValue & operator = (const QCString&);
9bool operator ==(LangValue&);
10bool operator !=(LangValue& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {LangValue a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);}
13
14virtual ~LangValue();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18
19void _parse();
20void _assemble();
21const char * className() const { return "LangValue"; }
22
23// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/NValue-generated.h b/kabc/vcard/include/generated/NValue-generated.h
new file mode 100644
index 0000000..082c253
--- a/dev/null
+++ b/kabc/vcard/include/generated/NValue-generated.h
@@ -0,0 +1,23 @@
1// XXX Automatically generated. DO NOT EDIT! XXX //
2
3public:
4NValue();
5NValue(const NValue&);
6NValue(const QCString&);
7NValue & operator = (NValue&);
8NValue & operator = (const QCString&);
9bool operator ==(NValue&);
10bool operator !=(NValue& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {NValue a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);}
13
14virtual ~NValue();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18
19void _parse();
20void _assemble();
21const char * className() const { return "NValue"; }
22
23// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/Name-generated.h b/kabc/vcard/include/generated/Name-generated.h
new file mode 100644
index 0000000..0e69abd
--- a/dev/null
+++ b/kabc/vcard/include/generated/Name-generated.h
@@ -0,0 +1,22 @@
1// XXX Automatically generated. DO NOT EDIT! XXX //
2
3public:
4V_Name();
5V_Name(const V_Name&);
6V_Name(const QCString&);
7V_Name & operator = (V_Name&);
8V_Name & operator = (const QCString&);
9bool operator ==(V_Name&);
10bool operator !=(V_Name& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {V_Name a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);}
13
14virtual ~V_Name();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18
19void _parse();
20void _assemble();
21
22// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/OrgValue-generated.h b/kabc/vcard/include/generated/OrgValue-generated.h
new file mode 100644
index 0000000..51eb1b7
--- a/dev/null
+++ b/kabc/vcard/include/generated/OrgValue-generated.h
@@ -0,0 +1,23 @@
1// XXX Automatically generated. DO NOT EDIT! XXX //
2
3public:
4OrgValue();
5OrgValue(const OrgValue&);
6OrgValue(const QCString&);
7OrgValue & operator = (OrgValue&);
8OrgValue & operator = (const QCString&);
9bool operator ==(OrgValue&);
10bool operator !=(OrgValue& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {OrgValue a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);}
13
14virtual ~OrgValue();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18
19void _parse();
20void _assemble();
21const char * className() const { return "OrgValue"; }
22
23// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/Param-generated.h b/kabc/vcard/include/generated/Param-generated.h
new file mode 100644
index 0000000..cf4666a
--- a/dev/null
+++ b/kabc/vcard/include/generated/Param-generated.h
@@ -0,0 +1,23 @@
1// XXX Automatically generated. DO NOT EDIT! XXX //
2
3public:
4Param();
5Param(const Param&);
6Param(const QCString&);
7Param & operator = (Param&);
8Param & operator = (const QCString&);
9bool operator ==(Param&);
10bool operator !=(Param& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {Param a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);}
13
14virtual ~Param();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18
19void _parse();
20void _assemble();
21const char * className() const { return "Param"; }
22
23// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/ParamName-generated.h b/kabc/vcard/include/generated/ParamName-generated.h
new file mode 100644
index 0000000..ef673c3
--- a/dev/null
+++ b/kabc/vcard/include/generated/ParamName-generated.h
@@ -0,0 +1,22 @@
1// XXX Automatically generated. DO NOT EDIT! XXX //
2
3public:
4V_ParamName();
5V_ParamName(const V_ParamName&);
6V_ParamName(const QCString&);
7V_ParamName & operator = (V_ParamName&);
8V_ParamName & operator = (const QCString&);
9bool operator ==(V_ParamName&);
10bool operator !=(V_ParamName& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {V_ParamName a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);}
13
14virtual ~V_ParamName();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18
19void _parse();
20void _assemble();
21
22// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/ParamValue-generated.h b/kabc/vcard/include/generated/ParamValue-generated.h
new file mode 100644
index 0000000..e73500f
--- a/dev/null
+++ b/kabc/vcard/include/generated/ParamValue-generated.h
@@ -0,0 +1,22 @@
1// XXX Automatically generated. DO NOT EDIT! XXX //
2
3public:
4V_ParamValue();
5V_ParamValue(const V_ParamValue&);
6V_ParamValue(const QCString&);
7V_ParamValue & operator = (V_ParamValue&);
8V_ParamValue & operator = (const QCString&);
9bool operator ==(V_ParamValue&);
10bool operator !=(V_ParamValue& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {V_ParamValue a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);}
13
14virtual ~V_ParamValue();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18
19void _parse();
20void _assemble();
21
22// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/PhoneNumberValue-generated.h b/kabc/vcard/include/generated/PhoneNumberValue-generated.h
new file mode 100644
index 0000000..1320f18
--- a/dev/null
+++ b/kabc/vcard/include/generated/PhoneNumberValue-generated.h
@@ -0,0 +1,23 @@
1// XXX Automatically generated. DO NOT EDIT! XXX //
2
3public:
4PhoneNumberValue();
5PhoneNumberValue(const PhoneNumberValue&);
6PhoneNumberValue(const QCString&);
7PhoneNumberValue & operator = (PhoneNumberValue&);
8PhoneNumberValue & operator = (const QCString&);
9bool operator ==(PhoneNumberValue&);
10bool operator !=(PhoneNumberValue& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {PhoneNumberValue a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);}
13
14virtual ~PhoneNumberValue();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18
19void _parse();
20void _assemble();
21const char * className() const { return "PhoneNumberValue"; }
22
23// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/SoundValue-generated.h b/kabc/vcard/include/generated/SoundValue-generated.h
new file mode 100644
index 0000000..a9ab2e8
--- a/dev/null
+++ b/kabc/vcard/include/generated/SoundValue-generated.h
@@ -0,0 +1,23 @@
1// XXX Automatically generated. DO NOT EDIT! XXX //
2
3public:
4SoundValue();
5SoundValue(const SoundValue&);
6SoundValue(const QCString&);
7SoundValue & operator = (SoundValue&);
8SoundValue & operator = (const QCString&);
9bool operator ==(SoundValue&);
10bool operator !=(SoundValue& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {SoundValue a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);}
13
14virtual ~SoundValue();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18
19void _parse();
20void _assemble();
21const char * className() const { return "SoundValue"; }
22
23// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/SourceParam-generated.h b/kabc/vcard/include/generated/SourceParam-generated.h
new file mode 100644
index 0000000..75fefb8
--- a/dev/null
+++ b/kabc/vcard/include/generated/SourceParam-generated.h
@@ -0,0 +1,23 @@
1// XXX Automatically generated. DO NOT EDIT! XXX //
2
3public:
4SourceParam();
5SourceParam(const SourceParam&);
6SourceParam(const QCString&);
7SourceParam & operator = (SourceParam&);
8SourceParam & operator = (const QCString&);
9bool operator ==(SourceParam&);
10bool operator !=(SourceParam& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {SourceParam a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);}
13
14virtual ~SourceParam();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18
19void _parse();
20void _assemble();
21const char * className() const { return "SourceParam"; }
22
23// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/TelParam-generated.h b/kabc/vcard/include/generated/TelParam-generated.h
new file mode 100644
index 0000000..3ee77cc
--- a/dev/null
+++ b/kabc/vcard/include/generated/TelParam-generated.h
@@ -0,0 +1,23 @@
1// XXX Automatically generated. DO NOT EDIT! XXX //
2
3public:
4TelParam();
5TelParam(const TelParam&);
6TelParam(const QCString&);
7TelParam & operator = (TelParam&);
8TelParam & operator = (const QCString&);
9bool operator ==(TelParam&);
10bool operator !=(TelParam& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {TelParam a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);}
13
14virtual ~TelParam();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18
19void _parse();
20void _assemble();
21const char * className() const { return "TelParam"; }
22
23// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/TelValue-generated.h b/kabc/vcard/include/generated/TelValue-generated.h
new file mode 100644
index 0000000..3213e1c
--- a/dev/null
+++ b/kabc/vcard/include/generated/TelValue-generated.h
@@ -0,0 +1,23 @@
1// XXX Automatically generated. DO NOT EDIT! XXX //
2
3public:
4TelValue();
5TelValue(const TelValue&);
6TelValue(const QCString&);
7TelValue & operator = (TelValue&);
8TelValue & operator = (const QCString&);
9bool operator ==(TelValue&);
10bool operator !=(TelValue& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {TelValue a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);}
13
14virtual ~TelValue();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18
19void _parse();
20void _assemble();
21const char * className() const { return "TelValue"; }
22
23// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/TextBinParam-generated.h b/kabc/vcard/include/generated/TextBinParam-generated.h
new file mode 100644
index 0000000..d075c10
--- a/dev/null
+++ b/kabc/vcard/include/generated/TextBinParam-generated.h
@@ -0,0 +1,23 @@
1// XXX Automatically generated. DO NOT EDIT! XXX //
2
3public:
4TextBinParam();
5TextBinParam(const TextBinParam&);
6TextBinParam(const QCString&);
7TextBinParam & operator = (TextBinParam&);
8TextBinParam & operator = (const QCString&);
9bool operator ==(TextBinParam&);
10bool operator !=(TextBinParam& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {TextBinParam a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);}
13
14virtual ~TextBinParam();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18
19void _parse();
20void _assemble();
21const char * className() const { return "TextBinParam"; }
22
23// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/TextBinValue-generated.h b/kabc/vcard/include/generated/TextBinValue-generated.h
new file mode 100644
index 0000000..e9553ac
--- a/dev/null
+++ b/kabc/vcard/include/generated/TextBinValue-generated.h
@@ -0,0 +1,23 @@
1// XXX Automatically generated. DO NOT EDIT! XXX //
2
3public:
4TextBinValue();
5TextBinValue(const TextBinValue&);
6TextBinValue(const QCString&);
7TextBinValue & operator = (TextBinValue&);
8TextBinValue & operator = (const QCString&);
9bool operator ==(TextBinValue&);
10bool operator !=(TextBinValue& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {TextBinValue a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);}
13
14virtual ~TextBinValue();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18
19void _parse();
20void _assemble();
21const char * className() const { return "TextBinValue"; }
22
23// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/TextListValue-generated.h b/kabc/vcard/include/generated/TextListValue-generated.h
new file mode 100644
index 0000000..9f46124
--- a/dev/null
+++ b/kabc/vcard/include/generated/TextListValue-generated.h
@@ -0,0 +1,23 @@
1// XXX Automatically generated. DO NOT EDIT! XXX //
2
3public:
4TextListValue();
5TextListValue(const TextListValue&);
6TextListValue(const QCString&);
7TextListValue & operator = (TextListValue&);
8TextListValue & operator = (const QCString&);
9bool operator ==(TextListValue&);
10bool operator !=(TextListValue& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {TextListValue a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);}
13
14virtual ~TextListValue();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18
19void _parse();
20void _assemble();
21const char * className() const { return "TextListValue"; }
22
23// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/TextNSParam-generated.h b/kabc/vcard/include/generated/TextNSParam-generated.h
new file mode 100644
index 0000000..d7f58ca
--- a/dev/null
+++ b/kabc/vcard/include/generated/TextNSParam-generated.h
@@ -0,0 +1,23 @@
1// XXX Automatically generated. DO NOT EDIT! XXX //
2
3public:
4TextNSParam();
5TextNSParam(const TextNSParam&);
6TextNSParam(const QCString&);
7TextNSParam & operator = (TextNSParam&);
8TextNSParam & operator = (const QCString&);
9bool operator ==(TextNSParam&);
10bool operator !=(TextNSParam& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {TextNSParam a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);}
13
14virtual ~TextNSParam();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18
19void _parse();
20void _assemble();
21const char * className() const { return "TextNSParam"; }
22
23// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/TextParam-generated.h b/kabc/vcard/include/generated/TextParam-generated.h
new file mode 100644
index 0000000..154e1bf
--- a/dev/null
+++ b/kabc/vcard/include/generated/TextParam-generated.h
@@ -0,0 +1,23 @@
1// XXX Automatically generated. DO NOT EDIT! XXX //
2
3public:
4TextParam();
5TextParam(const TextParam&);
6TextParam(const QCString&);
7TextParam & operator = (TextParam&);
8TextParam & operator = (const QCString&);
9bool operator ==(TextParam&);
10bool operator !=(TextParam& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {TextParam a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);}
13
14virtual ~TextParam();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18
19void _parse();
20void _assemble();
21const char * className() const { return "TextParam"; }
22
23// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/TextValue-generated.h b/kabc/vcard/include/generated/TextValue-generated.h
new file mode 100644
index 0000000..e1c4dcc
--- a/dev/null
+++ b/kabc/vcard/include/generated/TextValue-generated.h
@@ -0,0 +1,23 @@
1// XXX Automatically generated. DO NOT EDIT! XXX //
2
3public:
4TextValue();
5TextValue(const TextValue&);
6TextValue(const QCString&);
7TextValue & operator = (TextValue&);
8TextValue & operator = (const QCString&);
9bool operator ==(TextValue&);
10bool operator !=(TextValue& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {TextValue a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);}
13
14virtual ~TextValue();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18
19void _parse();
20void _assemble();
21const char * className() const { return "TextValue"; }
22
23// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/URIValue-generated.h b/kabc/vcard/include/generated/URIValue-generated.h
new file mode 100644
index 0000000..dbcb5c1
--- a/dev/null
+++ b/kabc/vcard/include/generated/URIValue-generated.h
@@ -0,0 +1,23 @@
1// XXX Automatically generated. DO NOT EDIT! XXX //
2
3public:
4URIValue();
5URIValue(const URIValue&);
6URIValue(const QCString&);
7URIValue & operator = (URIValue&);
8URIValue & operator = (const QCString&);
9bool operator ==(URIValue&);
10bool operator !=(URIValue& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {URIValue a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);}
13
14virtual ~URIValue();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18
19void _parse();
20void _assemble();
21const char * className() const { return "URIValue"; }
22
23// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/UTCValue-generated.h b/kabc/vcard/include/generated/UTCValue-generated.h
new file mode 100644
index 0000000..46e447b
--- a/dev/null
+++ b/kabc/vcard/include/generated/UTCValue-generated.h
@@ -0,0 +1,23 @@
1// XXX Automatically generated. DO NOT EDIT! XXX //
2
3public:
4UTCValue();
5UTCValue(const UTCValue&);
6UTCValue(const QCString&);
7UTCValue & operator = (UTCValue&);
8UTCValue & operator = (const QCString&);
9bool operator ==(UTCValue&);
10bool operator !=(UTCValue& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {UTCValue a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);}
13
14virtual ~UTCValue();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18
19void _parse();
20void _assemble();
21const char * className() const { return "UTCValue"; }
22
23// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/VCard-generated.h b/kabc/vcard/include/generated/VCard-generated.h
new file mode 100644
index 0000000..4d7d96d
--- a/dev/null
+++ b/kabc/vcard/include/generated/VCard-generated.h
@@ -0,0 +1,23 @@
1// XXX Automatically generated. DO NOT EDIT! XXX //
2
3public:
4VCard();
5VCard(const VCard&);
6VCard(const QCString&);
7VCard & operator = (VCard&);
8VCard & operator = (const QCString&);
9bool operator ==(VCard&);
10bool operator !=(VCard& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {VCard a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);}
13
14virtual ~VCard();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18
19void _parse();
20void _assemble();
21const char * className() const { return "VCard"; }
22
23// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/VCardEntity-generated.h b/kabc/vcard/include/generated/VCardEntity-generated.h
new file mode 100644
index 0000000..9f2dfbc
--- a/dev/null
+++ b/kabc/vcard/include/generated/VCardEntity-generated.h
@@ -0,0 +1,23 @@
1// XXX Automatically generated. DO NOT EDIT! XXX //
2
3public:
4VCardEntity();
5VCardEntity(const VCardEntity&);
6VCardEntity(const QCString&);
7VCardEntity & operator = (VCardEntity&);
8VCardEntity & operator = (const QCString&);
9bool operator ==(VCardEntity&);
10bool operator !=(VCardEntity& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {VCardEntity a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);}
13
14virtual ~VCardEntity();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18
19void _parse();
20void _assemble();
21const char * className() const { return "VCardEntity"; }
22
23// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/Value-generated.h b/kabc/vcard/include/generated/Value-generated.h
new file mode 100644
index 0000000..7afac34
--- a/dev/null
+++ b/kabc/vcard/include/generated/Value-generated.h
@@ -0,0 +1,23 @@
1// XXX Automatically generated. DO NOT EDIT! XXX //
2
3public:
4Value();
5Value(const Value&);
6Value(const QCString&);
7Value & operator = (Value&);
8Value & operator = (const QCString&);
9bool operator ==(Value&);
10bool operator !=(Value& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {Value a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);}
13
14virtual ~Value();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18
19void _parse();
20void _assemble();
21const char * className() const { return "Value"; }
22
23// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/generate b/kabc/vcard/include/generated/generate
new file mode 100644
index 0000000..926dbf1
--- a/dev/null
+++ b/kabc/vcard/include/generated/generate
@@ -0,0 +1,2 @@
1#!/bin/sh
2cat headerBodies | awk -f generateHeaders.awk
diff --git a/kabc/vcard/include/generated/generateHeaders.awk b/kabc/vcard/include/generated/generateHeaders.awk
new file mode 100644
index 0000000..1053144
--- a/dev/null
+++ b/kabc/vcard/include/generated/generateHeaders.awk
@@ -0,0 +1,40 @@
1#!/bin/awk -f
2
3{
4 outfile = $1 "-generated.h"
5 name = $1
6
7 OFS=""
8
9 print "// XXX Automatically generated. DO NOT EDIT! XXX //\n" > outfile
10
11 if ($2 == "v") { pre = "virtual " } else { pre = "" }
12
13 print "public:" >> outfile
14 print name "();" >> outfile
15 print name "(const " name "&);" >> outfile
16 print name "(const QCString&);" >> outfile
17 print pre name " & operator = (" name "&);" >> outfile
18 print pre name " & operator = (const QCString&);" >> outfile
19 print pre "bool operator ==(" name "&);" >> outfile
20 print pre "bool operator !=(" name "& x) {return !(*this==x);}" \
21 >> outfile
22 print pre "bool operator ==(const QCString& s) {" name " a(s);" \
23 "return(*this==a);} " >> outfile
24 print pre "bool operator != (const QCString& s) {return !(*this == s);}\n" \
25 >> outfile
26 print "virtual ~" name "();" >> outfile
27 print pre "void parse() " \
28 "{if(!parsed_) _parse();parsed_=true;assembled_=false;}\n" \
29 >> outfile
30 print pre "void assemble() " \
31 "{if(assembled_) return;parse();_assemble();assembled_=true;}\n" \
32 >> outfile
33 print pre "void _parse();" >> outfile
34 print pre "void _assemble();" >> outfile
35 print pre "const char * className() const { return \"" name "\"; }" \
36 >> outfile
37
38 print "\n// End of automatically generated code //" >> outfile
39}
40
diff --git a/kabc/vcard/include/generated/headerBodies b/kabc/vcard/include/generated/headerBodies
new file mode 100644
index 0000000..5e77b2b
--- a/dev/null
+++ b/kabc/vcard/include/generated/headerBodies
@@ -0,0 +1,34 @@
1AdrParam Param
2AdrValue Value
3AgentParam Param
4ContentLine Entity
5DateParam Param
6DateValue Value
7EmailParam Param
8GeoValue Value
9Group Entity
10ImageParam Param
11ImageValue Value
12LangValue Value
13NValue Value
14Param Entity
15PhoneNumberValue Value
16SourceParam Param
17TelParam Param
18TextParam Param
19TextNSParam Param
20TextValue Value
21TextBinParam Param
22URIValue Value
23VCard Entity
24VCardEntity Entity
25Value Entity
26SoundValue Value
27AgentValue Value
28TelValue Value
29TextBinValue Value
30OrgValue Value
31UTCValue Value
32ClassValue Value
33FloatValue Value
34TextListValue Value
diff --git a/kabc/vcard/testread.cpp b/kabc/vcard/testread.cpp
new file mode 100644
index 0000000..919c661
--- a/dev/null
+++ b/kabc/vcard/testread.cpp
@@ -0,0 +1,129 @@
1#include <iostream>
2#include <stdlib.h>
3#include <assert.h>
4
5#include <qfile.h>
6#include <qtextstream.h>
7
8#include <VCard.h>
9
10using namespace std;
11
12int main(int argc, char * argv[])
13{
14 if (argc != 2) {
15 cerr << "Usage: " << argv[0] << " <filename>" << endl;
16 exit(1);
17 }
18
19 QFile f(argv[1]);
20
21 QCString str;
22
23 if (!f.open(IO_ReadOnly)) {
24 cerr << "Couldn't open file \"" << argv[1] << endl;
25 exit(1);
26 }
27
28 QTextStream t(&f);
29
30 while (!t.eof())
31 str += t.readLine().utf8() + '\n';
32
33 using namespace VCARD;
34
35 // Iterate through all vCards in the file.
36
37 cout << "--------- begin ----------" << endl;
38 cout << str.data();
39 cout << "--------- end ----------" << endl;
40
41 VCardEntity e(str);
42
43 VCardListIterator it(e.cardList());
44
45 for (; it.current(); ++it) {
46
47 cerr << "****************** VCARD ********************" << endl;
48
49 // Create a vcard using the string representation.
50 VCard & v (*it.current());
51
52 if (v.has(EntityEmail)) {
53 cerr << "Email parameter found" << endl;
54
55 QCString s = v.contentLine(EntityEmail)->value()->asString();
56
57 cerr << "Email value == " << s << endl;
58 }
59
60 if (v.has(EntityNickname)) {
61 cerr << "Nickname parameter found" << endl;
62
63 cerr << "Nickname value == " <<
64 v.contentLine(EntityNickname)->value()->asString() <<
65 endl;
66 }
67
68 if (v.has(EntityRevision)) {
69
70 cerr << "Revision parameter found" << endl;
71
72 DateValue * d =
73 (DateValue *)
74 v.contentLine(EntityRevision)->value();
75
76 assert(d != 0);
77
78 cerr << "Revision date: " << endl;
79 cerr << "Day : " << d->day() << endl;
80 cerr << "Month : " << d->month()<< endl;
81 cerr << "Year : " << d->year() << endl;
82
83 if (d->hasTime()) {
84 cerr << "Revision date has a time component" << endl;
85 cerr << "Revision time: " << endl;
86 cerr << "Hour : " << d->hour()<< endl;
87 cerr << "Minute : " << d->minute()<< endl;
88 cerr << "Second : " << d->second()<< endl;
89
90 }
91 else cerr << "Revision date does NOT have a time component" << endl;
92 }
93
94 if (v.has(EntityURL)) {
95 cerr << "URL Parameter found" << endl;
96
97 cerr << "URL Value == " <<
98 v.contentLine(EntityURL)->value()->asString() <<
99 endl;
100
101 URIValue * urlVal =
102 (URIValue *)v.contentLine(EntityURL)->value();
103
104 assert(urlVal != 0);
105
106 cerr << "URL scheme == " <<
107 urlVal->scheme() << endl;
108
109 cerr << "URL scheme specific part == " <<
110 urlVal->schemeSpecificPart() << endl;
111 }
112
113 if (v.has(EntityN)) {
114 cerr << "N Parameter found" << endl;
115
116 NValue * n =
117 (NValue *)(v.contentLine(EntityN)->value());
118
119 cerr << "Family name == " << n->family()<< endl;
120 cerr << "Given name == " << n->given()<< endl;
121 cerr << "Middle name == " << n->middle()<< endl;
122 cerr << "Prefix == " << n->prefix()<< endl;
123 cerr << "Suffix == " << n->suffix()<< endl;
124 }
125
126 cerr << "***************** END VCARD ******************" << endl;
127 }
128}
129
diff --git a/kabc/vcard/testwrite.cpp b/kabc/vcard/testwrite.cpp
new file mode 100644
index 0000000..e4bbe7b
--- a/dev/null
+++ b/kabc/vcard/testwrite.cpp
@@ -0,0 +1,41 @@
1#include <kaboutdata.h>
2#include <kapplication.h>
3#include <kdebug.h>
4#include <klocale.h>
5#include <kcmdlineargs.h>
6
7#include <VCard.h>
8
9int main(int argc,char **argv)
10{
11 KAboutData aboutData("testwrite",I18N_NOOP("TestWritevCard"),"0.1");
12 KCmdLineArgs::init(argc,argv,&aboutData);
13
14 KApplication app;
15
16 kdDebug() << "Test Write VCard" << endl;
17
18 using namespace VCARD;
19
20 VCard v;
21
22 ContentLine cl1;
23 cl1.setName(EntityTypeToParamName(EntityName));
24 cl1.setValue(new TextValue("Hans Wurst"));
25 v.add(cl1);
26
27 ContentLine cl2;
28 cl2.setName(EntityTypeToParamName(EntityTelephone));
29 cl2.setValue(new TelValue("12345"));
30 ParamList p;
31 p.append( new TelParam("home") );
32 p.append( new TelParam("fax") );
33 cl2.setParamList( p );
34 v.add(cl2);
35
36 QCString str = v.asString();
37
38 kdDebug() << "--- VCard begin ---" << endl
39 << str
40 << "--- VCard end ---" << endl;
41}
diff --git a/kabc/vcard/vCard-all.cpp b/kabc/vcard/vCard-all.cpp
new file mode 100644
index 0000000..07bbcd2
--- a/dev/null
+++ b/kabc/vcard/vCard-all.cpp
@@ -0,0 +1,37 @@
1#include "AdrParam.cpp"
2#include "AdrValue.cpp"
3#include "AgentParam.cpp"
4#include "AgentValue.cpp"
5#include "ClassValue.cpp"
6#include "ContentLine.cpp"
7#include "DateParam.cpp"
8#include "DateValue.cpp"
9#include "EmailParam.cpp"
10#include "Entity.cpp"
11#include "Enum.cpp"
12#include "FloatValue.cpp"
13#include "GeoValue.cpp"
14#include "ImageParam.cpp"
15#include "ImageValue.cpp"
16#include "ImgValue.cpp"
17#include "LangValue.cpp"
18#include "NValue.cpp"
19#include "OrgValue.cpp"
20#include "Param.cpp"
21#include "PhoneNumberValue.cpp"
22#include "RToken.cpp"
23#include "SoundValue.cpp"
24#include "SourceParam.cpp"
25#include "TelParam.cpp"
26#include "TelValue.cpp"
27#include "TextBinParam.cpp"
28#include "TextBinValue.cpp"
29#include "TextListValue.cpp"
30#include "TextParam.cpp"
31#include "TextValue.cpp"
32#include "URIValue.cpp"
33#include "UTCValue.cpp"
34#include "VCard.cpp"
35#include "VCardEntity.cpp"
36#include "Value.cpp"
37