| 1 | /* |
| 2 | This file is part of the Nepomuk KDE project. |
| 3 | SPDX-FileCopyrightText: 2010 Sebastian Trueg <[email protected]> |
| 4 | |
| 5 | SPDX-License-Identifier: LGPL-2.0-or-later |
| 6 | */ |
| 7 | |
| 8 | #ifndef BALOO_TIMELINE_TOOLS_H_ |
| 9 | #define BALOO_TIMELINE_TOOLS_H_cxx . . $ `src/kioworkers/timeline/timelinetools.h:9:9`! |
| 10 | |
| 11 | class QStringcxx . . $ QString#; |
| 12 | |
| 13 | #include <QDate> |
| 14 | #include <QUrl> |
| 15 | |
| 16 | namespace Baloocxx . . $ Baloo/ |
| 17 | { |
| 18 | /** |
| 19 | * The hierarchy in timeline:/ looks as follows: |
| 20 | * |
| 21 | * / |
| 22 | * |- /today |
| 23 | * | |
| 24 | * |- /calendar |
| 25 | * | |- /calendar/2010 |
| 26 | * | |- /calendar/2010/january |
| 27 | * | |- /calendar/2010/january/2010-01-01 |
| 28 | * | |- /calendar/2009 |
| 29 | * | |
| 30 | * |- /months |
| 31 | * | |- /month/2010 |
| 32 | * | |- /months/2010/january |
| 33 | * | |
| 34 | * |- /weeks |
| 35 | */ |
| 36 | enum TimelineFolderTypecxx . . $ Baloo/TimelineFolderType# { |
| 37 | NoFoldercxx . . $ Baloo/NoFolder. = 0, /// nothing |
| 38 | RootFoldercxx . . $ Baloo/RootFolder., /// the root folder |
| 39 | CalendarFoldercxx . . $ Baloo/CalendarFolder., /// the calendar folder listing all months |
| 40 | MonthFoldercxx . . $ Baloo/MonthFolder., /// a folder listing a month's days (m_date contains the month) |
| 41 | DayFoldercxx . . $ Baloo/DayFolder., /// a folder listing a day (m_date); optionally m_filename is set |
| 42 | }; |
| 43 | |
| 44 | /** |
| 45 | * Parse a timeline URL like timeline:/today and return the type of folder it |
| 46 | * represents. If DayFolder is returned \p date is set to the date that should be listed. |
| 47 | * Otherwise it is an invalid date. \p filename is optionally set to the name of the file |
| 48 | * in the folder. |
| 49 | */ |
| 50 | TimelineFolderTypecxx . . $ Baloo/TimelineFolderType# parseTimelineUrlcxx . . $ Baloo/parseTimelineUrl(c305c5181ca97ce3).(const QUrlcxx . . $ QUrl#& url, QDatecxx . . $ QDate#* date, QStringcxx . . $ QString#* filename = nullptr); |
| 51 | |
| 52 | /** |
| 53 | * Remove any double slashes, remove any trailing slashes, and |
| 54 | * add an initial slash after the scheme. |
| 55 | */ |
| 56 | QUrlcxx . . $ QUrl# canonicalizeTimelineUrlcxx . . $ Baloo/canonicalizeTimelineUrl(b956eaf5ca15f507).(const QUrlcxx . . $ QUrl#& url); |
| 57 | |
| 58 | } |
| 59 | |
| 60 | #endif |