messagelist
themeeditor.cpp
Go to the documentation of this file.
63 static const char * gThemeContentItemTypeDndMimeDataFormat = "application/x-kmail-messagelistview-theme-contentitem-type";
69 ThemeColumnPropertiesDialog::ThemeColumnPropertiesDialog( QWidget * parent, Theme::Column * column, const QString &title )
95 mMessageSortingCombo->setToolTip( i18n( "The sorting order that clicking on this column header will switch to." ) );
99 mVisibleByDefaultCheck->setToolTip( i18n( "Check this if this column should be visible when the theme is selected." ) );
102 mIsSenderOrReceiverCheck = new QCheckBox( i18n( "Contains \"Sender or Receiver\" field" ), base );
103 mIsSenderOrReceiverCheck->setToolTip( i18n( "Check this if this column label should be updated depending on the folder \"inbound\"/\"outbound\" type." ) );
116 ComboBoxUtils::fillIntegerOptionCombo( mMessageSortingCombo, SortOrder::enumerateMessageSortingOptions( Aggregation::PerfectReferencesAndSubject ) );
138 ThemeContentItemSourceLabel::ThemeContentItemSourceLabel( QWidget * parent, Theme::ContentItem::Type type )
197 mSampleGroupHeaderItem->setSubject( i18n( "Very long subject very long subject very long subject very long subject very long subject very long" ) );
206 mSampleMessageItem->setSubject( i18n( "Very long subject very long subject very long subject very long subject very long subject very long" ) );
211 list.append( new MessageItem::Tag( SmallIcon( QLatin1String( "feed-subscribe" ) ), i18n( "Sample Tag 1" ), QString() ) );
212 list.append( new MessageItem::Tag( SmallIcon( QLatin1String( "feed-subscribe" ) ), i18n( "Sample Tag 2" ), QString() ) );
213 list.append( new MessageItem::Tag( SmallIcon( QLatin1String( "feed-subscribe" ) ), i18n( "Sample Tag 3" ), QString() ) );
344 realWidth = ( ( hintWidth * viewport()->width() ) / totalVisibleWidthHint ) - 2; // -2 is heuristic
429 label += QString::fromLatin1( " (%1)" ).arg( i18nc( "Indicates whether or not a header label is visible", "Visible") );
489 QByteArray arry = e->mimeData()->data(QLatin1String( gThemeContentItemTypeDndMimeDataFormat ) );
530 QByteArray arry = e->mimeData()->data( QLatin1String( gThemeContentItemTypeDndMimeDataFormat ) );
550 const_cast< Theme::Column * >( mDelegate->hitColumn() )->insertMessageRow( mDelegate->hitRowIndex(), row );
552 const_cast< Theme::Column * >( mDelegate->hitColumn() )->insertGroupHeaderRow( mDelegate->hitRowIndex(), row );
560 const_cast< Theme::Column * >( mDelegate->hitColumn() )->insertMessageRow( mDelegate->hitRowIndex()+1, row );
562 const_cast< Theme::Column * >( mDelegate->hitColumn() )->insertGroupHeaderRow( mDelegate->hitRowIndex()+1, row );
590 row->rightItems().indexOf( const_cast< Theme::ContentItem * >( mDelegate->hitContentItem() ) ) : \
611 row->rightItems().indexOf( const_cast< Theme::ContentItem * >( mDelegate->hitContentItem() ) ) : \
650 bool ThemePreviewWidget::computeContentItemInsertPosition( const QPoint &pos, Theme::ContentItem::Type type )
742 // either there were some right items (so the theme delegate knows that the reported item is the closest)
743 // or there were no right items but the position is closest to the left item than the right row end
818 const_cast< Theme::Row * >( mDelegate->hitRow() )->removeRightItem( mSelectedThemeContentItem );
824 if ( mDelegate->hitRow()->rightItems().isEmpty() && mDelegate->hitRow()->leftItems().isEmpty() )
830 const_cast< Theme::Column * >( mDelegate->hitColumn() )->removeMessageRow( const_cast< Theme::Row * >( mDelegate->hitRow() ) );
836 const_cast< Theme::Column * >( mDelegate->hitColumn() )->removeGroupHeaderRow( const_cast< Theme::Row * >( mDelegate->hitRow() ) );
864 mThemeSelectedContentItemRect = mSelectedThemeContentItem ? mDelegate->hitContentItemRect() : QRect();
945 act = childmenu->addAction( i18nc("Hide a mark if the mail does not have the attribute, e.g. Important mark on a non important mail", "Hide") );
950 act = childmenu->addAction( i18nc("Keep a empty space in the list if the mail does not have the attribute, e.g. Important mark on a non important mail", "Keep Empty Space") );
953 act->setChecked( ! ( mSelectedThemeContentItem->softenByBlendingWhenDisabled() || mSelectedThemeContentItem->hideWhenDisabled() ) );
955 act = childmenu->addAction( i18nc("Show the icon softened in the list if the mail does not have the attribute, e.g. Important mark on a non important mail", "Keep Softened Icon") );
956 act->setData( QVariant( static_cast< int >( Theme::ContentItem::SoftenByBlendingWhenDisabled ) ) );
981 act = childmenu->addAction( i18nc("@action:inmenu Group header background color setting", "None") );
986 act = childmenu->addAction( i18nc("@action:inmenu Group header background color setting", "Automatic") );
991 act = childmenu->addAction( i18nc("@action:inmenu Group header background color setting", "Custom...") );
1010 for ( QList< QPair< QString, int > >::ConstIterator it = styles.constBegin(); it != end; ++it )
1015 act->setChecked( mTheme->groupHeaderBackgroundStyle() == static_cast< Theme::GroupHeaderBackgroundStyle >( ( *it ).second ) );
1049 mSelectedThemeContentItem->setHideWhenDisabled( flags == Theme::ContentItem::HideWhenDisabled );
1050 mSelectedThemeContentItem->setSoftenByBlendingWhenDisabled( flags == Theme::ContentItem::SoftenByBlendingWhenDisabled );
1073 const int result = KColorDialog::getColor( clr, mSelectedThemeContentItem->customColor(), this );
1088 mSelectedThemeContentItem->setSoftenByBlending( !mSelectedThemeContentItem->softenByBlending() );
1122 Theme::GroupHeaderBackgroundMode mode = static_cast< Theme::GroupHeaderBackgroundMode >( act->data().toInt( &ok ) );
1153 Theme::GroupHeaderBackgroundStyle mode = static_cast< Theme::GroupHeaderBackgroundStyle >( act->data().toInt( &ok ) );
1369 ThemeContentItemSourceLabel * cil = new ThemeContentItemSourceLabel( gb, Theme::ContentItem::Subject );
1505 l->setText( i18n( "Right click on the header to add or modify columns. Drag the content items and drop them on the columns in order to compose your theme. Right click on the items inside the view for more options." ) );
1565 ComboBoxUtils::setIntegerOptionComboValue( mViewHeaderPolicyCombo, (int)mCurrentTheme->viewHeaderPolicy() );
1588 (Theme::ViewHeaderPolicy)ComboBoxUtils::getIntegerOptionComboValue( mViewHeaderPolicyCombo, 0 )
The ContentItem class defines a content item inside a Row.
Definition: theme.h:73
void setFakeTags(const QList< Tag * > &tagList)
Sets a list of fake tags for this item.
Definition: messageitem.cpp:710
QCheckBox * mVisibleByDefaultCheck
Definition: themeeditor.h:67
void slotNameEditTextEdited(const QString &newName)
Definition: themeeditor.cpp:1602
ThemeEditor(QWidget *parent)
Definition: themeeditor.cpp:1353
void setDescription(const QString &description)
Sets the description for this option set.
Definition: optionset.h:94
void rawAppendChildItem(Item *child)
Appends a child item without inserting it via the model.
Definition: item.cpp:514
void setReadOnly(bool readOnly)
Definition: optionseteditor.cpp:70
Core::Theme * editedTheme() const
Definition: themeeditor.cpp:1619
void setIntegerOptionComboValue(KComboBox *combo, int value)
Sets the currently selected option in the specified combo.
Definition: comboboxutils.cpp:59
const QList< ContentItem * > & rightItems() const
Returns the list of right aligned items for this row.
Definition: theme.h:512
void slotFontMenuTriggered(QAction *act)
Definition: themeeditor.cpp:1092
void slotGroupHeaderBackgroundStyleMenuTriggered(QAction *act)
Definition: themeeditor.cpp:1150
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.h:731
ThemePreviewDelegate(QAbstractItemView *parent)
Definition: themeeditor.cpp:188
void slotHeaderContextMenuRequested(const QPoint &pos)
Definition: themeeditor.cpp:1189
void mousePressEvent(QMouseEvent *e)
Definition: themeeditor.cpp:154
KLineEdit * nameEdit() const
Returns the editor for the name of the OptionSet.
Definition: optionseteditor.cpp:81
QRect hitRowRect() const
Returns the rectangle of the row that was reported as hit by the previous call to hitTest()...
Definition: themedelegate.h:160
void insertColumn(int idx, Column *column)
Inserts a column to this theme at the specified position.
Definition: theme.cpp:749
The Row class defines a row of items inside a Column.
Definition: theme.h:466
void setSize(size_t size)
Sets the size of this item (size of the Message, mainly)
Definition: item.cpp:417
const QString & description() const
Returns a description of this option set.
Definition: optionset.h:88
void moveColumn(int idx, int newPosition)
Definition: theme.cpp:759
void setSoftenByBlendingWhenDisabled(bool softenByBlendingWhenDisabled)
Sets the flag that causes this item to be painted "softly" when disabled.
Definition: theme.h:389
This class is an optimizing helper for dealing with large flat QAbstractItemModel objects...
Definition: modelinvariantrowmapper.h:93
void setSubject(const QString &subject)
Sets the subject associated to this Item.
Definition: item.cpp:477
void setGroupHeaderBackgroundMode(GroupHeaderBackgroundMode bm)
Sets the group header background mode for this theme.
Definition: theme.cpp:766
GroupHeaderBackgroundStyle groupHeaderBackgroundStyle() const
Returns the group header background style for this theme.
Definition: theme.h:1004
bool displaysText() const
Returns true if this item displays some kind of text.
Definition: theme.h:286
QCheckBox * mIsSenderOrReceiverCheck
Definition: themeeditor.h:68
bool isSenderOrReceiver() const
Returns true if this column is marked as "sender/receiver" and we should update its label on-the-fly...
Definition: theme.h:699
~ThemePreviewDelegate()
Definition: themeeditor.cpp:234
bool hideWhenDisabled() const
Returns true if this item should be hidden when in disabled state.
Definition: theme.h:363
void setVisibleByDefault(bool vbd)
Sets the "visible by default" tag for this column.
Definition: theme.h:718
The Column class defines a view column available inside this theme.
Definition: theme.h:564
void setFont(const QFont &font)
Sets the custom font to be used with this item.
Definition: theme.cpp:166
const QColor & customColor() const
Returns the custom color set for this item.
Definition: theme.h:437
const QList< Row * > & messageRows() const
Returns the list of rows visible in this column for a MessageItem.
Definition: theme.h:773
void slotForegroundColorMenuTriggered(QAction *act)
Definition: themeeditor.cpp:1055
bool isClickable() const
Returns true if clicking on this kind of item can perform an action.
Definition: theme.h:304
virtual void mouseMoveEvent(QMouseEvent *e)
Definition: themeeditor.cpp:785
Core::Theme::Column * mColumn
Definition: themeeditor.h:65
ThemeColumnPropertiesDialog(QWidget *parent, Core::Theme::Column *column, const QString &title)
Definition: themeeditor.cpp:69
void setEncryptionState(EncryptionState state)
Definition: messageitem.cpp:470
void slotDisabledFlagsMenuTriggered(QAction *act)
Definition: themeeditor.cpp:1039
Item * hitItem() const
Returns the Item that was reported as hit by the previous call to hitTest().
Definition: themedelegate.h:108
ThemePreviewWidget(QWidget *parent)
Definition: themeeditor.cpp:253
bool canUseCustomColor() const
Returns true if this ContentItem can make use of a custom color.
Definition: theme.h:279
void themeNameChanged()
const Theme::Column * hitColumn() const
Returns the theme column that was reported as hit by the previous call to hitTest().
Definition: themedelegate.h:125
GroupHeaderBackgroundMode
Which color do we use to paint group header background ?
Definition: theme.h:881
void slotAddColumn()
Definition: themeeditor.cpp:1267
The base class for the OptionSet editors.
Definition: optionseteditor.h:45
void setGroupHeaderBackgroundColor(const QColor &clr)
Sets the group header background color for this theme.
Definition: theme.h:996
Core::Theme::ContentItem::Type type() const
Definition: themeeditor.cpp:148
virtual void dragEnterEvent(QDragEnterEvent *e)
Definition: themeeditor.cpp:468
const QList< ContentItem * > & leftItems() const
Returns the list of left aligned items for this row.
Definition: theme.h:481
virtual void mousePressEvent(QMouseEvent *e)
Definition: themeeditor.cpp:852
void fillIntegerOptionCombo(KComboBox *combo, const QList< QPair< QString, int > > &optionDescriptors)
Fills the specified KComboBox with the options available in optionDescriptors.
Definition: comboboxutils.cpp:29
int hitRowIndex() const
Returns the index of the theme row that was reported as hit by the previous call to hitTest()...
Definition: themedelegate.h:151
const Theme::Row * hitRow() const
Returns the theme row that was reported as hit by the previous call to hitTest(). ...
Definition: themedelegate.h:144
void createModelInvariantIndex(int modelIndexRow, ModelInvariantIndex *invariantToFill)
Binds a ModelInvariantIndex structure to the specified CURRENT modelIndexRow.
Definition: modelinvariantrowmapper.cpp:344
ViewHeaderPolicy viewHeaderPolicy() const
Returns the currently set ViewHeaderPolicy.
Definition: theme.h:1025
void slotSoftenActionTriggered(bool)
Definition: themeeditor.cpp:1083
void setSignatureState(SignatureState state)
Definition: messageitem.cpp:458
KTextEdit * descriptionEdit() const
Returns the editor for the description of the OptionSet.
Definition: optionseteditor.cpp:76
void slotIconSizeSpinBoxValueChanged(int val)
Definition: themeeditor.cpp:1610
virtual void dropEvent(QDropEvent *e)
Definition: themeeditor.cpp:515
void mouseMoveEvent(QMouseEvent *e)
Definition: themeeditor.cpp:160
void startDrag()
Definition: themeeditor.cpp:170
bool visibleByDefault() const
Returns true if this column has to be shown by default.
Definition: theme.h:712
QRect hitContentItemRect() const
Returns the bounding rect of the content item that was reported as hit by the previous call to hitTes...
Definition: themedelegate.h:193
A single item of the MessageList tree managed by MessageList::Model.
Definition: item.h:52
A message item that can have a fake tag list and a fake annotation.
Definition: messageitem.h:218
void setUseCustomColor(bool useCustomColor)
Makes this item use the custom color that can be set by setCustomColor().
Definition: theme.h:341
bool hitContentItemRight() const
Returns true if the hit theme content item was a right item and false otherwise.
Definition: themedelegate.h:184
bool hitTest(const QPoint &viewportPoint, bool exact=true)
Performs a hit test on the specified viewport point.
Definition: themedelegate.cpp:1173
GroupHeaderBackgroundMode groupHeaderBackgroundMode() const
Returns the group header background mode for this theme.
Definition: theme.h:976
bool canBeDisabled() const
Returns true if this ContentItem can be in a "disabled" state.
Definition: theme.h:273
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.h:738
void slotColumnProperties()
Definition: themeeditor.cpp:1309
void slotMoveColumnToRight()
Definition: themeeditor.cpp:1256
const Theme::ContentItem * hitContentItem() const
Returns the theme content item that was reported as hit by the previous call to hitTest().
Definition: themedelegate.h:177
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.h:946
void slotOkButtonClicked()
Definition: themeeditor.cpp:121
void setUseCustomFont(bool useCustomFont)
Makes this item use the custom font that can be set by setCustomFont().
Definition: theme.h:355
static const char * gThemeContentItemTypeDndMimeDataFormat
Definition: themeeditor.cpp:63
void setSoftenByBlending(bool softenByBlending)
Sets the flag that causes this item to be painted "softly".
Definition: theme.h:403
void setMaxDate(time_t date)
Sets the maximum date in the subtree originating from this item.
Definition: item.cpp:437
void setTheme(const Theme *theme)
Definition: themedelegate.cpp:62
ThemeContentItemSourceLabel(QWidget *parent, Core::Theme::ContentItem::Type type)
Definition: themeeditor.cpp:138
const QList< Row * > & groupHeaderRows() const
Returns the list of rows visible in this column for a GroupHeaderItem.
Definition: theme.h:803
void setTheme(Core::Theme *theme)
Definition: themeeditor.cpp:405
void setReadOnly(bool readOnly)
Definition: themeeditor.cpp:291
virtual void showEvent(QShowEvent *e)
Definition: themeeditor.cpp:454
void insertLeftItem(int idx, ContentItem *item)
Adds a left aligned item at the specified position in this row.
Definition: theme.cpp:268
QSize sizeHint() const
Definition: themeeditor.cpp:286
~ThemePreviewWidget()
Definition: themeeditor.cpp:282
void slotMoveColumnToLeft()
Definition: themeeditor.cpp:1246
The Theme class defines the visual appearance of the MessageList.
Definition: theme.h:65
const QColor & groupHeaderBackgroundColor() const
Returns the group header background color for this theme.
Definition: theme.h:989
void setIsSenderOrReceiver(bool sor)
Marks this column as containing the "sender/receiver" field.
Definition: theme.h:706
The ThemeDelegate paints the message list view message and group items by using the supplied Theme...
Definition: themedelegate.h:45
bool softenByBlendingWhenDisabled() const
Returns true if this item should be painted in a "soft" fashion when in disabled state.
Definition: theme.h:380
int getIntegerOptionComboValue(KComboBox *combo, int defaultValue)
Returns the identifier of the currently selected option in the specified combo.
Definition: comboboxutils.cpp:71
void setGroupHeaderBackgroundStyle(GroupHeaderBackgroundStyle groupHeaderBackgroundStyle)
Sets the group header background style for this theme.
Definition: theme.h:1012
bool hitRowIsMessageRow() const
Returns true if the hitRow() is a message row, false otherwise.
Definition: themedelegate.h:167
QSize sizeHintForItemTypeAndColumn(Item::Type type, int column, const Item *item=0) const
Returns a heuristic sizeHint() for the specified item type and column.
Definition: themedelegate.cpp:1592
KComboBox * mMessageSortingCombo
Definition: themeeditor.h:69
void setViewHeaderPolicy(ViewHeaderPolicy vhp)
Sets the ViewHeaderPolicy for this theme.
Definition: theme.h:1031
~ThemeContentItemSourceLabel()
Definition: themeeditor.cpp:144
KLineEdit * mNameEdit
Definition: themeeditor.h:66
bool softenByBlending() const
Returns true if this item should be always painted in a "soft" fashion.
Definition: theme.h:396
void insertRightItem(int idx, ContentItem *item)
Adds a right aligned item at the specified position in this row.
Definition: theme.cpp:278
virtual void dragMoveEvent(QDragMoveEvent *e)
Definition: themeeditor.cpp:502
void setHideWhenDisabled(bool hideWhenDisabled)
Sets the flag that causes this item to be hidden when disabled.
Definition: theme.h:372
virtual void paintEvent(QPaintEvent *e)
Definition: themeeditor.cpp:1163
void slotDeleteColumn()
Definition: themeeditor.cpp:1329
void slotGroupHeaderBackgroundModeMenuTriggered(QAction *act)
Definition: themeeditor.cpp:1119
void setReceiver(const QString &receiver)
Sets the sender associated to this item.
Definition: item.cpp:457
const QList< Column * > & columns() const
Returns the list of columns available in this theme.
Definition: theme.h:940
virtual Core::Item * itemFromIndex(const QModelIndex &index) const
Returns the Item for the specified model index.
Definition: themeeditor.cpp:241
void setSender(const QString &sender)
Sets the sender associated to this item.
Definition: item.cpp:447
void setStatus(const Akonadi::MessageStatus &status)
Sets the status associated to this Item.
Definition: item.cpp:407
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:55:32 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:55:32 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.