1 /***************************************************************************
2 * Copyright (C) 2006 by Peter Penz <peter.penz@gmx.at> *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (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 *
12 * GNU General Public License for more details. *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
18 ***************************************************************************/
20 #ifndef INFOSIDEBARPAGE_H
21 #define INFOSIDEBARPAGE_H
23 #include <sidebarpage.h>
25 #include <QtGui/QPushButton>
32 #include <kmimetype.h>
33 #include <kdesktopfileactions.h>
52 * @brief Prototype for a information sidebar.
54 * Will be exchanged in future releases by pluggable sidebar pages...
56 class InfoSidebarPage
: public SidebarPage
61 explicit InfoSidebarPage(QWidget
* parent
= 0);
62 virtual ~InfoSidebarPage();
65 void setUrl(const KUrl
& url
);
66 void setSelection(const KFileItemList
& selection
);
70 * Does a delayed request of information for the item of the given Url and
71 * provides default actions.
73 * @see InfoSidebarPage::showItemInfo()
75 void requestDelayedItemInfo(const KUrl
& url
);
78 * Shows the information for the item of the Url which has been provided by
79 * InfoSidebarPage::requestItemInfo() and provides default actions.
84 * Triggered if the request for item information has timed out.
85 * @see InfoSidebarPage::requestDelayedItemInfo()
90 * Is invoked if no preview is available for the item. In this
91 * case the icon will be shown.
93 void showIcon(const KFileItem
& item
);
96 * Is invoked if a preview is available for the item. The preview
97 * \a pixmap is shown inside the info page.
99 void showPreview(const KFileItem
& item
, const QPixmap
& pixmap
);
103 * Checks whether the an Url is repesented by a bookmark. If yes,
104 * then the bookmark icon and name are shown instead of a preview.
105 * @return True, if the Url represents exactly a bookmark.
106 * @param url The url to check.
108 bool applyBookmark(const KUrl
& url
);
110 /** Assures that any pending item information request is cancelled. */
111 void cancelRequest();
113 // TODO: the following methods are just a prototypes for meta
114 // info generation...
115 void createMetaInfo();
116 void addInfoLine(const QString
& labelText
,
117 const QString
& infoText
);
118 void beginInfoLines();
122 * Returns true, if the string \a key represents a meta information
123 * that should be shown.
125 bool showMetaInfo(const QString
& key
) const;
128 bool m_multipleSelection
;
129 bool m_pendingPreview
;
133 KFileItemList m_currentSelection
;
135 PixmapViewer
* m_preview
;
141 MetaDataWidget
* m_metadataWidget
;
144 #endif // INFOSIDEBARPAGE_H