nss: upgrade to release 3.73
[LibreOffice.git] / include / unotools / historyoptions.hxx
blob43c61b66788fd096bd0b6052efb323ee6c9f9563
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 .
20 #ifndef INCLUDED_UNOTOOLS_HISTORYOPTIONS_HXX
21 #define INCLUDED_UNOTOOLS_HISTORYOPTIONS_HXX
23 #include <unotools/unotoolsdllapi.h>
24 #include <sal/types.h>
25 #include <com/sun/star/uno/Sequence.h>
26 #include <rtl/ustring.hxx>
27 #include <unotools/options.hxx>
28 #include <memory>
30 #include <optional>
32 namespace com::sun::star::beans { struct PropertyValue; }
34 // The method GetList() returns a list of property values.
35 // Use follow defines to separate values by names.
37 #define HISTORY_PROPERTYNAME_URL "URL"
38 #define HISTORY_PROPERTYNAME_FILTER "Filter"
39 #define HISTORY_PROPERTYNAME_TITLE "Title"
40 #define HISTORY_PROPERTYNAME_PASSWORD "Password"
41 #define HISTORY_PROPERTYNAME_THUMBNAIL "Thumbnail"
43 /// You can use these enum values to specify right history if you call our interface methods.
44 enum EHistoryType
46 ePICKLIST = 0,
47 eHELPBOOKMARKS = 1
50 class SvtHistoryOptions_Impl;
52 /** Collect information about history features.
54 Interface methods to get and set value of config key "org.openoffice.Office.Common/History/..."
56 key "PickList": The last used documents displayed in the file menu.
57 key "History": The last opened documents general.
59 class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtHistoryOptions final : public utl::detail::Options
61 public:
62 SvtHistoryOptions();
63 virtual ~SvtHistoryOptions() override;
65 /** Clear complete specified list.
67 @param eHistory select right history.
69 void Clear(EHistoryType eHistory);
71 /** Return the complete specified history list.
73 @param eHistory select right history.
74 @return A list of history items is returned.
76 css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > GetList(EHistoryType eHistory) const;
78 /** Append a new item to the specified list.
80 The oldest entry is deleted automatically when the size reaches the maximum.
82 @param eHistory select right history.
83 @param sURL URL to save in history
84 @param sFilter filter name to save in history
85 @param sTitle document title to save in history
87 void AppendItem(EHistoryType eHistory,
88 const OUString& sURL, const OUString& sFilter, const OUString& sTitle,
89 const std::optional<OUString>& sThumbnail);
91 /** Delete item from the specified list.
93 void DeleteItem(EHistoryType eHistory, const OUString& sURL);
95 private:
96 std::shared_ptr<SvtHistoryOptions_Impl> m_pImpl;
99 #endif // INCLUDED_UNOTOOLS_HISTORYOPTIONS_HXX
101 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */