summaryrefslogtreecommitdiff
path: root/basctl/source/basicide
diff options
context:
space:
mode:
authortagezi <lera.goncharuk@gmail.com>2018-12-06 16:59:28 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2018-12-08 10:09:58 +0100
commit79cf98634354a8dcc320391b5c8fcd1dbb7f7089 (patch)
tree34bc675b483b862f1b3754c5c0b0c21c54557241 /basctl/source/basicide
parent8f8f9aa52d54f8cbdf044169d95e23b3dcc8da4b (diff)
Rename files for ToolBox ComboBoxes in BasicIDE
As part of documenting source code for easier code reading by newbies, because of the word "Box" in IDE is used not only for drop-down lists, but also for other interface elements with limited boundaries Change-Id: Ie9e1949cc9ac474bffe8201d12b9ce7dc2276076 Reviewed-on: https://gerrit.libreoffice.org/64713 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'basctl/source/basicide')
-rw-r--r--basctl/source/basicide/IDEComboBox.cxx (renamed from basctl/source/basicide/basicbox.cxx)4
-rw-r--r--basctl/source/basicide/basicbox.hxx257
-rw-r--r--basctl/source/basicide/basidesh.cxx2
3 files changed, 2 insertions, 261 deletions
diff --git a/basctl/source/basicide/basicbox.cxx b/basctl/source/basicide/IDEComboBox.cxx
index 6a1d32cf35cb..4e240e988a74 100644
--- a/basctl/source/basicide/basicbox.cxx
+++ b/basctl/source/basicide/IDEComboBox.cxx
@@ -19,10 +19,8 @@
#include <strings.hrc>
#include <basidesh.hxx>
-
-#include "basicbox.hxx"
+#include <IDEComboBox.hxx>
#include <iderdll.hxx>
-
#include <localizationmgr.hxx>
#include <managelang.hxx>
diff --git a/basctl/source/basicide/basicbox.hxx b/basctl/source/basicide/basicbox.hxx
deleted file mode 100644
index 8c183ff30793..000000000000
--- a/basctl/source/basicide/basicbox.hxx
+++ /dev/null
@@ -1,257 +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_BASCTL_SOURCE_BASICIDE_BASICBOX_HXX
-#define INCLUDED_BASCTL_SOURCE_BASICIDE_BASICBOX_HXX
-
-#include <svl/stritem.hxx>
-#include <sfx2/tbxctrl.hxx>
-#include <vcl/lstbox.hxx>
-
-namespace basctl
-{
-/*!
- * @brief Manage states of macro and dialog Library ComboBox
- *
- * @see LibBox Class
- */
-class LibBoxControl : public SfxToolBoxControl
-{
-public:
- /*!
- * Macro for registering two methods
- *
- * @code
- * static SfxToolBoxControl* CreateImpl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx)
- * static void RegisterControl(sal_uInt16 nSlotId = 0, SfxModule* pMod=nullptr)
- * @endcode
- * @see Macro SFX_IMPL_TOOLBOX_CONTROL
- */
- SFX_DECL_TOOLBOX_CONTROL();
-
- /*!
- * @param nSlotId -- the slot as internal operation number
- * @param nId -- this item's unique id in ToolBox
- * @param rTbx -- the ToolBox which contains this ComboBox
- */
- LibBoxControl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx);
-
- /*!
- * Triggered if state was changed
- *
- * @param nSlotID -- the slot as internal operation number (not used in this place)
- * @param eState -- enum value which contains ComboBox state
- * @param pState --
- */
- virtual void StateChanged(sal_uInt16 nSlotID, SfxItemState eState,
- const SfxPoolItem* pState) override;
- /*!
- * Create combobox of Macro and Dialog Library
- *
- * @param pParent -- parent window
- * @return ComboBox of macro and dialog Library
- */
- virtual VclPtr<vcl::Window> CreateItemWindow(vcl::Window* pParent) override;
-};
-
-/*!
- * @brief Base class for all ComboBox elements.
- *
- * Base class for ComboBoxes which need to update their content according
- * to the list of open documents.
- */
-class DocListenerBox : public ListBox, public DocumentEventListener
-{
-protected:
- /// @param pParent -- parent window
- DocListenerBox(vcl::Window* pParent);
- virtual ~DocListenerBox() override;
- virtual void dispose() override;
-
- virtual void FillBox() = 0;
-
-private:
- // DocumentEventListener
- virtual void onDocumentCreated(const ScriptDocument& _rDoc) override;
- virtual void onDocumentOpened(const ScriptDocument& _rDoc) override;
- virtual void onDocumentSave(const ScriptDocument& _rDoc) override;
- virtual void onDocumentSaveDone(const ScriptDocument& _rDoc) override;
- virtual void onDocumentSaveAs(const ScriptDocument& _rDoc) override;
- virtual void onDocumentSaveAsDone(const ScriptDocument& _rDoc) override;
- virtual void onDocumentClosed(const ScriptDocument& _rDoc) override;
- virtual void onDocumentTitleChanged(const ScriptDocument& _rDoc) override;
- virtual void onDocumentModeChanged(const ScriptDocument& _rDoc) override;
-
- DocumentEventNotifier maNotifier;
-};
-
-/*!
- * @brief Macros and Dialogs Library ComboBox
- *
- * @see LibBoxControl Class
- */
-class LibBox : public DocListenerBox
-{
-public:
- /// @param pParent
- LibBox(vcl::Window* pParent);
- virtual ~LibBox() override;
- virtual void dispose() override;
-
- using Window::Update;
- /*!
- * Update selection in ComboBox of macro and dialog Library
- *
- * @param pItem -- string that was selected
- */
- void Update(const SfxStringItem* pItem);
-
-protected:
- /// Called for setting language when user selects a language in ComboBox
- virtual void Select() override;
-
- /*!
- * Handle keystrokes and mouse
- *
- * @param rNEvt represents mouse event
- * @return a bool value: true if was handled, and false if there was nothing handled
- */
- virtual bool PreNotify(NotifyEvent& rNEvt) override;
-
-private:
- static void ReleaseFocus();
-
- /*!
- * Insert name library in specified position
- *
- * @param rDocument -- macro or dialog
- * @param eLocation -- enum value of Locations
- */
- void InsertEntries(const ScriptDocument& rDocument, LibraryLocation eLocation);
-
- void ClearBox();
- void NotifyIDE();
-
- /// Fill up the combobox
- virtual void FillBox() override;
-
- OUString maCurrentText;
- bool mbIgnoreSelect;
- bool mbFillBox; ///< If true, when FillBox() is called
-};
-
-/*!
- * @brief Manage stats of Language ComboBox
- *
- * @see LanguageBox Class
- */
-class LanguageBoxControl : public SfxToolBoxControl
-{
-public:
- /*! Macro for registering two methods
- *
- * @code
- * static SfxToolBoxControl* CreateImpl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx)
- * static void RegisterControl(sal_uInt16 nSlotId = 0, SfxModule* pMod=nullptr)
- * @endcode
- * @see Macro SFX_IMPL_TOOLBOX_CONTROL
- */
- SFX_DECL_TOOLBOX_CONTROL();
-
- /*!
- * @param nSlotId -- the slot as internal operation number
- * @param nId -- this item's unique id in ToolBox
- * @param rTbx -- the ToolBox which contains this ComboBox
- */
- LanguageBoxControl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx);
-
- /*!
- * Triggered if state was changed
- *
- * @param nSlotID -- the slot as internal operation number (not used in this place)
- * @param eState -- enum value which contains ComboBox state
- * @param pState --
- */
- virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState,
- const SfxPoolItem* pState) override;
- /*!
- * Create ComboBox of Language
- *
- * @param pParent
- * @return LanguageBox ComboBox
- */
- virtual VclPtr<vcl::Window> CreateItemWindow(vcl::Window* pParent) override;
-};
-
-/*!
- * @brief Class language ComboBox
- *
- * @see LanguageBoxControl Class
- */
-class LanguageBox : public DocListenerBox
-{
-public:
- /*!
- * @param pParent
- */
- LanguageBox(vcl::Window* pParent);
- virtual ~LanguageBox() override;
- virtual void dispose() override;
-
- using Window::Update;
- /*!
- * Update selection in ComboBox of macro and dialog Library
- *
- * @param pItem -- string that was selected
- */
- void Update(const SfxStringItem* pItem);
-
-protected:
- /// Called for setting language when user selects a language in ComboBox
- virtual void Select() override;
-
- /*!
- * Handle keystrokes and mouse
- *
- * @param rNEvt represents mouse event
- * @return a bool value: true if was handled, and false if there was nothing handled
- */
- virtual bool PreNotify(NotifyEvent& rNEvt) override;
-
-private:
- /// Delete all languages from ComboBox
- void ClearBox();
- /// Switch inferface of dialog to selected language
- void SetLanguage();
-
- /// Fill up the language combobox
- virtual void FillBox() override;
-
- OUString msNotLocalizedStr;
- OUString msDefaultLanguageStr;
- OUString msCurrentText;
-
- bool mbIgnoreSelect; ///< do not use in this class
-};
-
-} // namespace basctl
-
-#endif // INCLUDED_BASCTL_SOURCE_BASICIDE_BASICBOX_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basctl/source/basicide/basidesh.cxx b/basctl/source/basicide/basidesh.cxx
index 78009761502d..2c7049a5ddfa 100644
--- a/basctl/source/basicide/basidesh.cxx
+++ b/basctl/source/basicide/basidesh.cxx
@@ -26,7 +26,7 @@
#include "baside2.hxx"
#include <baside3.hxx>
#include "basdoc.hxx"
-#include "basicbox.hxx"
+#include <IDEComboBox.hxx>
#include <editeng/sizeitem.hxx>
#include "iderdll2.hxx"
#include <basidectrlr.hxx>