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 .
20 #ifndef INCLUDED_UUI_SOURCE_LOGINDLG_HXX
21 #define INCLUDED_UUI_SOURCE_LOGINDLG_HXX
23 #include <svtools/stdctrl.hxx>
24 #include <vcl/button.hxx>
25 #include <vcl/dialog.hxx>
26 #include <vcl/edit.hxx>
27 #include <vcl/fixed.hxx>
30 #define LF_NO_PATH 0x0001 // hide "path"
31 #define LF_NO_USERNAME 0x0002 // hide "name"
32 #define LF_NO_PASSWORD 0x0004 // hide "password"
33 #define LF_NO_SAVEPASSWORD 0x0008 // hide "save password"
34 #define LF_NO_ERRORTEXT 0x0010 // hide message
35 #define LF_PATH_READONLY 0x0020 // "path" readonly
36 #define LF_USERNAME_READONLY 0x0040 // "name" readonly
37 #define LF_NO_ACCOUNT 0x0080 // hide "account"
38 #define LF_NO_USESYSCREDS 0x0100 // hide "use system credentials"
44 class LoginDialog
: public ModalDialog
46 VclPtr
<FixedText
> m_pErrorFT
;
47 VclPtr
<FixedText
> m_pErrorInfo
;
48 VclPtr
<FixedText
> m_pRequestInfo
;
49 VclPtr
<FixedText
> m_pPathFT
;
50 VclPtr
<Edit
> m_pPathED
;
51 VclPtr
<PushButton
> m_pPathBtn
;
52 VclPtr
<FixedText
> m_pNameFT
;
53 VclPtr
<Edit
> m_pNameED
;
54 VclPtr
<FixedText
> m_pPasswordFT
;
55 VclPtr
<Edit
> m_pPasswordED
;
56 VclPtr
<FixedText
> m_pAccountFT
;
57 VclPtr
<Edit
> m_pAccountED
;
58 VclPtr
<CheckBox
> m_pSavePasswdBtn
;
59 VclPtr
<CheckBox
> m_pUseSysCredsCB
;
60 VclPtr
<OKButton
> m_pOKBtn
;
62 void HideControls_Impl( sal_uInt16 nFlags
);
63 void EnableUseSysCredsControls_Impl( bool bUseSysCredsEnabled
);
65 DECL_LINK(OKHdl_Impl
, void *);
66 DECL_LINK(PathHdl_Impl
, void *);
67 DECL_LINK(UseSysCredsHdl_Impl
, void *);
70 LoginDialog(vcl::Window
* pParent
, sal_uInt16 nFlags
,
71 const OUString
& rServer
, const OUString
&rRealm
);
72 virtual ~LoginDialog();
73 virtual void dispose() SAL_OVERRIDE
;
75 OUString
GetPath() const { return m_pPathED
->GetText(); }
76 void SetPath( const OUString
& rNewPath
) { m_pPathED
->SetText( rNewPath
); }
77 OUString
GetName() const { return m_pNameED
->GetText(); }
78 void SetName( const OUString
& rNewName
) { m_pNameED
->SetText( rNewName
); }
79 OUString
GetPassword() const { return m_pPasswordED
->GetText(); }
80 void SetPassword( const OUString
& rNew
) { m_pPasswordED
->SetText( rNew
); }
81 OUString
GetAccount() const { return m_pAccountED
->GetText(); }
82 void SetAccount( const OUString
& rNew
) { m_pAccountED
->SetText( rNew
); }
83 bool IsSavePassword() const { return m_pSavePasswdBtn
->IsChecked(); }
84 void SetSavePassword( bool bSave
) { m_pSavePasswdBtn
->Check( bSave
); }
85 void SetSavePasswordText( const OUString
& rTxt
) { m_pSavePasswdBtn
->SetText( rTxt
); }
86 bool IsUseSystemCredentials() const { return m_pUseSysCredsCB
->IsChecked(); }
87 void SetUseSystemCredentials( bool bUse
);
88 void SetErrorText( const OUString
& rTxt
) { m_pErrorInfo
->SetText( rTxt
); }
89 void SetLoginRequestText( const OUString
& rTxt
) { m_pRequestInfo
->SetText( rTxt
); }
100 #endif // INCLUDED_UUI_SOURCE_LOGINDLG_HXX
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */