KDECore
ktoolinvocation_win.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include "ktoolinvocation.h"
00022 #include <config.h>
00023
00024 #include "kmessage.h"
00025 #include "klocale.h"
00026 #include "kurl.h"
00027
00028 #include <QProcess>
00029 #include <QtCore/QCoreApplication>
00030 #include <QtCore/QHash>
00031 #include <QtDBus/QtDBus>
00032
00033 #include "windows.h"
00034 #include "shellapi.h"
00035
00036
00037 void KToolInvocation::invokeBrowser( const QString &url, const QByteArray& startup_id )
00038 {
00039 QString sOpen( "open" );
00040 ShellExecuteW(0, ( LPCWSTR )sOpen.utf16(), ( LPCWSTR )url.utf16(), 0, 0, SW_NORMAL);
00041 }
00042
00043 void KToolInvocation::invokeMailer(const QString &_to, const QString &_cc, const QString &_bcc,
00044 const QString &subject, const QString &body,
00045 const QString & , const QStringList &attachURLs,
00046 const QByteArray& startup_id )
00047 {
00048 KUrl url("mailto:"+_to);
00049 url.setQuery("?subject="+subject);
00050 url.addQueryItem("cc", _cc);
00051 url.addQueryItem("bcc", _bcc);
00052 url.addQueryItem("body", body);
00053 foreach (const QString& attachURL, attachURLs)
00054 url.addQueryItem("attach", QLatin1String( KUrl::toPercentEncoding(attachURL) ));
00055
00056 QString sOpen( "open" );
00057 ShellExecuteW(0, ( LPCWSTR )sOpen.utf16(), ( LPCWSTR )url.url().utf16(), 0, 0, SW_NORMAL);
00058 }
00059
00060 void KToolInvocation::invokeTerminal(const QString &command, const QString &workdir, const QByteArray &startup_id)
00061 {
00062
00063 }