1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 <boost/optional.hpp>
24 #include <unotools/unotoolsdllapi.h>
25 #include <sal/types.h>
26 #include <osl/mutex.hxx>
27 #include <com/sun/star/uno/Sequence.h>
28 #include <com/sun/star/beans/PropertyValue.hpp>
29 #include <rtl/ustring.hxx>
30 #include <unotools/options.hxx>
33 // The method GetList() returns a list of property values.
34 // Use follow defines to separate values by names.
36 #define HISTORY_PROPERTYNAME_URL "URL"
37 #define HISTORY_PROPERTYNAME_FILTER "Filter"
38 #define HISTORY_PROPERTYNAME_TITLE "Title"
39 #define HISTORY_PROPERTYNAME_PASSWORD "Password"
40 #define HISTORY_PROPERTYNAME_THUMBNAIL "Thumbnail"
42 /// You can use these enum values to specify right history if you call our interface methods.
49 class SvtHistoryOptions_Impl
;
51 /** Collect information about history features.
53 Interface methods to get and set value of config key "org.openoffice.Office.Common/History/..."
55 key "PickList": The last used documents displayed in the file menu.
56 key "History": The last opened documents general.
58 class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtHistoryOptions
: public utl::detail::Options
62 virtual ~SvtHistoryOptions() override
;
64 /** Get max size of specified history.
66 Call this methods to get information about max. size of specified list.
67 If a new one is add to it the oldest one is deleted automatically.
69 @param eHistory select right history.
70 @return Current max size of specified list.
72 sal_uInt32
GetSize(EHistoryType eHistory
) const;
74 /** Clear complete specified list.
76 @param eHistory select right history.
78 void Clear(EHistoryType eHistory
);
80 /** Return the complete specified history list.
82 @param eHistory select right history.
83 @return A list of history items is returned.
85 css::uno::Sequence
< css::uno::Sequence
< css::beans::PropertyValue
> > GetList(EHistoryType eHistory
) const;
87 /** Append a new item to the specified list.
89 The oldest entry is deleted automatically when the size reaches the maximum.
91 @param eHistory select right history.
92 @param sURL URL to save in history
93 @param sFilter filter name to save in history
94 @param sTitle document title to save in history
95 @param sPassword password to save in history
97 void AppendItem(EHistoryType eHistory
,
98 const OUString
& sURL
, const OUString
& sFilter
, const OUString
& sTitle
,
99 const OUString
& sPassword
, const boost::optional
<OUString
>& sThumbnail
);
101 /** Delete item from the specified list.
103 void DeleteItem(EHistoryType eHistory
, const OUString
& sURL
);
106 std::shared_ptr
<SvtHistoryOptions_Impl
> m_pImpl
;
109 #endif // INCLUDED_UNOTOOLS_HISTORYOPTIONS_HXX
111 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */