1 | /* -*- c++ -*- |
2 | * Copyright (C)2000 Waldo Bastian <bastian@kde.org> |
3 | * |
4 | * All rights reserved. |
5 | * |
6 | * Redistribution and use in source and binary forms, with or without |
7 | * modification, are permitted provided that the following conditions |
8 | * are met: |
9 | * 1. Redistributions of source code must retain the above copyright |
10 | * notice, this list of conditions and the following disclaimer. |
11 | * 2. Redistributions in binary form must reproduce the above copyright |
12 | * notice, this list of conditions and the following disclaimer in the |
13 | * documentation and/or other materials provided with the distribution. |
14 | * |
15 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND |
16 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
17 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE |
19 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
20 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
21 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
22 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
23 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
24 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
25 | * SUCH DAMAGE. |
26 | * |
27 | */ |
28 | #ifndef __KRECENTDIRS_H |
29 | #define __KRECENTDIRS_H |
30 | |
31 | #include <QtCore/QStringList> |
32 | |
33 | #include <kio/kio_export.h> |
34 | |
35 | /** |
36 | * The goal of this namespace is to make sure that, when the user needs to |
37 | * specify a file via the file selection dialog, this dialog will start |
38 | * in the directory most likely to contain the desired files. |
39 | * |
40 | * This works as follows: Each time the file selection dialog is |
41 | * shown, the programmer can specify a "file-class". The file-dialog will |
42 | * then start with the directory associated with this file-class. When |
43 | * the dialog closes, the directory currently shown in the file-dialog |
44 | * will be associated with the file-class. |
45 | * |
46 | * A file-class can either start with ':' or with '::'. If it starts with |
47 | * a single ':' the file-class is specific to the current application. |
48 | * If the file-class starts with '::' it is global to all applications. |
49 | * |
50 | * @since 4.6 |
51 | */ |
52 | namespace KRecentDirs |
53 | { |
54 | /** |
55 | * Returns a list of directories associated with this file-class. |
56 | * The most recently used directory is at the front of the list. |
57 | * |
58 | * @since 4.6 |
59 | */ |
60 | KIO_EXPORT QStringList list(const QString &fileClass); |
61 | |
62 | /** |
63 | * Returns the most recently used directory accociated with this file-class. |
64 | * |
65 | * @since 4.6 |
66 | */ |
67 | KIO_EXPORT QString dir(const QString &fileClass); |
68 | |
69 | /** |
70 | * Associates @p directory with @p fileClass |
71 | * |
72 | * @since 4.6 |
73 | */ |
74 | KIO_EXPORT void add(const QString &fileClass, const QString &directory); |
75 | } |
76 | |
77 | #endif |
78 | |