home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / kurlrequesterdlg.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-10-10  |  3.7 KB  |  115 lines

  1. /* This file is part of the KDE libraries
  2.     Copyright (C) 2000 Wilco Greven <greven@kde.org>
  3.  
  4.     library is free software; you can redistribute it and/or
  5.     modify it under the terms of the GNU Library General Public
  6.     License as published by the Free Software Foundation; either
  7.     version 2 of the License, or (at your option) any later version.
  8.  
  9.     This library 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 GNU
  12.     Library General Public License for more details.
  13.  
  14.     You should have received a copy of the GNU Library General Public License
  15.     along with this library; see the file COPYING.LIB.  If not, write to
  16.     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  17.     Boston, MA 02110-1301, USA.
  18. */
  19.  
  20.  
  21. #ifndef KURLREQUESTERDIALOG_H
  22. #define KURLREQUESTERDIALOG_H
  23.  
  24. #include <kdialogbase.h>
  25. #include <kurl.h>
  26.  
  27. class KURLCompletion;
  28. class KURLRequester;
  29. class KFileDialog;
  30. /**
  31.  * Dialog in which a user can enter a filename or url. It is a dialog
  32.  * encapsulating KURLRequester. The API is derived from
  33.  * KFileDialog.
  34.  *
  35.  * @short Simple dialog to enter a filename/url.
  36.  * @author Wilco Greven <greven@kde.org>
  37.  */
  38. class KIO_EXPORT KURLRequesterDlg : public KDialogBase
  39. {
  40.     Q_OBJECT
  41.  
  42. public:
  43.     /**
  44.      * Constructs a KURLRequesterDlg.
  45.      *
  46.      * @param url    The url of the directory to start in. Use QString::null
  47.      *               to start in the current working directory, or the last
  48.      *               directory where a file has been selected.
  49.      * @param parent The parent object of this widget.
  50.      * @param name The name of this widget.
  51.      * @param modal  Specifies whether the dialog should be opened as modal
  52.      *               or not.
  53.      */
  54.     KURLRequesterDlg( const QString& url, QWidget *parent,
  55.                       const char *name, bool modal = true );
  56.  
  57.     /**
  58.      * Constructs a KURLRequesterDlg.
  59.      *
  60.      * @param url    The url of the directory to start in. Use QString::null
  61.      *               to start in the current working directory, or the last
  62.      *               directory where a file has been selected.
  63.      * @param text   Text of the label
  64.      * @param parent The parent object of this widget.
  65.      * @param name The name of this widget.
  66.      * @param modal  Specifies whether the dialog should be opened as modal
  67.      *                  or not.
  68.      */
  69.     KURLRequesterDlg( const QString& url, const QString& text,
  70.                       QWidget *parent, const char *name, bool modal=true );
  71.     /**
  72.      * Destructs the dialog.
  73.      */
  74.     ~KURLRequesterDlg();
  75.  
  76.     /**
  77.      * Returns the fully qualified filename.
  78.      */
  79.     KURL selectedURL() const;
  80.  
  81.     /**
  82.      * Creates a modal dialog, executes it and returns the selected URL.
  83.      *
  84.      * @param url This specifies the initial path of the input line.
  85.      * @param parent The widget the dialog will be centered on initially.
  86.      * @param caption The caption to use for the dialog.
  87.      */
  88.     static KURL getURL(const QString& url = QString::null,
  89.             QWidget *parent= 0, const QString& caption = QString::null);
  90.  
  91.     /**
  92.      * Returns a pointer to the file dialog used by the KURLRequester.
  93.      */
  94.     KFileDialog * fileDialog();
  95.     /**
  96.      * Returns a pointer to the KURLRequester.
  97.      */
  98.     KURLRequester *urlRequester();
  99.  
  100. private slots:
  101.     void slotClear();
  102.     void slotTextChanged(const QString &);
  103. private:
  104.     void initDialog(const QString &text, const QString &url);
  105.     KURLRequester *urlRequester_;
  106.  
  107.     class KURLRequesterDlgPrivate;
  108.     KURLRequesterDlgPrivate *d;
  109.  
  110. };
  111.  
  112. #endif // KURLREQUESTERDIALOG_H
  113.  
  114. // vim:ts=4:sw=4:tw=78
  115.