akregator
akregatorconfig.h
Go to the documentation of this file.00001
00002
00003 #ifndef AKREGATOR_SETTINGS_H
00004 #define AKREGATOR_SETTINGS_H
00005
00006 #include <akregator_export.h>
00007
00008 #include <kconfigskeleton.h>
00009 #include <kdebug.h>
00010
00011 namespace Akregator {
00012
00013 class AKREGATOR_EXPORT Settings : public KConfigSkeleton
00014 {
00015 public:
00016 class EnumArchiveMode
00017 {
00018 public:
00019 enum type { keepAllArticles, limitArticleNumber, limitArticleAge, disableArchiving, COUNT };
00020 };
00021 class EnumLMBBehaviour
00022 {
00023 public:
00024 enum type { OpenInInternalBrowser, OpenInBackground, OpenInExternalBrowser, COUNT };
00025 };
00026 class EnumMMBBehaviour
00027 {
00028 public:
00029 enum type { OpenInInternalBrowser, OpenInBackground, OpenInExternalBrowser, COUNT };
00030 };
00031
00032 static Settings *self();
00033 ~Settings();
00034
00038 static
00039 void setShowQuickFilter( bool v )
00040 {
00041 if (!self()->isImmutable( QString::fromLatin1 ( "ShowQuickFilter" ) ))
00042 self()->mShowQuickFilter = v;
00043 }
00044
00048 static
00049 bool showQuickFilter()
00050 {
00051 return self()->mShowQuickFilter;
00052 }
00053
00057 static
00058 void setViewMode( int v )
00059 {
00060 if (!self()->isImmutable( QString::fromLatin1 ( "ViewMode" ) ))
00061 self()->mViewMode = v;
00062 }
00063
00067 static
00068 int viewMode()
00069 {
00070 return self()->mViewMode;
00071 }
00072
00076 static
00077 void setSplitter1Sizes( const QList<int> & v )
00078 {
00079 if (!self()->isImmutable( QString::fromLatin1 ( "Splitter1Sizes" ) ))
00080 self()->mSplitter1Sizes = v;
00081 }
00082
00086 static
00087 QList<int> splitter1Sizes()
00088 {
00089 return self()->mSplitter1Sizes;
00090 }
00091
00095 static
00096 void setSplitter2Sizes( const QList<int> & v )
00097 {
00098 if (!self()->isImmutable( QString::fromLatin1 ( "Splitter2Sizes" ) ))
00099 self()->mSplitter2Sizes = v;
00100 }
00101
00105 static
00106 QList<int> splitter2Sizes()
00107 {
00108 return self()->mSplitter2Sizes;
00109 }
00110
00114 static
00115 void setStandardFont( const QString & v )
00116 {
00117 if (!self()->isImmutable( QString::fromLatin1 ( "StandardFont" ) ))
00118 self()->mStandardFont = v;
00119 }
00120
00124 static
00125 QString standardFont()
00126 {
00127 return self()->mStandardFont;
00128 }
00129
00133 static
00134 void setFixedFont( const QString & v )
00135 {
00136 if (!self()->isImmutable( QString::fromLatin1 ( "FixedFont" ) ))
00137 self()->mFixedFont = v;
00138 }
00139
00143 static
00144 QString fixedFont()
00145 {
00146 return self()->mFixedFont;
00147 }
00148
00152 static
00153 void setSerifFont( const QString & v )
00154 {
00155 if (!self()->isImmutable( QString::fromLatin1 ( "SerifFont" ) ))
00156 self()->mSerifFont = v;
00157 }
00158
00162 static
00163 QString serifFont()
00164 {
00165 return self()->mSerifFont;
00166 }
00167
00171 static
00172 void setSansSerifFont( const QString & v )
00173 {
00174 if (!self()->isImmutable( QString::fromLatin1 ( "SansSerifFont" ) ))
00175 self()->mSansSerifFont = v;
00176 }
00177
00181 static
00182 QString sansSerifFont()
00183 {
00184 return self()->mSansSerifFont;
00185 }
00186
00190 static
00191 void setUseCustomColors( bool v )
00192 {
00193 if (!self()->isImmutable( QString::fromLatin1 ( "UseCustomColors" ) ))
00194 self()->mUseCustomColors = v;
00195 }
00196
00200 static
00201 bool useCustomColors()
00202 {
00203 return self()->mUseCustomColors;
00204 }
00205
00209 static
00210 void setColorUnreadArticles( const QColor & v )
00211 {
00212 if (!self()->isImmutable( QString::fromLatin1 ( "ColorUnreadArticles" ) ))
00213 self()->mColorUnreadArticles = v;
00214 }
00215
00219 static
00220 QColor colorUnreadArticles()
00221 {
00222 return self()->mColorUnreadArticles;
00223 }
00224
00228 static
00229 void setColorNewArticles( const QColor & v )
00230 {
00231 if (!self()->isImmutable( QString::fromLatin1 ( "ColorNewArticles" ) ))
00232 self()->mColorNewArticles = v;
00233 }
00234
00238 static
00239 QColor colorNewArticles()
00240 {
00241 return self()->mColorNewArticles;
00242 }
00243
00247 static
00248 void setFonts( const QStringList & v )
00249 {
00250 if (!self()->isImmutable( QString::fromLatin1 ( "Fonts" ) ))
00251 self()->mFonts = v;
00252 }
00253
00257 static
00258 QStringList fonts()
00259 {
00260 return self()->mFonts;
00261 }
00262
00266 static
00267 void setMediumFontSize( int v )
00268 {
00269 if (!self()->isImmutable( QString::fromLatin1 ( "MediumFontSize" ) ))
00270 self()->mMediumFontSize = v;
00271 }
00272
00276 static
00277 int mediumFontSize()
00278 {
00279 return self()->mMediumFontSize;
00280 }
00281
00285 static
00286 void setMinimumFontSize( int v )
00287 {
00288 if (!self()->isImmutable( QString::fromLatin1 ( "MinimumFontSize" ) ))
00289 self()->mMinimumFontSize = v;
00290 }
00291
00295 static
00296 int minimumFontSize()
00297 {
00298 return self()->mMinimumFontSize;
00299 }
00300
00304 static
00305 void setUnderlineLinks( bool v )
00306 {
00307 if (!self()->isImmutable( QString::fromLatin1 ( "UnderlineLinks" ) ))
00308 self()->mUnderlineLinks = v;
00309 }
00310
00314 static
00315 bool underlineLinks()
00316 {
00317 return self()->mUnderlineLinks;
00318 }
00319
00323 static
00324 void setArchiveMode( int v )
00325 {
00326 if (!self()->isImmutable( QString::fromLatin1 ( "ArchiveMode" ) ))
00327 self()->mArchiveMode = v;
00328 }
00329
00333 static
00334 int archiveMode()
00335 {
00336 return self()->mArchiveMode;
00337 }
00338
00342 static
00343 void setMaxArticleAge( int v )
00344 {
00345 if (!self()->isImmutable( QString::fromLatin1 ( "MaxArticleAge" ) ))
00346 self()->mMaxArticleAge = v;
00347 }
00348
00352 static
00353 int maxArticleAge()
00354 {
00355 return self()->mMaxArticleAge;
00356 }
00357
00361 static
00362 void setMaxArticleNumber( int v )
00363 {
00364 if (!self()->isImmutable( QString::fromLatin1 ( "MaxArticleNumber" ) ))
00365 self()->mMaxArticleNumber = v;
00366 }
00367
00371 static
00372 int maxArticleNumber()
00373 {
00374 return self()->mMaxArticleNumber;
00375 }
00376
00380 static
00381 void setDoNotExpireImportantArticles( bool v )
00382 {
00383 if (!self()->isImmutable( QString::fromLatin1 ( "DoNotExpireImportantArticles" ) ))
00384 self()->mDoNotExpireImportantArticles = v;
00385 }
00386
00390 static
00391 bool doNotExpireImportantArticles()
00392 {
00393 return self()->mDoNotExpireImportantArticles;
00394 }
00395
00399 static
00400 void setConcurrentFetches( int v )
00401 {
00402 if (!self()->isImmutable( QString::fromLatin1 ( "ConcurrentFetches" ) ))
00403 self()->mConcurrentFetches = v;
00404 }
00405
00409 static
00410 int concurrentFetches()
00411 {
00412 return self()->mConcurrentFetches;
00413 }
00414
00418 static
00419 void setUseHTMLCache( bool v )
00420 {
00421 if (!self()->isImmutable( QString::fromLatin1 ( "UseHTMLCache" ) ))
00422 self()->mUseHTMLCache = v;
00423 }
00424
00428 static
00429 bool useHTMLCache()
00430 {
00431 return self()->mUseHTMLCache;
00432 }
00433
00437 static
00438 void setCustomUserAgent( const QString & v )
00439 {
00440 if (!self()->isImmutable( QString::fromLatin1 ( "CustomUserAgent" ) ))
00441 self()->mCustomUserAgent = v;
00442 }
00443
00447 static
00448 QString customUserAgent()
00449 {
00450 return self()->mCustomUserAgent;
00451 }
00452
00456 static
00457 void setFetchOnStartup( bool v )
00458 {
00459 if (!self()->isImmutable( QString::fromLatin1 ( "FetchOnStartup" ) ))
00460 self()->mFetchOnStartup = v;
00461 }
00462
00466 static
00467 bool fetchOnStartup()
00468 {
00469 return self()->mFetchOnStartup;
00470 }
00471
00475 static
00476 void setMarkAllFeedsReadOnStartup( bool v )
00477 {
00478 if (!self()->isImmutable( QString::fromLatin1 ( "MarkAllFeedsReadOnStartup" ) ))
00479 self()->mMarkAllFeedsReadOnStartup = v;
00480 }
00481
00485 static
00486 bool markAllFeedsReadOnStartup()
00487 {
00488 return self()->mMarkAllFeedsReadOnStartup;
00489 }
00490
00494 static
00495 void setUseIntervalFetch( bool v )
00496 {
00497 if (!self()->isImmutable( QString::fromLatin1 ( "UseIntervalFetch" ) ))
00498 self()->mUseIntervalFetch = v;
00499 }
00500
00504 static
00505 bool useIntervalFetch()
00506 {
00507 return self()->mUseIntervalFetch;
00508 }
00509
00513 static
00514 void setAutoFetchInterval( int v )
00515 {
00516 if (!self()->isImmutable( QString::fromLatin1 ( "AutoFetchInterval" ) ))
00517 self()->mAutoFetchInterval = v;
00518 }
00519
00523 static
00524 int autoFetchInterval()
00525 {
00526 return self()->mAutoFetchInterval;
00527 }
00528
00532 static
00533 void setUseNotifications( bool v )
00534 {
00535 if (!self()->isImmutable( QString::fromLatin1 ( "UseNotifications" ) ))
00536 self()->mUseNotifications = v;
00537 }
00538
00542 static
00543 bool useNotifications()
00544 {
00545 return self()->mUseNotifications;
00546 }
00547
00551 static
00552 void setShowTrayIcon( bool v )
00553 {
00554 if (!self()->isImmutable( QString::fromLatin1 ( "ShowTrayIcon" ) ))
00555 self()->mShowTrayIcon = v;
00556 }
00557
00561 static
00562 bool showTrayIcon()
00563 {
00564 return self()->mShowTrayIcon;
00565 }
00566
00570 static
00571 void setCloseButtonOnTabs( bool v )
00572 {
00573 if (!self()->isImmutable( QString::fromLatin1 ( "CloseButtonOnTabs" ) ))
00574 self()->mCloseButtonOnTabs = v;
00575 }
00576
00580 static
00581 bool closeButtonOnTabs()
00582 {
00583 return self()->mCloseButtonOnTabs;
00584 }
00585
00589 static
00590 void setExternalBrowserUseKdeDefault( bool v )
00591 {
00592 if (!self()->isImmutable( QString::fromLatin1 ( "ExternalBrowserUseKdeDefault" ) ))
00593 self()->mExternalBrowserUseKdeDefault = v;
00594 }
00595
00599 static
00600 bool externalBrowserUseKdeDefault()
00601 {
00602 return self()->mExternalBrowserUseKdeDefault;
00603 }
00604
00608 static
00609 void setExternalBrowserUseCustomCommand( bool v )
00610 {
00611 if (!self()->isImmutable( QString::fromLatin1 ( "ExternalBrowserUseCustomCommand" ) ))
00612 self()->mExternalBrowserUseCustomCommand = v;
00613 }
00614
00618 static
00619 bool externalBrowserUseCustomCommand()
00620 {
00621 return self()->mExternalBrowserUseCustomCommand;
00622 }
00623
00627 static
00628 void setExternalBrowserCustomCommand( const QString & v )
00629 {
00630 if (!self()->isImmutable( QString::fromLatin1 ( "ExternalBrowserCustomCommand" ) ))
00631 self()->mExternalBrowserCustomCommand = v;
00632 }
00633
00637 static
00638 QString externalBrowserCustomCommand()
00639 {
00640 return self()->mExternalBrowserCustomCommand;
00641 }
00642
00646 static
00647 void setLMBBehaviour( int v )
00648 {
00649 if (!self()->isImmutable( QString::fromLatin1 ( "LMBBehaviour" ) ))
00650 self()->mLMBBehaviour = v;
00651 }
00652
00656 static
00657 int lMBBehaviour()
00658 {
00659 return self()->mLMBBehaviour;
00660 }
00661
00665 static
00666 void setMMBBehaviour( int v )
00667 {
00668 if (!self()->isImmutable( QString::fromLatin1 ( "MMBBehaviour" ) ))
00669 self()->mMMBBehaviour = v;
00670 }
00671
00675 static
00676 int mMBBehaviour()
00677 {
00678 return self()->mMMBBehaviour;
00679 }
00680
00684 static
00685 void setFeedlistHeaderStates( const QList<int> & v )
00686 {
00687 if (!self()->isImmutable( QString::fromLatin1 ( "FeedlistHeaderStates" ) ))
00688 self()->mFeedlistHeaderStates = v;
00689 }
00690
00694 static
00695 QList<int> feedlistHeaderStates()
00696 {
00697 return self()->mFeedlistHeaderStates;
00698 }
00699
00703 static
00704 void setArticlelistHeaderStates( const QList<int> & v )
00705 {
00706 if (!self()->isImmutable( QString::fromLatin1 ( "ArticlelistHeaderStates" ) ))
00707 self()->mArticlelistHeaderStates = v;
00708 }
00709
00713 static
00714 QList<int> articlelistHeaderStates()
00715 {
00716 return self()->mArticlelistHeaderStates;
00717 }
00718
00722 static
00723 void setArticlelistSortColumn( int v )
00724 {
00725 if (!self()->isImmutable( QString::fromLatin1 ( "ArticlelistSortColumn" ) ))
00726 self()->mArticlelistSortColumn = v;
00727 }
00728
00732 static
00733 int articlelistSortColumn()
00734 {
00735 return self()->mArticlelistSortColumn;
00736 }
00737
00741 static
00742 void setArticlelistSortOrder( int v )
00743 {
00744 if (!self()->isImmutable( QString::fromLatin1 ( "ArticlelistSortOrder" ) ))
00745 self()->mArticlelistSortOrder = v;
00746 }
00747
00751 static
00752 int articlelistSortOrder()
00753 {
00754 return self()->mArticlelistSortOrder;
00755 }
00756
00760 static
00761 void setArchiveBackend( const QString & v )
00762 {
00763 if (!self()->isImmutable( QString::fromLatin1 ( "ArchiveBackend" ) ))
00764 self()->mArchiveBackend = v;
00765 }
00766
00770 static
00771 QString archiveBackend()
00772 {
00773 return self()->mArchiveBackend;
00774 }
00775
00779 static
00780 void setUseMarkReadDelay( bool v )
00781 {
00782 if (!self()->isImmutable( QString::fromLatin1 ( "UseMarkReadDelay" ) ))
00783 self()->mUseMarkReadDelay = v;
00784 }
00785
00789 static
00790 bool useMarkReadDelay()
00791 {
00792 return self()->mUseMarkReadDelay;
00793 }
00794
00798 static
00799 void setMarkReadDelay( int v )
00800 {
00801 if (!self()->isImmutable( QString::fromLatin1 ( "MarkReadDelay" ) ))
00802 self()->mMarkReadDelay = v;
00803 }
00804
00808 static
00809 int markReadDelay()
00810 {
00811 return self()->mMarkReadDelay;
00812 }
00813
00814 protected:
00815 Settings();
00816 friend class SettingsHelper;
00817
00818
00819
00820 bool mShowQuickFilter;
00821 int mViewMode;
00822 QList<int> mSplitter1Sizes;
00823 QList<int> mSplitter2Sizes;
00824
00825
00826 QString mStandardFont;
00827 QString mFixedFont;
00828 QString mSerifFont;
00829 QString mSansSerifFont;
00830 bool mUseCustomColors;
00831 QColor mColorUnreadArticles;
00832 QColor mColorNewArticles;
00833
00834
00835 QStringList mFonts;
00836 int mMediumFontSize;
00837 int mMinimumFontSize;
00838 bool mUnderlineLinks;
00839
00840
00841 int mArchiveMode;
00842 int mMaxArticleAge;
00843 int mMaxArticleNumber;
00844 bool mDoNotExpireImportantArticles;
00845
00846
00847 int mConcurrentFetches;
00848 bool mUseHTMLCache;
00849 QString mCustomUserAgent;
00850
00851
00852 bool mFetchOnStartup;
00853 bool mMarkAllFeedsReadOnStartup;
00854 bool mUseIntervalFetch;
00855 int mAutoFetchInterval;
00856 bool mUseNotifications;
00857 bool mShowTrayIcon;
00858
00859
00860 bool mCloseButtonOnTabs;
00861 bool mExternalBrowserUseKdeDefault;
00862 bool mExternalBrowserUseCustomCommand;
00863 QString mExternalBrowserCustomCommand;
00864 int mLMBBehaviour;
00865 int mMMBBehaviour;
00866
00867
00868 QList<int> mFeedlistHeaderStates;
00869 QList<int> mArticlelistHeaderStates;
00870 int mArticlelistSortColumn;
00871 int mArticlelistSortOrder;
00872
00873
00874 QString mArchiveBackend;
00875 bool mUseMarkReadDelay;
00876 int mMarkReadDelay;
00877
00878 private:
00879 };
00880
00881 }
00882
00883 #endif
00884