summaryrefslogtreecommitdiffabout
path: root/kabc/agent.h
Unidiff
Diffstat (limited to 'kabc/agent.h') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/agent.h129
1 files changed, 129 insertions, 0 deletions
diff --git a/kabc/agent.h b/kabc/agent.h
new file mode 100644
index 0000000..fa459d5
--- a/dev/null
+++ b/kabc/agent.h
@@ -0,0 +1,129 @@
1/*
2 This file is part of libkabc.
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/*
22Enhanced Version of the file for platform independent KDE tools.
23Copyright (c) 2004 Ulf Schenk
24
25$Id$
26*/
27
28#ifndef KABC_AGENT_H
29#define KABC_AGENT_H
30
31namespace KABC {
32
33class Addressee;
34
35/**
36 * Important!!!
37 *
38 * At the moment the vcard format does not support saving and loading
39 * this entity.
40 */
41class Agent
42{
43 friend QDataStream &operator<<( QDataStream &, const Agent & );
44 friend QDataStream &operator>>( QDataStream &, Agent & );
45
46public:
47
48 /**
49 * Consturctor. Creates an empty object.
50 */
51 Agent();
52
53 /**
54 * Consturctor.
55 *
56 * @param url A URL that describes the position of the agent file.
57 */
58 Agent( const QString &url );
59
60 /**
61 * Consturctor.
62 *
63 * @param addressee The addressee object of the agent.
64 */
65 Agent( Addressee *addressee );
66
67 /**
68 * Destructor.
69 */
70 ~Agent();
71
72
73 bool operator==( const Agent & ) const;
74 bool operator!=( const Agent & ) const;
75 Agent &operator=( const Agent & );
76
77 /**
78 * Sets a URL for the location of the agent file. When using this
79 * function, @ref isIntern() will return 'false' until you use
80 * @ref setAddressee().
81 *
82 * @param url The location URL of the agent file.
83 */
84 void setUrl( const QString &url );
85
86 /**
87 * Sets the addressee of the agent. When using this function,
88 * @ref isIntern() will return 'true' until you use @ref setUrl().
89 *
90 * @param addressee The addressee object of the agent.
91 */
92 void setAddressee( Addressee *addressee );
93
94 /**
95 * Returns whether the agent is described by a URL (extern) or
96 * by a addressee (intern).
97 * When this method returns 'true' you can use @ref addressee() to
98 * get a @ref Addressee object. Otherwise you can request the URL
99 * of this agent by @ref url() and load the data from that location.
100 */
101 bool isIntern() const;
102
103 /**
104 * Returns the location URL of this agent.
105 */
106 QString url() const;
107
108 /**
109 * Returns the addressee object of this agent.
110 */
111 Addressee* addressee() const;
112
113 /**
114 * Returns string representation of the agent.
115 */
116 QString asString() const;
117
118private:
119 Addressee *mAddressee;
120 QString mUrl;
121
122 int mIntern;
123};
124
125QDataStream &operator<<( QDataStream &, const Agent & );
126QDataStream &operator>>( QDataStream &, Agent & );
127
128}
129#endif