diff options
author | Shubham Goyal <22shubh22@gmail.com> | 2019-07-03 12:15:08 +0530 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2019-07-25 07:15:10 +0200 |
commit | 2de42b53b7c23223c38e64a75eae248d8a0cd4ec (patch) | |
tree | dc4b2fc96a0569b7c0ebfdc80446181c842a9964 /cui/source/inc | |
parent | 5ccc8124a03cffca3a1848f754524a06a063cb51 (diff) |
QRCode Dialog Box feature
The patch handles the created QR code as a Customized Shape (Graphic
Object)
Change-Id: I1cee6f0e7fac585de880a9ac34e3bc441a4b7390
Reviewed-on: https://gerrit.libreoffice.org/74167
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'cui/source/inc')
-rw-r--r-- | cui/source/inc/QrCodeGenDialog.hxx | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/cui/source/inc/QrCodeGenDialog.hxx b/cui/source/inc/QrCodeGenDialog.hxx new file mode 100644 index 000000000000..70fc2c7f7d7a --- /dev/null +++ b/cui/source/inc/QrCodeGenDialog.hxx @@ -0,0 +1,58 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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/. + */ +#ifndef INCLUDED_CUI_INC_QRCODEGENDIALOG_HXX +#define INCLUDED_CUI_INC_QRCODEGENDIALOG_HXX + +#include <vcl/weld.hxx> + +#include <com/sun/star/frame/XModel.hpp> +#include <com/sun/star/uno/Reference.hxx> +#include <com/sun/star/drawing/QRCodeErrorCorrection.hpp> + +#include <com/sun/star/beans/XPropertySet.hpp> + +// cuitabarea included to use Button Box class for group of Radio Buttons +#include "cuitabarea.hxx" + +class QrCodeGenDialog : public weld::GenericDialogController +{ +public: + QrCodeGenDialog(weld::Widget* pParent, css::uno::Reference<css::frame::XModel> xModel, + bool bEditExisting); + + virtual short run() override; + +protected: + css::uno::Reference<css::frame::XModel> m_xModel; + void Apply(); + +private: + std::unique_ptr<weld::Entry> m_xEdittext; + std::unique_ptr<weld::RadioButton> m_xRadioLow; + std::unique_ptr<weld::RadioButton> m_xRadioMedium; + std::unique_ptr<weld::RadioButton> m_xRadioQuartile; + std::unique_ptr<weld::RadioButton> m_xRadioHigh; + std::unique_ptr<weld::SpinButton> m_xSpinBorder; + + css::uno::Reference<css::beans::XPropertySet> m_xExistingShapeProperties; + + /* maBox - holds radioButton, helped in writing code. */ + ButtonBox maBox; + /* Stores which error correction is selected. */ + long m_aECCSelect; + void SelectErrorCorrection(weld::ToggleButton&); + void GetErrorCorrection(long); + static OUString GenerateQrCode(OUString aQrText, int aQrECC, int aQrBorder); + + DECL_LINK(SelectRadio_Impl, weld::ToggleButton&, void); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ |