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