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

tdeio/tdefile

Public Slots | Signals | Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | List of all members
KURLRequester Class Reference

#include <kurlrequester.h>

Inheritance diagram for KURLRequester:
KURLComboRequester

Public Slots

void setURL (const TQString &url)
 
void setKURL (const KURL &url)
 
virtual void setCaption (const TQString &caption)
 
void clear ()
 

Signals

void textChanged (const TQString &)
 
void returnPressed ()
 
void returnPressed (const TQString &)
 
void openFileDialog (KURLRequester *)
 
void urlSelected (const TQString &)
 

Public Member Functions

 KURLRequester (TQWidget *parent=0, const char *name=0)
 
 KURLRequester (const TQString &url, TQWidget *parent=0, const char *name=0)
 
 KURLRequester (TQWidget *editWidget, TQWidget *parent, const char *name=0)
 
 ~KURLRequester ()
 
TQString url () const
 
void setShowLocalProtocol (bool b)
 
void setMode (uint m)
 
uint mode () const
 
void setFilter (const TQString &filter)
 
TQString filter () const
 
bool showLocalProtocol () const
 
virtual KFileDialog * fileDialog () const
 
KLineEdit * lineEdit () const
 
KComboBox * comboBox () const
 
KPushButton * button () const
 
KURLCompletion * completionObject () const
 
KEditListBox::CustomEditor customEditor ()
 

Protected Slots

void slotOpenDialog ()
 

Protected Member Functions

void init ()
 
virtual void virtual_hook (int id, void *data)
 
bool eventFilter (TQObject *obj, TQEvent *ev)
 

Protected Attributes

KURLCompletion * myCompletion
 

Detailed Description

This class is a widget showing a lineedit and a button, which invokes a filedialog.

File name completion is available in the lineedit.

The defaults for the filedialog are to ask for one existing local file, i.e. KFileDialog::setMode( KFile::File | KFile::ExistingOnly | KFile::LocalOnly ) The default filter is "*", i.e. show all files, and the start directory is the current working directory, or the last directory where a file has been selected.

You can change this behavior by using setMode() or setFilter().

KDE URL Requester

A widget to request a filename/url from the user

Author
Carsten Pfeiffer pfeif.nosp@m.fer@.nosp@m.kde.o.nosp@m.rg

Definition at line 56 of file kurlrequester.h.

Constructor & Destructor Documentation

◆ KURLRequester() [1/3]

KURLRequester::KURLRequester ( TQWidget *  parent = 0,
const char *  name = 0 
)

Constructs a KURLRequester widget.

Definition at line 174 of file kurlrequester.cpp.

◆ KURLRequester() [2/3]

KURLRequester::KURLRequester ( const TQString &  url,
TQWidget *  parent = 0,
const char *  name = 0 
)

Constructs a KURLRequester widget with the initial URL url.

// TODO KDE4: Use KURL instead

Definition at line 182 of file kurlrequester.cpp.

◆ KURLRequester() [3/3]

KURLRequester::KURLRequester ( TQWidget *  editWidget,
TQWidget *  parent,
const char *  name = 0 
)

Special constructor, which creates a KURLRequester widget with a custom edit-widget.

The edit-widget can be either a KComboBox or a KLineEdit (or inherited thereof). Note: for geometry management reasons, the edit-widget is reparented to have the KURLRequester as parent.

Definition at line 159 of file kurlrequester.cpp.

◆ ~KURLRequester()

KURLRequester::~KURLRequester ( )

Destructs the KURLRequester.

Definition at line 192 of file kurlrequester.cpp.

Member Function Documentation

◆ button()

KPushButton * KURLRequester::button ( ) const
Returns
a pointer to the pushbutton. It is provided so that you can specify an own pixmap or a text, if you really need to.

Definition at line 398 of file kurlrequester.cpp.

◆ clear

void KURLRequester::clear ( )
slot

Clears the lineedit/combobox.

Definition at line 364 of file kurlrequester.cpp.

◆ comboBox()

KComboBox * KURLRequester::comboBox ( ) const
Returns
a pointer to the combobox, in case you have set one using the special constructor. Returns 0L otherwise.

Definition at line 374 of file kurlrequester.cpp.

◆ completionObject()

KURLCompletion * KURLRequester::completionObject ( ) const
inline
Returns
the KURLCompletion object used in the lineedit/combobox.

Definition at line 175 of file kurlrequester.h.

◆ customEditor()

KEditListBox::CustomEditor KURLRequester::customEditor ( )
Returns
an object, suitable for use with KEditListBox. It allows you to put this KURLRequester into a KEditListBox. Basically, do it like this:
KURLRequester *req = new KURLRequester( someWidget );
[...]
KEditListBox *editListBox = new KEditListBox( i18n("Some Title"), req->customEditor(), someWidget );
KURLRequester
This class is a widget showing a lineedit and a button, which invokes a filedialog.
Definition: kurlrequester.h:57
KURLRequester::KURLRequester
KURLRequester(TQWidget *parent=0, const char *name=0)
Constructs a KURLRequester widget.
Definition: kurlrequester.cpp:174
KURLRequester::customEditor
KEditListBox::CustomEditor customEditor()
Definition: kurlrequester.cpp:403
Since
3.1

Definition at line 403 of file kurlrequester.cpp.

◆ eventFilter()

