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

tdecore

  • tdecore
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 <tdeapplication.h>
21#include <tdestandarddirs.h>
22#include <tdelocale.h>
23#include <kurl.h>
24
25#include "kcheckaccelerators.h"
26#include "tdeappdcopinterface.h"
27
28#include <qassistantclient.h>
29#include <tqdir.h>
30
31#include "windows.h"
32#include "shellapi.h"
33
43void TDEApplication_init_windows(bool /*GUIenabled*/)
44{
45 TQString qt_transl_file = ::locate( "locale", TDEGlobal::locale()->language()
46 + "/LC_MESSAGES/qt_" + TDEGlobal::locale()->language() + ".qm" );
47 QTranslator *qt_transl = new QTranslator();
48 if (qt_transl->load( qt_transl_file, ""))
49 tdeApp->installTranslator( qt_transl );
50 else
51 delete qt_transl;
52}
53
54//unsafe; create tdeapplication_p.h instead!
55typedef void* IceIOErrorHandler;
56
57class TDEApplicationPrivate
58{
59public:
60 TDEApplicationPrivate();
61 ~TDEApplicationPrivate();
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 TDEAppDCOPInterface *m_TDEAppDCOPInterface;
73 bool session_save;
74 QAssistantClient* qassistantclient;
75};
76
77void TDEApplication::invokeHelp( const TQString& anchor,
78 const TQString& _appname, const TQCString& startup_id ) const
79{
80 if (!d->qassistantclient) {
81 d->qassistantclient = new QAssistantClient(
82 TDEStandardDirs::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
93void TDEApplication::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
100void TDEApplication::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:128
KURL::encode_string
static TQString encode_string(const TQString &str, int encoding_hint=0)
Encodes a string for use in URLs.
Definition: kurl.cpp:2106
KURL::setQuery
void setQuery(const TQString &_txt, int encoding_hint=0)
Sets the encoded query of the URL.
Definition: kurl.cpp:2047
KURL::addQueryItem
void addQueryItem(const TQString &_item, const TQString &_value, int encoding_hint=0)
Adds an additional query item.
Definition: kurl.cpp:2259
KURL::url
TQString url(int _trailing=0, int encoding_hint=0) const
Returns the URL as string, with all escape sequences intact, encoded in a given charset.
Definition: kurl.cpp:1499
TDEAppDCOPInterface
This is the main interface to the TDEApplication.
Definition: tdeappdcopinterface.h:38
TDEApplication::invokeBrowser
void invokeBrowser(const TQString &url, const TQCString &startup_id)
Invokes the standard browser.
Definition: kapplication_win.cpp:93
TDEApplication::invokeMailer
void invokeMailer(const TQString &address, const TQString &subject, const TQCString &startup_id)
Convenience method; invokes the standard email application.
Definition: tdeapplication.cpp:2734
TDEApplication::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_win.cpp:77
TDEGlobal::locale
static TDELocale * locale()
Returns the global locale object.
Definition: tdeglobal.cpp:108
TDEStandardDirs::findExe
static TQString findExe(const TQString &appname, const TQString &pathstr=TQString::null, bool ignoreExecBit=false)
Finds the executable in the system path.
Definition: tdestandarddirs.cpp:932
TDEStandardDirs::locate
TQString locate(const char *type, const TQString &filename, const TDEInstance *instance=TDEGlobal::instance())
Definition: tdestandarddirs.cpp:1689
tdelocale.h

tdecore

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

tdecore

Skip menu "tdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdecore by doxygen 1.9.4
This website is maintained by Timothy Pearson.