• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.14.10 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
23using namespace KABC;
24
25VCardLine::VCardLine()
26 : d( 0 )
27{
28}
29
30VCardLine::VCardLine( const QString &identifier )
31 : d( 0 )
32{
33 mIdentifier = identifier;
34}
35
36VCardLine::VCardLine( const QString &identifier, const QVariant &value )
37 : d( 0 )
38{
39 mIdentifier = identifier;
40 mValue = value;
41}
42
43VCardLine::VCardLine( const VCardLine &line )
44 : d( 0 )
45{
46 mParamMap = line.mParamMap;
47 mValue = line.mValue;
48 mIdentifier = line.mIdentifier;
49}
50
51VCardLine::~VCardLine()
52{
53}
54
55VCardLine &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
68void VCardLine::setIdentifier( const QString &identifier )
69{
70 mIdentifier = identifier;
71}
72
73QString VCardLine::identifier() const
74{
75 return mIdentifier;
76}
77
78void VCardLine::setValue( const QVariant &value )
79{
80 mValue = value;
81}
82
83QVariant VCardLine::value() const
84{
85 return mValue;
86}
87
88void VCardLine::setGroup( const QString &group )
89{
90 mGroup = group;
91}
92
93QString VCardLine::group() const
94{
95 return mGroup;
96}
97
98bool VCardLine::hasGroup() const
99{
100 return !mGroup.isEmpty();
101}
102
103QStringList VCardLine::parameterList() const
104{
105 return mParamMap.keys();
106}
107
108void 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
116QStringList 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
126QString 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}
139
140VCardLine::ParamMap VCardLine::parameterMap() const
141{
142 return mParamMap;
143}
KABC
Class that holds a Calendar Url (FBURL/CALADRURI/CALURI)
Definition: address.h:29
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jul 21 2022 00:00:00 by doxygen 1.9.5 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.14.10 API Reference

Skip menu "kdepimlibs-4.14.10 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • 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