diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2015-07-12 21:11:17 +0300 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2015-07-13 12:09:52 +0000 |
commit | 2aea9e37d697ce51efc5fb37ba50f1bf177e0445 (patch) | |
tree | c6564f6cc7a61c497be13b146ed00615652b85dc /include | |
parent | 9c2a8065add0da1e649633efa0795beddfa68eed (diff) |
Introduce generic sub toolbar controller
Currently many toolbar controllers are basically doing the
same thing - show some docked toolbar. So the idea here is
to have one generic controller that will handle all these
cases in a unified way. It will get the name of the toolbar
that it's supposed to show from the configuration, based on
the command it was registered for.
Right now it can handle both simple (i.e. with DROPDOWNONLY
bits) and split (i.e. with DROPDOWN bits) scenarios, where
for split kind it replaces the function (and the image) of
the main part of the button, with the last selected function,
for easy reusing. A button is considered to be a split one,
if the name of the initial default command was passed along
with the sub toolbar name, otherwise it will be a simple
button.
The core change is in framework/. Other parts are a usage
example, in form of converting the custom shapes buttons
to this new controller.
Change-Id: I087cc58c3db1889ca69a26546d4f00fe07e2a58d
Reviewed-on: https://gerrit.libreoffice.org/16967
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/svx/tbxcustomshapes.hxx | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/include/svx/tbxcustomshapes.hxx b/include/svx/tbxcustomshapes.hxx deleted file mode 100644 index 2d55c8a49ba2..000000000000 --- a/include/svx/tbxcustomshapes.hxx +++ /dev/null @@ -1,59 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_SVX_TBXCUSTOMSHAPES_HXX -#define INCLUDED_SVX_TBXCUSTOMSHAPES_HXX - -#include <sfx2/tbxctrl.hxx> -#include <svx/svxdllapi.h> - -/************************************************************************* -|* -|* SvxTbxCtlCustomShapes -|* -\************************************************************************/ - -class SVX_DLLPUBLIC SvxTbxCtlCustomShapes : public SfxToolBoxControl -{ -public: - virtual void Select(sal_uInt16 nSelectModifier) SAL_OVERRIDE; - virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, - const SfxPoolItem* pState ) SAL_OVERRIDE; - virtual VclPtr<SfxPopupWindow> CreatePopupWindow() SAL_OVERRIDE; - - SFX_DECL_TOOLBOX_CONTROL(); - - SvxTbxCtlCustomShapes( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx ); - virtual ~SvxTbxCtlCustomShapes() {} - - //interface XSubToolbarController: - virtual sal_Bool SAL_CALL opensSubToolbar() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - virtual OUString SAL_CALL getSubToolbarName() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - virtual void SAL_CALL functionSelected( const OUString& aCommand ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - virtual void SAL_CALL updateImage() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - -private: - OUString m_aSubTbName; - OUString m_aSubTbxResName; - OUString m_aCommand; -}; - - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |