File indexing completed on 2024-04-28 03:55:13
0001 /* -*- c++ -*- 0002 SPDX-FileCopyrightText: 2000 Waldo Bastian <bastian@kde.org> 0003 0004 SPDX-License-Identifier: BSD-2-Clause 0005 */ 0006 0007 #ifndef __KRECENTDIRS_H 0008 #define __KRECENTDIRS_H 0009 0010 #include <QStringList> 0011 0012 #include "kiocore_export.h" 0013 0014 /** 0015 * The goal of this namespace is to make sure that, when the user needs to 0016 * specify a file via the file selection dialog, this dialog will start 0017 * in the directory most likely to contain the desired files. 0018 * 0019 * This works as follows: Each time the file selection dialog is 0020 * shown, the programmer can specify a "file-class". The file-dialog will 0021 * then start with the directory associated with this file-class. When 0022 * the dialog closes, the directory currently shown in the file-dialog 0023 * will be associated with the file-class. 0024 * 0025 * A file-class can either start with ':' or with '::'. If it starts with 0026 * a single ':' the file-class is specific to the current application. 0027 * If the file-class starts with '::' it is global to all applications. 0028 */ 0029 namespace KRecentDirs 0030 { 0031 /** 0032 * Returns a list of directories associated with this file-class. 0033 * The most recently used directory is at the front of the list. 0034 */ 0035 KIOCORE_EXPORT QStringList list(const QString &fileClass); 0036 0037 /** 0038 * Returns the most recently used directory associated with this file-class. 0039 */ 0040 KIOCORE_EXPORT QString dir(const QString &fileClass); 0041 0042 /** 0043 * Associates @p directory with @p fileClass 0044 */ 0045 KIOCORE_EXPORT void add(const QString &fileClass, const QString &directory); 0046 } 0047 0048 #endif