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 _SFX_PASSWD_HXX
20 #define _SFX_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>
31 // defines ---------------------------------------------------------------
33 #define SHOWEXTRAS_NONE ((sal_uInt16)0x0000)
34 #define SHOWEXTRAS_USER ((sal_uInt16)0x0001)
35 #define SHOWEXTRAS_CONFIRM ((sal_uInt16)0x0002)
36 #define SHOWEXTRAS_PASSWORD2 ((sal_uInt16)0x0004)
37 #define SHOWEXTRAS_CONFIRM2 ((sal_uInt16)0x0008)
38 #define SHOWEXTRAS_ALL ((sal_uInt16)(SHOWEXTRAS_USER | SHOWEXTRAS_CONFIRM))
40 // class SfxPasswordDialog -----------------------------------------------
42 class SFX2_DLLPUBLIC SfxPasswordDialog
: public ModalDialog
45 VclFrame
* mpPassword1Box
;
48 FixedText
* mpPassword1FT
;
50 FixedText
* mpConfirm1FT
;
53 VclFrame
* mpPassword2Box
;
54 FixedText
* mpPassword2FT
;
56 FixedText
* mpConfirm2FT
;
59 FixedText
* mpMinLengthFT
;
63 String maMinLenPwdStr
;
70 DECL_DLLPRIVATE_LINK(EditModifyHdl
, Edit
*);
71 DECL_DLLPRIVATE_LINK(OKHdl
, void *);
76 SfxPasswordDialog(Window
* pParent
, const String
* pGroupText
= NULL
);
78 String
GetUser() const
80 return mpUserED
->GetText();
82 String
GetPassword() const
84 return mpPassword1ED
->GetText();
86 String
GetConfirm() const
88 return mpConfirm1ED
->GetText();
90 String
GetPassword2() const
92 return mpPassword2ED
->GetText();
94 String
GetConfirm2() const
96 return mpConfirm2ED
->GetText();
98 void SetGroup2Text(const String
& i_rText
)
100 mpPassword2Box
->set_label(i_rText
);
102 void SetMinLen(sal_uInt16 Len
);
103 void SetEditHelpId(const OString
& rId
)
105 mpPassword1ED
->SetHelpId( rId
);
107 void ShowExtras(sal_uInt16 nExtras
)
111 void AllowAsciiOnly(bool i_bAsciiOnly
= true)
113 mbAsciiOnly
= i_bAsciiOnly
;
116 void ShowMinLengthText(bool bShow
);
118 virtual short Execute();
121 #endif // #ifndef _SFX_PASSWD_HXX
123 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */