//
//     Copyright 2008 Jim Bublitz <jbublitz@nwinternet.com>
//     Earlier copyrights 1998 - 2007 Jim Bublitz also apply

//                 Generated by twine

// This file is part of PyKDE4.

// PyKDE4 is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of
// the License, or (at your option) any later version.

// PyKDE4 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 program.  If not, see <http://www.gnu.org/licenses/>.



class KDirOperator : QWidget
{
%TypeHeaderCode
#include <kdiroperator.h>
%End


public:

    enum ActionType
    {
        SortActions,
        ViewActions,
        NavActions,
        FileActions,
        AllActions
    };

    explicit                KDirOperator (const KUrl& urlName = KUrl(), QWidget* parent /TransferThis/ = 0);
    virtual void            setShowHiddenFiles (bool s);
    bool                    showHiddenFiles () const;
    void                    close ();
    void                    setNameFilter (const QString& filter);
    QString                 nameFilter () const;
    void                    setMimeFilter (const QStringList& mimetypes);
    QStringList             mimeFilter () const;
    void                    clearFilter ();
    KUrl                    url () const;
    virtual void            setUrl (const KUrl& url, bool clearforward);
    void                    setCurrentItem (const QString& url);
    void                    setCurrentItem (const KFileItem& item);
    void                    setCurrentItems (const QStringList& urls);
    void                    setCurrentItems (const KFileItemList& items);
    virtual void            setView (QAbstractItemView* view);
    QAbstractItemView*      view () const;
    virtual void            setView (KFile::FileView viewKind);
    void                    setSorting (QDir::SortFlags);
    QDir::SortFlags         sorting () const;
    bool                    isRoot () const;
    KDirLister*             dirLister () const;
    QProgressBar*           progressBar () const;
    virtual void            setMode (KFile::Modes m);
    KFile::Modes            mode () const;
    virtual void            setPreviewWidget (KPreviewWidgetBase* w);
    KFileItemList           selectedItems () const;
    bool                    isSelected (const KFileItem& item) const;
    int                     numDirs () const;
    int                     numFiles () const;
    KCompletion*            completionObject () const;
    KCompletion*            dirCompletionObject () const;
    KActionCollection*      actionCollection () const;
    virtual void            setViewConfig (KConfigGroup& configGroup);
    KConfigGroup*           viewConfigGroup () const;
    virtual void            readConfig (const KConfigGroup& configGroup);
    virtual void            writeConfig (KConfigGroup& configGroup);
    void                    setOnlyDoubleClickSelectsFiles (bool enable);
    bool                    onlyDoubleClickSelectsFiles () const;
    virtual bool            mkdir (const QString& directory, bool enterDirectory = 1);
    virtual KIO::DeleteJob*  del (const KFileItemList& items, QWidget* parent /Transfer/ = 0, bool ask = 1, bool showProgress = 1) /PyName=del_/;
    void                    clearHistory ();
    virtual void            setEnableDirHighlighting (bool enable);
    bool                    dirHighlighting () const;
    bool                    dirOnlyMode () const;
    static bool             dirOnlyMode (uint mode);
    void                    setupMenu (int whichActions);
    virtual void            setAcceptDrops (bool b);
    virtual void            setDropOptions (int options);
    virtual KIO::CopyJob*   trash (const KFileItemList& items, QWidget* parent /Transfer/, bool ask = 1, bool showProgress = 1);
    KFilePreviewGenerator*  previewGenerator () const;
    void                    setInlinePreviewShown (bool show);
    QStyleOptionViewItem::Position  decorationPosition () const;
    void                    setDecorationPosition (QStyleOptionViewItem::Position position);
    bool                    isInlinePreviewShown () const;
    int                     iconsZoom () const;
    void                    setIsSaving (bool isSaving);
    bool                    isSaving () const;

protected:
    virtual QAbstractItemView*  createView (QWidget* parent /Transfer/, KFile::FileView viewKind);
    virtual void            setDirLister (KDirLister* lister);
    virtual void            resizeEvent (QResizeEvent* event);
    void                    setupActions ();
    void                    updateSortActions ();
    void                    updateViewActions ();
    void                    setupMenu ();
    void                    prepareCompletionObjects ();
    bool                    checkPreviewSupport ();
    virtual void            activatedMenu (const KFileItem& item, const QPoint& pos);
    virtual void            changeEvent (QEvent* event);
    virtual bool            eventFilter (QObject* watched, QEvent* event);

public:
    virtual void            back ();
    virtual void            forward ();
    virtual void            home ();
    virtual void            cdUp ();
    void                    updateDir ();
    virtual void            rereadDir ();
    virtual void            mkdir ();
    virtual void            deleteSelected ();
    void                    updateSelectionDependentActions ();
    QString                 makeCompletion (const QString&);
    QString                 makeDirCompletion (const QString&);
    virtual void            trashSelected ();
    void                    setIconsZoom (int value);

protected:
    void                    resetCursor ();
    void                    pathChanged ();
    virtual void            selectDir (const KFileItem& item);
    void                    selectFile (const KFileItem& item);
    void                    highlightFile (const KFileItem& item);
    void                    sortByName ();
    void                    sortBySize ();
    void                    sortByDate ();
    void                    sortByType ();
    void                    sortReversed ();
    void                    toggleDirsFirst ();
    void                    toggleIgnoreCase ();
    void                    slotCompletionMatch (const QString& match);

signals:
    void                    urlEntered (const KUrl&);
    void                    updateInformation (int files, int dirs);
    void                    completion (const QString&);
    void                    finishedLoading ();
    void                    viewChanged (QAbstractItemView* newView);
    void                    fileHighlighted (const KFileItem& item);
    void                    dirActivated (const KFileItem& item);
    void                    fileSelected (const KFileItem& item);
    void                    dropped (const KFileItem& item, QDropEvent* event, const KUrl::List& urls);
    void                    contextMenuAboutToShow (const KFileItem& item, QMenu* menu);
    void                    currentIconSizeChanged (int size);

public:
//ig    KFile::FileView         viewKind () const;
};   // KDirOperator


