1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef UUI_LOGINDLG_HXX 25 #define UUI_LOGINDLG_HXX 26 27 #include <svtools/stdctrl.hxx> 28 #ifndef _SV_BUTTON_HXX 29 #include <vcl/button.hxx> 30 #endif 31 #include <vcl/dialog.hxx> 32 #include <vcl/edit.hxx> 33 #include <vcl/fixed.hxx> 34 35 //============================================================================ 36 #define LF_NO_PATH 0x0001 // hide "path" 37 #define LF_NO_USERNAME 0x0002 // hide "name" 38 #define LF_NO_PASSWORD 0x0004 // hide "password" 39 #define LF_NO_SAVEPASSWORD 0x0008 // hide "save password" 40 #define LF_NO_ERRORTEXT 0x0010 // hide message 41 #define LF_PATH_READONLY 0x0020 // "path" readonly 42 #define LF_USERNAME_READONLY 0x0040 // "name" readonly 43 #define LF_NO_ACCOUNT 0x0080 // hide "account" 44 #define LF_NO_USESYSCREDS 0x0100 // hide "use system cedentials" 45 46 //............................................................................ 47 //............................................................................ 48 49 //============================================================================ 50 class LoginDialog : public ModalDialog 51 { 52 FixedText aErrorFT; 53 FixedInfo aErrorInfo; 54 FixedLine aLogin1FL; 55 FixedInfo aRequestInfo; 56 FixedLine aLogin2FL; 57 FixedText aPathFT; 58 Edit aPathED; 59 PushButton aPathBtn; 60 FixedText aNameFT; 61 Edit aNameED; 62 FixedText aPasswordFT; 63 Edit aPasswordED; 64 FixedText aAccountFT; 65 Edit aAccountED; 66 CheckBox aSavePasswdBtn; 67 CheckBox aUseSysCredsCB; 68 FixedLine aButtonsFL; 69 OKButton aOKBtn; 70 CancelButton aCancelBtn; 71 HelpButton aHelpBtn; 72 73 void HideControls_Impl( sal_uInt16 nFlags ); 74 void EnableUseSysCredsControls_Impl( sal_Bool bUseSysCredsEnabled ); 75 76 DECL_LINK( OKHdl_Impl, OKButton * ); 77 DECL_LINK( PathHdl_Impl, PushButton * ); 78 DECL_LINK( UseSysCredsHdl_Impl, CheckBox * ); 79 80 public: 81 LoginDialog( Window* pParent, sal_uInt16 nFlags, 82 const String& rServer, const String* pRealm, 83 ResMgr * pResMgr ); 84 virtual ~LoginDialog(); 85 GetPath() const86 String GetPath() const { return aPathED.GetText(); } SetPath(const String & rNewPath)87 void SetPath( const String& rNewPath ) { aPathED.SetText( rNewPath ); } GetName() const88 String GetName() const { return aNameED.GetText(); } SetName(const String & rNewName)89 void SetName( const String& rNewName ) { aNameED.SetText( rNewName ); } GetPassword() const90 String GetPassword() const { return aPasswordED.GetText(); } SetPassword(const String & rNew)91 void SetPassword( const String& rNew ) { aPasswordED.SetText( rNew ); } GetAccount() const92 String GetAccount() const { return aAccountED.GetText(); } SetAccount(const String & rNew)93 void SetAccount( const String& rNew ) { aAccountED.SetText( rNew ); } IsSavePassword() const94 sal_Bool IsSavePassword() const { return aSavePasswdBtn.IsChecked(); } SetSavePassword(sal_Bool bSave)95 void SetSavePassword( sal_Bool bSave ) { aSavePasswdBtn.Check( bSave ); } SetSavePasswordText(const String & rTxt)96 void SetSavePasswordText( const String& rTxt ) { aSavePasswdBtn.SetText( rTxt ); } IsUseSystemCredentials() const97 sal_Bool IsUseSystemCredentials() const { return aUseSysCredsCB.IsChecked(); } 98 void SetUseSystemCredentials( sal_Bool bUse ); SetErrorText(const String & rTxt)99 void SetErrorText( const String& rTxt ) { aErrorInfo.SetText( rTxt ); } SetLoginRequestText(const String & rTxt)100 void SetLoginRequestText( const String& rTxt ) { aRequestInfo.SetText( rTxt ); } 101 void ClearPassword(); 102 void ClearAccount(); 103 }; 104 105 // ----------------------------------------------------------------------- 106 107 108 //............................................................................ 109 //............................................................................ 110 111 #endif // UUI_LOGINDLG_HXX 112 113