271
271
* and SoftenByBlendingWhenDisabled flags are meaningful.
273
273
bool canBeDisabled() const
274
{ return ( static_cast< int >( mType ) & CanBeDisabled ) != 0; };
274
{ return ( static_cast< int >( mType ) & CanBeDisabled ) != 0; }
277
277
* Returns true if this ContentItem can make use of a custom color.
279
279
bool canUseCustomColor() const
280
{ return ( static_cast< int >( mType ) & CanUseCustomColor ) != 0; };
280
{ return ( static_cast< int >( mType ) & CanUseCustomColor ) != 0; }
283
283
* Returns true if this item displays some kind of text.
284
284
* Items that display text make use of the customFont() setting.
286
286
bool displaysText() const
287
{ return ( static_cast< int >( mType ) & DisplaysText ) != 0; };
287
{ return ( static_cast< int >( mType ) & DisplaysText ) != 0; }
290
290
* Returns true if this item displays a long text.
291
291
* The returned value makes sense only if displaysText() returned true.
293
293
bool displaysLongText() const
294
{ return ( static_cast< int >( mType ) & LongText ) != 0; };
294
{ return ( static_cast< int >( mType ) & LongText ) != 0; }
297
297
* Returns true if this item displays an icon.
299
299
bool isIcon() const
300
{ return ( static_cast< int >( mType ) & IsIcon ) != 0; };
300
{ return ( static_cast< int >( mType ) & IsIcon ) != 0; }
303
302
* Returns true if clicking on this kind of item can perform an action
305
304
bool isClickable() const
306
{ return ( static_cast< int >( mType ) & IsClickable ) != 0; };
305
{ return ( static_cast< int >( mType ) & IsClickable ) != 0; }
309
308
* Returns true if this item is a small spacer
311
310
bool isSpacer() const
312
{ return ( static_cast< int >( mType ) & IsSpacer ) != 0; };
311
{ return ( static_cast< int >( mType ) & IsSpacer ) != 0; }
315
314
* Static test that returns true if an instance of ContentItem with the
333
332
* The return value of this function is valid only if canUseCustomColor() returns true.
335
334
bool useCustomColor() const
336
{ return mFlags & UseCustomColor; };
335
{ return mFlags & UseCustomColor; }
339
338
* Makes this item use the custom color that can be set by setCustomColor().
340
339
* The custom color is meaningful only if canUseCustomColor() returns true.
342
341
void setUseCustomColor( bool useCustomColor )
343
{ if ( useCustomColor )mFlags |= UseCustomColor; else mFlags &= ~UseCustomColor; };
342
{ if ( useCustomColor )mFlags |= UseCustomColor; else mFlags &= ~UseCustomColor; }
346
345
* Returns true if this item uses a custom font.
347
346
* The return value of this function is valid only if displaysText() returns true.
349
348
bool useCustomFont() const
350
{ return mFlags & UseCustomFont; };
349
{ return mFlags & UseCustomFont; }
353
352
* Makes this item use the custom font that can be set by setCustomFont().
354
353
* The custom font is meaningful only if canUseCustomFont() returns true.
356
355
void setUseCustomFont( bool useCustomFont )
357
{ if ( useCustomFont )mFlags |= UseCustomFont; else mFlags &= ~UseCustomFont; };
356
{ if ( useCustomFont )mFlags |= UseCustomFont; else mFlags &= ~UseCustomFont; }
360
359
* Returns true if this item should be hidden when in disabled state.
362
361
* This flag has meaning only on items for that canBeDisabled() returns true.
364
363
bool hideWhenDisabled() const
365
{ return mFlags & HideWhenDisabled; };
364
{ return mFlags & HideWhenDisabled; }
368
367
* Sets the flag that causes this item to be hidden when disabled.
371
370
* This flag has meaning only on items for that canBeDisabled() returns true.
373
372
void setHideWhenDisabled( bool hideWhenDisabled )
374
{ if ( hideWhenDisabled )mFlags |= HideWhenDisabled; else mFlags &= ~HideWhenDisabled; };
373
{ if ( hideWhenDisabled )mFlags |= HideWhenDisabled; else mFlags &= ~HideWhenDisabled; }
377
376
* Returns true if this item should be painted in a "soft" fashion when
379
378
* This flag has meaning only on items for that canBeDisabled() returns true.
381
380
bool softenByBlendingWhenDisabled() const
382
{ return mFlags & SoftenByBlendingWhenDisabled; };
381
{ return mFlags & SoftenByBlendingWhenDisabled; }
385
384
* Sets the flag that causes this item to be painted "softly" when disabled.
388
387
* This flag has meaning only on items for that canBeDisabled() returns true.
390
389
void setSoftenByBlendingWhenDisabled( bool softenByBlendingWhenDisabled )
391
{ if ( softenByBlendingWhenDisabled )mFlags |= SoftenByBlendingWhenDisabled; else mFlags &= ~SoftenByBlendingWhenDisabled; };
390
{ if ( softenByBlendingWhenDisabled )mFlags |= SoftenByBlendingWhenDisabled; else mFlags &= ~SoftenByBlendingWhenDisabled; }
394
393
* Returns true if this item should be always painted in a "soft" fashion.
395
394
* Meaningful only for text items.
397
396
bool softenByBlending() const
398
{ return mFlags & SoftenByBlending; };
397
{ return mFlags & SoftenByBlending; }
401
400
* Sets the flag that causes this item to be painted "softly".
402
401
* Meaningful only for text items.
404
403
void setSoftenByBlending( bool softenByBlending )
405
{ if ( softenByBlending )mFlags |= SoftenByBlending; else mFlags &= ~SoftenByBlending; };
404
{ if ( softenByBlending )mFlags |= SoftenByBlending; else mFlags &= ~SoftenByBlending; }
408
407
* Sets the custom font to be used with this item.
436
435
* returns true and setUseCustomColor( true ) has been called.
438
437
const QColor & customColor() const
439
{ return mCustomColor; };
438
{ return mCustomColor; }
442
441
* Sets the custom color for this item. Meaningful only if canUseCustomColor()
443
442
* returns true and you call setUseCustomColor( true )
445
444
void setCustomColor( const QColor &clr )
446
{ mCustomColor = clr; };
445
{ mCustomColor = clr; }
448
447
// Stuff used by ThemeDelegate. This section should be protected but some gcc
449
448
// versions seem to get confused with nested class and friend declarations
492
491
* of the ContentItem pointer.
494
493
void addLeftItem( ContentItem * item )
495
{ mLeftItems.append( item ); };
494
{ mLeftItems.append( item ); }
498
497
* Adds a left aligned item at the specified position in this row. The row takes the ownership
505
504
* The item is NOT deleted.
507
506
void removeLeftItem( ContentItem * item )
508
{ mLeftItems.removeAll( item ); };
507
{ mLeftItems.removeAll( item ); }
511
510
* Returns the list of right aligned items for this row
513
512
const QList< ContentItem * > & rightItems() const
514
{ return mRightItems; };
513
{ return mRightItems; }
517
516
* Removes all the right items from this row. The items are deleted.
524
523
* will start at the right edge, the second right aligned item will come after it etc...
526
525
void addRightItem( ContentItem * item )
527
{ mRightItems.append( item ); };
526
{ mRightItems.append( item ); }
530
529
* Adds a right aligned item at the specified position in this row. The row takes the ownership
537
536
* The item is NOT deleted.
539
538
void removeRightItem( ContentItem * item )
540
{ mRightItems.removeAll( item ); };
539
{ mRightItems.removeAll( item ); }
543
542
* Returns true if this row contains text items.
603
602
* Theme::Column objects that use this SharedRuntimeData instance.
605
604
int referenceCount() const
606
{ return mReferences; };
605
{ return mReferences; }
609
608
* Returns the current visibility state
611
610
bool currentlyVisible() const
612
{ return mCurrentlyVisible; };
611
{ return mCurrentlyVisible; }
615
614
* Sets the current visibility state
617
616
void setCurrentlyVisible( bool visible )
618
{ mCurrentlyVisible = visible; };
617
{ mCurrentlyVisible = visible; }
621
620
* Returns the current width or -1 if the width is unspecified/invalid
623
622
int currentWidth() const
624
{ return mCurrentWidth; };
623
{ return mCurrentWidth; }
627
626
* Sets the current width of the column
629
628
void setCurrentWidth( int currentWidth )
630
{ mCurrentWidth = currentWidth; };
629
{ mCurrentWidth = currentWidth; }
633
632
* Saves this runtime data to the specified stream
673
672
* Returns the label set for this column
675
674
const QString & label() const
679
678
* Sets the label for this column
681
680
void setLabel( const QString &label )
685
684
* Returns the icon's name (used in SmallIcon) set for this column
691
690
* Sets the icon's name (used in SmallIcon) for this column
693
692
void setPixmapName( const QString &pixmapName )
694
{ mPixmapName = pixmapName; };
693
{ mPixmapName = pixmapName; }
697
696
* Returns true if this column is marked as "sender/receiver" and we should
698
697
* update its label on-the-fly.
700
699
bool isSenderOrReceiver() const
701
{ return mIsSenderOrReceiver; };
700
{ return mIsSenderOrReceiver; }
704
703
* Marks this column as containing the "sender/receiver" field.
705
704
* Such columns will have the label automatically updated.
707
706
void setIsSenderOrReceiver( bool sor )
708
{ mIsSenderOrReceiver = sor; };
707
{ mIsSenderOrReceiver = sor; }
711
710
* Returns true if this column has to be shown by default
713
712
bool visibleByDefault() const
714
{ return mVisibleByDefault; };
713
{ return mVisibleByDefault; }
717
716
* Sets the "visible by default" tag for this column.
719
718
void setVisibleByDefault( bool vbd )
720
{ mVisibleByDefault = vbd; };
719
{ mVisibleByDefault = vbd; }
723
722
* Detaches the shared runtime data object and makes this object
730
729
* when clicking on this column's header (if visible at all).
732
731
SortOrder::MessageSorting messageSorting() const
733
{ return mMessageSorting; };
732
{ return mMessageSorting; }
736
735
* Sets the sort order for messages that we should switch to
737
736
* when clicking on this column's header (if visible at all).
739
738
void setMessageSorting( SortOrder::MessageSorting ms )
740
{ mMessageSorting = ms; };
739
{ mMessageSorting = ms; }
743
742
* Returns the current shared visibility state for this column.
744
743
* This state is shared between all the instances of this theme.
746
745
bool currentlyVisible() const
747
{ return mSharedRuntimeData->currentlyVisible(); };
746
{ return mSharedRuntimeData->currentlyVisible(); }
750
749
* Sets the current shared visibility state for this column.
751
750
* This state is shared between all the instances of this theme.
753
752
void setCurrentlyVisible( bool currentlyVisible )
754
{ mSharedRuntimeData->setCurrentlyVisible( currentlyVisible ); };
753
{ mSharedRuntimeData->setCurrentlyVisible( currentlyVisible ); }
757
756
* Returns the current shared width setting for this column
759
758
* This state is shared between all the instances of this theme.
761
760
int currentWidth() const
762
{ return mSharedRuntimeData->currentWidth(); };
761
{ return mSharedRuntimeData->currentWidth(); }
765
764
* Sets the current shared width setting for this column.
766
765
* This state is shared between all the instances of this theme.
768
767
void setCurrentWidth( int currentWidth )
769
{ mSharedRuntimeData->setCurrentWidth( currentWidth ); };
768
{ mSharedRuntimeData->setCurrentWidth( currentWidth ); }
772
771
* Returns the list of rows visible in this column for a MessageItem
774
773
const QList< Row * > & messageRows() const
775
{ return mMessageRows; };
774
{ return mMessageRows; }
778
777
* Removes all the message rows from this column.
784
783
* the ownership of the Row pointer.
786
785
void addMessageRow( Row * row )
787
{ mMessageRows.append( row ); };
786
{ mMessageRows.append( row ); }
790
789
* Inserts a message row to this theme column in the specified position. The Theme takes
796
795
* Removes the specified message row. The row is NOT deleted.
798
797
void removeMessageRow( Row * row )
799
{ mMessageRows.removeAll( row ); };
798
{ mMessageRows.removeAll( row ); }
802
801
* Returns the list of rows visible in this column for a GroupHeaderItem
804
803
const QList< Row * > & groupHeaderRows() const
805
{ return mGroupHeaderRows; };
804
{ return mGroupHeaderRows; }
808
807
* Removes all the group header rows from this column.
814
813
* the ownership of the Row pointer.
816
815
void addGroupHeaderRow( Row * row )
817
{ mGroupHeaderRows.append( row ); };
816
{ mGroupHeaderRows.append( row ); }
820
819
* Inserts a group header row to this theme column in the specified position. The Theme takes
826
825
* Removes the specified group header row. The row is NOT deleted.
828
827
void removeGroupHeaderRow( Row * row )
829
{ mGroupHeaderRows.removeAll( row ); };
828
{ mGroupHeaderRows.removeAll( row ); }
832
831
* Returns true if this column contains text items.
939
938
* Returns the list of columns available in this theme
941
940
const QList< Column * > & columns() const
942
{ return mColumns; };
945
944
* Returns a pointer to the column at the specified index or 0 if there is no such column
947
946
Column * column( int idx ) const
948
{ return mColumns.count() > idx ? mColumns.at( idx ) : 0; };
947
{ return mColumns.count() > idx ? mColumns.at( idx ) : 0; }
949
void moveColumn(int idx, int newPosition);
951
952
* Removes all columns from this theme
956
957
* Appends a column to this theme
958
959
void addColumn( Column * column )
959
{ mColumns.append( column ); };
960
{ mColumns.append( column ); }
962
963
* Inserts a column to this theme at the specified position.
967
968
* Removes the specified message row. The row is NOT deleted.
969
970
void removeColumn( Column * col )
970
{ mColumns.removeAll( col ); };
971
{ mColumns.removeAll( col ); }
973
974
* Returns the group header background mode for this theme.
975
976
GroupHeaderBackgroundMode groupHeaderBackgroundMode() const
976
{ return mGroupHeaderBackgroundMode; };
977
{ return mGroupHeaderBackgroundMode; }
979
980
* Sets the group header background mode for this theme.
986
987
* This color is used only if groupHeaderBackgroundMode() is set to CustomColor.
988
989
const QColor & groupHeaderBackgroundColor() const
989
{ return mGroupHeaderBackgroundColor; };
990
{ return mGroupHeaderBackgroundColor; }
992
993
* Sets the group header background color for this theme.
993
994
* This color is used only if groupHeaderBackgroundMode() is set to CustomColor.
995
996
void setGroupHeaderBackgroundColor( const QColor &clr )
996
{ mGroupHeaderBackgroundColor = clr; };
997
{ mGroupHeaderBackgroundColor = clr; }
999
1000
* Returns the group header background style for this theme.
1001
1002
* set to something different than Transparent.
1003
1004
GroupHeaderBackgroundStyle groupHeaderBackgroundStyle() const
1004
{ return mGroupHeaderBackgroundStyle; };
1005
{ return mGroupHeaderBackgroundStyle; }
1007
1008
* Sets the group header background style for this theme.
1009
1010
* set to something different than Transparent.
1011
1012
void setGroupHeaderBackgroundStyle( GroupHeaderBackgroundStyle groupHeaderBackgroundStyle )
1012
{ mGroupHeaderBackgroundStyle = groupHeaderBackgroundStyle; };
1013
{ mGroupHeaderBackgroundStyle = groupHeaderBackgroundStyle; }
1015
1016
* Enumerates the available group header background styles.
1022
1023
* Returns the currently set ViewHeaderPolicy
1024
1025
ViewHeaderPolicy viewHeaderPolicy() const
1025
{ return mViewHeaderPolicy; };
1026
{ return mViewHeaderPolicy; }
1028
1029
* Sets the ViewHeaderPolicy for this theme
1030
1031
void setViewHeaderPolicy( ViewHeaderPolicy vhp )
1031
{ mViewHeaderPolicy = vhp; };
1032
{ mViewHeaderPolicy = vhp; }
1034
1035
* Returns the currently set icon size
1036
1037
int iconSize() const
1037
{ return mIconSize; };
1038
{ return mIconSize; }
1040
1041
* Sets the icon size for this theme.