LibreOffice Module framework (master) 1
properties.h
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
22#include <com/sun/star/uno/Any.hxx>
23
24namespace framework{
25
28inline constexpr OUStringLiteral FRAME_PROPNAME_ASCII_DISPATCHRECORDERSUPPLIER = u"DispatchRecorderSupplier";
29inline constexpr OUStringLiteral FRAME_PROPNAME_ASCII_ISHIDDEN = u"IsHidden";
30inline constexpr OUStringLiteral FRAME_PROPNAME_ASCII_LAYOUTMANAGER = u"LayoutManager";
31inline constexpr OUStringLiteral FRAME_PROPNAME_ASCII_TITLE = u"Title";
32inline constexpr OUStringLiteral FRAME_PROPNAME_ASCII_INDICATORINTERCEPTION = u"IndicatorInterception";
33inline constexpr OUStringLiteral FRAME_PROPNAME_ASCII_URL = u"URL";
34
35// Please add new entries alphabetical sorted and correct all other handles!
36// Start counting with 0, so it can be used as direct index into an array too.
37#define FRAME_PROPHANDLE_DISPATCHRECORDERSUPPLIER 0
38#define FRAME_PROPHANDLE_ISHIDDEN 1
39#define FRAME_PROPHANDLE_LAYOUTMANAGER 2
40#define FRAME_PROPHANDLE_TITLE 3
41#define FRAME_PROPHANDLE_INDICATORINTERCEPTION 4
42#define FRAME_PROPHANDLE_URL 5
43
46inline constexpr OUStringLiteral LAYOUTMANAGER_PROPNAME_ASCII_MENUBARCLOSER = u"MenuBarCloser";
47inline constexpr OUStringLiteral LAYOUTMANAGER_PROPNAME_ASCII_AUTOMATICTOOLBARS = u"AutomaticToolbars";
48inline constexpr OUStringLiteral LAYOUTMANAGER_PROPNAME_ASCII_REFRESHVISIBILITY = u"RefreshContextToolbarVisibility";
49inline constexpr OUStringLiteral LAYOUTMANAGER_PROPNAME_ASCII_HIDECURRENTUI = u"HideCurrentUI";
50inline constexpr OUStringLiteral LAYOUTMANAGER_PROPNAME_ASCII_LOCKCOUNT = u"LockCount";
51inline constexpr OUStringLiteral LAYOUTMANAGER_PROPNAME_ASCII_PRESERVE_CONTENT_SIZE = u"PreserveContentSize";
52inline constexpr OUStringLiteral LAYOUTMANAGER_PROPNAME_ASCII_REFRESHTOOLTIP = u"RefreshContextToolbarToolTip";
53
54#define LAYOUTMANAGER_PROPNAME_MENUBARCLOSER LAYOUTMANAGER_PROPNAME_ASCII_MENUBARCLOSER
55
56#define LAYOUTMANAGER_PROPHANDLE_MENUBARCLOSER 0
57#define LAYOUTMANAGER_PROPHANDLE_AUTOMATICTOOLBARS 1
58#define LAYOUTMANAGER_PROPHANDLE_REFRESHVISIBILITY 2
59#define LAYOUTMANAGER_PROPHANDLE_HIDECURRENTUI 3
60#define LAYOUTMANAGER_PROPHANDLE_LOCKCOUNT 4
61#define LAYOUTMANAGER_PROPHANDLE_PRESERVE_CONTENT_SIZE 5
62#define LAYOUTMANAGER_PROPHANDLE_REFRESHTOOLTIP 6
63
65inline constexpr OUStringLiteral UICOMMANDDESCRIPTION_NAMEACCESS_COMMANDIMAGELIST = u"private:resource/image/commandimagelist";
66inline constexpr OUStringLiteral UICOMMANDDESCRIPTION_NAMEACCESS_COMMANDROTATEIMAGELIST = u"private:resource/image/commandrotateimagelist";
67inline constexpr OUStringLiteral UICOMMANDDESCRIPTION_NAMEACCESS_COMMANDMIRRORIMAGELIST = u"private:resource/image/commandmirrorimagelist";
68
69
70#define UICOMMANDDESCRIPTION_PROPERTIES_TOGGLEBUTTON 8
71
74inline constexpr OUStringLiteral AUTORECOVERY_PROPNAME_ASCII_EXISTS_RECOVERYDATA = u"ExistsRecoveryData";
75inline constexpr OUStringLiteral AUTORECOVERY_PROPNAME_ASCII_EXISTS_SESSIONDATA = u"ExistsSessionData";
76inline constexpr OUStringLiteral AUTORECOVERY_PROPNAME_ASCII_CRASHED = u"Crashed";
77
78#define AUTORECOVERY_PROPNAME_EXISTS_RECOVERYDATA AUTORECOVERY_PROPNAME_ASCII_EXISTS_RECOVERYDATA
79#define AUTORECOVERY_PROPNAME_EXISTS_SESSIONDATA AUTORECOVERY_PROPNAME_ASCII_EXISTS_SESSIONDATA
80#define AUTORECOVERY_PROPNAME_CRASHED AUTORECOVERY_PROPNAME_ASCII_CRASHED
81
82#define AUTORECOVERY_PROPHANDLE_EXISTS_RECOVERYDATA 0
83#define AUTORECOVERY_PROPHANDLE_EXISTS_SESSIONDATA 1
84#define AUTORECOVERY_PROPHANDLE_CRASHED 2
85
88inline constexpr OUStringLiteral FILTER_PROPNAME_ASCII_DOCUMENTSERVICE = u"DocumentService";
89
92inline constexpr OUStringLiteral OFFICEFACTORY_PROPNAME_ASCII_UINAME = u"ooSetupFactoryUIName";
93inline constexpr OUStringLiteral OFFICEFACTORY_PROPNAME_ASCII_ICON = u"ooSetupFactoryIcon";
94
98{
99 public:
100
112 static bool willPropertyBeChanged( const css::uno::Any& aCurrentValue ,
113 const css::uno::Any& aNewValue ,
114 css::uno::Any& aOldValue ,
115 css::uno::Any& aChangedValue )
116 {
117 bool bChanged = false;
118
119 // clear return parameter to be sure, to put out only valid values ...
120 aOldValue.clear();
121 aChangedValue.clear();
122
123 // if value change ...
124 bChanged = aCurrentValue != aNewValue;
125 if (bChanged)
126 {
127 // ... set information of change.
128 aOldValue = aCurrentValue;
129 aChangedValue = aNewValue;
130 }
131
132 return bChanged;
133 }
134};
135
136} // namespace framework
137
138/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
provides some helper methods to implement property sets.
Definition: properties.h:98
static bool willPropertyBeChanged(const css::uno::Any &aCurrentValue, const css::uno::Any &aNewValue, css::uno::Any &aOldValue, css::uno::Any &aChangedValue)
checks if given property will be changed by this settings.
Definition: properties.h:112
float u
constexpr OUStringLiteral FRAME_PROPNAME_ASCII_INDICATORINTERCEPTION
Definition: properties.h:32
constexpr OUStringLiteral FRAME_PROPNAME_ASCII_TITLE
Definition: properties.h:31
constexpr OUStringLiteral AUTORECOVERY_PROPNAME_ASCII_EXISTS_SESSIONDATA
Definition: properties.h:75
constexpr OUStringLiteral LAYOUTMANAGER_PROPNAME_ASCII_PRESERVE_CONTENT_SIZE
Definition: properties.h:51
constexpr OUStringLiteral FRAME_PROPNAME_ASCII_DISPATCHRECORDERSUPPLIER
properties for "Frame" class
Definition: properties.h:28
constexpr OUStringLiteral AUTORECOVERY_PROPNAME_ASCII_CRASHED
Definition: properties.h:76
constexpr OUStringLiteral AUTORECOVERY_PROPNAME_ASCII_EXISTS_RECOVERYDATA
properties for "AutoRecovery" class
Definition: properties.h:74
constexpr OUStringLiteral UICOMMANDDESCRIPTION_NAMEACCESS_COMMANDIMAGELIST
properties for "UICommandDescription" class
Definition: properties.h:65
constexpr OUStringLiteral LAYOUTMANAGER_PROPNAME_ASCII_AUTOMATICTOOLBARS
Definition: properties.h:47
constexpr OUStringLiteral UICOMMANDDESCRIPTION_NAMEACCESS_COMMANDMIRRORIMAGELIST
Definition: properties.h:67
constexpr OUStringLiteral OFFICEFACTORY_PROPNAME_ASCII_UINAME
properties for office module config (Setup.xcu)
Definition: properties.h:92
constexpr OUStringLiteral FRAME_PROPNAME_ASCII_ISHIDDEN
Definition: properties.h:29
constexpr OUStringLiteral LAYOUTMANAGER_PROPNAME_ASCII_MENUBARCLOSER
properties for "LayoutManager" class
Definition: properties.h:46
constexpr OUStringLiteral FRAME_PROPNAME_ASCII_URL
Definition: properties.h:33
constexpr OUStringLiteral OFFICEFACTORY_PROPNAME_ASCII_ICON
Definition: properties.h:93
constexpr OUStringLiteral LAYOUTMANAGER_PROPNAME_ASCII_REFRESHTOOLTIP
Definition: properties.h:52
constexpr OUStringLiteral FILTER_PROPNAME_ASCII_DOCUMENTSERVICE
properties for Filter config
Definition: properties.h:88
constexpr OUStringLiteral LAYOUTMANAGER_PROPNAME_ASCII_HIDECURRENTUI
Definition: properties.h:49
constexpr OUStringLiteral LAYOUTMANAGER_PROPNAME_ASCII_LOCKCOUNT
Definition: properties.h:50
constexpr OUStringLiteral FRAME_PROPNAME_ASCII_LAYOUTMANAGER
Definition: properties.h:30
constexpr OUStringLiteral LAYOUTMANAGER_PROPNAME_ASCII_REFRESHVISIBILITY
Definition: properties.h:48
constexpr OUStringLiteral UICOMMANDDESCRIPTION_NAMEACCESS_COMMANDROTATEIMAGELIST
Definition: properties.h:66