• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeio/tdefile
 

tdeio/tdefile

  • tdeio
  • tdefile
kurlcombobox.h
1 /* This file is part of the KDE libraries
2  Copyright (C) 2000 Carsten Pfeiffer <pfeiffer@kde.org>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License version 2, as published by the Free Software Foundation.
7 
8  This library is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  Library General Public License for more details.
12 
13  You should have received a copy of the GNU Library General Public License
14  along with this library; see the file COPYING.LIB. If not, write to
15  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  Boston, MA 02110-1301, USA.
17 */
18 
19 #ifndef KURLCOMBOBOX_H
20 #define KURLCOMBOBOX_H
21 
22 #include <tqevent.h>
23 #include <tqptrlist.h>
24 #include <tqmap.h>
25 #include <tqpixmap.h>
26 #include <tqstringlist.h>
27 
28 #include <kcombobox.h>
29 #include <kurl.h>
30 
41 class TDEIO_EXPORT KURLComboBox : public KComboBox
42 {
43  TQ_OBJECT
44  TQ_PROPERTY(TQStringList urls READ urls WRITE setURLs DESIGNABLE true)
45  TQ_PROPERTY(int maxItems READ maxItems WRITE setMaxItems DESIGNABLE true)
46 
47 public:
51  enum Mode { Files = -1, Directories = 1, Both = 0 };
59  enum OverLoadResolving { RemoveTop, RemoveBottom };
60 
76  KURLComboBox( Mode mode, TQWidget *parent=0, const char *name=0 );
77  KURLComboBox( Mode mode, bool rw, TQWidget *parent=0, const char *name=0 );
81  ~KURLComboBox();
82 
95  void setURL( const KURL& url );
96 
104  void setURLs( TQStringList urls );
105 
113  void setURLs( TQStringList urls, OverLoadResolving remove );
114 
125  TQStringList urls() const;
126 
131  void setMaxItems( int );
132 
137  int maxItems() const { return myMaximum; }
138 
147  void addDefaultURL( const KURL& url, const TQString& text = TQString::null );
148 
157  void addDefaultURL( const KURL& url, const TQPixmap& pix,
158  const TQString& text = TQString::null );
159 
165  void setDefaults();
166 
171  void removeURL( const KURL& url, bool checkDefaultURLs = true );
172 
173 signals:
179  void urlActivated( const KURL& url );
180 
181 
182 protected slots:
183  void slotActivated( int );
184 
185 
186 protected:
187  struct _KURLComboItem {
188  TQString text;
189  KURL url;
190  TQPixmap pixmap;
191  };
192  typedef _KURLComboItem KURLComboItem;
193  TQPtrList<KURLComboItem> itemList;
194  TQPtrList<KURLComboItem> defaultList;
195  TQMap<int,const KURLComboItem*> itemMapper;
196 
197  void init( Mode mode );
198  void insertURLItem( const KURLComboItem * );
199 
204  TQPixmap getPixmap( const KURL& url ) const;
205 
211  void updateItem( const KURLComboItem *item, int index, const TQPixmap& pix);
212 
213  TQPixmap opendirPix;
214  int firstItemIndex;
215 
216 
217 private:
218  bool urlAdded;
219  int myMaximum;
220  Mode myMode; // can be used as parameter to KUR::path( int ) or url( int )
221  // to specify if we want a trailing slash or not
222 
223 private:
224  class KURLComboBoxPrivate;
225  KURLComboBoxPrivate *d;
226 };
227 
228 
229 #endif // KURLCOMBOBOX_H
KURLComboBox
This combobox shows a number of recent URLs/directories, as well as some default directories.
Definition: kurlcombobox.h:42
KURLComboBox::OverLoadResolving
OverLoadResolving
This Enumeration is used in setURL() to determine which items will be removed when the given list is ...
Definition: kurlcombobox.h:59
KURLComboBox::urlActivated
void urlActivated(const KURL &url)
Emitted when an item was clicked at.
KURLComboBox::maxItems
int maxItems() const
Definition: kurlcombobox.h:137
KURLComboBox::Mode
Mode
This enum describes which kind of items is shown in the combo box.
Definition: kurlcombobox.h:51

tdeio/tdefile

Skip menu "tdeio/tdefile"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

tdeio/tdefile

Skip menu "tdeio/tdefile"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeio/tdefile by doxygen 1.9.1
This website is maintained by Timothy Pearson.