Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / include / unotools / historyoptions.hxx
blobb2388de2ad4b25262ae126ae1346632d38e767bb
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #pragma once
21 #include <unotools/unotoolsdllapi.h>
22 #include <rtl/ustring.hxx>
23 #include <vector>
24 #include <optional>
26 /// You can use these enum values to specify right history if you call our interface methods.
27 enum class EHistoryType
29 PickList,
30 HelpBookmarks
33 /** Collect information about history features.
35 Interface methods to get and set value of config key "org.openoffice.Office.Common/History/..."
37 key "PickList": The last used documents displayed in the file menu.
38 key "History": The last opened documents general.
40 namespace SvtHistoryOptions
43 /** Clear complete specified list.
45 @param eHistory select right history.
47 UNOTOOLS_DLLPUBLIC void Clear(EHistoryType eHistory);
49 /** Return the complete specified history list.
51 @param eHistory select right history.
52 @return A list of history items is returned.
54 struct HistoryItem
56 OUString sURL;
57 OUString sFilter;
58 OUString sTitle;
59 OUString sPassword;
60 OUString sThumbnail;
61 bool isReadOnly = false;
62 bool isPinned = false;
64 UNOTOOLS_DLLPUBLIC std::vector< HistoryItem > GetList(EHistoryType eHistory);
66 /** Append a new item to the specified list.
68 The oldest entry is deleted automatically when the size reaches the maximum.
70 @param eHistory select right history.
71 @param sURL URL to save in history
72 @param sFilter filter name to save in history
73 @param sTitle document title to save in history
74 @param sThumbnail base64 encoded thumbnail of the item
75 @param oIsReadOnly item was opened editable or read-only
77 UNOTOOLS_DLLPUBLIC void AppendItem(EHistoryType eHistory, const OUString& sURL,
78 const OUString& sFilter, const OUString& sTitle,
79 const std::optional<OUString>& sThumbnail,
80 std::optional<bool> oIsReadOnly);
82 /** Delete item from the specified list.
84 UNOTOOLS_DLLPUBLIC void DeleteItem(EHistoryType eHistory, const OUString& sURL);
86 // tdf#38742 - toggle pinned state of an item
87 UNOTOOLS_DLLPUBLIC void TogglePinItem(EHistoryType eHistory, const OUString& sURL);
90 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */