Kaydet (Commit) ca2fd526 authored tarafından Samuel Mehrbrodt's avatar Samuel Mehrbrodt

tdf#83877 Add dialog to sign signature lines

actual signing still missing

Change-Id: I41f013a2867f923155203dcee58ff453a43fa7c2
Reviewed-on: https://gerrit.libreoffice.org/51735Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
üst 55e84652
......@@ -121,6 +121,7 @@ $(eval $(call gb_Library_add_exception_objects,cui,\
cui/source/dialogs/pastedlg \
cui/source/dialogs/postdlg \
cui/source/dialogs/scriptdlg \
cui/source/dialogs/SignSignatureLineDialog \
cui/source/dialogs/sdrcelldlg \
cui/source/dialogs/showcols \
cui/source/dialogs/SpellAttrib \
......
......@@ -180,6 +180,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\
cui/uiconfig/ui/shadowtabpage \
cui/uiconfig/ui/showcoldialog \
cui/uiconfig/ui/similaritysearchdialog \
cui/uiconfig/ui/signsignatureline \
cui/uiconfig/ui/slantcornertabpage \
cui/uiconfig/ui/smarttagoptionspage \
cui/uiconfig/ui/smoothdialog \
......
......@@ -382,6 +382,7 @@
#define RID_SVXSTR_SHADOW_STYLE_TOPRIGHT NC_("RID_SVXSTR_SHADOW_STYLE_TOPRIGHT", "Cast Shadow to Top Right")
#define RID_SVXSTR_SHADOW_STYLE_BOTTOMLEFT NC_("RID_SVXSTR_SHADOW_STYLE_BOTTOMLEFT", "Cast Shadow to Bottom Left")
#define RID_SVXSTR_SHADOW_STYLE_TOPLEFT NC_("RID_SVXSTR_SHADOW_STYLE_TOPLEFT", "Cast Shadow to Top Left")
#define RID_SVXSTR_SIGNATURELINE_SIGNED_BY NC_("RID_SVXSTR_SIGNATURELINE_SIGNED_BY", "Signed by: %1")
#endif
......
This diff is collapsed.
......@@ -41,6 +41,7 @@
#include <cuicharmap.hxx>
#include <cuihyperdlg.hxx>
#include <cfgutil.hxx>
#include <SignSignatureLineDialog.hxx>
#include <SpellDialog.hxx>
#include <zoom.hxx>
#include <showcols.hxx>
......
......@@ -60,6 +60,7 @@
#include <insdlg.hxx>
#include <pastedlg.hxx>
#include <linkdlg.hxx>
#include <SignSignatureLineDialog.hxx>
#include <SpellDialog.hxx>
#include <cfg.hxx>
#include <numpages.hxx>
......@@ -191,6 +192,11 @@ void AbstractSvxCharacterMapDialog_Impl::SetText(const OUString& rStr)
m_xDlg->set_title(rStr);
}
short AbstractSignSignatureLineDialog_Impl::Execute()
{
return m_xDlg->execute();
}
IMPL_ABSTDLG_BASE(AbstractScreenshotAnnotationDlg_Impl);
......@@ -1569,4 +1575,12 @@ VclPtr<AbstractScreenshotAnnotationDlg> AbstractDialogFactory_Impl::CreateScreen
return VclPtr<AbstractScreenshotAnnotationDlg_Impl>::Create(pDlg);
}
VclPtr<AbstractSignSignatureLineDialog>
AbstractDialogFactory_Impl::CreateSignSignatureLineDialog(weld::Window* pParent,
const Reference<XModel> xModel)
{
return VclPtr<AbstractSignSignatureLineDialog_Impl>::Create(
new SignSignatureLineDialog(pParent, xModel));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -533,6 +533,20 @@ class AbstractScreenshotAnnotationDlg_Impl : public AbstractScreenshotAnnotation
DECL_ABSTDLG_BASE(AbstractScreenshotAnnotationDlg_Impl, ScreenshotAnnotationDlg)
};
class SignSignatureLineDialog;
class AbstractSignSignatureLineDialog_Impl : public AbstractSignSignatureLineDialog
{
protected:
std::unique_ptr<SignSignatureLineDialog> m_xDlg;
public:
explicit AbstractSignSignatureLineDialog_Impl(SignSignatureLineDialog* p)
: m_xDlg(p)
{
}
virtual short Execute() override;
};
//AbstractDialogFactory_Impl implementations
class AbstractDialogFactory_Impl : public SvxAbstractDialogFactory
{
......@@ -711,6 +725,10 @@ public:
virtual VclPtr<AbstractPasswordToOpenModifyDialog> CreatePasswordToOpenModifyDialog(weld::Window * pParent, sal_uInt16 nMaxPasswdLen, bool bIsPasswordToModify) override;
virtual VclPtr<AbstractScreenshotAnnotationDlg> CreateScreenshotAnnotationDlg(vcl::Window * pParent, Dialog& rParentDialog) override;
virtual VclPtr<AbstractSignSignatureLineDialog>
CreateSignSignatureLineDialog(weld::Window* pParent,
const css::uno::Reference<css::frame::XModel> xModel) override;
};
#endif
......
/* -*- 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_SIGNSIGNATURELINEDIALOG_HXX
#define INCLUDED_CUI_INC_SIGNSIGNATURELINEDIALOG_HXX
#include <vcl/weld.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/security/XCertificate.hpp>
#include <com/sun/star/uno/Reference.hxx>
class SignSignatureLineDialog : public weld::GenericDialogController
{
public:
SignSignatureLineDialog(weld::Widget* pParent, css::uno::Reference<css::frame::XModel> xModel);
short execute();
private:
std::unique_ptr<weld::Entry> m_xEditName;
std::unique_ptr<weld::TextView> m_xEditComment;
std::unique_ptr<weld::Button> m_xBtnChooseCertificate;
std::unique_ptr<weld::Button> m_xBtnSign;
css::uno::Reference<css::frame::XModel> m_xModel;
css::uno::Reference<css::beans::XPropertySet> m_xShapeProperties;
css::uno::Reference<css::security::XCertificate> m_xSelectedCertifate;
OUString m_aSignatureLineId;
OUString m_aSuggestedSignerName;
OUString m_aSuggestedSignerTitle;
bool m_bShowSignDate;
void ValidateFields();
void Apply();
OUString getCDataString(const OUString& rString);
OUString getSignatureImage();
DECL_LINK(chooseCertificate, weld::Button&, void);
};
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
This diff is collapsed.
......@@ -966,10 +966,11 @@ class SfxStringItem;
#define SID_INSERT_SIGNATURELINE ( SID_SVX_START + 1173 )
#define SID_EDIT_SIGNATURELINE ( SID_SVX_START + 1174 )
#define SID_SIGN_SIGNATURELINE ( SID_SVX_START + 1175 )
// IMPORTANT NOTE: adjust SID_SVX_FIRSTFREE, when adding new slot id
#define SID_SVX_FIRSTFREE ( SID_EDIT_SIGNATURELINE + 1 )
#define SID_SVX_FIRSTFREE ( SID_SIGN_SIGNATURELINE + 1 )
// Overflow check for slot IDs
#if SID_SVX_FIRSTFREE > SID_SVX_END
......
......@@ -19,6 +19,7 @@
#ifndef INCLUDED_VCL_ABSTDLG_HXX
#define INCLUDED_VCL_ABSTDLG_HXX
#include <sal/types.h>
#include <rtl/ustring.hxx>
#include <tools/link.hxx>
#include <vcl/dllapi.h>
......@@ -28,6 +29,9 @@
#include <functional>
#include <memory>
#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/frame/XModel.hpp>
namespace vcl { class Window; }
class Dialog;
class Bitmap;
......@@ -115,6 +119,12 @@ protected:
virtual ~AbstractScreenshotAnnotationDlg() override = default;
};
class VCL_DLLPUBLIC AbstractSignSignatureLineDialog : public VclAbstractDialog
{
protected:
virtual ~AbstractSignSignatureLineDialog() override = default;
};
class VCL_DLLPUBLIC VclAbstractDialogFactory
{
public:
......@@ -126,6 +136,12 @@ public:
// creates instance of PasswordToOpenModifyDialog from cui
virtual VclPtr<AbstractPasswordToOpenModifyDialog> CreatePasswordToOpenModifyDialog(weld::Window * pParent, sal_uInt16 nMaxPasswdLen, bool bIsPasswordToModify) = 0;
// creates instance of SignSignatureDialog from cui
virtual VclPtr<AbstractSignSignatureLineDialog>
CreateSignSignatureLineDialog(weld::Window* pParent,
const css::uno::Reference<css::frame::XModel> xModel)
= 0;
// creates instance of ScreenshotAnnotationDlg from cui
virtual VclPtr<AbstractScreenshotAnnotationDlg> CreateScreenshotAnnotationDlg(
vcl::Window* pParent,
......
......@@ -6553,6 +6553,14 @@
<value>1</value>
</prop>
</node>
<node oor:name=".uno:SignSignatureLine" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">~Sign Signature Line...</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
<value>1</value>
</prop>
</node>
</node>
</node>
</oor:component-data>
......@@ -11978,3 +11978,20 @@ SfxVoidItem EditSignatureLine SID_EDIT_SIGNATURELINE
ToolBoxConfig = TRUE,
GroupId = SfxGroupId::Edit;
]
SfxVoidItem SignSignatureLine SID_SIGN_SIGNATURELINE
()
[
AutoUpdate = FALSE,
FastCall = FALSE,
ReadOnlyDoc = FALSE,
Toggle = FALSE,
Container = FALSE,
RecordAbsolute = FALSE,
RecordPerSet;
AccelConfig = FALSE,
MenuConfig = FALSE,
ToolBoxConfig = FALSE,
GroupId = SfxGroupId::Edit;
]
......@@ -48,6 +48,12 @@ interface TextEditView : BaseTextEditView
StateMethod = GetState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
SID_SIGN_SIGNATURELINE // status()
[
ExecMethod = ExecDlgExt ;
StateMethod = GetState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
FN_EDIT_FOOTNOTE // status(final|play)
[
ExecMethod = ExecDlgExt ;
......
......@@ -79,6 +79,20 @@ void SwView::ExecDlgExt(SfxRequest const &rReq)
pDialog->Execute();
break;
}
case SID_SIGN_SIGNATURELINE:
{
VclAbstractDialogFactory* pFact = VclAbstractDialogFactory::Create();
assert(pFact && "VclAbstractDialogFactory fail!");
const uno::Reference<frame::XModel> xModel(GetCurrentDocument());
VclPtr<AbstractSignSignatureLineDialog> pDialog
= pFact->CreateSignSignatureLineDialog(GetFrameWeld(), xModel);
assert(pDialog && "Dialog creation failed!");
if (pDialog)
pDialog->Execute();
break;
}
case FN_EDIT_FOOTNOTE:
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
......
......@@ -104,6 +104,7 @@ void SwView::GetState(SfxItemSet &rSet)
}
break;
case SID_EDIT_SIGNATURELINE:
case SID_SIGN_SIGNATURELINE:
if (!isSignatureLineSelected())
rSet.DisableItem(nWhich);
break;
......
......@@ -69,4 +69,5 @@
<menu:menuitem menu:id=".uno:AddTextBox"/>
<menu:menuitem menu:id=".uno:RemoveTextBox"/>
<menu:menuitem menu:id=".uno:EditSignatureLine"/>
<menu:menuitem menu:id=".uno:SignSignatureLine"/>
</menu:menupopup>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment