• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdenetwork API Reference
  • KDE Home
  • Contact Us
 

kopete/kopete

  • sources
  • kde-4.12
  • kdenetwork
  • kopete
  • kopete
  • chatwindow
kopetechatwindowsettings.cpp
Go to the documentation of this file.
1 // This file is generated by kconfig_compiler from kopetechatwindowsettings.kcfg.
2 // All changes you do to this file will be lost.
3 
4 #include "kopetechatwindowsettings.h"
5 
6 #include <kglobal.h>
7 #include <QtCore/QFile>
8 
9 class KopeteChatWindowSettingsHelper
10 {
11  public:
12  KopeteChatWindowSettingsHelper() : q(0) {}
13  ~KopeteChatWindowSettingsHelper() { delete q; }
14  KopeteChatWindowSettings *q;
15 };
16 K_GLOBAL_STATIC(KopeteChatWindowSettingsHelper, s_globalKopeteChatWindowSettings)
17 KopeteChatWindowSettings *KopeteChatWindowSettings::self()
18 {
19  if (!s_globalKopeteChatWindowSettings->q) {
20  new KopeteChatWindowSettings;
21  s_globalKopeteChatWindowSettings->q->readConfig();
22  }
23 
24  return s_globalKopeteChatWindowSettings->q;
25 }
26 
27 KopeteChatWindowSettings::KopeteChatWindowSettings( )
28  : KConfigSkeleton( QLatin1String( "kopeterc" ) )
29  , mSettingsChanged(0)
30 {
31  Q_ASSERT(!s_globalKopeteChatWindowSettings->q);
32  s_globalKopeteChatWindowSettings->q = this;
33  setCurrentGroup( QLatin1String( "Appearance" ) );
34 
35  mStyleNameItem = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "styleName" ), mStyleName, QLatin1String( "Kopete" ) );
36  addItem( mStyleNameItem, QLatin1String( "styleName" ) );
37  mStyleVariantItem = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "styleVariant" ), mStyleVariant );
38  addItem( mStyleVariantItem, QLatin1String( "styleVariant" ) );
39  mGroupConsecutiveMessagesItem = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "groupConsecutiveMessages" ), mGroupConsecutiveMessages, true );
40  addItem( mGroupConsecutiveMessagesItem, QLatin1String( "groupConsecutiveMessages" ) );
41  mUseCompactItem = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "useCompact" ), mUseCompact, true );
42  addItem( mUseCompactItem, QLatin1String( "useCompact" ) );
43  mHighlightForegroundColorItem = new KConfigSkeleton::ItemColor( currentGroup(), QLatin1String( "highlightForegroundColor" ), mHighlightForegroundColor, KColorScheme(QPalette::Active, KColorScheme::Selection).foreground().color() );
44  addItem( mHighlightForegroundColorItem, QLatin1String( "highlightForegroundColor" ) );
45  mHighlightBackgroundColorItem = new KConfigSkeleton::ItemColor( currentGroup(), QLatin1String( "highlightBackgroundColor" ), mHighlightBackgroundColor, KColorScheme(QPalette::Active, KColorScheme::Selection).background().color() );
46  addItem( mHighlightBackgroundColorItem, QLatin1String( "highlightBackgroundColor" ) );
47  mChatFmtOverrideItem = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "chatFmtOverride" ), mChatFmtOverride, false );
48  addItem( mChatFmtOverrideItem, QLatin1String( "chatFmtOverride" ) );
49  mChatTextColorItem = new KConfigSkeleton::ItemColor( currentGroup(), QLatin1String( "chatTextColor" ), mChatTextColor, KColorScheme(QPalette::Active, KColorScheme::View).foreground().color() );
50  addItem( mChatTextColorItem, QLatin1String( "chatTextColor" ) );
51  mChatBackgroundColorItem = new KConfigSkeleton::ItemColor( currentGroup(), QLatin1String( "chatBackgroundColor" ), mChatBackgroundColor, KColorScheme(QPalette::Active, KColorScheme::View).background().color() );
52  addItem( mChatBackgroundColorItem, QLatin1String( "chatBackgroundColor" ) );
53  mChatLinkColorItem = new KConfigSkeleton::ItemColor( currentGroup(), QLatin1String( "chatLinkColor" ), mChatLinkColor, KColorScheme(QPalette::Active, KColorScheme::Window).foreground(KColorScheme::LinkText).color() );
54  addItem( mChatLinkColorItem, QLatin1String( "chatLinkColor" ) );
55  mChatFontItem = new KConfigSkeleton::ItemFont( currentGroup(), QLatin1String( "chatFont" ), mChatFont );
56  addItem( mChatFontItem, QLatin1String( "chatFont" ) );
57 }
58 
59 KopeteChatWindowSettings::~KopeteChatWindowSettings()
60 {
61  if (!s_globalKopeteChatWindowSettings.isDestroyed()) {
62  s_globalKopeteChatWindowSettings->q = 0;
63  }
64 }
65 
66 void KopeteChatWindowSettings::usrWriteConfig()
67 {
68  KConfigSkeleton::usrWriteConfig();
69 
70  if ( mSettingsChanged & signalChatwindowAppearanceChanged )
71  emit chatwindowAppearanceChanged();
72 
73  if ( mSettingsChanged & signalMessageOverridesChanged )
74  emit messageOverridesChanged();
75 
76  if ( mSettingsChanged & signalStyleChanged )
77  emit styleChanged(mStyleName);
78 
79  if ( mSettingsChanged & signalStyleVariantChanged )
80  emit styleVariantChanged(mStyleVariant);
81 
82  mSettingsChanged = 0;
83 }
84 
85 #include "kopetechatwindowsettings.moc"
86 
KopeteChatWindowSettings::mChatTextColor
QColor mChatTextColor
Definition: kopetechatwindowsettings.h:377
KopeteChatWindowSettings::signalStyleVariantChanged
Definition: kopetechatwindowsettings.h:22
KopeteChatWindowSettings::chatwindowAppearanceChanged
void chatwindowAppearanceChanged()
Emitted when the font and colors settings have changed.
KopeteChatWindowSettings
Definition: kopetechatwindowsettings.h:13
KConfigSkeleton
KopeteChatWindowSettings::mChatBackgroundColor
QColor mChatBackgroundColor
Definition: kopetechatwindowsettings.h:378
KopeteChatWindowSettings::mStyleVariant
QString mStyleVariant
Definition: kopetechatwindowsettings.h:371
kopetechatwindowsettings.h
KopeteChatWindowSettings::usrWriteConfig
virtual void usrWriteConfig()
Definition: kopetechatwindowsettings.cpp:66
KopeteChatWindowSettings::mHighlightBackgroundColor
QColor mHighlightBackgroundColor
Definition: kopetechatwindowsettings.h:375
KopeteChatWindowSettings::styleChanged
void styleChanged(const QString &styleName)
Emitted when the chat window style has changed.
KopeteChatWindowSettings::mUseCompact
bool mUseCompact
Definition: kopetechatwindowsettings.h:373
KopeteChatWindowSettings::messageOverridesChanged
void messageOverridesChanged()
Emitted when the message overrides settings have changed.
KopeteChatWindowSettings::mChatFmtOverride
bool mChatFmtOverride
Definition: kopetechatwindowsettings.h:376
KopeteChatWindowSettings::signalStyleChanged
Definition: kopetechatwindowsettings.h:21
KopeteChatWindowSettings::mGroupConsecutiveMessages
bool mGroupConsecutiveMessages
Definition: kopetechatwindowsettings.h:372
KopeteChatWindowSettings::mChatFont
QFont mChatFont
Definition: kopetechatwindowsettings.h:380
KopeteChatWindowSettings::signalChatwindowAppearanceChanged
Definition: kopetechatwindowsettings.h:19
KopeteChatWindowSettings::KopeteChatWindowSettings
KopeteChatWindowSettings()
Definition: kopetechatwindowsettings.cpp:27
KopeteChatWindowSettings::signalMessageOverridesChanged
Definition: kopetechatwindowsettings.h:20
KopeteChatWindowSettings::mStyleName
QString mStyleName
Definition: kopetechatwindowsettings.h:370
KopeteChatWindowSettings::styleVariantChanged
void styleVariantChanged(const QString &styleVariant)
Emitted when ChatWindowStyle variant has changed.
KopeteChatWindowSettings::mHighlightForegroundColor
QColor mHighlightForegroundColor
Definition: kopetechatwindowsettings.h:374
KopeteChatWindowSettings::mChatLinkColor
QColor mChatLinkColor
Definition: kopetechatwindowsettings.h:379
KopeteChatWindowSettings::~KopeteChatWindowSettings
~KopeteChatWindowSettings()
Definition: kopetechatwindowsettings.cpp:59
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:53:40 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kopete/kopete

Skip menu "kopete/kopete"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdenetwork API Reference

Skip menu "kdenetwork API Reference"
  • kget
  • kopete
  •   kopete
  •   libkopete
  • krdc
  • krfb

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal