summaryrefslogtreecommitdiffabout
path: root/kabc/picture.h
Unidiff
Diffstat (limited to 'kabc/picture.h') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/picture.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/kabc/picture.h b/kabc/picture.h
index 714d1e2..1b63610 100644
--- a/kabc/picture.h
+++ b/kabc/picture.h
@@ -1,134 +1,136 @@
1/* 1/*
2 This file is part of libkabc. 2 This file is part of libkabc.
3 Copyright (c) 2002 Tobias Koenig <tokoe@kde.org> 3 Copyright (c) 2002 Tobias Koenig <tokoe@kde.org>
4 4
5 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public 6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either 7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version. 8 version 2 of the License, or (at your option) any later version.
9 9
10 This library is distributed in the hope that it will be useful, 10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 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 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, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21/* 21/*
22Enhanced Version of the file for platform independent KDE tools. 22Enhanced Version of the file for platform independent KDE tools.
23Copyright (c) 2004 Ulf Schenk 23Copyright (c) 2004 Ulf Schenk
24 24
25$Id$ 25$Id$
26*/ 26*/
27 27
28#ifndef KABC_PICTURE_H 28#ifndef KABC_PICTURE_H
29#define KABC_PICTURE_H 29#define KABC_PICTURE_H
30 30
31#include <qimage.h> 31#include <qimage.h>
32//Added by qt3to4:
33#include <QPixmap>
32 34
33namespace KABC { 35namespace KABC {
34 36
35class Picture 37class Picture
36{ 38{
37 friend QDataStream &operator<<( QDataStream &, const Picture & ); 39 friend QDataStream &operator<<( QDataStream &, const Picture & );
38 friend QDataStream &operator>>( QDataStream &, Picture & ); 40 friend QDataStream &operator>>( QDataStream &, Picture & );
39 41
40public: 42public:
41 43
42 /** 44 /**
43 * Consturctor. Creates an empty object. 45 * Consturctor. Creates an empty object.
44 */ 46 */
45 Picture(); 47 Picture();
46 48
47 /** 49 /**
48 * Consturctor. 50 * Consturctor.
49 * 51 *
50 * @param url A URL that describes the position of the picture file. 52 * @param url A URL that describes the position of the picture file.
51 */ 53 */
52 Picture( const QString &url ); 54 Picture( const QString &url );
53 55
54 /** 56 /**
55 * Consturctor. 57 * Consturctor.
56 * 58 *
57 * @param data The raw data of the picture. 59 * @param data The raw data of the picture.
58 */ 60 */
59 Picture( const QImage &data ); 61 Picture( const QImage &data );
60 62
61 /** 63 /**
62 * Destructor. 64 * Destructor.
63 */ 65 */
64 ~Picture(); 66 ~Picture();
65 67
66 bool undefined() const; 68 bool undefined() const;
67 bool operator==( const Picture & ) const; 69 bool operator==( const Picture & ) const;
68 bool operator!=( const Picture & ) const; 70 bool operator!=( const Picture & ) const;
69 71
70 /** 72 /**
71 * Sets a URL for the location of the picture file. When using this 73 * Sets a URL for the location of the picture file. When using this
72 * function, @ref isIntern() will return 'false' until you use 74 * function, @ref isIntern() will return 'false' until you use
73 * @ref setData(). 75 * @ref setData().
74 * 76 *
75 * @param url The location URL of the picture file. 77 * @param url The location URL of the picture file.
76 */ 78 */
77 void setUrl( const QString &url ); 79 void setUrl( const QString &url );
78 80
79 /** 81 /**
80 * Sets the raw data of the picture. When using this function, 82 * Sets the raw data of the picture. When using this function,
81 * @ref isIntern() will return 'true' until you use @ref setUrl(). 83 * @ref isIntern() will return 'true' until you use @ref setUrl().
82 * 84 *
83 * @param data The raw data of the picture. 85 * @param data The raw data of the picture.
84 */ 86 */
85 void setData( const QImage &data ); 87 void setData( const QImage &data );
86 88
87 /** 89 /**
88 * Sets the type of the picture. 90 * Sets the type of the picture.
89 */ 91 */
90 void setType( const QString &type ); 92 void setType( const QString &type );
91 93
92 /** 94 /**
93 * Returns whether the picture is described by a URL (extern) or 95 * Returns whether the picture is described by a URL (extern) or
94 * by the raw data (intern). 96 * by the raw data (intern).
95 * When this method returns 'true' you can use @ref data() to 97 * When this method returns 'true' you can use @ref data() to
96 * get the raw data. Otherwise you can request the URL of this 98 * get the raw data. Otherwise you can request the URL of this
97 * picture by @ref url() and load the raw data from that location. 99 * picture by @ref url() and load the raw data from that location.
98 */ 100 */
99 bool isIntern() const; 101 bool isIntern() const;
100 102
101 /** 103 /**
102 * Returns the location URL of this picture. 104 * Returns the location URL of this picture.
103 */ 105 */
104 QString url() const; 106 QString url() const;
105 107
106 /** 108 /**
107 * Returns the raw data of this picture. 109 * Returns the raw data of this picture.
108 */ 110 */
109 QImage data() const; 111 QImage data() const;
110 QPixmap pixmap() const; 112 QPixmap pixmap() const;
111 /** 113 /**
112 * Returns the type of this picture. 114 * Returns the type of this picture.
113 */ 115 */
114 QString type() const; 116 QString type() const;
115 117
116 /** 118 /**
117 * Returns string representation of the picture. 119 * Returns string representation of the picture.
118 */ 120 */
119 QString asString() const; 121 QString asString() const;
120 122
121private: 123private:
122 QString mUrl; 124 QString mUrl;
123 QString mType; 125 QString mType;
124 QImage mData; 126 QImage mData;
125 bool mUndefined; 127 bool mUndefined;
126 128
127 int mIntern; 129 int mIntern;
128}; 130};
129 131
130QDataStream &operator<<( QDataStream &, const Picture & ); 132QDataStream &operator<<( QDataStream &, const Picture & );
131QDataStream &operator>>( QDataStream &, Picture & ); 133QDataStream &operator>>( QDataStream &, Picture & );
132 134
133} 135}
134#endif 136#endif