kopenwith.h
00001 // 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., 51 Franklin Street, Fifth Floor, 00018 Boston, MA 02110-1301, USA. 00019 */ 00020 #ifndef __open_with_h__ 00021 #define __open_with_h__ 00022 00023 #include <tqdialog.h> 00024 00025 #include <kurl.h> 00026 #include <krun.h> 00027 #include <kservice.h> 00028 00029 class TDEApplicationTree; 00030 class KURLRequester; 00031 00032 class TQWidget; 00033 class TQCheckBox; 00034 class TQPushButton; 00035 class TQLabel; 00036 00037 class KOpenWithDlgPrivate; 00038 00039 /* ------------------------------------------------------------------------- */ 00046 class TDEIO_EXPORT KOpenWithDlg : public TQDialog //#TODO: Use KDialogBase for KDE4 00047 { 00048 Q_OBJECT 00049 public: 00050 00059 KOpenWithDlg( const KURL::List& urls, TQWidget *parent = 0L ); 00060 00070 KOpenWithDlg( const KURL::List& urls, const TQString& text, const TQString& value, 00071 TQWidget *parent = 0L ); 00072 00081 KOpenWithDlg( const TQString& serviceType, const TQString& value, 00082 TQWidget *parent = 0L ); 00083 00091 KOpenWithDlg( TQWidget *parent = 0L ); 00092 00096 ~KOpenWithDlg(); 00097 00101 TQString text() const; 00105 void hideNoCloseOnExit(); 00109 void hideRunInTerminal(); 00114 KService::Ptr service() const { return m_pService; } 00125 void setSaveNewApplications(bool b); 00126 00127 public slots: 00131 void slotClear(); 00132 void slotSelected( const TQString&_name, const TQString& _exec, const TQString& _desktopPath ); 00133 void slotHighlighted( const TQString& _name, const TQString& _exec, const TQString& _desktopPath ); 00134 void slotTextChanged(); 00135 void slotTerminalToggled(bool); 00136 void slotDbClick(); 00137 void slotOK(); 00138 00139 protected slots: 00143 virtual void accept(); 00144 00145 protected: 00146 00150 void setServiceType( const KURL::List& _urls ); 00151 00159 void init( const TQString& text, const TQString& value ); 00160 00161 KURLRequester * edit; 00162 TQString m_command; 00163 00164 TDEApplicationTree* m_pTree; 00165 TQLabel *label; 00166 00167 TQString qName, qServiceType; 00168 bool m_terminaldirty; 00169 TQCheckBox *terminal, *remember, *nocloseonexit; 00170 TQPushButton *UNUSED; 00171 TQPushButton *UNUSED2; 00172 00173 KService::Ptr m_pService; 00174 00175 KOpenWithDlgPrivate *d; 00176 }; 00177 00178 /* ------------------------------------------------------------------------- */ 00179 00180 #ifndef KDE_NO_COMPAT 00181 00192 class TDEIO_EXPORT_DEPRECATED KFileOpenWithHandler : public KOpenWithHandler 00193 { 00194 public: 00195 KFileOpenWithHandler() : KOpenWithHandler() {} 00196 virtual ~KFileOpenWithHandler() {} 00197 00202 virtual bool displayOpenWithDialog( const KURL::List& urls ); 00203 }; 00204 #endif 00205 00206 00207 /* ------------------------------------------------------------------------- */ 00208 00209 #endif