kopete/libkopete
kopetebehaviorsettings.h
Go to the documentation of this file.00001
00002
00003 #ifndef KOPETE_BEHAVIORSETTINGS_H
00004 #define KOPETE_BEHAVIORSETTINGS_H
00005
00006 #include <kopete_export.h>
00007 #include <klocale.h>
00008
00009 #include <kconfigskeleton.h>
00010 #include <kdebug.h>
00011
00012 namespace Kopete {
00013
00014 class KOPETE_EXPORT BehaviorSettings : public KConfigSkeleton
00015 {
00016 public:
00017 class EnumChatWindowGroupPolicy
00018 {
00019 public:
00020 enum type { OpenNewWindow, GroupByAccount, GroupAll, GroupByGroup, GroupByMetaContact, COUNT };
00021 };
00022
00023 static BehaviorSettings *self();
00024 ~BehaviorSettings();
00025
00029 static
00030 void setStartDocked( bool v )
00031 {
00032 if (!self()->isImmutable( QString::fromLatin1 ( "startDocked" ) ))
00033 self()->mStartDocked = v;
00034 }
00035
00039 static
00040 bool startDocked()
00041 {
00042 return self()->mStartDocked;
00043 }
00044
00048 ItemBool *startDockedItem()
00049 {
00050 return mStartDockedItem;
00051 }
00052
00056 static
00057 void setShowSystemTray( bool v )
00058 {
00059 if (!self()->isImmutable( QString::fromLatin1 ( "showSystemTray" ) ))
00060 self()->mShowSystemTray = v;
00061 }
00062
00066 static
00067 bool showSystemTray()
00068 {
00069 return self()->mShowSystemTray;
00070 }
00071
00075 ItemBool *showSystemTrayItem()
00076 {
00077 return mShowSystemTrayItem;
00078 }
00079
00083 static
00084 void setUseMessageStack( bool v )
00085 {
00086 if (!self()->isImmutable( QString::fromLatin1 ( "useMessageStack" ) ))
00087 self()->mUseMessageStack = v;
00088 }
00089
00093 static
00094 bool useMessageStack()
00095 {
00096 return self()->mUseMessageStack;
00097 }
00098
00102 ItemBool *useMessageStackItem()
00103 {
00104 return mUseMessageStackItem;
00105 }
00106
00110 static
00111 void setUseMessageQueue( bool v )
00112 {
00113 if (!self()->isImmutable( QString::fromLatin1 ( "useMessageQueue" ) ))
00114 self()->mUseMessageQueue = v;
00115 }
00116
00120 static
00121 bool useMessageQueue()
00122 {
00123 return self()->mUseMessageQueue;
00124 }
00125
00129 ItemBool *useMessageQueueItem()
00130 {
00131 return mUseMessageQueueItem;
00132 }
00133
00137 static
00138 void setQueueUnreadMessages( bool v )
00139 {
00140 if (!self()->isImmutable( QString::fromLatin1 ( "queueUnreadMessages" ) ))
00141 self()->mQueueUnreadMessages = v;
00142 }
00143
00147 static
00148 bool queueUnreadMessages()
00149 {
00150 return self()->mQueueUnreadMessages;
00151 }
00152
00156 ItemBool *queueUnreadMessagesItem()
00157 {
00158 return mQueueUnreadMessagesItem;
00159 }
00160
00164 static
00165 void setContactListMouseNavigation( bool v )
00166 {
00167 if (!self()->isImmutable( QString::fromLatin1 ( "contactListMouseNavigation" ) ))
00168 self()->mContactListMouseNavigation = v;
00169 }
00170
00174 static
00175 bool contactListMouseNavigation()
00176 {
00177 return self()->mContactListMouseNavigation;
00178 }
00179
00183 ItemBool *contactListMouseNavigationItem()
00184 {
00185 return mContactListMouseNavigationItem;
00186 }
00187
00191 static
00192 void setReconnectOnDisconnect( bool v )
00193 {
00194 if (!self()->isImmutable( QString::fromLatin1 ( "reconnectOnDisconnect" ) ))
00195 self()->mReconnectOnDisconnect = v;
00196 }
00197
00201 static
00202 bool reconnectOnDisconnect()
00203 {
00204 return self()->mReconnectOnDisconnect;
00205 }
00206
00210 ItemBool *reconnectOnDisconnectItem()
00211 {
00212 return mReconnectOnDisconnectItem;
00213 }
00214
00218 static
00219 void setAutoConnect( bool v )
00220 {
00221 if (!self()->isImmutable( QString::fromLatin1 ( "autoConnect" ) ))
00222 self()->mAutoConnect = v;
00223 }
00224
00228 static
00229 bool autoConnect()
00230 {
00231 return self()->mAutoConnect;
00232 }
00233
00237 ItemBool *autoConnectItem()
00238 {
00239 return mAutoConnectItem;
00240 }
00241
00245 static
00246 void setRaiseMessageWindow( bool v )
00247 {
00248 if (!self()->isImmutable( QString::fromLatin1 ( "raiseMessageWindow" ) ))
00249 self()->mRaiseMessageWindow = v;
00250 }
00251
00255 static
00256 bool raiseMessageWindow()
00257 {
00258 return self()->mRaiseMessageWindow;
00259 }
00260
00264 ItemBool *raiseMessageWindowItem()
00265 {
00266 return mRaiseMessageWindowItem;
00267 }
00268
00272 static
00273 void setShowEvents( bool v )
00274 {
00275 if (!self()->isImmutable( QString::fromLatin1 ( "showEvents" ) ))
00276 self()->mShowEvents = v;
00277 }
00278
00282 static
00283 bool showEvents()
00284 {
00285 return self()->mShowEvents;
00286 }
00287
00291 ItemBool *showEventsItem()
00292 {
00293 return mShowEventsItem;
00294 }
00295
00299 static
00300 void setQueueOnlyHighlightedMessagesInGroupChats( bool v )
00301 {
00302 if (!self()->isImmutable( QString::fromLatin1 ( "queueOnlyHighlightedMessagesInGroupChats" ) ))
00303 self()->mQueueOnlyHighlightedMessagesInGroupChats = v;
00304 }
00305
00309 static
00310 bool queueOnlyHighlightedMessagesInGroupChats()
00311 {
00312 return self()->mQueueOnlyHighlightedMessagesInGroupChats;
00313 }
00314
00318 ItemBool *queueOnlyHighlightedMessagesInGroupChatsItem()
00319 {
00320 return mQueueOnlyHighlightedMessagesInGroupChatsItem;
00321 }
00322
00326 static
00327 void setQueueOnlyMessagesOnAnotherDesktop( bool v )
00328 {
00329 if (!self()->isImmutable( QString::fromLatin1 ( "queueOnlyMessagesOnAnotherDesktop" ) ))
00330 self()->mQueueOnlyMessagesOnAnotherDesktop = v;
00331 }
00332
00336 static
00337 bool queueOnlyMessagesOnAnotherDesktop()
00338 {
00339 return self()->mQueueOnlyMessagesOnAnotherDesktop;
00340 }
00341
00345 ItemBool *queueOnlyMessagesOnAnotherDesktopItem()
00346 {
00347 return mQueueOnlyMessagesOnAnotherDesktopItem;
00348 }
00349
00353 static
00354 void setBalloonNotifyIgnoreClosesChatView( bool v )
00355 {
00356 if (!self()->isImmutable( QString::fromLatin1 ( "balloonNotifyIgnoreClosesChatView" ) ))
00357 self()->mBalloonNotifyIgnoreClosesChatView = v;
00358 }
00359
00363 static
00364 bool balloonNotifyIgnoreClosesChatView()
00365 {
00366 return self()->mBalloonNotifyIgnoreClosesChatView;
00367 }
00368
00372 ItemBool *balloonNotifyIgnoreClosesChatViewItem()
00373 {
00374 return mBalloonNotifyIgnoreClosesChatViewItem;
00375 }
00376
00380 static
00381 void setTrayflashNotify( bool v )
00382 {
00383 if (!self()->isImmutable( QString::fromLatin1 ( "trayflashNotify" ) ))
00384 self()->mTrayflashNotify = v;
00385 }
00386
00390 static
00391 bool trayflashNotify()
00392 {
00393 return self()->mTrayflashNotify;
00394 }
00395
00399 ItemBool *trayflashNotifyItem()
00400 {
00401 return mTrayflashNotifyItem;
00402 }
00403
00407 static
00408 void setTrayflashNotifyLeftClickOpensMessage( bool v )
00409 {
00410 if (!self()->isImmutable( QString::fromLatin1 ( "trayflashNotifyLeftClickOpensMessage" ) ))
00411 self()->mTrayflashNotifyLeftClickOpensMessage = v;
00412 }
00413
00417 static
00418 bool trayflashNotifyLeftClickOpensMessage()
00419 {
00420 return self()->mTrayflashNotifyLeftClickOpensMessage;
00421 }
00422
00426 ItemBool *trayflashNotifyLeftClickOpensMessageItem()
00427 {
00428 return mTrayflashNotifyLeftClickOpensMessageItem;
00429 }
00430
00434 static
00435 void setTrayflashNotifySetCurrentDesktopToChatView( bool v )
00436 {
00437 if (!self()->isImmutable( QString::fromLatin1 ( "trayflashNotifySetCurrentDesktopToChatView" ) ))
00438 self()->mTrayflashNotifySetCurrentDesktopToChatView = v;
00439 }
00440
00444 static
00445 bool trayflashNotifySetCurrentDesktopToChatView()
00446 {
00447 return self()->mTrayflashNotifySetCurrentDesktopToChatView;
00448 }
00449
00453 ItemBool *trayflashNotifySetCurrentDesktopToChatViewItem()
00454 {
00455 return mTrayflashNotifySetCurrentDesktopToChatViewItem;
00456 }
00457
00461 static
00462 void setEnableEventsWhileAway( bool v )
00463 {
00464 if (!self()->isImmutable( QString::fromLatin1 ( "enableEventsWhileAway" ) ))
00465 self()->mEnableEventsWhileAway = v;
00466 }
00467
00471 static
00472 bool enableEventsWhileAway()
00473 {
00474 return self()->mEnableEventsWhileAway;
00475 }
00476
00480 ItemBool *enableEventsWhileAwayItem()
00481 {
00482 return mEnableEventsWhileAwayItem;
00483 }
00484
00488 static
00489 void setChatWindowGroupPolicy( int v )
00490 {
00491 if (!self()->isImmutable( QString::fromLatin1 ( "chatWindowGroupPolicy" ) ))
00492 self()->mChatWindowGroupPolicy = v;
00493 }
00494
00498 static
00499 int chatWindowGroupPolicy()
00500 {
00501 return self()->mChatWindowGroupPolicy;
00502 }
00503
00507 ItemEnum *chatWindowGroupPolicyItem()
00508 {
00509 return mChatWindowGroupPolicyItem;
00510 }
00511
00515 static
00516 void setSpellCheck( bool v )
00517 {
00518 if (!self()->isImmutable( QString::fromLatin1 ( "spellCheck" ) ))
00519 self()->mSpellCheck = v;
00520 }
00521
00525 static
00526 bool spellCheck()
00527 {
00528 return self()->mSpellCheck;
00529 }
00530
00534 ItemBool *spellCheckItem()
00535 {
00536 return mSpellCheckItem;
00537 }
00538
00542 static
00543 void setChatWindowShowSendButton( bool v )
00544 {
00545 if (!self()->isImmutable( QString::fromLatin1 ( "chatWindowShowSendButton" ) ))
00546 self()->mChatWindowShowSendButton = v;
00547 }
00548
00552 static
00553 bool chatWindowShowSendButton()
00554 {
00555 return self()->mChatWindowShowSendButton;
00556 }
00557
00561 ItemBool *chatWindowShowSendButtonItem()
00562 {
00563 return mChatWindowShowSendButtonItem;
00564 }
00565
00569 static
00570 void setShowDates( bool v )
00571 {
00572 if (!self()->isImmutable( QString::fromLatin1 ( "showDates" ) ))
00573 self()->mShowDates = v;
00574 }
00575
00579 static
00580 bool showDates()
00581 {
00582 return self()->mShowDates;
00583 }
00584
00588 ItemBool *showDatesItem()
00589 {
00590 return mShowDatesItem;
00591 }
00592
00596 static
00597 void setTruncateContactName( bool v )
00598 {
00599 if (!self()->isImmutable( QString::fromLatin1 ( "truncateContactName" ) ))
00600 self()->mTruncateContactName = v;
00601 }
00602
00606 static
00607 bool truncateContactName()
00608 {
00609 return self()->mTruncateContactName;
00610 }
00611
00615 ItemBool *truncateContactNameItem()
00616 {
00617 return mTruncateContactNameItem;
00618 }
00619
00623 static
00624 void setTruncateContactNameLength( int v )
00625 {
00626 if (!self()->isImmutable( QString::fromLatin1 ( "truncateContactNameLength" ) ))
00627 self()->mTruncateContactNameLength = v;
00628 }
00629
00633 static
00634 int truncateContactNameLength()
00635 {
00636 return self()->mTruncateContactNameLength;
00637 }
00638
00642 ItemInt *truncateContactNameLengthItem()
00643 {
00644 return mTruncateContactNameLengthItem;
00645 }
00646
00650 static
00651 void setChatWindowBufferViewSize( int v )
00652 {
00653 if (!self()->isImmutable( QString::fromLatin1 ( "chatWindowBufferViewSize" ) ))
00654 self()->mChatWindowBufferViewSize = v;
00655 }
00656
00660 static
00661 int chatWindowBufferViewSize()
00662 {
00663 return self()->mChatWindowBufferViewSize;
00664 }
00665
00669 ItemInt *chatWindowBufferViewSizeItem()
00670 {
00671 return mChatWindowBufferViewSizeItem;
00672 }
00673
00677 static
00678 void setHighlightEnabled( bool v )
00679 {
00680 if (!self()->isImmutable( QString::fromLatin1 ( "highlightEnabled" ) ))
00681 self()->mHighlightEnabled = v;
00682 }
00683
00687 static
00688 bool highlightEnabled()
00689 {
00690 return self()->mHighlightEnabled;
00691 }
00692
00696 ItemBool *highlightEnabledItem()
00697 {
00698 return mHighlightEnabledItem;
00699 }
00700
00704 static
00705 void setViewPlugin( const QString & v )
00706 {
00707 if (!self()->isImmutable( QString::fromLatin1 ( "viewPlugin" ) ))
00708 self()->mViewPlugin = v;
00709 }
00710
00714 static
00715 QString viewPlugin()
00716 {
00717 return self()->mViewPlugin;
00718 }
00719
00723 ItemString *viewPluginItem()
00724 {
00725 return mViewPluginItem;
00726 }
00727
00731 static
00732 void setUseAutoAway( bool v )
00733 {
00734 if (!self()->isImmutable( QString::fromLatin1 ( "useAutoAway" ) ))
00735 self()->mUseAutoAway = v;
00736 }
00737
00741 static
00742 bool useAutoAway()
00743 {
00744 return self()->mUseAutoAway;
00745 }
00746
00750 ItemBool *useAutoAwayItem()
00751 {
00752 return mUseAutoAwayItem;
00753 }
00754
00758 static
00759 void setAutoAwayTimeout( int v )
00760 {
00761 if (!self()->isImmutable( QString::fromLatin1 ( "autoAwayTimeout" ) ))
00762 self()->mAutoAwayTimeout = v;
00763 }
00764
00768 static
00769 int autoAwayTimeout()
00770 {
00771 return self()->mAutoAwayTimeout;
00772 }
00773
00777 ItemInt *autoAwayTimeoutItem()
00778 {
00779 return mAutoAwayTimeoutItem;
00780 }
00781
00785 static
00786 void setAutoAwayGoAvailable( bool v )
00787 {
00788 if (!self()->isImmutable( QString::fromLatin1 ( "autoAwayGoAvailable" ) ))
00789 self()->mAutoAwayGoAvailable = v;
00790 }
00791
00795 static
00796 bool autoAwayGoAvailable()
00797 {
00798 return self()->mAutoAwayGoAvailable;
00799 }
00800
00804 ItemBool *autoAwayGoAvailableItem()
00805 {
00806 return mAutoAwayGoAvailableItem;
00807 }
00808
00812 static
00813 void setUseLastAwayMessage( bool v )
00814 {
00815 if (!self()->isImmutable( QString::fromLatin1 ( "useLastAwayMessage" ) ))
00816 self()->mUseLastAwayMessage = v;
00817 }
00818
00822 static
00823 bool useLastAwayMessage()
00824 {
00825 return self()->mUseLastAwayMessage;
00826 }
00827
00831 ItemBool *useLastAwayMessageItem()
00832 {
00833 return mUseLastAwayMessageItem;
00834 }
00835
00839 static
00840 void setUseCustomAwayMessage( bool v )
00841 {
00842 if (!self()->isImmutable( QString::fromLatin1 ( "useCustomAwayMessage" ) ))
00843 self()->mUseCustomAwayMessage = v;
00844 }
00845
00849 static
00850 bool useCustomAwayMessage()
00851 {
00852 return self()->mUseCustomAwayMessage;
00853 }
00854
00858 ItemBool *useCustomAwayMessageItem()
00859 {
00860 return mUseCustomAwayMessageItem;
00861 }
00862
00866 static
00867 void setAutoAwayCustomTitle( const QString & v )
00868 {
00869 if (!self()->isImmutable( QString::fromLatin1 ( "autoAwayCustomTitle" ) ))
00870 self()->mAutoAwayCustomTitle = v;
00871 }
00872
00876 static
00877 QString autoAwayCustomTitle()
00878 {
00879 return self()->mAutoAwayCustomTitle;
00880 }
00881
00885 ItemString *autoAwayCustomTitleItem()
00886 {
00887 return mAutoAwayCustomTitleItem;
00888 }
00889
00893 static
00894 void setAutoAwayCustomMessage( const QString & v )
00895 {
00896 if (!self()->isImmutable( QString::fromLatin1 ( "autoAwayCustomMessage" ) ))
00897 self()->mAutoAwayCustomMessage = v;
00898 }
00899
00903 static
00904 QString autoAwayCustomMessage()
00905 {
00906 return self()->mAutoAwayCustomMessage;
00907 }
00908
00912 ItemString *autoAwayCustomMessageItem()
00913 {
00914 return mAutoAwayCustomMessageItem;
00915 }
00916
00920 static
00921 void setSmoothScrolling( bool v )
00922 {
00923 if (!self()->isImmutable( QString::fromLatin1 ( "smoothScrolling" ) ))
00924 self()->mSmoothScrolling = v;
00925 }
00926
00930 static
00931 bool smoothScrolling()
00932 {
00933 return self()->mSmoothScrolling;
00934 }
00935
00939 ItemBool *smoothScrollingItem()
00940 {
00941 return mSmoothScrollingItem;
00942 }
00943
00947 static
00948 void setAlwaysShowTabs( bool v )
00949 {
00950 if (!self()->isImmutable( QString::fromLatin1 ( "AlwaysShowTabs" ) ))
00951 self()->mAlwaysShowTabs = v;
00952 }
00953
00957 static
00958 bool alwaysShowTabs()
00959 {
00960 return self()->mAlwaysShowTabs;
00961 }
00962
00966 ItemBool *alwaysShowTabsItem()
00967 {
00968 return mAlwaysShowTabsItem;
00969 }
00970
00971 protected:
00972 BehaviorSettings();
00973 friend class BehaviorSettingsHelper;
00974
00975
00976
00977 bool mStartDocked;
00978 bool mShowSystemTray;
00979 bool mUseMessageStack;
00980 bool mUseMessageQueue;
00981 bool mQueueUnreadMessages;
00982 bool mContactListMouseNavigation;
00983 bool mReconnectOnDisconnect;
00984 bool mAutoConnect;
00985 bool mRaiseMessageWindow;
00986 bool mShowEvents;
00987 bool mQueueOnlyHighlightedMessagesInGroupChats;
00988 bool mQueueOnlyMessagesOnAnotherDesktop;
00989 bool mBalloonNotifyIgnoreClosesChatView;
00990 bool mTrayflashNotify;
00991 bool mTrayflashNotifyLeftClickOpensMessage;
00992 bool mTrayflashNotifySetCurrentDesktopToChatView;
00993 bool mEnableEventsWhileAway;
00994 int mChatWindowGroupPolicy;
00995 bool mSpellCheck;
00996 bool mChatWindowShowSendButton;
00997 bool mShowDates;
00998 bool mTruncateContactName;
00999 int mTruncateContactNameLength;
01000 int mChatWindowBufferViewSize;
01001 bool mHighlightEnabled;
01002 QString mViewPlugin;
01003
01004
01005 bool mUseAutoAway;
01006 int mAutoAwayTimeout;
01007 bool mAutoAwayGoAvailable;
01008 bool mUseLastAwayMessage;
01009 bool mUseCustomAwayMessage;
01010 QString mAutoAwayCustomTitle;
01011 QString mAutoAwayCustomMessage;
01012
01013
01014 bool mSmoothScrolling;
01015
01016
01017 bool mAlwaysShowTabs;
01018
01019 private:
01020 ItemBool *mStartDockedItem;
01021 ItemBool *mShowSystemTrayItem;
01022 ItemBool *mUseMessageStackItem;
01023 ItemBool *mUseMessageQueueItem;
01024 ItemBool *mQueueUnreadMessagesItem;
01025 ItemBool *mContactListMouseNavigationItem;
01026 ItemBool *mReconnectOnDisconnectItem;
01027 ItemBool *mAutoConnectItem;
01028 ItemBool *mRaiseMessageWindowItem;
01029 ItemBool *mShowEventsItem;
01030 ItemBool *mQueueOnlyHighlightedMessagesInGroupChatsItem;
01031 ItemBool *mQueueOnlyMessagesOnAnotherDesktopItem;
01032 ItemBool *mBalloonNotifyIgnoreClosesChatViewItem;
01033 ItemBool *mTrayflashNotifyItem;
01034 ItemBool *mTrayflashNotifyLeftClickOpensMessageItem;
01035 ItemBool *mTrayflashNotifySetCurrentDesktopToChatViewItem;
01036 ItemBool *mEnableEventsWhileAwayItem;
01037 ItemEnum *mChatWindowGroupPolicyItem;
01038 ItemBool *mSpellCheckItem;
01039 ItemBool *mChatWindowShowSendButtonItem;
01040 ItemBool *mShowDatesItem;
01041 ItemBool *mTruncateContactNameItem;
01042 ItemInt *mTruncateContactNameLengthItem;
01043 ItemInt *mChatWindowBufferViewSizeItem;
01044 ItemBool *mHighlightEnabledItem;
01045 ItemString *mViewPluginItem;
01046 ItemBool *mUseAutoAwayItem;
01047 ItemInt *mAutoAwayTimeoutItem;
01048 ItemBool *mAutoAwayGoAvailableItem;
01049 ItemBool *mUseLastAwayMessageItem;
01050 ItemBool *mUseCustomAwayMessageItem;
01051 ItemString *mAutoAwayCustomTitleItem;
01052 ItemString *mAutoAwayCustomMessageItem;
01053 ItemBool *mSmoothScrollingItem;
01054 ItemBool *mAlwaysShowTabsItem;
01055 };
01056
01057 }
01058
01059 #endif
01060