• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeabc
 

tdeabc

  • tdeabc
  • vcardparser
vcardline.cpp
1/*
2 This file is part of libtdeabc.
3 Copyright (c) 2003 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., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/
20
21#include "vcardline.h"
22
23using namespace TDEABC;
24
25class VCardLine::VCardLinePrivate
26{
27 public:
28 TQString mGroup;
29};
30
31VCardLine::VCardLine()
32 : d( 0 )
33{
34}
35
36VCardLine::VCardLine( const TQString &identifier )
37 : d( 0 )
38{
39 mIdentifier = identifier;
40}
41
42VCardLine::VCardLine( const TQString &identifier, const TQVariant &value )
43 : d( 0 )
44{
45 mIdentifier = identifier;
46 mValue = value;
47}
48
49VCardLine::VCardLine( const VCardLine& line )
50 : d( 0 )
51{
52 mParamMap = line.mParamMap;
53 mValue = line.mValue;
54 mIdentifier = line.mIdentifier;
55}
56
57VCardLine::~VCardLine()
58{
59 delete d;
60 d = 0;
61}
62
63VCardLine& VCardLine::operator=( const VCardLine& line )
64{
65 if ( &line == this )
66 return *this;
67
68 mParamMap = line.mParamMap;
69 mValue = line.mValue;
70 mIdentifier = line.mIdentifier;
71
72 return *this;
73}
74
75void VCardLine::setIdentifier( const TQString& identifier )
76{
77 mIdentifier = identifier;
78}
79
80TQString VCardLine::identifier() const
81{
82 return mIdentifier;
83}
84
85void VCardLine::setValue( const TQVariant& value )
86{
87 mValue = value;
88}
89
90TQVariant VCardLine::value() const
91{
92 return mValue;
93}
94
95void VCardLine::setGroup( const TQString& group )
96{
97 if ( !d )
98 d = new VCardLinePrivate();
99
100 d->mGroup = group;
101}
102
103TQString VCardLine::group() const
104{
105 if ( d )
106 return d->mGroup;
107 else
108 return TQString();
109}
110
111bool VCardLine::hasGroup() const
112{
113 if ( !d )
114 return false;
115 else
116 return d->mGroup.isEmpty();
117}
118
119TQStringList VCardLine::parameterList() const
120{
121 return mParamMap.keys();
122}
123
124void VCardLine::addParameter( const TQString& param, const TQString& value )
125{
126 TQStringList &list = mParamMap[ param ];
127 if ( list.findIndex( value ) == -1 ) // not included yet
128 list.append( value );
129}
130
131TQStringList VCardLine::parameters( const TQString& param ) const
132{
133 ParamMap::ConstIterator it = mParamMap.find( param );
134 if ( it == mParamMap.end() )
135 return TQStringList();
136 else
137 return *it;
138}
139
140TQString VCardLine::parameter( const TQString& param ) const
141{
142 ParamMap::ConstIterator it = mParamMap.find( param );
143 if ( it == mParamMap.end() )
144 return TQString::null;
145 else {
146 if ( (*it).isEmpty() )
147 return TQString::null;
148 else
149 return (*it).first();
150 }
151}
TDEABC
static data, shared by ALL addressee objects
Definition: address.h:48

tdeabc

Skip menu "tdeabc"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeabc

Skip menu "tdeabc"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeabc by doxygen 1.9.4
This website is maintained by Timothy Pearson.