File indexing completed on 2024-04-21 04:58:23
0001 /* 0002 This file is part of the KDE project 0003 SPDX-FileCopyrightText: 1998-2005 David Faure <faure@kde.org> 0004 0005 SPDX-License-Identifier: GPL-2.0-or-later 0006 */ 0007 0008 #ifndef __konq_view_h__ 0009 #define __konq_view_h__ 0010 0011 #include "konqmainwindow.h" // hmm, please move PageSecurity out of konq_mainwindow... 0012 #include "konqfactory.h" 0013 #include "konqframe.h" 0014 #include "konqutils.h" 0015 #include "kf5compat.h" //For NavigationExtension 0016 #include "browserarguments.h" 0017 0018 #include <kservice.h> 0019 #include <QMimeType> 0020 0021 #include <QList> 0022 0023 #include <QObject> 0024 #include <QStringList> 0025 #include <QPointer> 0026 #include <QEvent> 0027 0028 #include <config-konqueror.h> 0029 0030 class UrlLoader; 0031 class KonqFrame; 0032 namespace KParts 0033 { 0034 //TODO KF6: when removing compatibility with KF5, uncomment the line below 0035 //class NavigationExtension; 0036 class StatusBarExtension; 0037 } 0038 0039 #if QT_VERSION_MAJOR < 6 0040 #ifdef KActivities_FOUND 0041 namespace KActivities 0042 { 0043 class ResourceInstance; 0044 } 0045 #endif 0046 #endif 0047 0048 namespace Konq { 0049 class PlaceholderPart; 0050 } 0051 0052 // TODO: make the history-handling code reuseable (e.g. in kparts) for people who want to use a 0053 // khtml-based browser in some apps. Back/forward support is all in here currently. 0054 struct HistoryEntry { 0055 void loadItem(const KConfigGroup &config, const QString &prefix, const KonqFrameBase::Options &options); 0056 void saveConfig(KConfigGroup &config, const QString &prefix, const KonqFrameBase::Options &options); 0057 static HistoryEntry* fromDelayedLoadingData(const KConfigGroup &config, const QString &prefix, const KonqFrameBase::Options &options); 0058 0059 QUrl url; 0060 QString locationBarURL; // can be different from url when showing a index.html 0061 QString title; 0062 QByteArray buffer; 0063 QString strServiceType; 0064 QString strServiceName; 0065 QByteArray postData; 0066 QString postContentType; 0067 bool doPost; 0068 QString pageReferrer; 0069 KonqMainWindow::PageSecurity pageSecurity; 0070 bool reload; // This is used when History entry is restored from a config file 0071 }; 0072 0073 /* This class represents a child of the main view. The main view maintains 0074 * the list of children. A KonqView contains a Browser::View and 0075 * handles it. It's more or less the backend structure for the views. 0076 * The widget handling stuff is done by the KonqFrame. 0077 */ 0078 class KONQ_TESTS_EXPORT KonqView : public QObject 0079 { 0080 Q_OBJECT 0081 public: 0082 0083 /** 0084 * @brief Constructor which creates a view with a PlaceholderPart 0085 * @param viewFrame the frame which will contain the view 0086 * @param mainWindow the main window the view will belong to 0087 */ 0088 KonqView(KonqFrame *viewFrame, KonqMainWindow* mainWindow); 0089 0090 /** 0091 * Create a konqueror view with an appropriate part 0092 * @param viewFactory the factory to be used to create the part 0093 * @param viewFrame the frame where to create the view 0094 * @param mainWindow is the main window :-) 0095 * @param service the service implementing the part 0096 * @param partServiceOffers list of part offers found by the factory 0097 * @param appServiceOffers list of app offers found by the factory 0098 * @param serviceType the serviceType implemented by the part 0099 * @param passiveMode whether to initially make the view passive 0100 */ 0101 KonqView(KonqViewFactory &viewFactory, 0102 KonqFrame *viewFrame, 0103 KonqMainWindow *mainWindow, 0104 const KPluginMetaData &service, 0105 const QVector<KPluginMetaData> &partServiceOffers, 0106 const KService::List &appServiceOffers, 0107 const QString &serviceType, 0108 bool passiveMode); 0109 0110 ~KonqView() override; 0111 0112 bool isWebEngineView() const; 0113 0114 /** 0115 * Displays another URL, but without changing the view mode (caller has to 0116 * ensure that the call makes sense) 0117 * @param url the URL to open 0118 * @param locationBarURL the URL to set in the location bar (see @ref setLocationBarURL) 0119 * @param nameFilter e.g. *.cpp 0120 * @param tempFile whether to delete the file after use 0121 */ 0122 void openUrl(const QUrl &url, 0123 const QString &locationBarURL, 0124 const QString &nameFilter = QString(), 0125 bool tempFile = false, 0126 const QUrl &requestedUrl={}); 0127 0128 void duplicateView(KonqView *otherView); 0129 0130 /** 0131 * Change the part inside this view if necessary. 0132 * Contract: the caller should call stop() first. 0133 * 0134 * @param mimeType the mime type we want to show 0135 * @param serviceName allows to enforce a particular service to be chosen, 0136 * @see KonqFactory. 0137 * @param forceAutoEmbed 0138 * @param dontDeleteTemporaryFile 0139 */ 0140 bool changePart(const QString &mimeType, 0141 const QString &serviceName = QString(), 0142 bool forceAutoEmbed = false); 0143 0144 /** 0145 * Ensures that this view's part supports the given @p mimeType, 0146 * otherwise calls changePart. 0147 */ 0148 bool ensureViewSupports(const QString &mimeType, 0149 bool forceAutoEmbed); 0150 0151 /** 0152 * Call this to prevent next openUrl() call from changing history lists 0153 * Used when the same URL is reloaded (for instance with another view mode) 0154 * 0155 * Calling with lock=false is a hack reserved to the "find" feature. 0156 */ 0157 void lockHistory(bool lock = true) 0158 { 0159 m_bLockHistory = lock; 0160 } 0161 0162 /** 0163 * @return true if view can go back 0164 */ 0165 bool canGoBack() const 0166 { 0167 return m_lstHistoryIndex > 0; 0168 } 0169 0170 /** 0171 * @return true if view can go forward 0172 */ 0173 bool canGoForward() const 0174 { 0175 return m_lstHistoryIndex != m_lstHistory.count() - 1; 0176 } 0177 0178 /** 0179 * @return the position in the history 0180 */ 0181 int historyIndex() const 0182 { 0183 return m_lstHistoryIndex; 0184 } 0185 0186 int historyLength() 0187 { 0188 return m_lstHistory.count(); 0189 } 0190 0191 /** 0192 * Move in history. +1 is "forward", -1 is "back", you can guess the rest. 0193 */ 0194 void go(int steps); 0195 0196 /** 0197 * Helper function for go() and KonqViewManager 0198 */ 0199 void restoreHistory(); 0200 0201 void setHistoryIndex(int index) 0202 { 0203 m_lstHistoryIndex = index; 0204 } 0205 0206 /** 0207 * @return the history of this view 0208 */ 0209 const QList<HistoryEntry *> &history() 0210 { 0211 return m_lstHistory; 0212 } 0213 0214 /** 0215 * @return the HistoryEntry at postion @p pos 0216 */ 0217 const HistoryEntry *historyAt(int pos); 0218 0219 /** 0220 * 0221 */ 0222 HistoryEntry *currentHistoryEntry() const 0223 { 0224 return m_lstHistory.value(m_lstHistoryIndex); 0225 } 0226 0227 /** 0228 * Creates a deep copy of the @p other view's history buffers. 0229 */ 0230 void copyHistory(KonqView *other); 0231 0232 /** 0233 * Set the UrlLoader instance that is running something for this view 0234 * The main window uses this to store the UrlLoader for each child view. 0235 */ 0236 void setUrlLoader(UrlLoader *loader); 0237 0238 UrlLoader* urlLoader() const 0239 { 0240 return m_loader; 0241 } 0242 0243 /** 0244 * Stop loading 0245 */ 0246 void stop(bool keepTemporaryFile = false); 0247 0248 /** 0249 * @brief The URL the view was requested to display 0250 * 0251 * This will be the same as the part's URL except when the URL was downloaded using 0252 * a part's \link KonqInterfaces::DownloaderExtension DownloaderExtension\endlink. In this case, this will be the URL the user originally 0253 * requested, while realUrl() is the URL of the downloaded file. 0254 * 0255 * @return the URL the view was requested to display 0256 * @see realUrl() 0257 * @see KonqInterfaces::DownloaderExtension 0258 */ 0259 QUrl url() const {return m_requestedUrl;}; 0260 0261 /** 0262 * @brief The real URL displayed in the view 0263 * 0264 * If the URL represents a file which has been downloaded using a part's 0265 * \link KonqInterfaces::DownloaderExtension DownloaderExtension\endlink before being displayed, then the real URL is the local 0266 * file the URL was downloaded to. In all other cases, this is the same as url(). 0267 * @return the URL of the local file where a file was downloaded by a part's \link KonqInterfaces::DownloaderExtension DownloaderExtension\endlink 0268 * or url() if the URL wasn't downloaded using \link KonqInterfaces::DownloaderExtension DownloaderExtension\endlink 0269 * @see KonqInterfaces::DownloaderExtension 0270 */ 0271 QUrl realUrl() const; 0272 0273 QUrl upUrl() const; 0274 0275 /** 0276 * Get view's location bar URL, i.e. the one that the view signals 0277 * It can be different from url(), for instance if we display a index.html 0278 */ 0279 QString locationBarURL() const 0280 { 0281 return m_sLocationBarURL; 0282 } 0283 0284 /** 0285 * Get the URL that was typed to get the current URL. 0286 */ 0287 QString typedUrl() const 0288 { 0289 return m_sTypedURL; 0290 } 0291 /** 0292 * Set the URL that was typed to get the current URL. 0293 */ 0294 void setTypedURL(const QString &u) 0295 { 0296 m_sTypedURL = u; 0297 } 0298 0299 /** 0300 * Returns the name filter, if any, like *.txt 0301 */ 0302 QString nameFilter() const; 0303 0304 /** 0305 * Returns true if the part was modified by the user (unsaved data). 0306 */ 0307 bool isModified() const; 0308 0309 /** 0310 * Return the security state of page in view 0311 */ 0312 KonqMainWindow::PageSecurity pageSecurity() const 0313 { 0314 return m_pageSecurity; 0315 } 0316 0317 /** 0318 * @return the part embedded into this view 0319 */ 0320 KParts::ReadOnlyPart *part() const 0321 { 0322 return m_pPart; 0323 } 0324 0325 /** 0326 * see KonqViewManager::removePart 0327 */ 0328 void partDeleted() 0329 { 0330 m_pPart = nullptr; 0331 } 0332 0333 /** 0334 * Return true if the loading in the view was aborted due to an error 0335 * or to user cancellation 0336 */ 0337 bool aborted() const 0338 { 0339 return m_bAborted; 0340 } 0341 0342 KParts::NavigationExtension *browserExtension() const; 0343 0344 KParts::StatusBarExtension *statusBarExtension() const; 0345 0346 /** 0347 * @return a pointer to the KonqFrame which the view lives in 0348 */ 0349 KonqFrame *frame() const 0350 { 0351 return m_pKonqFrame; 0352 } 0353 0354 /** 0355 * @return the servicetype this view is currently displaying 0356 * This is usually a mimetype, but it can be "Browser/View" 0357 * for toggle views like the sidebar or the embedded konsole. 0358 */ 0359 QString serviceType() const 0360 { 0361 return m_serviceType; 0362 } 0363 0364 /** 0365 * The mimetype this view is currently displaying. 0366 * Can be invalid, if serviceType() is not a mimetype. 0367 */ 0368 QMimeType mimeType() const; 0369 0370 /** 0371 * @return the servicetypes this view is capable to display 0372 */ 0373 QStringList serviceTypes() const 0374 { 0375 return Konq::serviceTypes(m_service); 0376 } 0377 0378 /** 0379 * Returns true if the part used in this view would be able to display 0380 * @p mimeType too. WARNING: this often leads to showing HTML in katepart... 0381 */ 0382 bool supportsMimeType(const QString &mimeType) const; 0383 0384 //TODO: it seems to be unused. Check and remove it 0385 /** 0386 * Whether the view in this part is suitable for web browsing. 0387 * 0388 * @return @b true if the part is suitable for browsing and @b false otherwise 0389 * 0390 * @warning Unfortunately, as far as I know, there's no way to detect whether a part is 0391 * suitable for browsing. This function works by hardcoding the component names of such 0392 * parts (currently only khtml, kwebkitpart and webenginepart). If other browsing parts 0393 * will be added, the list should be changed or another way must be found. 0394 **/ 0395 bool isWebBrowsingPart() const; 0396 0397 // True if showing a directory 0398 bool showsDirectory() const; 0399 0400 // True if currently loading 0401 bool isLoading() const 0402 { 0403 return m_bLoading; 0404 } 0405 void setLoading(bool loading, bool hasPending = false); 0406 0407 // True if "locked to current location" (and their view mode, in fact) 0408 bool isLockedLocation() const 0409 { 0410 return m_bLockedLocation; 0411 } 0412 void setLockedLocation(bool b); 0413 0414 // True if can't be made active (e.g. dirtree). 0415 bool isPassiveMode() const 0416 { 0417 return m_bPassiveMode; 0418 } 0419 void setPassiveMode(bool mode); 0420 0421 // True if 'link' symbol set 0422 bool isLinkedView() const 0423 { 0424 return m_bLinkedView; 0425 } 0426 void setLinkedView(bool mode); 0427 0428 // True if toggle view 0429 void setToggleView(bool b) 0430 { 0431 m_bToggleView = b; 0432 } 0433 bool isToggleView() const 0434 { 0435 return m_bToggleView; 0436 } 0437 0438 // True if it always follows the active view 0439 void setFollowActive(bool b) 0440 { 0441 m_bFollowActive = b; 0442 } 0443 bool isFollowActive() 0444 { 0445 return m_bFollowActive; 0446 } 0447 0448 // True if locked to current view mode 0449 // Toggle views and passive views are locked to their view mode. 0450 bool isLockedViewMode() const 0451 { 0452 return m_bToggleView || m_bPassiveMode; 0453 } 0454 0455 /** 0456 * @brief Whether the view can navigate to the given URL 0457 * 0458 * The view can always navigate to @p newUrl unless it's locked and @p newUrl is different 0459 * from the current URL. If the view is following the current view, then the it can navigate to 0460 * @p newUrl only if it's the same url as that of the current view 0461 * 0462 * @param newUrl the URL the view wants to navigate to 0463 * @return `true` if the view can navigate to @p newUrl and `false` otherwise 0464 */ 0465 bool canNavigateTo(const QUrl &newUrl) const; 0466 0467 // True if "builtin" (see X-KDE-BrowserView-Built-Into) 0468 //bool isBuiltinView() const { return m_bBuiltinView; } 0469 0470 /** 0471 * The current viewmode used by this view -- only meaningful 0472 * when the part implements several view modes internally, like DolphinPart. 0473 */ 0474 QString internalViewMode() const; 0475 /** 0476 * Switch the internal view mode in this view -- only meaningful 0477 * when the part implements several view modes internally, like DolphinPart. 0478 */ 0479 void setInternalViewMode(const QString &viewMode); 0480 0481 KPluginMetaData service() const 0482 { 0483 return m_service; 0484 } 0485 0486 QString caption() const 0487 { 0488 return m_caption; 0489 } 0490 0491 QVector<KPluginMetaData> partServiceOffers() 0492 { 0493 return m_partServiceOffers; 0494 } 0495 KService::List appServiceOffers() 0496 { 0497 return m_appServiceOffers; 0498 } 0499 0500 KonqMainWindow *mainWindow() const 0501 { 0502 return m_pMainWindow; 0503 } 0504 0505 // return true if the method was found, false if the execution failed 0506 bool callExtensionMethod(const char *methodName); 0507 bool callExtensionBoolMethod(const char *methodName, bool value); 0508 bool callExtensionURLMethod(const char *methodName, const QUrl &value); 0509 0510 void setViewName(const QString &name); 0511 QString viewName() const; 0512 0513 // True to enable the context popup menu 0514 void enablePopupMenu(bool b); 0515 bool isPopupMenuEnabled() const 0516 { 0517 return m_bPopupMenuEnabled; 0518 } 0519 0520 KFileItemList selectedItems() const 0521 { 0522 return m_selectedItems; 0523 } 0524 0525 void reparseConfiguration(); 0526 0527 void disableScrolling(); 0528 0529 QString dbusObjectPath(); 0530 QString partObjectPath(); 0531 0532 // Set the KGlobal active componentData(the one used by KBugReport) 0533 void setActiveComponent(); 0534 0535 // Called before reloading this view. Sets args.reload to true, and offers to repost form data. 0536 // Returns false in case the reload must be canceled. 0537 bool prepareReload(KParts::OpenUrlArguments &args, BrowserArguments &browserArgs, bool softReload); 0538 0539 // overload for the QString version 0540 void setLocationBarURL(const QUrl &locationBarURL); 0541 0542 /** 0543 * Gives focus to the part's widget, after we just opened a URL in this part. 0544 * Does nothing on error:/ urls, so that the user can fix the wrong URL more easily. 0545 */ 0546 void setFocus(); 0547 0548 /** 0549 * Returns true if this page is showing an error page, from an error: URL. 0550 * url() will still return the original URL, so it can't be used for this purpose. 0551 */ 0552 bool isErrorUrl() const; 0553 0554 /** 0555 * Saves config in a KConfigGroup 0556 */ 0557 void saveConfig(KConfigGroup &config, const QString &prefix, const KonqFrameBase::Options &options); 0558 void loadHistoryConfig(const KConfigGroup &config, const QString &prefix); 0559 0560 /** 0561 * @brief Creates a view and load an URL according to the delayed loading data and the history content 0562 * 0563 * It does nothing if there's no delayed loading data 0564 */ 0565 void loadDelayed(); 0566 0567 /** 0568 * @brief Changes the part used to display the current url 0569 * @param newPluginId the plugin id of the new part to use 0570 * @param newInternalViewMode the new view mode for the part, if any 0571 * 0572 * If the current URL is a temporary file, according to #m_tempFile, it __won't be deleted__. This is because 0573 * we want to display the same URL, not navigate to another one. Deleting the temporary file would mean 0574 * the new part doesn't actually have a file to display. 0575 */ 0576 void switchEmbeddingPart(const QString &newPluginId, const QString &newInternalViewMode = {}); 0577 0578 /** 0579 * @brief Stores the information needed to restore the state of the view 0580 * 0581 * The history-related information is directly read in #m_lstHistory and #m_lstHistoryIndex, 0582 * while the part-specific information is stored in #m_delayedLoadingData. 0583 * 0584 * This function allows to load the content of the view only when it actually becomes visible 0585 * @param mimeType the mimetype of the URL 0586 * @param serviceName the id of the part to use 0587 * @param openUrl whether an URL should be loaded when the part will be created 0588 * @param url the URL to load when the part will be created 0589 * @param lockedLocation whether to block the URL when the view will be created 0590 * @param grp the object to read configuration options from 0591 * @param prexfix the prefix to add to configuration options names when reading from @p grp 0592 */ 0593 void storeDelayedLoadingData(const QString &mimeType, const QString &serviceName, bool openUrl, const QUrl &url, 0594 bool lockedLocation, const KConfigGroup &grp, const QString &prefix); 0595 0596 /** 0597 * @brief Whether or not loading this view has been delayed 0598 * 0599 * When this function returns `true` it means that loadDelayed() should be called next time 0600 * the tab containing this view is activated. 0601 * 0602 * @return `true` if the loading has been delayed and `false` otherwise 0603 */ 0604 bool isDelayed() const; 0605 0606 Q_SIGNALS: 0607 0608 /** 0609 * Signal the main window that the embedded part changed (e.g. because of changePart) 0610 */ 0611 void sigPartChanged(KonqView *childView, KParts::ReadOnlyPart *oldPart, KParts::ReadOnlyPart *newPart); 0612 0613 /** 0614 * Emitted in slotCompleted 0615 */ 0616 void viewCompleted(KonqView *view); 0617 0618 public Q_SLOTS: 0619 /** 0620 * Store location-bar URL in the child view 0621 * and updates the main view if this view is the current one 0622 * May be different from url. 0623 */ 0624 void setLocationBarURL(const QString &locationBarURL); 0625 /** 0626 * get an icon for the URL from the NavigationExtension 0627 */ 0628 void setIconURL(const QUrl &iconURL); 0629 0630 void setTabIcon(const QUrl &url); 0631 0632 void setCaption(const QString &caption); 0633 0634 void setPageSecurity(int); 0635 0636 // connected to the KROP's KIO::Job 0637 // but also to UrlLoader's job 0638 void slotInfoMessage(KJob *, const QString &msg); 0639 0640 private Q_SLOTS: 0641 // connected to the KROP's KIO::Job 0642 void slotStarted(KIO::Job *job); 0643 void slotCompleted(); 0644 void slotCompleted(bool); 0645 void slotCanceled(const QString &errMsg); 0646 void slotPercent(KJob *, unsigned long percent); 0647 void slotSpeed(KJob *, unsigned long bytesPerSecond); 0648 0649 //The four slots below are called in response to the several variants of the NavigationExtension::popupMenu signal. 0650 //There are four variants of this signal: two come from KParts::NavigationExtension and two from BrowserExtension, 0651 //which (as of KF6) has been moved to Konqueror. For each of them, there are two variants, one taking a KFileItemList 0652 //and one taing a QUrl. 0653 // 0654 //Since these slots need to be disconnected, we can't just use a lambda 0655 #if QT_VERSION_MAJOR > 5 0656 void slotBrowserPopupMenuFiles(const QPoint &global, 0657 const KFileItemList &items, const KParts::OpenUrlArguments &args, const BrowserArguments &bargs, 0658 KParts::NavigationExtension::PopupFlags flags, const KParts::NavigationExtension::ActionGroupMap &actionGroups); 0659 void slotBrowserPopupMenuUrl(const QPoint &global, 0660 const QUrl &url, mode_t mode, const KParts::OpenUrlArguments &arguments, const BrowserArguments &bargs, 0661 KParts::NavigationExtension::PopupFlags flags, const KParts::NavigationExtension::ActionGroupMap &actionGroups); 0662 #endif 0663 void slotPopupMenuFiles(const QPoint &global, 0664 const KFileItemList &items, const KParts::OpenUrlArguments &args, KParts::NavigationExtension::PopupFlags flags, 0665 const KParts::NavigationExtension::ActionGroupMap &actionGroups); 0666 void slotPopupMenuUrl(const QPoint &global, 0667 const QUrl &url, mode_t mode, const KParts::OpenUrlArguments &arguments, KParts::NavigationExtension::PopupFlags flags, 0668 const KParts::NavigationExtension::ActionGroupMap &actionGroups); 0669 0670 /** 0671 * Connected to the NavigationExtension 0672 */ 0673 void slotSelectionInfo(const KFileItemList &items); 0674 void slotMouseOverInfo(const KFileItem &item); 0675 void slotOpenURLNotify(); 0676 void slotEnableAction(const char *name, bool enabled); 0677 void slotSetActionText(const char *name, const QString &text); 0678 void slotMoveTopLevelWidget(int x, int y); 0679 void slotResizeTopLevelWidget(int w, int h); 0680 void slotRequestFocus(KParts::ReadOnlyPart *); 0681 0682 private: 0683 /** 0684 * Replace the current part with a new part, created by @p viewFactory. 0685 * 0686 * If the factory isn't valid and @p allowPlaceholder is `true`, a PlaceholderPart 0687 * will be created. 0688 * 0689 * @param viewFactory the factory to use to create the part 0690 * @param allowPlaceholder whether a PlaceholderPart should be used if @p viewFactory isn't valid. 0691 * If this is `false` and @p viewFactory is invalid, nothing will be done 0692 */ 0693 void switchView(KonqViewFactory &viewFactory, bool allowPlaceholder = false); 0694 0695 /** 0696 * Connects the internal part to the main window. 0697 * Do this after creating it and before inserting it. 0698 */ 0699 void connectPart(); 0700 0701 /** 0702 * Creates a new entry in the history. 0703 */ 0704 void createHistoryEntry(); 0705 0706 /** 0707 * Appends a entry in the history. 0708 */ 0709 void appendHistoryEntry(HistoryEntry *historyEntry); 0710 0711 /** 0712 * Updates the current entry in the history. 0713 * @param needsReload whether page is fully loaded 0714 * (not done in openUrl, to be able to revert if aborting) 0715 */ 0716 void updateHistoryEntry(bool needsReload); 0717 0718 void aboutToOpenURL(const QUrl &url, const KParts::OpenUrlArguments &args = KParts::OpenUrlArguments()); 0719 0720 void setPartMimeType(); 0721 0722 void finishedWithCurrentURL(); 0723 0724 bool eventFilter(QObject *obj, QEvent *e) override; 0725 0726 /** 0727 * @brief Casts the part associated with the view to a Konq::PlaceholderPart 0728 * @return the part associated with the view cast to a Konq::PlaceholderPart or `nullptr` if it's not a Konq::PlaceholderPart 0729 */ 0730 Konq::PlaceholderPart *placeholderPart() const; 0731 0732 ////////////////// private members /////////////// 0733 0734 KParts::ReadOnlyPart *m_pPart; 0735 0736 QString m_sLocationBarURL; 0737 QString m_sTypedURL; 0738 KonqMainWindow::PageSecurity m_pageSecurity; 0739 KFileItemList m_selectedItems; 0740 0741 /** 0742 * The full history (back + current + forward) 0743 */ 0744 QList<HistoryEntry *> m_lstHistory; 0745 /** 0746 * The current position in the history 0747 */ 0748 int m_lstHistoryIndex; 0749 0750 /** 0751 * The post data that _resulted_ in this page. 0752 * e.g. when submitting a form, and the result is an image, this data will be 0753 * set (and saved/restored) when the image is being viewed. Necessary for reload. 0754 */ 0755 QByteArray m_postData; 0756 QString m_postContentType; 0757 bool m_doPost; 0758 0759 /** 0760 * The referrer that was used to obtain this page. 0761 */ 0762 QString m_pageReferrer; 0763 0764 KonqMainWindow *m_pMainWindow; 0765 UrlLoader *m_loader = nullptr; 0766 KonqFrame *m_pKonqFrame; 0767 0768 uint m_bLoading: 1; 0769 uint m_bLockedLocation: 1; 0770 uint m_bPassiveMode: 1; 0771 uint m_bLinkedView: 1; 0772 uint m_bToggleView: 1; 0773 uint m_bLockHistory: 1; 0774 uint m_bAborted: 1; 0775 uint m_bGotIconURL: 1; 0776 uint m_bPopupMenuEnabled: 1; 0777 uint m_bFollowActive: 1; 0778 uint m_bPendingRedirection: 1; 0779 uint m_bBuiltinView: 1; 0780 uint m_bURLDropHandling: 1; 0781 uint m_bDisableScrolling: 1; 0782 uint m_bErrorURL: 1; 0783 QVector<KPluginMetaData> m_partServiceOffers; 0784 KService::List m_appServiceOffers; 0785 KPluginMetaData m_service; 0786 QString m_serviceType; 0787 QString m_caption; 0788 QString m_tempFile; 0789 QString m_dbusObjectPath; 0790 QUrl m_requestedUrl; 0791 0792 #if QT_VERSION_MAJOR < 6 0793 #ifdef KActivities_FOUND 0794 KActivities::ResourceInstance *m_activityResourceInstance; 0795 #endif 0796 #endif 0797 }; 0798 0799 #endif