LibreOffice Module framework (master) 1
|
#include <toolbarmerger.hxx>
Static Public Member Functions | |
static bool | IsCorrectContext (std::u16string_view aContext, std::u16string_view aModuleIdentifier) |
Check whether a module identifier is part of a context defined by a colon separated list of module identifier. More... | |
static void | ConvertSeqSeqToVector (const css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > &rSequence, AddonToolbarItemContainer &rContainer) |
Converts a sequence, sequence of property values to a vector of structs. More... | |
static void | ConvertSequenceToValues (const css::uno::Sequence< css::beans::PropertyValue > &rSequence, OUString &rCommandURL, OUString &rLabel, OUString &rTarget, OUString &rContext, OUString &rControlType, sal_uInt16 &rWidth) |
Converts a sequence of property values to single values. More... | |
static ReferenceToolbarPathInfo | FindReferencePoint (const ToolBox *pToolbar, sal_uInt16 nFirstItem, std::u16string_view rReferencePoint) |
Tries to find the reference point provided and delivers position and result of the search process. More... | |
static bool | ProcessMergeOperation (ToolBox *pToolbar, ToolBox::ImplToolItems::size_type nPos, ToolBoxItemId &rItemId, CommandToInfoMap &rCommandMap, std::u16string_view rModuleIdentifier, std::u16string_view rMergeCommand, std::u16string_view rMergeCommandParameter, const AddonToolbarItemContainer &rItems) |
Processes a merge operation. More... | |
static bool | ProcessMergeFallback (ToolBox *pToolbar, ToolBoxItemId &rItemId, CommandToInfoMap &rCommandMap, std::u16string_view rModuleIdentifier, std::u16string_view rMergeCommand, std::u16string_view rMergeFallback, const AddonToolbarItemContainer &rItems) |
Processes a merge fallback operation. More... | |
static void | MergeItems (ToolBox *pToolbar, ToolBox::ImplToolItems::size_type nPos, sal_uInt16 nModIndex, ToolBoxItemId &rItemId, CommandToInfoMap &rCommandMap, std::u16string_view rModuleIdentifier, const AddonToolbarItemContainer &rAddonToolbarItems) |
Merges (adds) toolbar items into an existing toolbar. More... | |
static void | ReplaceItem (ToolBox *pToolbar, ToolBox::ImplToolItems::size_type nPos, ToolBoxItemId &rItemId, CommandToInfoMap &rCommandMap, std::u16string_view rModuleIdentifier, const AddonToolbarItemContainer &rAddonToolbarItems) |
Replaces a toolbar item with new items for an existing toolbar. More... | |
static void | RemoveItems (ToolBox *pToolbar, ToolBox::ImplToolItems::size_type nPos, std::u16string_view rMergeCommandParameter) |
Removes toolbar items from an existing toolbar. More... | |
static rtl::Reference<::cppu::OWeakObject > | CreateController (const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::uno::Reference< css::frame::XFrame > &xFrame, ToolBox *pToolbar, const OUString &rCommandURL, ToolBoxItemId nId, sal_uInt16 nWidth, std::u16string_view rControlType) |
Removes toolbar items from an existing toolbar. More... | |
static void | CreateToolbarItem (ToolBox *pToolbox, ToolBox::ImplToolItems::size_type nPos, ToolBoxItemId nItemId, const AddonToolbarItem &rAddonToolbarItem) |
Private Member Functions | |
ToolBarMerger (const ToolBarMerger &)=delete | |
ToolBarMerger & | operator= (const ToolBarMerger &)=delete |
Definition at line 62 of file toolbarmerger.hxx.
|
privatedelete |
|
static |
Converts a sequence, sequence of property values to a vector of structs.
rSequence |
Provides a sequence, sequence of property values.
rContainer |
A vector of AddonToolbarItems which will hold the conversion from the rSequence argument.
Definition at line 117 of file toolbarmerger.cxx.
References framework::AddonToolbarItem::aCommandURL, framework::AddonToolbarItem::aContext, framework::AddonToolbarItem::aControlType, framework::AddonToolbarItem::aLabel, framework::AddonToolbarItem::aTarget, ConvertSequenceToValues(), i, and framework::AddonToolbarItem::nWidth.
|
static |
Converts a sequence of property values to single values.
rSequence |
Provides a sequence of property values.
rCommandURL |
Contains the value of the property with Name="CommandURL".
rLabel |
Contains the value of the property with Name="Title"
rTarget |
Contains the value of the property with Name="Target"
rContext |
Contains the value of the property with Name="Context"
rControlType |
Contains the value of the property with Name="ControlType"
Definition at line 180 of file toolbarmerger.cxx.
References framework::MERGE_TOOLBAR_CONTEXT, framework::MERGE_TOOLBAR_CONTROLTYPE, framework::MERGE_TOOLBAR_TARGET, framework::MERGE_TOOLBAR_TITLE, framework::MERGE_TOOLBAR_URL, framework::MERGE_TOOLBAR_WIDTH, and rTarget.
Referenced by ConvertSeqSeqToVector().
|
static |
Removes toolbar items from an existing toolbar.
pToolbar |
A valid pointer to the toolbar where the merge fall back operation is applied to.
nPos |
The reference position of the toolbar item for the merge operation. Value must be between 0 and number of toolbar items - 1.
rMergeCommandParameter. |
An optional argument for the merge command.
Definition at line 590 of file toolbarmerger.cxx.
References framework::ToggleButtonToolbarController::DropDownButton, nId, framework::ToggleButtonToolbarController::ToggleDropDownButton, framework::TOOLBARCONTROLLER_BUTTON, framework::TOOLBARCONTROLLER_COMBOBOX, framework::TOOLBARCONTROLLER_DROPDOWNBOX, framework::TOOLBARCONTROLLER_DROPDOWNBTN, framework::TOOLBARCONTROLLER_EDIT, framework::TOOLBARCONTROLLER_FIXEDIMAGE, framework::TOOLBARCONTROLLER_FIXEDTEXT, framework::TOOLBARCONTROLLER_IMGBUTTON, framework::TOOLBARCONTROLLER_SPINFIELD, framework::TOOLBARCONTROLLER_TOGGLEDDBTN, and xFrame.
|
static |
Definition at line 629 of file toolbarmerger.cxx.
References framework::AddonToolbarItem::aCommandURL, framework::AddonsParams::aControlType, framework::AddonToolbarItem::aControlType, framework::AddonToolbarItem::aLabel, ToolBox::EnableItem(), ToolBox::GetItemData(), ToolBox::InsertItem(), nPos, framework::AddonsParams::nWidth, framework::AddonToolbarItem::nWidth, ToolBox::SetItemData(), ToolBox::SetItemState(), ToolBox::SetItemText(), ToolBox::SetQuickHelpText(), and TRISTATE_FALSE.
Referenced by MergeItems().
|
static |
Tries to find the reference point provided and delivers position and result of the search process.
pToolbar |
Must be a valid pointer to a toolbar with items which should be searched.
nFirstItem |
First toolbar item to search from.
rReferencePoint |
A command URL which should be the reference point for the coming merge operation.
Definition at line 234 of file toolbarmerger.cxx.
References framework::ReferenceToolbarPathInfo::bResult, ToolBox::GetItemCommand(), ToolBox::GetItemCount(), ToolBox::GetItemId(), i, ToolBox::ITEM_NOTFOUND, and framework::ReferenceToolbarPathInfo::nPos.
|
static |
Check whether a module identifier is part of a context defined by a colon separated list of module identifier.
rContext |
Describes a context string list where all contexts are delimited by a colon. For more information about the module identifier used as context strings see the IDL description of css::frame::XModuleManager
rModuleIdentifier |
A string describing a module identifier. See IDL description of css::frame::XModuleManager.
Definition at line 95 of file toolbarmerger.cxx.
Referenced by MergeItems().
|
static |
Merges (adds) toolbar items into an existing toolbar.
pToolbar |
A valid pointer to the toolbar where the merge fall back operation is applied to.
nPos |
The reference position of the toolbar item for the merge operation. Value must be between 0 and number of toolbar items - 1.
rItemId |
A unique item ID.
rModuleIdentifier |
The current application module context.
rItems |
Toolbar items which are associated to the merge command.
Definition at line 434 of file toolbarmerger.cxx.
References framework::AddonToolbarItem::aCommandURL, framework::AddonToolbarItem::aContext, ToolBox::APPEND, CreateToolbarItem(), ToolBox::GetItemCount(), i, ToolBox::InsertSeparator(), IsCorrectContext(), framework::CommandInfo::nId, nPos, and framework::TOOLBOXITEM_SEPARATOR_STR.
Referenced by ProcessMergeFallback(), ProcessMergeOperation(), and ReplaceItem().
|
privatedelete |
|
static |
Processes a merge fallback operation.
pToolbar |
A valid pointer to the toolbar where the merge fall back operation is applied to.
nPos |
The reference position of the toolbar item for the merge operation. Value must be between 0 and number of toolbar items - 1.
rItemId |
A unique item ID.
rModuleIdentifier |
The current application module context.
rMergeCommand |
A merge command.
rItems |
Toolbar items which are associated to the merge command.
Definition at line 372 of file toolbarmerger.cxx.
References ToolBox::APPEND, framework::MERGECOMMAND_ADDAFTER, framework::MERGECOMMAND_ADDBEFORE, framework::MERGECOMMAND_REMOVE, framework::MERGECOMMAND_REPLACE, framework::MERGEFALLBACK_ADDFIRST, framework::MERGEFALLBACK_ADDLAST, framework::MERGEFALLBACK_IGNORE, and MergeItems().
|
static |
Processes a merge operation.
pToolbar |
A valid pointer to the toolbar where the merge operation is applied to.
nPos |
The reference position of the toolbar item for the merge operation. Value must be between 0 and number of toolbar items - 1.
rItemId |
A unique item ID.
rModuleIdentifier |
The current application module context.
rMergeCommand |
A merge command.
rMergeCommandParameter. |
An optional argument for the merge command.
rItems |
Toolbar items which are associated to the merge command.
Definition at line 308 of file toolbarmerger.cxx.
References framework::MERGECOMMAND_ADDAFTER, framework::MERGECOMMAND_ADDBEFORE, framework::MERGECOMMAND_REMOVE, framework::MERGECOMMAND_REPLACE, MergeItems(), nPos, RemoveItems(), and ReplaceItem().
|
static |
Removes toolbar items from an existing toolbar.
pToolbar |
A valid pointer to the toolbar where the merge fall back operation is applied to.
nPos |
The reference position of the toolbar item for the merge operation. Value must be between 0 and number of toolbar items - 1.
rMergeCommandParameter. |
An optional argument for the merge command.
Definition at line 549 of file toolbarmerger.cxx.
References i, nCount, nPos, ToolBox::RemoveItem(), and o3tl::toInt32().
Referenced by ProcessMergeOperation().
|
static |
Replaces a toolbar item with new items for an existing toolbar.
pToolbar |
A valid pointer to the toolbar where the merge fall back operation is applied to.
nPos |
The reference position of the toolbar item for the merge operation. Value must be between 0 and number of toolbar items - 1.
rItemId |
A unique item ID.
rModuleIdentifier |
The current application module context.
rItems |
Toolbar items which are associated to the merge command.
Definition at line 516 of file toolbarmerger.cxx.
References MergeItems(), nPos, and ToolBox::RemoveItem().
Referenced by ProcessMergeOperation().