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

libkonq

  • libkonq
konq_propsview.h
1 /* This file is part of the KDE project
2  Copyright (C) 1997 David Faure <faure@kde.org>
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 
18 */
19 
20 #ifndef __konq_viewprops_h__
21 #define __konq_viewprops_h__
22 
23 #include <tqpixmap.h>
24 #include <tqstringlist.h>
25 
26 #include <kurl.h>
27 #include <libkonq_export.h>
28 
29 class KInstance;
30 class KConfigBase;
31 class KConfig;
32 
44 class LIBKONQ_EXPORT KonqPropsView
45 {
46 public:
47 
54  KonqPropsView( KInstance * instance, KonqPropsView * defaultProps /*= 0L*/ );
55 
57  virtual ~KonqPropsView();
58 
62  bool isDefaultProperties() const {
63  // No parent -> we are the default properties
64  return m_defaultProps == 0L;
65  }
66 
74  bool enterDir( const KURL & dir );
75 
80  void setSaveViewPropertiesLocally( bool value );
81 
83 
84  void setIconSize( int size ); // in pixel, 0 for default
85  int iconSize() const { return m_iIconSize; }
86 
87  void setItemTextPos( int pos ); // TQIconView::Bottom or TQIconView::Right, currently
88  int itemTextPos() const { return m_iItemTextPos; }
89 
90  void setSortCriterion( const TQString &criterion );
91  const TQString& sortCriterion() const;
92 
93  void setDirsFirst ( bool first );
94  bool isDirsFirst() const;
95 
96  void setDescending (bool descending);
97  bool isDescending() const;
98 
99  void setShowingDotFiles( bool show );
100  bool isShowingDotFiles() const { return m_bShowDot; }
101 
102  void setCaseInsensitiveSort( bool show );
103  bool isCaseInsensitiveSort() const;
104 
105  void setShowingDirectoryOverlays( bool show );
106  bool isShowingDirectoryOverlays() const { return m_bShowDirectoryOverlays; }
107 
108  void setShowingPreview( const TQString &preview, bool show );
109  void setShowingPreview( bool show );
110  bool isShowingPreview( const TQString &preview ) const { return ! m_dontPreview.contains(preview); }
111  bool isShowingPreview();
112  const TQStringList &previewSettings();
113 
114  void setBgColor( const TQColor & color );
115  const TQColor& bgColor(TQWidget * widget) const;
116  void setTextColor( const TQColor & color );
117  const TQColor& textColor(TQWidget * widget) const;
118  void setBgPixmapFile( const TQString & file );
119  const TQString& bgPixmapFile() const { return m_bgPixmapFile; }
120 
121  // Applies bgcolor, textcolor, pixmap to the @p widget
122  void applyColors( TQWidget * widget ) const;
123 
124 protected:
125 
126  TQPixmap loadPixmap() const;
127 
128  // Current config object for _saving_
129  KConfigBase * currentConfig();
130 
131  // Current config object for _saving_ settings related to colors
132  KConfigBase * currentColorConfig();
133 
134  TQString currentGroup() const {
135  return isDefaultProperties() ?
136  TQString::fromLatin1("Settings") : TQString::fromLatin1("URL properties");
137  }
138 
139 private:
140  // The actual properties
141 
142  int m_iIconSize;
143  int m_iItemTextPos;
144  bool m_bShowDot;
145  bool m_bShowDirectoryOverlays;
146  TQStringList m_dontPreview;
147  TQColor m_textColor;
148  TQColor m_bgColor;
149  TQString m_bgPixmapFile;
150 
151  // Path to .directory file, whether it exists or not
152  TQString dotDirectory;
153 
154  bool m_bSaveViewPropertiesLocally;
155 
156  // True if we found a .directory file to read
157  bool m_dotDirExists;
158 
159  // Points to the current .directory file if we are in
160  // save-view-properties-locally mode, otherwise to the global config
161  // It is set to 0L to mark it as "needs to be constructed".
162  // This is to be used for SAVING only.
163  // Can be a KConfig or a KSimpleConfig
164  KConfigBase * m_currentConfig;
165 
166  // If this is not a "default properties" instance (but one used by a view)
167  // then m_defaultProps points to the "default properties" instance
168  // Otherwise it's 0L.
169  KonqPropsView * m_defaultProps;
170 
175  struct Private;
176 
177  Private *d;
178 
179 private:
180  KonqPropsView( const KonqPropsView & );
181  KonqPropsView();
182 };
183 
184 
185 #endif

libkonq

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

libkonq

Skip menu "libkonq"
  • kate
  • kwin
  •   lib
  • libkonq
Generated for libkonq by doxygen 1.8.1.2
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |