• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • libkonq
 

libkonq

konq_propsview.h

00001 /*  This file is part of the KDE project
00002     Copyright (C) 1997 David Faure <faure@kde.org>
00003 
00004     This program is free software; you can redistribute it and/or modify
00005     it under the terms of the GNU General Public License as published by
00006     the Free Software Foundation; either version 2 of the License, or
00007     (at your option) any later version.
00008 
00009     This program 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
00012     GNU General Public License for more details.
00013 
00014     You should have received a copy of the GNU General Public License
00015     along with this program; if not, write to the Free Software
00016     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00017 
00018 */
00019 
00020 #ifndef __konq_viewprops_h__
00021 #define __konq_viewprops_h__
00022 
00023 #include <tqpixmap.h>
00024 #include <tqstringlist.h>
00025 
00026 #include <kurl.h>
00027 #include <libkonq_export.h>
00028 
00029 class TDEInstance;
00030 class TDEConfigBase;
00031 class TDEConfig;
00032 
00044 class LIBKONQ_EXPORT KonqPropsView
00045 {
00046 public:
00047 
00054   KonqPropsView( TDEInstance * instance, KonqPropsView * defaultProps /*= 0L*/ );
00055 
00057   virtual ~KonqPropsView();
00058 
00062   bool isDefaultProperties() const {
00063       // No parent -> we are the default properties
00064       return m_defaultProps == 0L;
00065   }
00066 
00074   bool enterDir( const KURL & dir );
00075 
00080   void setSaveViewPropertiesLocally( bool value );
00081 
00083 
00084   void setIconSize( int size ); // in pixel, 0 for default
00085   int iconSize() const { return m_iIconSize; }
00086 
00087   void setItemTextPos( int pos ); // TQIconView::Bottom or TQIconView::Right, currently
00088   int itemTextPos() const { return m_iItemTextPos; }
00089 
00090   void setSortCriterion( const TQString &criterion );
00091   const TQString& sortCriterion() const;
00092 
00093   void setDirsFirst ( bool first );
00094   bool isDirsFirst() const;
00095 
00096   void setDescending (bool descending);
00097   bool isDescending() const;
00098 
00099   void setShowingDotFiles( bool show );
00100   bool isShowingDotFiles() const { return m_bShowDot; }
00101 
00102   void setCaseInsensitiveSort( bool show );
00103   bool isCaseInsensitiveSort() const;
00104 
00105   void setShowingDirectoryOverlays( bool show );
00106   bool isShowingDirectoryOverlays() const { return m_bShowDirectoryOverlays; }
00107 
00108   void setShowingFreeSpaceOverlays( bool show );
00109   bool isShowingFreeSpaceOverlays() const { return m_bShowFreeSpaceOverlays; }
00110 
00111   void setShowingPreview( const TQString &preview, bool show );
00112   void setShowingPreview( bool show );
00113   bool isShowingPreview( const TQString &preview ) const { return ! m_dontPreview.contains(preview); }
00114   bool isShowingPreview();
00115   const TQStringList &previewSettings();
00116 
00117   void setBgColor( const TQColor & color );
00118   const TQColor& bgColor(TQWidget * widget) const;
00119   void setTextColor( const TQColor & color );
00120   const TQColor& textColor(TQWidget * widget) const;
00121   void setBgPixmapFile( const TQString & file );
00122   const TQString& bgPixmapFile() const { return m_bgPixmapFile; }
00123 
00124   // Applies bgcolor, textcolor, pixmap to the @p widget
00125   void applyColors( TQWidget * widget ) const;
00126 
00127 protected:
00128 
00129   TQPixmap loadPixmap() const;
00130 
00131   // Current config object for _saving_
00132   TDEConfigBase * currentConfig();
00133 
00134   // Current config object for _saving_ settings related to colors
00135   TDEConfigBase * currentColorConfig();
00136 
00137   TQString currentGroup() const {
00138       return isDefaultProperties() ? 
00139           TQString::fromLatin1("Settings") : TQString::fromLatin1("URL properties");
00140   }
00141 
00142 private:
00143   // The actual properties
00144 
00145   int m_iIconSize;
00146   int m_iItemTextPos;
00147   bool m_bShowDot;
00148   bool m_bShowDirectoryOverlays;
00149   bool m_bShowFreeSpaceOverlays;
00150   TQStringList m_dontPreview;
00151   TQColor m_textColor;
00152   TQColor m_bgColor;
00153   TQString m_bgPixmapFile;
00154 
00155   // Path to .directory file, whether it exists or not
00156   TQString dotDirectory;
00157 
00158   bool m_bSaveViewPropertiesLocally;
00159 
00160   // True if we found a .directory file to read
00161   bool m_dotDirExists;
00162 
00163   // Points to the current .directory file if we are in
00164   // save-view-properties-locally mode, otherwise to the global config
00165   // It is set to 0L to mark it as "needs to be constructed".
00166   // This is to be used for SAVING only.
00167   // Can be a TDEConfig or a KSimpleConfig
00168   TDEConfigBase * m_currentConfig;
00169 
00170   // If this is not a "default properties" instance (but one used by a view)
00171   // then m_defaultProps points to the "default properties" instance
00172   // Otherwise it's 0L.
00173   KonqPropsView * m_defaultProps;
00174 
00179   struct Private;
00180 
00181   Private *d;
00182 
00183 private:
00184   KonqPropsView( const KonqPropsView & );
00185   KonqPropsView();
00186 };
00187 
00188 
00189 #endif

libkonq

Skip menu "libkonq"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

libkonq

Skip menu "libkonq"
  • kate
  • libkonq
  • twin
  •   lib
Generated for libkonq by doxygen 1.7.1
This website is maintained by Timothy Pearson.