Messagelib
theme.cpp
31 // --------------------------------------------------------------------------------------------------------------
32 // 0x1013 08.11.2008 Initial theme version, introduced when this piece of code has been moved into trunk.
40 static const int gThemeCurrentVersion = 0x1019; // increase if you add new fields or change the meaning of some
481 if (ci->type() == ContentItem::AttachmentStateIcon && themeVersion < gThemeMinimumVersionWithAnnotationIcon && val > 1) {
482 qCDebug(MESSAGELIST_LOG) << "Old theme version detected, adding annotation item next to attachment icon.";
493 if (ci->type() == ContentItem::AttachmentStateIcon && themeVersion < gThemeMinimumVersionWithInvitationIcon && val > 1) {
494 qCDebug(MESSAGELIST_LOG) << "Old theme version detected, adding invitation item next to attachment icon.";
594 qCDebug(MESSAGELIST_LOG) << "Theme has insane column width " << mCurrentWidth << " chopping to 100";
1040 void Theme::setGroupHeaderBackgroundStyle(Theme::GroupHeaderBackgroundStyle groupHeaderBackgroundStyle)
1212 mPixmaps << new QPixmap(QIcon::fromTheme(QStringLiteral("mail-mark-unread-new")).pixmap(mIconSize, mIconSize))
1213 << new QPixmap(QIcon::fromTheme(QStringLiteral("mail-mark-unread")).pixmap(mIconSize, mIconSize))
1214 << new QPixmap(QIcon::fromTheme(QStringLiteral("mail-mark-read")).pixmap(mIconSize, mIconSize))
1217 << new QPixmap(QIcon::fromTheme(QStringLiteral("mail-forwarded-replied")).pixmap(mIconSize, mIconSize))
1218 << new QPixmap(QIcon::fromTheme(QStringLiteral("mail-queued")).pixmap(mIconSize, mIconSize)) // mail-queue ?
1219 << new QPixmap(QIcon::fromTheme(QStringLiteral("mail-mark-task")).pixmap(mIconSize, mIconSize))
1221 << new QPixmap(QIcon::fromTheme(QStringLiteral("mail-forwarded")).pixmap(mIconSize, mIconSize))
1222 << new QPixmap(QIcon::fromTheme(QStringLiteral("mail-mark-important")).pixmap(mIconSize, mIconSize)) // "flag"
1223 << new QPixmap(QIcon::fromTheme(QStringLiteral("mail-thread-watch")).pixmap(mIconSize, mIconSize))
1224 << new QPixmap(QIcon::fromTheme(QStringLiteral("mail-thread-ignored")).pixmap(mIconSize, mIconSize))
1225 << new QPixmap(QIcon::fromTheme(QStringLiteral("mail-mark-junk")).pixmap(mIconSize, mIconSize))
1226 << new QPixmap(QIcon::fromTheme(QStringLiteral("mail-mark-notjunk")).pixmap(mIconSize, mIconSize))
1227 << new QPixmap(QIcon::fromTheme(QStringLiteral("mail-signed-verified")).pixmap(mIconSize, mIconSize))
1228 << new QPixmap(QIcon::fromTheme(QStringLiteral("mail-signed-part")).pixmap(mIconSize, mIconSize))
1231 << new QPixmap(QIcon::fromTheme(QStringLiteral("mail-encrypted-full")).pixmap(mIconSize, mIconSize))
1232 << new QPixmap(QIcon::fromTheme(QStringLiteral("mail-encrypted-part")).pixmap(mIconSize, mIconSize))
1233 << new QPixmap(QIcon::fromTheme(QStringLiteral("mail-encrypted")).pixmap(mIconSize, mIconSize))
1235 << new QPixmap(QIcon::fromTheme(QStringLiteral("mail-attachment")).pixmap(mIconSize, mIconSize))
1236 << new QPixmap(QIcon::fromTheme(QStringLiteral("view-pim-notes")).pixmap(mIconSize, mIconSize))
1237 << new QPixmap(QIcon::fromTheme(QStringLiteral("mail-invitation")).pixmap(mIconSize, mIconSize))
1238 << ((QApplication::isRightToLeft()) ? new QPixmap(QIcon::fromTheme(QStringLiteral("arrow-left")).pixmap(mIconSize, mIconSize))
1241 << new QPixmap(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("messagelist/pics/mail-vertical-separator-line.png")))
1242 << new QPixmap(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("messagelist/pics/mail-horizontal-space.png")));
bool softenByBlending() const
Returns true if this item should be always painted in a "soft" fashion.
Definition: theme.cpp:254
void setPixmapName(const QString &pixmapName)
Sets the icon's name (used in SmallIcon) for this column.
Definition: theme.cpp:652
bool visibleByDefault() const
Returns true if this column has to be shown by default.
Definition: theme.cpp:667
@ AttachmentStateIcon
The icon that displays the attachment state (may be disabled)
Definition: theme.h:138
static bool applicableToGroupHeaderItems(Type type)
Static test that returns true if an instance of ContentItem with the specified type makes sense in a ...
Definition: theme.cpp:283
const QList< ContentItem * > & leftItems() const
Returns the list of left aligned items for this row.
Definition: theme.cpp:507
void setHideWhenDisabled(bool hideWhenDisabled)
Sets the flag that causes this item to be hidden when disabled.
Definition: theme.cpp:231
void setMessageSorting(SortOrder::MessageSorting ms)
Sets the sort order for messages that we should switch to when clicking on this column's header (if v...
Definition: theme.cpp:693
static QList< QPair< QString, int > > enumerateViewHeaderPolicyOptions()
Enumerates the available view header policy options.
Definition: theme.cpp:1045
SortOrder::MessageSorting messageSorting() const
Returns the sort order for messages that we should switch to when clicking on this column's header (i...
Definition: theme.cpp:688
void save(QDataStream &stream) const
Handles column saving (used by Theme::save())
Definition: theme.cpp:795
void setCurrentWidth(double currentWidth)
Sets the current shared width setting for this column.
Definition: theme.cpp:713
void setGroupHeaderBackgroundStyle(GroupHeaderBackgroundStyle groupHeaderBackgroundStyle)
Sets the group header background style for this theme.
Definition: theme.cpp:1040
The Row class defines a row of items inside a Column.
Definition: theme.h:412
bool load(QDataStream &stream, int themeVersion)
Handles content item loading (used by Theme::Row::load())
Definition: theme.cpp:295
void setGroupHeaderBackgroundColor(const QColor &clr)
Sets the group header background color for this theme.
Definition: theme.cpp:1030
Subject
QIcon fromTheme(const QString &name)
void save(QDataStream &stream) const override
Pure virtual reimplemented from OptionSet.
Definition: theme.cpp:1180
const QList< Row * > & messageRows() const
Returns the list of rows visible in this column for a MessageItem.
Definition: theme.cpp:718
Column * column(int idx) const
Returns a pointer to the column at the specified index or 0 if there is no such column.
Definition: theme.cpp:973
static bool applicableToMessageItems(Type type)
Static test that returns true if an instance of ContentItem with the specified type makes sense in a ...
Definition: theme.cpp:278
void removeLeftItem(ContentItem *item)
Removes the specified left aligned content item from this row.
Definition: theme.cpp:397
void removeRightItem(ContentItem *item)
Removes the specified right aligned content item from this row.
Definition: theme.cpp:416
bool softenByBlendingWhenDisabled() const
Returns true if this item should be painted in a "soft" fashion when in disabled state.
Definition: theme.cpp:240
QString locate(QStandardPaths::StandardLocation type, const QString &fileName, QStandardPaths::LocateOptions options)
void setUseCustomColor(bool useCustomColor)
Makes this item use the custom color that can be set by setCustomColor().
Definition: theme.cpp:189
void setIsSenderOrReceiver(bool sor)
Marks this column as containing the "sender/receiver" field.
Definition: theme.cpp:662
void insertRightItem(int idx, ContentItem *item)
Adds a right aligned item at the specified position in this row.
Definition: theme.cpp:407
static QString description(Type type)
Returns a descriptive name for the specified content item type.
Definition: theme.cpp:103
void reserve(int alloc)
void insertMessageRow(int idx, Row *row)
Inserts a message row to this theme column in the specified position.
Definition: theme.cpp:747
void save(QDataStream &stream) const
Handles content item saving (used by Theme::Row::save())
Definition: theme.cpp:288
void resetColumnSizes()
Resets the column sizes to "default" (subset of resetColumnState() above).
Definition: theme.cpp:961
QString i18n(const char *text, const TYPE &arg...)
GroupHeaderBackgroundMode groupHeaderBackgroundMode() const
Returns the group header background mode for this theme.
Definition: theme.cpp:1004
void setCurrentlyVisible(bool currentlyVisible)
Sets the current shared visibility state for this column.
Definition: theme.cpp:703
@ AutoColor
Automatically determine the color (somewhere in the middle between background and text)
Definition: theme.h:800
void setViewHeaderPolicy(ViewHeaderPolicy vhp)
Sets the ViewHeaderPolicy for this theme.
Definition: theme.cpp:1067
GroupHeaderBackgroundStyle groupHeaderBackgroundStyle() const
Returns the group header background style for this theme.
Definition: theme.cpp:1035
void detach()
Detaches this object from the shared runtime data for columns.
Definition: theme.cpp:946
const QList< Column * > & columns() const
Returns the list of columns available in this theme.
Definition: theme.cpp:968
bool load(QDataStream &stream, int themeVersion)
Handles column loading (used by Theme::load())
Definition: theme.cpp:824
bool isSenderOrReceiver() const
Returns true if this column is marked as "sender/receiver" and we should update its label on-the-fly.
Definition: theme.cpp:657
const QString & pixmapName() const
Returns the icon's name (used in SmallIcon) set for this column.
Definition: theme.cpp:647
A class which holds information about sorting, e.g.
Definition: sortorder.h:34
bool canBeDisabled() const
Returns true if this ContentItem can be in a "disabled" state.
Definition: theme.cpp:68
void insertLeftItem(int idx, ContentItem *item)
Adds a left aligned item at the specified position in this row.
Definition: theme.cpp:388
bool canUseCustomColor() const
Returns true if this ContentItem can make use of a custom color.
Definition: theme.cpp:73
bool load(QDataStream &stream) override
Pure virtual reimplemented from OptionSet.
Definition: theme.cpp:1089
void setGroupHeaderBackgroundMode(GroupHeaderBackgroundMode bm)
Sets the group header background mode for this theme.
Definition: theme.cpp:1017
@ SortMessagesByUnreadStatus
Sort the messages by the "Unread" flags of status.
Definition: sortorder.h:88
bool isRightToLeft()
void insertGroupHeaderRow(int idx, Row *row)
Inserts a group header row to this theme column in the specified position.
Definition: theme.cpp:766
bool currentlyVisible() const
Returns the current shared visibility state for this column.
Definition: theme.cpp:698
Definition: aggregation.h:21
double currentWidth() const
Returns the current shared width setting for this column or -1 if the width is not specified and shou...
Definition: theme.cpp:708
The Theme class defines the visual appearance of the MessageList.
Definition: theme.h:47
const QList< ContentItem * > & rightItems() const
Returns the list of right aligned items for this row.
Definition: theme.cpp:402
GenericDataLocation
ViewHeaderPolicy viewHeaderPolicy() const
Returns the currently set ViewHeaderPolicy.
Definition: theme.cpp:1062
QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state) const const
bool containsTextItems() const
Returns true if this column contains text items.
Definition: theme.cpp:780
void removeAllLeftItems()
Removes all the left items from this row: the items are deleted.
Definition: theme.cpp:364
static QList< QPair< QString, int > > enumerateGroupHeaderBackgroundStyles()
Enumerates the available group header background styles.
Definition: theme.cpp:1050
GroupHeaderBackgroundMode
Which color do we use to paint group header background ?
Definition: theme.h:798
const QList< Row * > & groupHeaderRows() const
Returns the list of rows visible in this column for a GroupHeaderItem.
Definition: theme.cpp:761
bool isClickable() const
Returns true if clicking on this kind of item can perform an action.
Definition: theme.cpp:93
A set of options that can be applied to the MessageList in one shot.
Definition: optionset.h:32
bool displaysText() const
Returns true if this item displays some kind of text.
Definition: theme.cpp:78
The ContentItem class defines a content item inside a Row.
Definition: theme.h:55
void clear()
QString i18nc(const char *context, const char *text, const TYPE &arg...)
const QColor & groupHeaderBackgroundColor() const
Returns the group header background color for this theme.
Definition: theme.cpp:1025
void resetColumnState()
Resets the column state (visibility and width) to their default values (the "visible by default" ones...
Definition: theme.cpp:953
void save(QDataStream &stream) const
Handles row saving (used by Theme::Column::save())
Definition: theme.cpp:436
bool isValid() const const
const QColor & customColor() const
Returns the custom color set for this item.
Definition: theme.cpp:268
bool displaysLongText() const
Returns true if this item displays a long text.
Definition: theme.cpp:83
void detach()
Detaches the shared runtime data object and makes this object totally independent.
Definition: theme.cpp:677
static bool isValidMessageSorting(SortOrder::MessageSorting ms)
Returns true if the ms parameter specifies a valid MessageSorting option.
Definition: sortorder.cpp:263
void removeAllGroupHeaderRows()
Removes all the group header rows from this column.
Definition: theme.cpp:735
bool hideWhenDisabled() const
Returns true if this item should be hidden when in disabled state.
Definition: theme.cpp:226
void insertColumn(int idx, Column *column)
Inserts a column to this theme at the specified position.
Definition: theme.cpp:990
void setVisibleByDefault(bool vbd)
Sets the "visible by default" tag for this column.
Definition: theme.cpp:672
bool load(QDataStream &stream, int themeVersion)
Handles row loading (used by Theme::Column::load())
Definition: theme.cpp:512
The Column class defines a view column available inside this theme.
Definition: theme.h:505
void setSoftenByBlendingWhenDisabled(bool softenByBlendingWhenDisabled)
Sets the flag that causes this item to be painted "softly" when disabled.
Definition: theme.cpp:245
void setSoftenByBlending(bool softenByBlending)
Sets the flag that causes this item to be painted "softly".
Definition: theme.cpp:259
bool containsTextItems() const
Returns true if this row contains text items.
Definition: theme.cpp:421
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Wed Dec 6 2023 03:56:41 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Wed Dec 6 2023 03:56:41 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.