//
//     Copyright 2006 Jim Bublitz <jbublitz@nwinternet.com>
//     Earlier copyrights 1998 - 2005 Jim Bublitz and/or Phil Thompson
//     may also apply


//                 Generated by preSip
//            module kfile  version KDE 3.5.3


// This software is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 2 of
// the License, or (at your option) any later version.
//
// This software is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public
// License along with this library; see the file COPYING.
// If not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.


class KFileDialog : KDialogBase
{
%TypeHeaderCode
#include <kfiledialog.h>
%End


public:

    enum OperationMode
    {
        Other, 
        Opening, 
        Saving
    };

                         KFileDialog (const QString&, const QString&, QWidget* /TransferThis/, const char*, bool);

%If ( KDE_3_1_0 -  )
                         KFileDialog (const QString&, const QString&, QWidget* /TransferThis/, const char*, bool, QWidget*);
%End

    KURL                 selectedURL () const;
    KURL::List           selectedURLs () const;
    KURL                 baseURL () const;
    QString              selectedFile () const;
    QStringList          selectedFiles () const;
    void                 setURL (const KURL&, bool = 1);
    void                 setSelection (const QString&);
    void                 setOperationMode (KFileDialog::OperationMode);
    KFileDialog::OperationMode operationMode () const;
    void                 setKeepLocation (bool);
    bool                 keepsLocation () const;
    void                 setFilter (const QString&);
    QString              currentFilter () const;
    void                 setFilterMimeType (const QString&, const KMimeType::List&, const KMimeType::Ptr&);
    KMimeType::Ptr       currentFilterMimeType ();
    void                 setMimeFilter (const QStringList&, const QString& = QString ::null );
    QString              currentMimeFilter () const;
    void                 clearFilter ();
    void                 setPreviewWidget (const QWidget*);
    void                 setPreviewWidget (const KPreviewWidgetBase*);
    static QString       getOpenFileName (const QString& = QString ::null , const QString& = QString ::null , QWidget* /Transfer/ = 0, const QString& = QString ::null );

%If ( KDE_3_4_0 -  )
    static QString       getOpenFileNameWId (const QString&, const QString&, WId, const QString&);
%End

    static QStringList   getOpenFileNames (const QString& = QString ::null , const QString& = QString ::null , QWidget* /Transfer/ = 0, const QString& = QString ::null );
    static KURL          getOpenURL (const QString& = QString ::null , const QString& = QString ::null , QWidget* /Transfer/ = 0, const QString& = QString ::null );
    static KURL::List    getOpenURLs (const QString& = QString ::null , const QString& = QString ::null , QWidget* /Transfer/ = 0, const QString& = QString ::null );
    static QString       getSaveFileName (const QString& = QString ::null , const QString& = QString ::null , QWidget* /Transfer/ = 0, const QString& = QString ::null );

%If ( KDE_3_4_0 -  )
    static QString       getSaveFileNameWId (const QString&, const QString&, WId, const QString&);
%End

    static KURL          getSaveURL (const QString& = QString ::null , const QString& = QString ::null , QWidget* /Transfer/ = 0, const QString& = QString ::null );
    static QString       getExistingDirectory (const QString& = QString ::null , QWidget* /Transfer/ = 0, const QString& = QString ::null );

%If ( KDE_3_1_0 -  )
    static KURL          getExistingURL (const QString& = QString ::null , QWidget* /Transfer/ = 0, const QString& = QString ::null );
%End

    static KURL          getImageOpenURL (const QString& = QString ::null , QWidget* /Transfer/ = 0, const QString& = QString ::null );
    virtual void         show ();
    void                 setMode (KFile::Mode);
    void                 setMode (uint);
    KFile::Mode          mode () const;
    void                 setLocationLabel (const QString&);
    KToolBar*            toolBar () const;
    KPushButton*         okButton () const;
    KPushButton*         cancelButton () const;

%If ( KDE_3_2_0 -  )
    KURLBar*             speedBar ();
%End

    KActionCollection*   actionCollection () const;

%If ( KDE_3_1_0 -  )
    int                  pathComboIndex ();
    static KURL          getStartURL (const QString&, QString&);

%If ( KDE_3_2_0 -  )
    static void          setStartDir (const KURL&);
%End

%End


signals:
    void                 fileSelected (const QString&);
    void                 fileHighlighted (const QString&);
    void                 selectionChanged ();
    void                 filterChanged (const QString&);

protected:

%If ( KDE_3_2_0 -  )
    virtual void         keyPressEvent (QKeyEvent*);
%End


%If ( KDE_3_1_0 -  )
    void                 init (const QString&, const QString&, QWidget*);
%End

    virtual void         initGUI ();
    void                 multiSelectionChanged ();
    virtual void         readConfig (KConfig*, const QString& = QString ::null );
    virtual void         writeConfig (KConfig*, const QString& = QString ::null );
    virtual void         readRecentFiles (KConfig*);
    virtual void         saveRecentFiles (KConfig*);
    KURL::List           tokenize (const QString&) const;

%If ( KDE_3_2_0 -  )
    KURL                 getCompleteURL (const QString&);
    QString              currentFilterExtension ();
    void                 updateAutoSelectExtension ();
%End


protected slots:
    void                 urlEntered (const KURL&);
    void                 enterURL (const KURL&);
    void                 enterURL (const QString&);
    void                 locationActivated (const QString&);
    void                 toolbarCallback (int);
    void                 pathComboChanged (const QString&);
    void                 dirCompletion (const QString&);
    void                 slotFilterChanged ();
    void                 fileHighlighted (const KFileItem*);
    void                 fileSelected (const KFileItem*);
    void                 slotStatResult (KIO::Job*);
    void                 slotLoadingFinished ();
    void                 fileCompletion (const QString&);

%If ( KDE_3_1_0 -  )
    void                 toggleSpeedbar (bool);

%If ( KDE_3_4_0 -  )
    void                 toggleBookmarks (bool);
%End

%End

    virtual void         updateStatusLine (int, int);
    virtual void         slotOk ();
    virtual void         accept ();
    virtual void         slotCancel ();

%If ( KDE_3_2_0 -  )
    void                 slotAutoSelectExtClicked ();
%End

    void                 addToRecentDocuments ();

%If ( KDE_3_1_0 -  )
    void                 initSpeedbar ();
%End


private:
                         KFileDialog (const KFileDialog&);

protected:
    KURL::List&          parseSelectedURLs () const;

protected:
//igx     virtual void         virtual_hook (int, void*);

protected:

%If (  - KDE_3_2_0 )
//ig     void                 addDirEntry (KFileItem*, bool);
%End


};  // class KFileDialog