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 UUI_LOGINDLG_HXX
21 #define UUI_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>
29 //============================================================================
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 cedentials"
40 //............................................................................
41 //............................................................................
43 //============================================================================
44 class LoginDialog
: public ModalDialog
49 FixedInfo aRequestInfo
;
56 FixedText aPasswordFT
;
60 CheckBox aSavePasswdBtn
;
61 CheckBox aUseSysCredsCB
;
64 CancelButton aCancelBtn
;
67 void HideControls_Impl( sal_uInt16 nFlags
);
68 void EnableUseSysCredsControls_Impl( sal_Bool bUseSysCredsEnabled
);
70 DECL_LINK(OKHdl_Impl
, void *);
71 DECL_LINK(PathHdl_Impl
, void *);
72 DECL_LINK(UseSysCredsHdl_Impl
, void *);
75 LoginDialog( Window
* pParent
, sal_uInt16 nFlags
,
76 const rtl::OUString
& rServer
, const rtl::OUString
&rRealm
,
78 virtual ~LoginDialog();
80 String
GetPath() const { return aPathED
.GetText(); }
81 void SetPath( const String
& rNewPath
) { aPathED
.SetText( rNewPath
); }
82 String
GetName() const { return aNameED
.GetText(); }
83 void SetName( const String
& rNewName
) { aNameED
.SetText( rNewName
); }
84 String
GetPassword() const { return aPasswordED
.GetText(); }
85 void SetPassword( const String
& rNew
) { aPasswordED
.SetText( rNew
); }
86 String
GetAccount() const { return aAccountED
.GetText(); }
87 void SetAccount( const String
& rNew
) { aAccountED
.SetText( rNew
); }
88 sal_Bool
IsSavePassword() const { return aSavePasswdBtn
.IsChecked(); }
89 void SetSavePassword( sal_Bool bSave
) { aSavePasswdBtn
.Check( bSave
); }
90 void SetSavePasswordText( const String
& rTxt
) { aSavePasswdBtn
.SetText( rTxt
); }
91 sal_Bool
IsUseSystemCredentials() const { return aUseSysCredsCB
.IsChecked(); }
92 void SetUseSystemCredentials( sal_Bool bUse
);
93 void SetErrorText( const String
& rTxt
) { aErrorInfo
.SetText( rTxt
); }
94 void SetLoginRequestText( const String
& rTxt
) { aRequestInfo
.SetText( rTxt
); }
99 // -----------------------------------------------------------------------
102 //............................................................................
103 //............................................................................
105 #endif // UUI_LOGINDLG_HXX
107 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */