• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeabc
 

tdeabc

  • tdeabc
picture.cpp
1/*
2 This file is part of libtdeabc.
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., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/
20
21#include "picture.h"
22
23using namespace TDEABC;
24
25Picture::Picture()
26 : mIntern( false )
27{
28}
29
30Picture::Picture( const TQString &url )
31 : mUrl( url ), mIntern( false )
32{
33}
34
35Picture::Picture( const TQImage &data )
36 : mData( data ), mIntern( true )
37{
38}
39
40Picture::~Picture()
41{
42}
43
44bool Picture::operator==( const Picture &p ) const
45{
46 if ( mIntern != p.mIntern ) return false;
47
48 if ( mIntern ) {
49 if ( mData != p.mData )
50 return false;
51 } else {
52 if ( mUrl != p.mUrl )
53 return false;
54 }
55
56 return true;
57}
58
59bool Picture::operator!=( const Picture &p ) const
60{
61 return !( p == *this );
62}
63
64void Picture::setUrl( const TQString &url )
65{
66 mUrl = url;
67 mIntern = false;
68}
69
70void Picture::setData( const TQImage &data )
71{
72 mData = data;
73 mIntern = true;
74}
75
76void Picture::setType( const TQString &type )
77{
78 mType = type;
79}
80
81bool Picture::isIntern() const
82{
83 return mIntern;
84}
85
86TQString Picture::url() const
87{
88 return mUrl;
89}
90
91TQImage Picture::data() const
92{
93 return mData;
94}
95
96TQString Picture::type() const
97{
98 return mType;
99}
100
101TQString Picture::asString() const
102{
103 if ( mIntern )
104 return "intern picture";
105 else
106 return mUrl;
107}
108
109TQDataStream &TDEABC::operator<<( TQDataStream &s, const Picture &picture )
110{
111 return s << picture.mIntern << picture.mUrl << picture.mType;
112// return s << picture.mIntern << picture.mUrl << picture.mType << picture.mData;
113}
114
115TQDataStream &TDEABC::operator>>( TQDataStream &s, Picture &picture )
116{
117 s >> picture.mIntern >> picture.mUrl >> picture.mType;
118// s >> picture.mIntern >> picture.mUrl >> picture.mType >> picture.mData;
119 return s;
120}
TDEABC
static data, shared by ALL addressee objects
Definition: address.h:48

tdeabc

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

tdeabc

Skip menu "tdeabc"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeabc by doxygen 1.9.4
This website is maintained by Timothy Pearson.