bool KURLRequester::eventFilter ( TQObject *  obj,
TQEvent *  ev 
)
protected

Definition at line 387 of file kurlrequester.cpp.

◆ fileDialog()

KFileDialog * KURLRequester::fileDialog ( ) const
virtual
Returns
a pointer to the filedialog You can use this to customize the dialog, e.g. to specify a filter. Never returns 0L.

Remove in KDE4? KURLRequester should use KDirSelectDialog for (mode & KFile::Directory) && !(mode & KFile::File)

Definition at line 340 of file kurlrequester.cpp.

◆ filter()

TQString KURLRequester::filter ( ) const

Returns the current filter for the file dialog.

See also
KFileDialog::filter()
Since
3.3

Definition at line 334 of file kurlrequester.cpp.

◆ init()

void KURLRequester::init ( )
protected

Definition at line 200 of file kurlrequester.cpp.

◆ lineEdit()

KLineEdit * KURLRequester::lineEdit ( ) const
Returns
a pointer to the lineedit, either the default one, or the special one, if you used the special constructor.

It is provided so that you can e.g. set an own completion object (e.g. KShellCompletion) into it.

Definition at line 369 of file kurlrequester.cpp.

◆ mode()

unsigned int KURLRequester::mode ( ) const

Returns the current mode.

See also
KFileDialog::mode()
Since
3.3

Definition at line 322 of file kurlrequester.cpp.

◆ openFileDialog

void KURLRequester::openFileDialog ( KURLRequester *  )
signal

Emitted before the filedialog is going to open.

Connect to this signal to "configure" the filedialog, e.g. set the filefilter, the mode, a preview-widget, etc. It's usually not necessary to set a URL for the filedialog, as it will get set properly from the editfield contents.

If you use multiple KURLRequesters, you can connect all of them to the same slot and use the given KURLRequester pointer to know which one is going to open.

◆ returnPressed [1/2]

void KURLRequester::returnPressed ( )
signal

Emitted when return or enter was pressed in the lineedit.

◆ returnPressed [2/2]

void KURLRequester::returnPressed ( const TQString &  )
signal

Emitted when return or enter was pressed in the lineedit.

The parameter contains the contents of the lineedit.

◆ setCaption

void KURLRequester::setCaption ( const TQString &  caption)
virtualslot

Sets the caption of the file dialog.

Since
3.1

Definition at line 261 of file kurlrequester.cpp.

◆ setFilter()

void KURLRequester::setFilter ( const TQString &  filter)

Sets the filter for the file dialog.

See also
KFileDialog::setFilter()

Definition at line 327 of file kurlrequester.cpp.

◆ setKURL

void KURLRequester::setKURL ( const KURL &  url)
slot

Sets the url in the lineedit to url.

Since
3.4 // TODO KDE4: rename to setURL

Definition at line 253 of file kurlrequester.cpp.

◆ setMode()

void KURLRequester::setMode ( uint  m)

Sets the mode of the file dialog.

Note: you can only select one file with the filedialog, so KFile::Files doesn't make much sense.

See also
KFileDialog::setMode()

Definition at line 311 of file kurlrequester.cpp.

◆ setShowLocalProtocol()

void KURLRequester::setShowLocalProtocol ( bool  b)

Enables/disables showing file:/ in the lineedit, when a local file has been selected in the filedialog or was set via setURL().

Default is false, not showing file:/

See also
showLocalProtocol

Definition at line 355 of file kurlrequester.cpp.

◆ setURL

void KURLRequester::setURL ( const TQString &  url)
slot

Sets the url in the lineedit to url.

Depending on the state of showLocalProtocol(), file:/ on local files will be shown or not.

Since
3.1 // TODO KDE4: Use KURL instead

Definition at line 235 of file kurlrequester.cpp.

◆ showLocalProtocol()

bool KURLRequester::showLocalProtocol ( ) const
inline
Returns
whether local files will be prefixed with file:/ in the lineedit
See also
setShowLocalProtocol

Definition at line 138 of file kurlrequester.h.

◆ slotOpenDialog

void KURLRequester::slotOpenDialog ( )
protectedslot

Called when the button is pressed to open the filedialog.

Also called when TDEStdAccel::Open (default is Ctrl-O) is pressed.

Definition at line 273 of file kurlrequester.cpp.

◆ textChanged

void KURLRequester::textChanged ( const TQString &  )
signal

Emitted when the text in the lineedit changes.

The parameter contains the contents of the lineedit.

Since
3.1

◆ url()

TQString KURLRequester::url ( ) const
Returns
the current url in the lineedit. May be malformed, if the user entered something weird. ~user or environment variables are substituted for local files. // TODO KDE4: Use KURL so that the result is properly defined

Definition at line 268 of file kurlrequester.cpp.

◆ urlSelected

void KURLRequester::urlSelected ( const TQString &  )
signal

Emitted when the user changed the URL via the file dialog.

The parameter contains the contents of the lineedit. // TODO KDE4: Use KURL instead

◆ virtual_hook()

void KURLRequester::virtual_hook ( int  id,
void *  data 
)
protectedvirtual

Definition at line 421 of file kurlrequester.cpp.

Member Data Documentation

◆ myCompletion

KURLCompletion* KURLRequester::myCompletion
protected

Definition at line 260 of file kurlrequester.h.


The documentation for this class was generated from the following files:
  • kurlrequester.h
  • kurlrequester.cpp

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