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_CUI_SOURCE_INC_SVXCONFIGPAGEHELPER_HXX
21 #define INCLUDED_CUI_SOURCE_INC_SVXCONFIGPAGEHELPER_HXX
23 #include <com/sun/star/frame/XModuleManager2.hpp>
27 class SvxConfigPageHelper
30 static void RemoveEntry( SvxEntries
* pEntries
, SvxConfigEntry
const * pChildEntry
);
32 static OUString
replaceSaveInName( const OUString
& rMessage
, const OUString
& rSaveInName
);
33 static OUString
stripHotKey( const OUString
& str
);
34 static OUString
replaceSixteen( const OUString
& str
, sal_Int32 nReplacement
);
36 static sal_Int16
GetImageType();
37 static void InitImageType();
38 static css::uno::Reference
< css::graphic::XGraphic
> GetGraphic(
39 const css::uno::Reference
< css::ui::XImageManager
>& xImageManager
,
40 const OUString
& rCommandURL
);
42 static OUString
generateCustomName(
43 const OUString
& prefix
,
45 sal_Int32 suffix
= 1 );
46 static OUString
generateCustomMenuURL(
48 sal_Int32 suffix
= 1 );
49 static sal_uInt32
generateRandomValue();
51 Generates a custom resource URL for a new toolbar.
52 Typically something like: private:resource/toolbar/custom_toolbar_########
53 The last 8 letters are randomly generated alphanumeric characters.
55 static OUString
generateCustomURL( SvxEntries
* entries
);
57 static OUString
GetModuleName( const OUString
& aModuleId
);
58 static OUString
GetUIModuleName(
59 const OUString
& aModuleId
,
60 const css::uno::Reference
< css::frame::XModuleManager2
>& rModuleManager
);
62 static bool GetMenuItemData(
63 const css::uno::Reference
< css::container::XIndexAccess
>& rItemContainer
,
65 OUString
& rCommandURL
,
69 css::uno::Reference
< css::container::XIndexAccess
>& rSubMenu
);
70 static bool GetToolbarItemData(
71 const css::uno::Reference
< css::container::XIndexAccess
>& rItemContainer
,
73 OUString
& rCommandURL
,
79 static css::uno::Sequence
< css::beans::PropertyValue
> ConvertSvxConfigEntry(
80 const SvxConfigEntry
* pEntry
);
81 static css::uno::Sequence
< css::beans::PropertyValue
> ConvertToolbarEntry(
82 const SvxConfigEntry
* pEntry
);
84 static bool EntrySort( SvxConfigEntry
const * a
, SvxConfigEntry
const * b
);
86 static bool SvxConfigEntryModified( SvxConfigEntry
const * pEntry
);
90 #endif // INCLUDED_CUI_SOURCE_INC_SVXCONFIGPAGEHELPER_HXX
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */