• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kdecore
 

kdecore

  • kdecore
kapplication_win.cpp
1 /*
2  This file is part of the KDE libraries
3  Copyright (C) 2004 Jaroslaw Staniek <js@iidea.pl>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License version 2 as published by the Free Software Foundation.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 #include <kapplication.h>
21 #include <kstandarddirs.h>
22 #include <klocale.h>
23 #include <kurl.h>
24 
25 #include "kcheckaccelerators.h"
26 #include "kappdcopiface.h"
27 
28 #include <qassistantclient.h>
29 #include <tqdir.h>
30 
31 #include "windows.h"
32 #include "shellapi.h"
33 
43 void KApplication_init_windows(bool /*GUIenabled*/)
44 {
45  TQString qt_transl_file = ::locate( "locale", KGlobal::locale()->language()
46  + "/LC_MESSAGES/qt_" + KGlobal::locale()->language() + ".qm" );
47  QTranslator *qt_transl = new QTranslator();
48  if (qt_transl->load( qt_transl_file, ""))
49  kapp->installTranslator( qt_transl );
50  else
51  delete qt_transl;
52 }
53 
54 //unsafe; create kapplication_p.h instead!
55 typedef void* IceIOErrorHandler;
56 
57 class KApplicationPrivate
58 {
59 public:
60  KApplicationPrivate();
61  ~KApplicationPrivate();
62 
63  bool actionRestrictions : 1;
64  bool guiEnabled : 1;
65  int refCount;
66  IceIOErrorHandler oldIceIOErrorHandler;
67  KCheckAccelerators* checkAccelerators;
68  TQString overrideStyle;
69  TQString geometry_arg;
70  TQCString startup_id;
71  TQTimer* app_started_timer;
72  KAppDCOPInterface *m_KAppDCOPInterface;
73  bool session_save;
74  QAssistantClient* qassistantclient;
75 };
76 
77 void KApplication::invokeHelp( const TQString& anchor,
78  const TQString& _appname, const TQCString& startup_id ) const
79 {
80  if (!d->qassistantclient) {
81  d->qassistantclient = new QAssistantClient(
82  KStandardDirs::findExe( "assistant" ), 0);
83  TQStringList args;
84  args << "-profile";
85  args << TQDir::convertSeparators( locate("html", TQString(name())+"/"+TQString(name())+".adp") );
86  d->qassistantclient->setArguments(args);
87  }
88  d->qassistantclient->openAssistant();
89 }
90 
91 // on win32, for invoking browser we're using win32 API
92 // see kapplication_win.cpp
93 void KApplication::invokeBrowser( const TQString &url, const TQCString& startup_id )
94 {
95  TQCString s = url.latin1();
96  const unsigned short *l = (const unsigned short *)s.data();
97  ShellExecuteA(0, "open", s.data(), 0, 0, SW_NORMAL);
98 }
99 
100 void KApplication::invokeMailer(const TQString &to, const TQString &cc, const TQString &bcc,
101  const TQString &subject, const TQString &body,
102  const TQString & /*messageFile TODO*/, const TQStringList &attachURLs,
103  const TQCString& startup_id )
104 {
105  KURL url("mailto:"+to);
106  url.setQuery("?subject="+subject);
107  url.addQueryItem("cc", cc);
108  url.addQueryItem("bcc", bcc);
109  url.addQueryItem("body", body);
110  for (TQStringList::ConstIterator it = attachURLs.constBegin(); it != attachURLs.constEnd(); ++it)
111  url.addQueryItem("attach", KURL::encode_string(*it));
112 
113  TQCString s = url.url().latin1();
114  const unsigned short *l = (const unsigned short *)s.data();
115  ShellExecuteA(0, "open", s.data(), 0, 0, SW_NORMAL);
116 }
117 
KURL
Represents and parses a URL.
Definition: kurl.h:127
KStandardDirs::locate
TQString locate(const char *type, const TQString &filename, const KInstance *instance=KGlobal::instance())
Definition: kstandarddirs.cpp:1689
KGlobal::locale
static KLocale * locale()
Returns the global locale object.
Definition: kglobal.cpp:88
KStandardDirs::findExe
static TQString findExe(const TQString &appname, const TQString &pathstr=TQString::null, bool ignoreExecBit=false)
Finds the executable in the system path.
Definition: kstandarddirs.cpp:932
klocale.h
KApplication::invokeBrowser
void invokeBrowser(const TQString &url, const TQCString &startup_id)
Invokes the standard browser.
Definition: kapplication.cpp:2944
KStdAction::name
const char * name(StdAction id)
KURL::encode_string
static TQString encode_string(const TQString &str, int encoding_hint=0)
Encodes a string for use in URLs.
Definition: kurl.cpp:2075
KApplication::invokeMailer
void invokeMailer(const TQString &address, const TQString &subject, const TQCString &startup_id)
Convenience method; invokes the standard email application.
Definition: kapplication.cpp:2672
KAppDCOPInterface
This is the main interface to the KApplication.
Definition: kappdcopiface.h:37
KApplication::invokeHelp
void invokeHelp(const TQString &anchor, const TQString &appname, const TQCString &startup_id) const
Invokes the KHelpCenter HTML help viewer from docbook sources.
Definition: kapplication.cpp:2598

kdecore

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

kdecore

Skip menu "kdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kdecore by doxygen 1.8.6
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |