konqmainwindow.h 21.3 KB
Newer Older
David Faure's avatar
David Faure committed
1
/*
2
   This file is part of the KDE project
3
   Copyright (C) 1998, 1999 Simon Hausmann <hausmann@kde.org>
4
   Copyright (C) 2000-2004 David Faure <faure@kde.org>
5

6 7 8 9
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.
10

11 12 13 14
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    General Public License for more details.
15

16 17
   You should have received a copy of the GNU General Public License
   along with this program; see the file COPYING.  If not, write to
Dirk Mueller's avatar
Dirk Mueller committed
18
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Dirk Mueller's avatar
Dirk Mueller committed
19
   Boston, MA 02110-1301, USA.
20 21
*/

David Faure's avatar
David Faure committed
22 23
#ifndef __konq_mainwindow_h__
#define __konq_mainwindow_h__
24

25 26
#include "konqprivate_export.h"

Dirk Mueller's avatar
Dirk Mueller committed
27 28 29 30 31 32
#include <QtCore/QMap>
#include <QtCore/QPointer>
#include <QtGui/QKeyEvent>
#include <QtCore/QList>
#include <QtCore/QEvent>
#include <QtGui/QLabel>
33

34
#include <kfileitem.h>
35

36
#include "konqopenurlrequest.h"
37

David Faure's avatar
David Faure committed
38
#include <kparts/mainwindow.h>
39
#include <kbookmarkmanager.h>
40
#include <kcompletion.h>
41 42
#include <kurlcompletion.h>
#include <kglobalsettings.h>
43
#include <kxmlguifactory.h>
44
#include <kxmlguiclient.h>
Aaron J. Seigo's avatar
Aaron J. Seigo committed
45
#include <kservice.h>
46 47
#include "konqcombo.h"
#include "konqframecontainer.h"
48
#include <klocalizedstring.h>
Aaron J. Seigo's avatar
Aaron J. Seigo committed
49
#include <ktogglefullscreenaction.h>
50

Alexander Kellett's avatar
Alexander Kellett committed
51
class QFile;
52
class QAction;
53
class QPixmap;
54
class KAction;
55
class KActionCollection;
56
class KActionMenu;
57
class KBookmarkMenu;
Daniel Teske's avatar
Daniel Teske committed
58
class KonqBookmarkActionMenu;
59
class KCMultiDialog;
60
class KNewMenu;
61
class KToggleAction;
62
class KonqBidiHistoryAction;
63
class KBookmarkBar;
64
class KonqView;
65
class KonqFrame;
66
class KonqFrameBase;
Doug Hanley's avatar
 
Doug Hanley committed
67
class KonqFrameContainerBase;
68
class KonqFrameContainer;
69
class KToolBarPopupAction;
70 71
class KonqLogoAction;
class KonqViewManager;
72
class ToggleViewGUIClient;
73
class KonqMainWindowIface;
74
class KonqDirPart;
75
class KonqRun;
Laurent Montel's avatar
Laurent Montel committed
76
class KUrlRequester;
77
struct HistoryEntry;
78

David Faure's avatar
David Faure committed
79 80
namespace KParts {
 class BrowserExtension;
81
 class BrowserHostExtension;
David Faure's avatar
David Faure committed
82
 class ReadOnlyPart;
Simon Hausmann's avatar
Simon Hausmann committed
83
 struct URLArgs;
Dirk Mueller's avatar
Dirk Mueller committed
84
}
85

86
class KonqExtendedBookmarkOwner;
87

88
class KONQ_TESTS_EXPORT KonqMainWindow : public KParts::MainWindow, public KonqFrameContainerBase
89 90
{
  Q_OBJECT
91 92
  Q_PROPERTY( int viewCount READ viewCount )
  Q_PROPERTY( int activeViewsCount READ activeViewsCount )
93
  Q_PROPERTY( int linkableViewsCount READ linkableViewsCount )
94 95 96 97 98
  Q_PROPERTY( QString locationBarURL READ locationBarURL )
  Q_PROPERTY( bool fullScreenMode READ fullScreenMode )
  Q_PROPERTY( QString currentTitle READ currentTitle )
  Q_PROPERTY( QString currentURL READ currentURL )
  Q_PROPERTY( bool isHTMLAllowed READ isHTMLAllowed )
99
  Q_PROPERTY( QString currentProfile READ currentProfile )
100
public:
101
  enum ComboAction { ComboClear, ComboAdd, ComboRemove };
102
  enum PageSecurity { NotCrypted, Encrypted, Mixed };
103

104
  explicit KonqMainWindow( const KUrl &initialURL = KUrl(),
105
                           const QString& xmluiFile="konqueror.rc");
106
  ~KonqMainWindow();
107

108 109

  /**
110
   * Filters the URL and calls the main openUrl method.
111
   */
112
  void openFilteredUrl( const QString & _url, KonqOpenURLRequest& _req);
113

114
  /**
115
   * Filters the URL and calls the main openUrl method.
116
   */
117
  void openFilteredUrl( const QString &_url, bool inNewTab = false, bool tempFile = false );
118

119
  /**
120
   * The main openUrl method.
121
   */
122
  void openUrl( KonqView * view, const KUrl & url,
Laurent Montel's avatar
Laurent Montel committed
123
                const QString &serviceType = QString(),
124
                KonqOpenURLRequest & req = KonqOpenURLRequest::null, bool trustedSource = false );
125 126

  /**
127
   * Called by openUrl when it knows the service type (either directly,
128 129
   * or using KonqRun)
   */
Laurent Montel's avatar
Laurent Montel committed
130
  bool openView( QString serviceType, const KUrl &_url, KonqView *childView,
131
                 KonqOpenURLRequest & req = KonqOpenURLRequest::null );
132

133

134 135
  void abortLoading();

David Faure's avatar
David Faure committed
136
    void openMultiURL( const KUrl::List& url );
137

138 139
  KonqViewManager *viewManager() const { return m_pViewManager; }

140 141 142
  // Central widget of the mainwindow, never 0L
  QWidget *mainWidget() const;

Simon Hausmann's avatar
Simon Hausmann committed
143
  virtual QWidget *createContainer( QWidget *parent, int index, const QDomElement &element, int &id );
144
  virtual void removeContainer( QWidget *container, QWidget *parent, QDomElement &element, int id );
145

146 147
  virtual void saveProperties( KConfig& config );
  virtual void readProperties( KConfig& config );
Simon Hausmann's avatar
Simon Hausmann committed
148

149 150
  void setInitialFrameName( const QString &name );

151
//  KonqMainWindowIface * dcopObject();
152 153

  void reparseConfiguration();
154

155 156 157
  void insertChildView( KonqView *childView );
  void removeChildView( KonqView *childView );
  KonqView *childView( KParts::ReadOnlyPart *view );
158
  KonqView *childView( KParts::ReadOnlyPart *callingPart, const QString &name, KParts::BrowserHostExtension **hostExtension, KParts::ReadOnlyPart **part );
159

160
  // dcop idl bug! it can't handle KonqMainWindow *&mainWindow
161
  static KonqView *findChildView( KParts::ReadOnlyPart *callingPart, const QString &name, KonqMainWindow **mainWindow, KParts::BrowserHostExtension **hostExtension, KParts::ReadOnlyPart **part );
162

163
  // Total number of views
164
  int viewCount() const { return m_mapViews.count(); }
165 166

  // Number of views not in "passive" mode
167 168
  int activeViewsCount() const;

169 170 171
  // Number of views that can be linked, i.e. not with "follow active view" behavior
  int linkableViewsCount() const;

172 173 174
  // Number of main views (non-toggle non-passive views)
  int mainViewsCount() const;

175
  typedef QMap<KParts::ReadOnlyPart *, KonqView *> MapViews;
176 177

  const MapViews & viewMap() const { return m_mapViews; }
178

179
  KonqView *currentView() const;
180

181
  KParts::ReadOnlyPart *currentPart() const;
Simon Hausmann's avatar
Simon Hausmann committed
182

183
  /** URL of current part, or URLs of selected items for directory views */
Laurent Montel's avatar
Laurent Montel committed
184
  KUrl::List currentURLs() const;
185

186 187 188
  // Only valid if there are one or two views
  KonqView * otherView( KonqView * view ) const;

189
  /// Overloaded of KMainWindow
190 191
  virtual void setCaption( const QString &caption );

192 193 194 195
  /**
   * Change URL displayed in the location bar
   */
  void setLocationBarURL( const QString &url );
196 197 198
  /**
   * Overload for convenience
   */
Laurent Montel's avatar
Laurent Montel committed
199
  void setLocationBarURL( const KUrl &url );
200 201 202 203
  /**
   * Return URL displayed in the location bar - for KonqViewManager
   */
  QString locationBarURL() const;
204
  void focusLocationBar();
David Faure's avatar
David Faure committed
205

206 207 208 209
  /**
   * Set page security related to current view
   */
  void setPageSecurity( PageSecurity );
David Faure's avatar
David Faure committed
210

Simon Hausmann's avatar
- fix  
Simon Hausmann committed
211 212
  void enableAllActions( bool enable );

213 214
  void disableActionsNoView();

215
  void updateToolBarActions( bool pendingActions = false );
216 217
  void updateOpenWithActions();
  void updateViewModeActions();
218
  void updateViewActions();
219

220 221
  bool sidebarVisible() const;

Doug Hanley's avatar
 
Doug Hanley committed
222 223
  void setShowHTML( bool b );

224 225
    void showHTML( KonqView * view, bool b, bool _activateView );

226
  bool fullScreenMode() const { return m_ptaFullScreen->isChecked(); }
227

228 229 230
  /**
   * @return the "link view" action, for checking/unchecking from KonqView
   */
Laurent Montel's avatar
Laurent Montel committed
231
  KToggleAction * linkViewAction()const { return m_paLinkView; }
232

233
  void enableAction( const char * name, bool enabled );
234
  void setActionText( const char * name, const QString& text );
235

236 237 238 239 240 241
  /**
   * The default settings "allow HTML" - the one used when creating a new view
   * Might not match the current view !
   */
  bool isHTMLAllowed() const { return m_bHTMLAllowed; }

242 243
  bool saveViewPropertiesLocally() const { return m_bSaveViewPropertiesLocally; }

Pascal Létourneau's avatar
Pascal Létourneau committed
244
  static QList<KonqMainWindow*> *mainWindowList() { return s_lstViews; }
Simon Hausmann's avatar
Simon Hausmann committed
245

246 247 248
  // public for konq_guiclients
  void viewCountChanged();

249 250 251
  // for the view manager
  void currentProfileChanged();

252 253
  // operates on all combos of all mainwindows of this instance
  // up to now adds an entry or clears all entries
254
  static void comboAction( int action, const QString& url,
255
			   const QString& senderId );
256

257
#ifndef NDEBUG
Doug Hanley's avatar
 
Doug Hanley committed
258
  void dumpViewList();
259
#endif
260

Doug Hanley's avatar
 
Doug Hanley committed
261
  // KonqFrameContainerBase implementation BEGIN
262

David Faure's avatar
David Faure committed
263 264
  virtual bool accept( KonqFrameVisitor* visitor );

Doug Hanley's avatar
 
Doug Hanley committed
265
  /**
266
   * Call this after inserting a new frame into the container.
Doug Hanley's avatar
 
Doug Hanley committed
267 268 269 270 271 272
   */
  void insertChildFrame( KonqFrameBase * frame, int index = -1 );
  /**
   * Call this before deleting one of our children.
   */
  void removeChildFrame( KonqFrameBase * frame );
273

274
  void saveConfig( KConfigGroup& config, const QString &prefix, bool saveURLs, KonqFrameBase* docContainer, int id = 0, int depth = 0 );
Doug Hanley's avatar
 
Doug Hanley committed
275 276 277 278

  void copyHistory( KonqFrameBase *other );

  void reparentFrame( QWidget* parent,
279
                      const QPoint & p );
Doug Hanley's avatar
 
Doug Hanley committed
280

281
  void setTitle( const QString &title , QWidget* sender);
282
  void setTabIcon( const KUrl &url, QWidget* sender );
283

Pascal Létourneau's avatar
Pascal Létourneau committed
284
  QWidget* asQWidget();
Doug Hanley's avatar
 
Doug Hanley committed
285 286

  void listViews( ChildViewList *viewList );
Laurent Montel's avatar
Laurent Montel committed
287
  QByteArray frameType();
Doug Hanley's avatar
 
Doug Hanley committed
288

Laurent Montel's avatar
Laurent Montel committed
289
  KonqFrameBase* childFrame()const;
290

Doug Hanley's avatar
 
Doug Hanley committed
291 292 293
  void setActiveChild( KonqFrameBase* activeChild );

  // KonqFrameContainerBase implementation END
294

Laurent Montel's avatar
Laurent Montel committed
295
  KonqFrameBase* workingTab()const { return m_pWorkingTab; }
Doug Hanley's avatar
 
Doug Hanley committed
296
  void setWorkingTab( KonqFrameBase* tab ) { m_pWorkingTab = tab; }
297

298 299
  static bool isMimeTypeAssociatedWithSelf( const QString &mimeType );
  static bool isMimeTypeAssociatedWithSelf( const QString &mimeType, const KService::Ptr &offer );
300

301
  void resetWindow();
302

303 304 305 306 307
  static void setPreloadedFlag( bool preloaded );
  static bool isPreloaded() { return s_preloaded; }
  static void setPreloadedWindow( KonqMainWindow* );
  static KonqMainWindow* preloadedWindow() { return s_preloadedWindow; }

308 309
  QString currentTitle() const;
  QString currentURL() const;
Andre Magalhaes's avatar
Andre Magalhaes committed
310
  QString currentProfile() const;
311

312
  QStringList configModules() const;
313

Martin Koller's avatar
Martin Koller committed
314 315 316
  void saveWindowSize() const;
  void restoreWindowSize();

Laurent Montel's avatar
Laurent Montel committed
317
Q_SIGNALS:
318 319
  void viewAdded( KonqView *view );
  void viewRemoved( KonqView *view );
320
  void popupItemsDisturbed();
321

Laurent Montel's avatar
Laurent Montel committed
322
public Q_SLOTS:
Alexander Neundorf's avatar
 
Alexander Neundorf committed
323 324
  void slotCtrlTabPressed();

Laurent Montel's avatar
Laurent Montel committed
325 326 327
  void slotPopupMenu( const QPoint &_global, const KUrl &_url, const QString &_mimeType, mode_t mode );
  void slotPopupMenu( KXMLGUIClient *client, const QPoint &_global, const KUrl &_url, const QString &_mimeType, mode_t mode );
  void slotPopupMenu( KXMLGUIClient *client, const QPoint &_global, const KUrl &_url, const KParts::URLArgs &_args, KParts::BrowserExtension::PopupFlags f, mode_t mode );
328

329 330
  void slotPopupMenu( const QPoint &_global, const KFileItemList &_items );
  void slotPopupMenu( KXMLGUIClient *client, const QPoint &_global, const KFileItemList &_items );
331
  void slotPopupMenu( KXMLGUIClient *client, const QPoint &_global, const KFileItemList &_items, const KParts::URLArgs &_args, KParts::BrowserExtension::PopupFlags _flags );
332

333

334
  void slotPopupMenu( KXMLGUIClient *client, const QPoint &_global, const KFileItemList &_items, const KParts::URLArgs &_args, KParts::BrowserExtension::PopupFlags f, bool showProperties );
335

336 337 338
  /**
   * __NEEEEVER__ call this method directly. It relies on sender() (the part)
   */
Laurent Montel's avatar
Laurent Montel committed
339
  void slotOpenURLRequest( const KUrl &url, const KParts::URLArgs &args );
340

341
  void openUrl( KonqView *childView, const KUrl &url, const KParts::URLArgs &args );
342

Laurent Montel's avatar
Laurent Montel committed
343 344
  void slotCreateNewWindow( const KUrl &url, const KParts::URLArgs &args );
  void slotCreateNewWindow( const KUrl &url, const KParts::URLArgs &args,
345
                            const KParts::WindowArgs &windowArgs, KParts::ReadOnlyPart *&part );
346 347 348

  void slotNewWindow();
  void slotDuplicateWindow();
349 350
  void slotSendURL();
  void slotSendFile();
351 352
  void slotCopyFiles();
  void slotMoveFiles();
353
  void slotNewDir();
354 355 356 357 358 359 360 361
  void slotOpenTerminal();
  void slotOpenLocation();
  void slotToolFind();

  // View menu
  void slotViewModeToggle( bool toggle );
  void slotShowHTML();
  void slotLockView();
362
  void slotLinkView();
363
  void slotReload( KonqView* view = 0L );
364 365 366 367
  void slotStop();

  // Go menu
  void slotUp();
368
  void slotUp(Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
369
  void slotUpDelayed();
370
  void slotBack();
371
  void slotBack(Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
372
  void slotForward();
373
  void slotForward(Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
374
  void slotHome();
375
  void slotHome(Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
376
  void slotGoSystem();
377
  void slotGoApplications();
378
  void slotGoMedia();
379
  void slotGoNetworkFolders();
380
  void slotGoSettings();
381 382 383
  void slotGoDirTree();
  void slotGoTrash();
  void slotGoAutostart();
384
  void slotGoHistory();
385

386
  void slotConfigure();
387
  void slotConfigureToolbars();
388 389
  void slotConfigureExtensions();
  void slotConfigureSpellChecking();
390
  void slotNewToolbarConfig();
391

Simon Hausmann's avatar
- undo  
Simon Hausmann committed
392 393
  void slotUndoAvailable( bool avail );

394 395 396 397 398 399 400
  void slotPartChanged( KonqView *childView, KParts::ReadOnlyPart *oldPart, KParts::ReadOnlyPart *newPart );

  void slotRunFinished();

  // reimplement from KParts::MainWindow
  virtual void slotSetStatusBarText( const QString &text );

401
  // public for KonqViewManager
402
  void slotPartActivated( KParts::Part *part );
403

404
  virtual void setIcon( const QPixmap& );
405
  void slotGoHistoryActivated( int steps );
406
  void slotGoHistoryActivated( int steps, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers );
407

408
  void slotAddTab();
409 410
  void slotSplitViewHorizontal();
  void slotSplitViewVertical();
411

Laurent Montel's avatar
Laurent Montel committed
412
protected Q_SLOTS:
413
  void slotViewCompleted( KonqView * view );
414

415
  void slotURLEntered( const QString &text, int );
416

417
  void slotFileNewAboutToShow();
418
  void slotLocationLabelActivated();
419

Doug Hanley's avatar
 
Doug Hanley committed
420 421
  void slotDuplicateTab();
  void slotDuplicateTabPopup();
Maks Orlovich's avatar
 
Maks Orlovich committed
422

Doug Hanley's avatar
 
Doug Hanley committed
423 424
  void slotBreakOffTab();
  void slotBreakOffTabPopup();
Maks Orlovich's avatar
 
Maks Orlovich committed
425 426
  void slotBreakOffTabPopupDelayed();

427
  void slotPopupNewWindow();
428
  void slotPopupThisWindow();
Doug Hanley's avatar
 
Doug Hanley committed
429
  void slotPopupNewTab();
430
  void slotPopupPasteTo();
431
  void slotRemoveView();
Maks Orlovich's avatar
 
Maks Orlovich committed
432

433
  void slotRemoveOtherTabsPopup();
Maks Orlovich's avatar
 
Maks Orlovich committed
434 435
  void slotRemoveOtherTabsPopupDelayed();

436
  void slotReloadPopup();
Maks Orlovich's avatar
 
Maks Orlovich committed
437
  void slotReloadAllTabs();
Doug Hanley's avatar
 
Doug Hanley committed
438 439
  void slotRemoveTab();
  void slotRemoveTabPopup();
Maks Orlovich's avatar
 
Maks Orlovich committed
440 441
  void slotRemoveTabPopupDelayed();

442 443
  void slotActivateNextTab();
  void slotActivatePrevTab();
444
  void slotActivateTab();
Stephan Binner's avatar
 
Stephan Binner committed
445

Doug Hanley's avatar
 
Doug Hanley committed
446
  void slotDumpDebugInfo();
447

448
  void slotSaveViewProfile();
449
  void slotSaveViewPropertiesLocally();
450
  void slotRemoveLocalProperties();
451

452
  void slotOpenEmbedded();
453 454 455 456
  void slotOpenEmbeddedDoIt();

  // Connected to KSycoca
  void slotDatabaseChanged();
457

Waldo Bastian's avatar
Waldo Bastian committed
458 459
  // Connected to KApp
  void slotReconfigure();
460

461
  void slotForceSaveMainWindowSettings();
462

463 464
  void slotOpenWith();

465
  void slotGoMenuAboutToShow();
466 467 468
  void slotUpAboutToShow();
  void slotBackAboutToShow();
  void slotForwardAboutToShow();
469

470 471 472
  void slotUpActivated( int id );
  void slotBackActivated( int id );
  void slotForwardActivated( int id );
473
  void slotGoHistoryDelayed();
474

475 476
  void slotCompletionModeChanged( KGlobalSettings::Completion );
  void slotMakeCompletion( const QString& );
Carsten Pfeiffer's avatar
Carsten Pfeiffer committed
477
  void slotSubstringcompletion( const QString& );
478
  void slotRotation( KCompletionBase::KeyBindingType );
479
  void slotMatch( const QString& );
480 481
  void slotClearHistory();
  void slotClearComboHistory();
482

483
  void slotClipboardDataChanged();
484
  void slotCheckComboSelection();
485

Simon Hausmann's avatar
Simon Hausmann committed
486 487
  void slotShowMenuBar();

Laurent Montel's avatar
Laurent Montel committed
488
  void slotOpenURL( const KUrl& );
489

490
  void slotFindOpen( KonqDirPart * dirPart );
491 492
  void slotFindClosed( KonqDirPart * dirPart );

493
  void slotIconsChanged();
494

495
  virtual bool event( QEvent* );
496

497 498
  void slotMoveTabLeft();
  void slotMoveTabRight();
499

Laurent Montel's avatar
Laurent Montel committed
500
  void slotAddWebSideBar(const KUrl& url, const QString& name);
501

502 503
  void slotUpdateFullScreen( bool set ); // do not call directly

504
protected:
505
  virtual bool eventFilter(QObject*obj,QEvent *ev);
506

507 508 509 510
  /**
   * Reimplemented for internal reasons. The API is not affected.
   */
  virtual void showEvent(QShowEvent *event);
511

Pascal Létourneau's avatar
Pascal Létourneau committed
512
  void fillHistoryPopup( QMenu *menu, const QList<HistoryEntry*> &history );
513

Laurent Montel's avatar
Laurent Montel committed
514
  bool makeViewsFollow( const KUrl & url, const KParts::URLArgs &args, const QString & serviceType,
515
                        KonqView * senderView );
516

517
  void applyKonqMainWindowSettings();
518

Doug Hanley's avatar
 
Doug Hanley committed
519
  void saveToolBarServicesMap();
520

521 522
  void viewsChanged();

523 524
  void updateLocalPropsActions();

525
  virtual void closeEvent( QCloseEvent * );
526
  virtual bool queryExit();
527

528
  bool askForTarget(const KLocalizedString& text, KUrl& url);
529

Laurent Montel's avatar
Laurent Montel committed
530
private Q_SLOTS:
531 532
  void slotUndoTextChanged(const QString& newText);

Laurent Montel's avatar
Laurent Montel committed
533
  void slotRequesterClicked( KUrlRequester * );
534
  void slotIntro();
535
  void slotItemsRemoved(const KFileItemList &);
536 537 538 539 540
  /**
   * Loads the url displayed currently in the lineedit of the locationbar, by
   * emulating a enter key press event.
   */
  void goURL();
541

542
  void bookmarksIntoCompletion();
Carsten Pfeiffer's avatar
Carsten Pfeiffer committed
543 544

  void initBookmarkBar();
545
  void slotTrashActivated( Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers );
546

547 548
  void showPageSecurity();

549
private:
Laurent Montel's avatar
Laurent Montel committed
550
  QString detectNameFilter( KUrl & url );
551

552 553 554 555 556
  /**
   * takes care of hiding the bookmarkbar and calling setChecked( false ) on the
   * corresponding action
   */
  void updateBookmarkBar();
557

558 559 560
  /**
   * Adds all children of @p group to the static completion object
   */
561
  static void bookmarksIntoCompletion( const KBookmarkGroup& group );
562

563 564 565 566 567 568
  /**
   * Returns all matches of the url-history for @p s. If there are no direct
   * matches, it will try completing with http:// prepended, and if there's
   * still no match, then http://www. Due to that, this is only usable for
   * popupcompletion and not for manual or auto-completion.
   */
Laurent Montel's avatar
Laurent Montel committed
569
  static QStringList historyPopupCompletionItems( const QString& s = QString());
570

571 572
  void startAnimation();
  void stopAnimation();
573

Laurent Montel's avatar
Laurent Montel committed
574
  void setUpEnabled( const KUrl &url );
575

576
  void initCombo();
577
  void initActions();
578

579
  void popupNewTab(bool infront, bool openAfterCurrentPage);
Alexander Kellett's avatar
Alexander Kellett committed
580

581
  /**
582
   * Tries to find a index.html (.kde.html) file in the specified directory
583
   */
584
  static QString findIndexFile( const QString &directory );
585

586
  void connectExtension( KParts::BrowserExtension *ext );
David Faure's avatar
David Faure committed
587
  void disconnectExtension( KParts::BrowserExtension *ext );
588

589 590
  void plugViewModeActions();
  void unplugViewModeActions();
591
  static QString viewModeActionKey( KService::Ptr service );
592

593 594
  bool stayPreloaded();
  bool checkPreloadResourceUsage();
595

596
  QObject* lastFrame( KonqView *view );
597

598 599
private: // members

600
  KNewMenu * m_pMenuNew;
601

602
  QAction *m_paPrint;
603

Daniel Teske's avatar
Daniel Teske committed
604
  KonqBookmarkActionMenu *m_pamBookmarks;
605

606 607 608
  KToolBarPopupAction *m_paUp;
  KToolBarPopupAction *m_paBack;
  KToolBarPopupAction *m_paForward;
609
  QAction *m_paHome;
610

611 612
  KonqBidiHistoryAction *m_paHistory;

613
  QAction *m_paSaveViewProfile;
614
  KToggleAction *m_paSaveViewPropertiesLocally;
615
  QAction *m_paRemoveLocalProperties;
616

617 618 619 620 621 622 623 624 625 626 627 628
  QAction *m_paSplitViewHor;
  QAction *m_paSplitViewVer;
  QAction *m_paAddTab;
  QAction *m_paDuplicateTab;
  QAction *m_paBreakOffTab;
  QAction *m_paRemoveView;
  QAction *m_paRemoveTab;
  QAction *m_paRemoveOtherTabs;
  QAction *m_paActivateNextTab;
  QAction *m_paActivatePrevTab;

  QAction *m_paSaveRemoveViewProfile;
629
  KActionMenu *m_pamLoadViewProfile;
630

631
  KToggleAction *m_paLockView;
632
  KToggleAction *m_paLinkView;
633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653
  QAction *m_paReload;
  QAction *m_paReloadAllTabs;
  QAction *m_paUndo;
  QAction *m_paCut;
  QAction *m_paCopy;
  QAction *m_paPaste;
  QAction *m_paStop;
  QAction *m_paRename;

  QAction *m_paTrash;
  QAction *m_paDelete;

  QAction *m_paCopyFiles;
  QAction *m_paMoveFiles;
  QAction *m_paNewDir;

  QAction *m_paMoveTabLeft;
  QAction *m_paMoveTabRight;

  QAction *m_paConfigureExtensions;
  QAction *m_paConfigureSpellChecking;
654

655
  KonqLogoAction *m_paAnimatedLogo;
656

657
  KBookmarkBar *m_paBookmarkBar;
658

659
  KToggleAction * m_paFindFiles;
660
  KToggleAction *m_ptaUseHTML;
Simon Hausmann's avatar
Simon Hausmann committed
661

Simon Hausmann's avatar
Simon Hausmann committed
662 663 664
  KToggleAction *m_paShowMenuBar;
  KToggleAction *m_paShowS