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() ) {
97 components = QList<QByteArray>() << QByteArray::number( d->backgroundColor.red() )
98 << QByteArray::number( d->backgroundColor.green() )
99 << QByteArray::number( d->backgroundColor.blue() )
100 << QByteArray::number( d->backgroundColor.alpha() );
102 l <<
'(' + ImapParser::join( components,
" " ) +
')';
103 return '(' + ImapParser::join( l,
" " ) +
')';
109 ImapParser::parseParenthesizedList( data, l );
111 Q_ASSERT( size >= 2 );
112 d->name = QString::fromUtf8( l[0] );
113 d->icon = QString::fromUtf8( l[1] );
115 d->activeIcon = QString::fromUtf8( l[2] );
118 if ( !l[3].isEmpty() ) {
119 QList<QByteArray> componentData;
120 ImapParser::parseParenthesizedList( l[3], componentData );
121 if ( componentData.size() != 4 ) {
124 QList<int> components;
127 for (
int i = 0; i <= 3; ++i ) {
128 components << componentData.at( i ).toInt( &ok );
133 d->backgroundColor = QColor( components.at( 0 ), components.at( 1 ), components.at( 2 ), components.at( 3 ) );
140 d->activeIcon = name;
145 return KIcon( d->activeIcon );
150 return d->activeIcon;
155 return d->backgroundColor;
160 d->backgroundColor = color;
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jul 13 2013 01:27:35 by
doxygen 1.8.3.1 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.