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

kabc

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

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kldap
  • kmbox
  • kmime
  • kpimidentities
  • kpimtextedit
  • kresources
  • ktnef
  • kxmlrpcclient
  • microblog

Search



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