1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_SFX2_PASSWD_HXX
20 #define INCLUDED_SFX2_PASSWD_HXX
22 #include <sal/config.h>
23 #include <sfx2/dllapi.h>
24 #include <vcl/button.hxx>
25 #include <vcl/dialog.hxx>
26 #include <vcl/edit.hxx>
27 #include <vcl/fixed.hxx>
28 #include <vcl/layout.hxx>
29 #include <sfx2/app.hxx>
30 #include <o3tl/typed_flags_set.hxx>
32 // defines ---------------------------------------------------------------
34 enum class SfxShowExtras
45 template<> struct typed_flags
<SfxShowExtras
> : is_typed_flags
<SfxShowExtras
, 0x0f> {};
48 // class SfxPasswordDialog -----------------------------------------------
50 class SFX2_DLLPUBLIC SfxPasswordDialog
: public ModalDialog
53 VclPtr
<VclFrame
> mpPassword1Box
;
54 VclPtr
<FixedText
> mpUserFT
;
55 VclPtr
<Edit
> mpUserED
;
56 VclPtr
<FixedText
> mpPassword1FT
;
57 VclPtr
<Edit
> mpPassword1ED
;
58 VclPtr
<FixedText
> mpConfirm1FT
;
59 VclPtr
<Edit
> mpConfirm1ED
;
61 VclPtr
<VclFrame
> mpPassword2Box
;
62 VclPtr
<FixedText
> mpPassword2FT
;
63 VclPtr
<Edit
> mpPassword2ED
;
64 VclPtr
<FixedText
> mpConfirm2FT
;
65 VclPtr
<Edit
> mpConfirm2ED
;
67 VclPtr
<FixedText
> mpMinLengthFT
;
69 VclPtr
<OKButton
> mpOKBtn
;
71 OUString maMinLenPwdStr
;
72 OUString maMinLenPwdStr1
;
73 OUString maEmptyPwdStr
;
74 OUString maMainPwdStr
;
76 SfxShowExtras mnExtras
;
79 DECL_DLLPRIVATE_LINK(EditModifyHdl
, Edit
*);
80 DECL_DLLPRIVATE_LINK(OKHdl
, void *);
85 SfxPasswordDialog(vcl::Window
* pParent
, const OUString
* pGroupText
= NULL
);
86 virtual ~SfxPasswordDialog();
87 virtual void dispose() SAL_OVERRIDE
;
89 OUString
GetUser() const
91 return mpUserED
->GetText();
93 OUString
GetPassword() const
95 return mpPassword1ED
->GetText();
97 OUString
GetConfirm() const
99 return mpConfirm1ED
->GetText();
101 OUString
GetPassword2() const
103 return mpPassword2ED
->GetText();
105 OUString
GetConfirm2() const
107 return mpConfirm2ED
->GetText();
109 void SetGroup2Text(const OUString
& i_rText
)
111 mpPassword2Box
->set_label(i_rText
);
113 void SetMinLen(sal_uInt16 Len
);
114 void SetEditHelpId(const OString
& rId
)
116 mpPassword1ED
->SetHelpId( rId
);
118 void ShowExtras(SfxShowExtras nExtras
)
122 void AllowAsciiOnly(bool i_bAsciiOnly
= true)
124 mbAsciiOnly
= i_bAsciiOnly
;
127 void ShowMinLengthText(bool bShow
);
129 virtual short Execute() SAL_OVERRIDE
;
132 #endif // INCLUDED_SFX2_PASSWD_HXX
134 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */