tdf#130857 qt weld: Support mail merge "Server Auth" dialog
[LibreOffice.git] / cui / source / inc / SvxConfigPageHelper.hxx
blob025c4aad18c0a5d2904ed865a7aca1dbd88fa5cb
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 #pragma once
22 #include <com/sun/star/frame/XModuleManager2.hpp>
24 #include "cfg.hxx"
26 class SvxConfigPageHelper
28 public:
29 static void RemoveEntry(SvxEntries* pEntries, SvxConfigEntry const* pChildEntry);
31 static OUString replaceSaveInName(const OUString& rMessage, std::u16string_view rSaveInName);
32 static OUString stripHotKey(const OUString& str);
33 static OUString replaceSixteen(const OUString& str, sal_Int32 nReplacement);
35 static sal_Int16 GetImageType();
36 static void InitImageType();
37 static css::uno::Reference<css::graphic::XGraphic>
38 GetGraphic(const css::uno::Reference<css::ui::XImageManager>& xImageManager,
39 const OUString& rCommandURL);
41 static OUString generateCustomName(const OUString& prefix, SvxEntries* entries,
42 sal_Int32 suffix = 1);
43 static OUString generateCustomMenuURL(SvxEntries* entries, sal_Int32 suffix = 1);
44 static sal_uInt32 generateRandomValue();
45 /**
46 Generates a custom resource URL for a new toolbar.
47 Typically something like: private:resource/toolbar/custom_toolbar_########
48 The last 8 letters are randomly generated alphanumeric characters.
50 static OUString generateCustomURL(SvxEntries* entries);
52 static OUString GetModuleName(std::u16string_view aModuleId);
53 static OUString
54 GetUIModuleName(const OUString& aModuleId,
55 const css::uno::Reference<css::frame::XModuleManager2>& rModuleManager);
57 static bool
58 GetMenuItemData(const css::uno::Reference<css::container::XIndexAccess>& rItemContainer,
59 sal_Int32 nIndex, OUString& rCommandURL, OUString& rLabel, sal_uInt16& rType,
60 sal_Int32& rStyle, css::uno::Reference<css::container::XIndexAccess>& rSubMenu);
61 static bool
62 GetToolbarItemData(const css::uno::Reference<css::container::XIndexAccess>& rItemContainer,
63 sal_Int32 nIndex, OUString& rCommandURL, OUString& rLabel, sal_uInt16& rType,
64 bool& rIsVisible, sal_Int32& rStyle);
66 static css::uno::Sequence<css::beans::PropertyValue>
67 ConvertSvxConfigEntry(const SvxConfigEntry* pEntry);
68 static css::uno::Sequence<css::beans::PropertyValue>
69 ConvertToolbarEntry(const SvxConfigEntry* pEntry);
71 static bool EntrySort(SvxConfigEntry const* a, SvxConfigEntry const* b);
73 static bool SvxConfigEntryModified(SvxConfigEntry const* pEntry);
76 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */