• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.9.3 API Reference
  • KDE Home
  • Contact Us
 

kabc

  • kabc
  • vcardparser
vcardline.cpp
1 /*
2  This file is part of libkabc.
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 
23 using namespace KABC;
24 
25 VCardLine::VCardLine()
26 {
27 }
28 
29 VCardLine::VCardLine( const QString &identifier )
30 {
31  mIdentifier = identifier;
32 }
33 
34 VCardLine::VCardLine( const QString &identifier, const QVariant &value )
35 {
36  mIdentifier = identifier;
37  mValue = value;
38 }
39 
40 VCardLine::VCardLine( const VCardLine &line )
41 {
42  mParamMap = line.mParamMap;
43  mValue = line.mValue;
44  mIdentifier = line.mIdentifier;
45 }
46 
47 VCardLine::~VCardLine()
48 {
49 }
50 
51 VCardLine &VCardLine::operator=( const VCardLine &line )
52 {
53  if ( &line == this ) {
54  return *this;
55  }
56 
57  mParamMap = line.mParamMap;
58  mValue = line.mValue;
59  mIdentifier = line.mIdentifier;
60 
61  return *this;
62 }
63 
64 void VCardLine::setIdentifier( const QString &identifier )
65 {
66  mIdentifier = identifier;
67 }
68 
69 QString VCardLine::identifier() const
70 {
71  return mIdentifier;
72 }
73 
74 void VCardLine::setValue( const QVariant &value )
75 {
76  mValue = value;
77 }
78 
79 QVariant VCardLine::value() const
80 {
81  return mValue;
82 }
83 
84 void VCardLine::setGroup( const QString &group )
85 {
86  mGroup = group;
87 }
88 
89 QString VCardLine::group() const
90 {
91  return mGroup;
92 }
93 
94 bool VCardLine::hasGroup() const
95 {
96  return !mGroup.isEmpty();
97 }
98 
99 QStringList VCardLine::parameterList() const
100 {
101  return mParamMap.keys();
102 }
103 
104 void VCardLine::addParameter( const QString &param, const QString &value )
105 {
106  QStringList &list = mParamMap[ param ];
107  if ( !list.contains( value ) ) { // not included yet
108  list.append( value );
109  }
110 }
111 
112 QStringList VCardLine::parameters( const QString &param ) const
113 {
114  ParamMap::ConstIterator it = mParamMap.find( param );
115  if ( it == mParamMap.end() ) {
116  return QStringList();
117  } else {
118  return *it;
119  }
120 }
121 
122 QString VCardLine::parameter( const QString &param ) const
123 {
124  ParamMap::ConstIterator it = mParamMap.find( param );
125  if ( it == mParamMap.end() ) {
126  return QString();
127  } else {
128  if ( (*it).isEmpty() ) {
129  return QString();
130  } else {
131  return (*it).first();
132  }
133  }
134 }
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Wed Nov 28 2012 21:59:37 by doxygen 1.8.1.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kabc

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

kdepimlibs-4.9.3 API Reference

Skip menu "kdepimlibs-4.9.3 API Reference"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal