• Skip to content
  • Skip to link menu
KDE 4.3 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KDECore

ktoolinvocation_win.cpp

Go to the documentation of this file.
00001 /*
00002    This file is part of the KDE libraries
00003    Copyright (C) 2004-2008 Jarosław Staniek <staniek@kde.org>
00004    Copyright (C) 2006 Ralf Habacker <ralf.habacker@freenet.de>
00005 
00006    This library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Library General Public
00008    License version 2 as published by the Free Software Foundation.
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 
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 & /*messageFile TODO*/, 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     //TODO
00063 }

KDECore

Skip menu "KDECore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal