1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #ifndef UUI_LOGINDLG_HXX 29 #define UUI_LOGINDLG_HXX 30 31 #include <svtools/stdctrl.hxx> 32 #ifndef _SV_BUTTON_HXX 33 #include <vcl/button.hxx> 34 #endif 35 #include <vcl/dialog.hxx> 36 #include <vcl/edit.hxx> 37 #include <vcl/fixed.hxx> 38 39 //============================================================================ 40 #define LF_NO_PATH 0x0001 // hide "path" 41 #define LF_NO_USERNAME 0x0002 // hide "name" 42 #define LF_NO_PASSWORD 0x0004 // hide "password" 43 #define LF_NO_SAVEPASSWORD 0x0008 // hide "save password" 44 #define LF_NO_ERRORTEXT 0x0010 // hide message 45 #define LF_PATH_READONLY 0x0020 // "path" readonly 46 #define LF_USERNAME_READONLY 0x0040 // "name" readonly 47 #define LF_NO_ACCOUNT 0x0080 // hide "account" 48 #define LF_NO_USESYSCREDS 0x0100 // hide "use system cedentials" 49 50 //............................................................................ 51 //............................................................................ 52 53 //============================================================================ 54 class LoginDialog : public ModalDialog 55 { 56 FixedText aErrorFT; 57 FixedInfo aErrorInfo; 58 FixedLine aLogin1FL; 59 FixedInfo aRequestInfo; 60 FixedLine aLogin2FL; 61 FixedText aPathFT; 62 Edit aPathED; 63 PushButton aPathBtn; 64 FixedText aNameFT; 65 Edit aNameED; 66 FixedText aPasswordFT; 67 Edit aPasswordED; 68 FixedText aAccountFT; 69 Edit aAccountED; 70 CheckBox aSavePasswdBtn; 71 CheckBox aUseSysCredsCB; 72 FixedLine aButtonsFL; 73 OKButton aOKBtn; 74 CancelButton aCancelBtn; 75 HelpButton aHelpBtn; 76 77 void HideControls_Impl( sal_uInt16 nFlags ); 78 void EnableUseSysCredsControls_Impl( sal_Bool bUseSysCredsEnabled ); 79 80 DECL_LINK( OKHdl_Impl, OKButton * ); 81 DECL_LINK( PathHdl_Impl, PushButton * ); 82 DECL_LINK( UseSysCredsHdl_Impl, CheckBox * ); 83 84 public: 85 LoginDialog( Window* pParent, sal_uInt16 nFlags, 86 const String& rServer, const String* pRealm, 87 ResMgr * pResMgr ); 88 virtual ~LoginDialog(); 89 90 String GetPath() const { return aPathED.GetText(); } 91 void SetPath( const String& rNewPath ) { aPathED.SetText( rNewPath ); } 92 String GetName() const { return aNameED.GetText(); } 93 void SetName( const String& rNewName ) { aNameED.SetText( rNewName ); } 94 String GetPassword() const { return aPasswordED.GetText(); } 95 void SetPassword( const String& rNew ) { aPasswordED.SetText( rNew ); } 96 String GetAccount() const { return aAccountED.GetText(); } 97 void SetAccount( const String& rNew ) { aAccountED.SetText( rNew ); } 98 sal_Bool IsSavePassword() const { return aSavePasswdBtn.IsChecked(); } 99 void SetSavePassword( sal_Bool bSave ) { aSavePasswdBtn.Check( bSave ); } 100 void SetSavePasswordText( const String& rTxt ) { aSavePasswdBtn.SetText( rTxt ); } 101 sal_Bool IsUseSystemCredentials() const { return aUseSysCredsCB.IsChecked(); } 102 void SetUseSystemCredentials( sal_Bool bUse ); 103 void SetErrorText( const String& rTxt ) { aErrorInfo.SetText( rTxt ); } 104 void SetLoginRequestText( const String& rTxt ) { aRequestInfo.SetText( rTxt ); } 105 void ClearPassword(); 106 void ClearAccount(); 107 }; 108 109 // ----------------------------------------------------------------------- 110 111 112 //............................................................................ 113 //............................................................................ 114 115 #endif // UUI_LOGINDLG_HXX 116 117