1 /* This file is part of the KDE project
2 Copyright (C) 1998, 1999 David Faure <faure@kde.org>
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
9 This program 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 General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; see the file COPYING. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
23 #include "konqprivate_export.h"
26 #include <kparts/browserextension.h>
31 template <typename T
> class KSharedPtr
;
32 typedef KSharedPtr
<KSharedConfig
> KSharedConfigPtr
;
34 namespace KonqMisc
// TODO split into something like KonqWindowFactory or KonqWindowCreator, and KonqGlobal?
37 * Stop full-screen mode in all windows.
39 void abortFullScreenMode();
42 * Create a new window with a single view, showing @p url, using @p args
44 KonqMainWindow
* createSimpleWindow( const KUrl
&url
, const KParts::OpenUrlArguments
&args
,
45 const KParts::BrowserArguments
& browserArgs
= KParts::BrowserArguments(),
46 bool tempFile
= false);
49 * Create a new window for @p url using @p args and the appropriate profile for this URL.
50 * @param forbidUseHTML internal. True when called by "Find Files"
51 * @param openUrl If it is false, no url is opened in the new window (and the aboutpage is not shown).
52 * The url is used to guess the profile.
54 KonqMainWindow
* createNewWindow( const KUrl
&url
,
55 const KParts::OpenUrlArguments
&args
= KParts::OpenUrlArguments(),
56 const KParts::BrowserArguments
& browserArgs
= KParts::BrowserArguments(),
57 bool forbidUseHTML
= false,
58 const QStringList
&filesToSelect
= QStringList(),
59 bool tempFile
= false,
63 * Create a new window from the profile defined by @p filename and @p path.
64 * @param url an optional URL to open in this profile.
65 * @param forbidUseHTML internal. True when called by "Find Files"
66 * @param openUrl If false no url is opened
68 KonqMainWindow
* createBrowserWindowFromProfile( const QString
&path
,
69 const QString
&filename
,
70 const KUrl
&url
= KUrl(),
71 const KParts::OpenUrlArguments
&args
= KParts::OpenUrlArguments(),
72 const KParts::BrowserArguments
& browserArgs
= KParts::BrowserArguments(),
73 bool forbidUseHTML
= false,
74 const QStringList
& filesToSelect
= QStringList(),
75 bool tempFile
= false,
79 * Creates a new window from the history of a view, copies the history
80 * @param view the History is copied from this view
81 * @param steps Restore currentPos() + steps
83 KonqMainWindow
* newWindowFromHistory( KonqView
* view
, int steps
);
86 * Applies the URI filters to @p url.
88 * @p parent is used in case of a message box.
89 * @p _url to be filtered.
90 * @p _path the absolute path to append to the url before filtering it.
92 QString
konqFilteredURL( QWidget
* /*parent*/, const QString
& /*_url*/, const QString
& _path
= QString() );
95 * Name of the default profile
97 QString
defaultProfileName();
100 * Path to the default profile
102 QString
defaultProfilePath();
105 * These are some helper functions to encode/decode session filenames. The
106 * problem here is that windows doesn't like files with ':' inside.
109 QString
encodeFilename(QString filename
);
111 QString
decodeFilename(QString filename
);