• 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 TDEInstance;
30 class TDEConfigBase;
31 class TDEConfig;
32 
44 class LIBKONQ_EXPORT KonqPropsView
45 {
46 public:
47 
54  KonqPropsView( TDEInstance * 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 setShowingFreeSpaceOverlays( bool show );
109  bool isShowingFreeSpaceOverlays() const { return m_bShowFreeSpaceOverlays; }
110 
111  void setShowingPreview( const TQString &preview, bool show );
112  void setShowingPreview( bool show );
113  bool isShowingPreview( const TQString &preview ) const { return ! m_dontPreview.contains(preview); }
114  bool isShowingPreview();
115  const TQStringList &previewSettings();
116 
117  void setBgColor( const TQColor & color );
118  const TQColor& bgColor(TQWidget * widget) const;
119  void setTextColor( const TQColor & color );
120  const TQColor& textColor(TQWidget * widget) const;
121  void setBgPixmapFile( const TQString & file );
122  const TQString& bgPixmapFile() const { return m_bgPixmapFile; }
123 
124  // Applies bgcolor, textcolor, pixmap to the @p widget
125  void applyColors( TQWidget * widget ) const;
126 
127 protected:
128 
129  TQPixmap loadPixmap() const;
130 
131  // Current config object for _saving_
132  TDEConfigBase * currentConfig();
133 
134  // Current config object for _saving_ settings related to colors
135  TDEConfigBase * currentColorConfig();
136 
137  TQString currentGroup() const {
138  return isDefaultProperties() ?
139  TQString::fromLatin1("Settings") : TQString::fromLatin1("URL properties");
140  }
141 
142 private:
143  // The actual properties
144 
145  int m_iIconSize;
146  int m_iItemTextPos;
147  bool m_bShowDot;
148  bool m_bShowDirectoryOverlays;
149  bool m_bShowFreeSpaceOverlays;
150  TQStringList m_dontPreview;
151  TQColor m_textColor;
152  TQColor m_bgColor;
153  TQString m_bgPixmapFile;
154 
155  // Path to .directory file, whether it exists or not
156  TQString dotDirectory;
157 
158  bool m_bSaveViewPropertiesLocally;
159 
160  // True if we found a .directory file to read
161  bool m_dotDirExists;
162 
163  // Points to the current .directory file if we are in
164  // save-view-properties-locally mode, otherwise to the global config
165  // It is set to 0L to mark it as "needs to be constructed".
166  // This is to be used for SAVING only.
167  // Can be a TDEConfig or a KSimpleConfig
168  TDEConfigBase * m_currentConfig;
169 
170  // If this is not a "default properties" instance (but one used by a view)
171  // then m_defaultProps points to the "default properties" instance
172  // Otherwise it's 0L.
173  KonqPropsView * m_defaultProps;
174 
179  struct Private;
180 
181  Private *d;
182 
183 private:
184  KonqPropsView( const KonqPropsView & );
185  KonqPropsView();
186 };
187 
188 
189 #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.8.1.2
This website is maintained by Timothy Pearson.