]>
cloud.milkyroute.net Git - dolphin.git/blob - src/panels/places/placespanel.h
4156cfea09d966f36b701990dd8c5612a18819c8
1 /***************************************************************************
2 * Copyright (C) 2008-2012 by Peter Penz <peter.penz19@gmail.com> *
3 * Copyright (C) 2010 by Christian Muehlhaeuser <muesli@gmail.com> *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
19 ***************************************************************************/
24 #include <config-nepomuk.h>
27 #include <panels/panel.h>
29 class KItemListController
;
30 class PlacesItemEditDialog
;
32 class PlacesItemModel
;
45 * @brief Combines bookmarks and mounted devices as list.
47 class PlacesPanel
: public Panel
52 PlacesPanel(QWidget
* parent
);
53 virtual ~PlacesPanel();
56 void placeActivated(const KUrl
& url
);
57 void placeMiddleClicked(const KUrl
& url
);
58 void errorMessage(const QString
& error
);
61 virtual bool urlChanged();
62 virtual void showEvent(QShowEvent
* event
);
65 void slotItemActivated(int index
);
66 void slotItemMiddleClicked(int index
);
67 void slotItemContextMenuRequested(int index
, const QPointF
& pos
);
68 void slotViewContextMenuRequested(const QPointF
& pos
);
69 void slotUrlsDropped(const KUrl
& dest
, QDropEvent
* event
, QWidget
* parent
);
70 void slotTrashUpdated(KJob
* job
);
75 void editEntry(int index
);
78 * Selects the item that has the closest URL for the URL set
79 * for the panel (see Panel::setUrl()).
81 void selectClosestItem();
84 * @return Converts the URL, which contains "virtual" URLs for system-items like
85 * "search:/documents" into a Nepomuk-Query-URL that will be handled by
86 * the corresponding IO-slave. Virtual URLs for bookmarks are used to
87 * be independent from internal format changes.
89 static KUrl
convertedUrl(const KUrl
& url
);
92 * @return URL using the timeline-protocol for searching (see convertedUrl()).
94 static KUrl
createTimelineUrl(const KUrl
& url
);
97 * Helper method for createTimelineUrl().
98 * @return String that represents a date-path in the format that
99 * the timeline-protocol expects.
101 static QString
timelineDateString(int year
, int month
, int day
= 0);
104 * @return URL that can be listed by KIO and results in searching
105 * for a given term. The URL \a url represents a places-internal
106 * URL like e.g. "search:/documents" (see convertedUrl()).
108 static KUrl
createSearchUrl(const KUrl
& url
);
112 * Helper method for createSearchUrl().
113 * @return URL that can be listed by KIO and results in searching
114 * for the given term.
116 static KUrl
searchUrlForTerm(const Nepomuk::Query::Term
& term
);
120 KItemListController
* m_controller
;
121 PlacesItemModel
* m_model
;
124 #endif // PLACESPANEL_H