• 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 #include "konq_sort_constants.h"
30 
31 class TDEInstance;
32 class TDEConfigBase;
33 class TDEConfig;
34 
46 class LIBKONQ_EXPORT KonqPropsView
47 {
48 public:
49 
56  KonqPropsView( TDEInstance * instance, KonqPropsView * defaultProps /*= 0L*/ );
57 
59  virtual ~KonqPropsView();
60 
64  bool isDefaultProperties() const {
65  // No parent -> we are the default properties
66  return m_defaultProps == 0L;
67  }
68 
76  bool enterDir( const KURL & dir );
77 
82  void setSaveViewPropertiesLocally( bool value );
83 
85 
86  void setIconSize( int size ); // in pixel, 0 for default
87  int iconSize() const { return m_iIconSize; }
88 
89  void setItemTextPos( int pos ); // TQIconView::Bottom or TQIconView::Right, currently
90  int itemTextPos() const { return m_iItemTextPos; }
91 
92  void setSortCriterion( const TQString &criterion );
93  const TQString& sortCriterion() const;
94 
95  void setSortOrder( TextSortOrder order);
96  TextSortOrder getSortOrder() const;
97 
98  void setDirsFirst ( bool first );
99  bool isDirsFirst() const;
100 
101  void setHiddenFirst ( bool first );
102  bool isHiddenFirst() const;
103 
104  void setDescending (bool descending);
105  bool isDescending() const;
106 
107  void setShowingDotFiles( bool show );
108  bool isShowingDotFiles() const { return m_bShowDot; }
109 
110  void setCaseInsensitiveSort( bool show );
111  bool isCaseInsensitiveSort() const;
112 
113  void setShowingDirectoryOverlays( bool show );
114  bool isShowingDirectoryOverlays() const { return m_bShowDirectoryOverlays; }
115 
116  void setShowingFreeSpaceOverlays( bool show );
117  bool isShowingFreeSpaceOverlays() const { return m_bShowFreeSpaceOverlays; }
118 
119  void setShowingPreview( const TQString &preview, bool show );
120  void setShowingPreview( bool show );
121  bool isShowingPreview( const TQString &preview ) const { return ! m_dontPreview.contains(preview); }
122  bool isShowingPreview();
123  const TQStringList &previewSettings();
124 
125  void setBgColor( const TQColor & color );
126  const TQColor& bgColor(TQWidget * widget) const;
127  void setTextColor( const TQColor & color );
128  const TQColor& textColor(TQWidget * widget) const;
129  void setBgPixmapFile( const TQString & file );
130  const TQString& bgPixmapFile() const { return m_bgPixmapFile; }
131 
132  // Applies bgcolor, textcolor, pixmap to the @p widget
133  void applyColors( TQWidget * widget ) const;
134 
135 protected:
136 
137  TQPixmap loadPixmap() const;
138 
139  // Current config object for _saving_
140  TDEConfigBase * currentConfig();
141 
142  // Current config object for _saving_ settings related to colors
143  TDEConfigBase * currentColorConfig();
144 
145  TQString currentGroup() const {
146  return isDefaultProperties() ?
147  TQString::fromLatin1("Settings") : TQString::fromLatin1("URL properties");
148  }
149 
150 private:
151  // The actual properties
152 
153  int m_iIconSize;
154  int m_iItemTextPos;
155  bool m_bShowDot;
156  bool m_bShowDirectoryOverlays;
157  bool m_bShowFreeSpaceOverlays;
158  TQStringList m_dontPreview;
159  TQColor m_textColor;
160  TQColor m_bgColor;
161  TQString m_bgPixmapFile;
162 
163  // Path to .directory file, whether it exists or not
164  TQString dotDirectory;
165 
166  bool m_bSaveViewPropertiesLocally;
167 
168  // True if we found a .directory file to read
169  bool m_dotDirExists;
170 
171  // Points to the current .directory file if we are in
172  // save-view-properties-locally mode, otherwise to the global config
173  // It is set to 0L to mark it as "needs to be constructed".
174  // This is to be used for SAVING only.
175  // Can be a TDEConfig or a KSimpleConfig
176  TDEConfigBase * m_currentConfig;
177 
178  // If this is not a "default properties" instance (but one used by a view)
179  // then m_defaultProps points to the "default properties" instance
180  // Otherwise it's 0L.
181  KonqPropsView * m_defaultProps;
182 
187  struct Private;
188 
189  Private *d;
190 
191 private:
192  KonqPropsView( const KonqPropsView & );
193  KonqPropsView();
194 };
195 
196 
197 #endif
KonqPropsView
The class KonqPropsView holds the properties for a Konqueror View.
Definition: konq_propsview.h:46
KonqPropsView::isDefaultProperties
bool isDefaultProperties() const
Is this the instance representing default properties ?
Definition: konq_propsview.h:64

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.13
This website is maintained by Timothy Pearson.