tdf#130857 qt weld: Implement QtInstanceWidget::get_text_height
[LibreOffice.git] / include / unotools / historyoptions.hxx
blobc6107dbdc3798f8daa695abf7924cd67e99ad8bf
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 <config_options.h>
22 #include <unotools/unotoolsdllapi.h>
23 #include <rtl/ustring.hxx>
24 #include <vector>
25 #include <optional>
27 /// You can use these enum values to specify right history if you call our interface methods.
28 enum class EHistoryType
30 PickList,
31 HelpBookmarks
34 /** Collect information about history features.
36 Interface methods to get and set value of config key "org.openoffice.Office.Common/History/..."
38 key "PickList": The last used documents displayed in the file menu.
39 key "History": The last opened documents general.
41 namespace SvtHistoryOptions
44 /** Clear complete specified list.
46 @param eHistory select right history.
48 UNLESS_MERGELIBS_MORE(UNOTOOLS_DLLPUBLIC) void Clear(EHistoryType eHistory, const bool bClearPinnedItems = true);
50 /** Return the complete specified history list.
52 @param eHistory select right history.
53 @return A list of history items is returned.
55 struct HistoryItem
57 OUString sURL;
58 OUString sFilter;
59 OUString sTitle;
60 OUString sThumbnail;
61 bool isReadOnly = false;
62 bool isPinned = false;
64 UNLESS_MERGELIBS_MORE(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 UNLESS_MERGELIBS_MORE(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 UNLESS_MERGELIBS_MORE(UNOTOOLS_DLLPUBLIC) void DeleteItem(EHistoryType eHistory, const OUString& sURL,
85 const bool bClearPinned = true);
87 // tdf#38742 - toggle pinned state of an item
88 UNLESS_MERGELIBS_MORE(UNOTOOLS_DLLPUBLIC) void TogglePinItem(EHistoryType eHistory, const OUString& sURL);
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */