akonadi
20 #include "entitydisplayattribute.h"
22 #include "imapparser_p.h"
26 using namespace Akonadi;
28 class EntityDisplayAttribute::Private
31 Private() : hidden( false ) {}
61 return KIcon( d->icon );
76 return "ENTITYDISPLAY";
82 attr->d->name = d->name;
83 attr->d->
icon = d->icon;
92 l << ImapParser::quote( d->name.toUtf8() );
93 l << ImapParser::quote( d->icon.toUtf8() );
94 l << ImapParser::quote( d->activeIcon.toUtf8() );
95 QList<QByteArray> components;
96 if ( d->backgroundColor.isValid() )
98 components = QList<QByteArray>() << QByteArray::number( d->backgroundColor.red() )
99 << QByteArray::number( d->backgroundColor.green() )
100 << QByteArray::number( d->backgroundColor.blue() )
101 << QByteArray::number( d->backgroundColor.alpha() );
103 l <<
'(' + ImapParser::join( components,
" " ) +
')';
104 return '(' + ImapParser::join( l,
" " ) +
')';
110 ImapParser::parseParenthesizedList( data, l );
112 Q_ASSERT( size >= 2 );
113 d->name = QString::fromUtf8( l[0] );
114 d->icon = QString::fromUtf8( l[1] );
116 d->activeIcon = QString::fromUtf8( l[2] );
120 if ( !l[3].isEmpty() )
122 QList<QByteArray> componentData;
123 ImapParser::parseParenthesizedList( l[3], componentData );
124 if ( componentData.size() != 4 )
126 QList<int> components;
129 for (
int i = 0; i <= 3; ++i )
131 components << componentData.at( i ).toInt( &ok );
135 d->backgroundColor = QColor( components.at( 0 ), components.at( 1 ), components.at( 2 ), components.at( 3 ) );
142 d->activeIcon = name;
147 return KIcon( d->activeIcon );
152 return d->activeIcon;
157 return d->backgroundColor;
162 d->backgroundColor = color;
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jan 5 2013 19:46:03 by
doxygen 1.8.1.2 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.