konq_settings.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 1999 David Faure <faure@kde.org>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017    Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #ifndef __konq_settings_h__
00021 #define __konq_settings_h__
00022 
00023 class KConfig;
00024 #include <qcolor.h>
00025 #include <qstring.h>
00026 #include <qfont.h>
00027 #include <qmap.h>
00028 
00029 #include <libkonq_export.h>
00030 
00044 class LIBKONQ_EXPORT KonqFMSettings
00045 {
00046 protected:
00051   KonqFMSettings( KConfig * config );
00052 
00054   virtual ~KonqFMSettings();
00055 
00056 public:
00057 
00061   static KonqFMSettings * settings();
00062 
00070   static void reparseConfiguration();
00071 
00072   // Use settings (and mimetype definition files)
00073   // to find whether to embed a certain service type or not
00074   // Only makes sense in konqueror.
00075   bool shouldEmbed( const QString & serviceType ) const;
00076 
00077   // Behaviour settings
00078   bool wordWrapText() const { return m_bWordWrapText; }
00079   int iconTextHeight() const { return m_iconTextHeight; }
00080   int iconTextWidth() const;
00081   bool underlineLink() const { return m_underlineLink; }
00082   bool fileSizeInBytes() const { return m_fileSizeInBytes; }
00083   bool alwaysNewWin() const { return m_alwaysNewWin; }
00084   const QString & homeURL() const { return m_homeURL; }
00085 
00086   bool showFileTips() const {return m_showFileTips; }
00087   bool showPreviewsInFileTips() const;
00088   int numFileTips() const {return m_numFileTips; }
00089     bool renameIconDirectly() const;
00090 
00091   // Font settings
00092   const QFont& standardFont() const { return m_standardFont; }
00093 
00094   // Color settings
00095   const QColor& normalTextColor() const { return m_normalTextColor; }
00096   const QColor& highlightedTextColor() const { return m_highlightedTextColor; }
00097   const QColor& itemTextBackground() const { return m_itemTextBackground; }
00098 
00099   int textPreviewIconTransparency() const { return m_iconTransparency; }
00100 
00101   int caseSensitiveCompare( const QString& a, const QString& b ) const;
00102 
00103 private:
00104 
00105   static KonqFMSettings * s_pSettings;
00106 
00107   bool m_underlineLink;
00108   bool m_fileSizeInBytes;
00109   bool m_alwaysNewWin;
00110   bool m_bTreeFollow;
00111 
00112   QMap<QString, QString> m_embedMap;
00113 
00114   QFont m_standardFont;
00115 
00116   QColor m_normalTextColor;
00117   QColor m_highlightedTextColor;
00118   QColor m_itemTextBackground;
00119 
00120   bool m_bWordWrapText;
00121   int m_iconTextHeight;
00122 
00123   QString m_homeURL;
00124   bool m_showFileTips;
00125   int  m_numFileTips;
00126 
00127   // used for the textpreview
00128   int m_iconTransparency;
00129 
00131   void init( KConfig * config );
00132 
00133   struct KonqFMSettingsPrivate * d;
00134 
00135   // There is no default constructor. Use the provided ones.
00136   KonqFMSettings();
00137   // No copy constructor either. What for ?
00138   KonqFMSettings( const KonqFMSettings &);
00139 };
00140 
00141 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys