kio Library API Documentation

kopenwith.h

00001 // "$Id: kopenwith.h,v 1.25 2002/09/28 14:00:59 tjansen Exp $"
00002 /* This file is part of the KDE libraries
00003     Copyright (C) 2000 David Faure <faure@kde.org>
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Library General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Library General Public License for more details.
00014 
00015     You should have received a copy of the GNU Library General Public License
00016     along with this library; see the file COPYING.LIB.  If not, write to
00017     the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00018     Boston, MA 02111-1307, USA.
00019 */
00020 #ifndef __open_with_h__
00021 #define __open_with_h__
00022 
00023 #include <qdialog.h>
00024 
00025 #include <kurl.h>
00026 #include <krun.h>
00027 
00028 #include <kservice.h>
00029 
00030 class KApplicationTree;
00031 class KURLRequester;
00032 
00033 class QWidget;
00034 class QCheckBox;
00035 class QPushButton;
00036 class QLabel;
00037 
00038 
00039 /* ------------------------------------------------------------------------- */
00040 
00047 class KOpenWithDlg : public QDialog
00048 {
00049     Q_OBJECT
00050 public:
00051 
00060     KOpenWithDlg( const KURL::List& urls, QWidget *parent = 0L );
00061 
00071     KOpenWithDlg( const KURL::List& urls, const QString& text, const QString& value, QWidget *parent = 0L );
00072 
00081     KOpenWithDlg( const QString& serviceType, const QString& value, QWidget *parent = 0L );
00082 
00090     KOpenWithDlg( QWidget *parent = 0L );
00091 
00095     ~KOpenWithDlg();
00096 
00100     QString text() const;
00105     KService::Ptr service() const { return m_pService; }
00106 
00107 public slots:
00111     void slotClear();
00112     void slotSelected( const QString&_name, const QString& _exec );
00113     void slotHighlighted( const QString& _name, const QString& _exec );
00114     void slotTextChanged();
00115     void slotTerminalToggled(bool);
00116     void slotDbClick();
00117     void slotOK();
00118 
00119 protected slots:
00123     virtual void accept();
00124     
00125 protected:
00126 
00130     void setServiceType( const KURL::List& _urls );
00131 
00139     void init( const QString& text, const QString& value );
00140 
00141     KURLRequester * edit;
00142     QString m_command;
00143 
00144     KApplicationTree* m_pTree;
00145     QLabel *label;
00146 
00147     QString qName, qServiceType;
00148     bool m_terminaldirty;
00149     QCheckBox   *terminal, *remember;
00150     QPushButton *ok;
00151     QPushButton *clear;
00152     QPushButton *cancel;
00153 
00154     KService::Ptr m_pService;
00155 
00156     class KOpenWithDlgPrivate;
00157     KOpenWithDlgPrivate *d;
00158 };
00159 
00160 /* ------------------------------------------------------------------------- */
00161 
00162 #ifndef KDE_NO_COMPAT
00163 
00174 class KFileOpenWithHandler : public KOpenWithHandler
00175 {
00176 public:
00177   KFileOpenWithHandler() : KOpenWithHandler() {}
00178   virtual ~KFileOpenWithHandler() {}
00179 
00184   virtual bool displayOpenWithDialog( const KURL::List& urls );
00185 };
00186 #endif
00187 
00188 
00189 /* ------------------------------------------------------------------------- */
00190 
00191 #endif
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.0.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Oct 8 12:21:31 2003 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2001