1*353d8f4dSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*353d8f4dSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*353d8f4dSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*353d8f4dSAndrew Rist * distributed with this work for additional information 6*353d8f4dSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*353d8f4dSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*353d8f4dSAndrew Rist * "License"); you may not use this file except in compliance 9*353d8f4dSAndrew Rist * with the License. You may obtain a copy of the License at 10*353d8f4dSAndrew Rist * 11*353d8f4dSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*353d8f4dSAndrew Rist * 13*353d8f4dSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*353d8f4dSAndrew Rist * software distributed under the License is distributed on an 15*353d8f4dSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*353d8f4dSAndrew Rist * KIND, either express or implied. See the License for the 17*353d8f4dSAndrew Rist * specific language governing permissions and limitations 18*353d8f4dSAndrew Rist * under the License. 19*353d8f4dSAndrew Rist * 20*353d8f4dSAndrew Rist *************************************************************/ 21*353d8f4dSAndrew Rist 22*353d8f4dSAndrew Rist 23cdf0e10cSrcweir #ifndef _SFX_PASSWD_HXX 24cdf0e10cSrcweir #define _SFX_PASSWD_HXX 25cdf0e10cSrcweir 26cdf0e10cSrcweir #include "sal/config.h" 27cdf0e10cSrcweir #include <sfx2/dllapi.h> 28cdf0e10cSrcweir #include <vcl/button.hxx> 29cdf0e10cSrcweir #include <vcl/dialog.hxx> 30cdf0e10cSrcweir #include <vcl/edit.hxx> 31cdf0e10cSrcweir #include <vcl/fixed.hxx> 32cdf0e10cSrcweir #include <sfx2/app.hxx> 33cdf0e10cSrcweir 34cdf0e10cSrcweir // defines --------------------------------------------------------------- 35cdf0e10cSrcweir 36cdf0e10cSrcweir #define SHOWEXTRAS_NONE ((sal_uInt16)0x0000) 37cdf0e10cSrcweir #define SHOWEXTRAS_USER ((sal_uInt16)0x0001) 38cdf0e10cSrcweir #define SHOWEXTRAS_CONFIRM ((sal_uInt16)0x0002) 39cdf0e10cSrcweir #define SHOWEXTRAS_PASSWORD2 ((sal_uInt16)0x0004) 40cdf0e10cSrcweir #define SHOWEXTRAS_CONFIRM2 ((sal_uInt16)0x0008) 41cdf0e10cSrcweir #define SHOWEXTRAS_ALL ((sal_uInt16)(SHOWEXTRAS_USER | SHOWEXTRAS_CONFIRM)) 42cdf0e10cSrcweir 43cdf0e10cSrcweir // class SfxPasswordDialog ----------------------------------------------- 44cdf0e10cSrcweir 45cdf0e10cSrcweir class SFX2_DLLPUBLIC SfxPasswordDialog : public ModalDialog 46cdf0e10cSrcweir { 47cdf0e10cSrcweir private: 48cdf0e10cSrcweir FixedLine maPasswordBox; 49cdf0e10cSrcweir FixedText maUserFT; 50cdf0e10cSrcweir Edit maUserED; 51cdf0e10cSrcweir FixedText maPasswordFT; 52cdf0e10cSrcweir Edit maPasswordED; 53cdf0e10cSrcweir FixedText maConfirmFT; 54cdf0e10cSrcweir Edit maConfirmED; 55cdf0e10cSrcweir FixedLine maPassword2Box; 56cdf0e10cSrcweir FixedText maPassword2FT; 57cdf0e10cSrcweir Edit maPassword2ED; 58cdf0e10cSrcweir FixedText maConfirm2FT; 59cdf0e10cSrcweir Edit maConfirm2ED; 60cdf0e10cSrcweir 61cdf0e10cSrcweir OKButton maOKBtn; 62cdf0e10cSrcweir CancelButton maCancelBtn; 63cdf0e10cSrcweir HelpButton maHelpBtn; 64cdf0e10cSrcweir 65cdf0e10cSrcweir sal_uInt16 mnMinLen; 66cdf0e10cSrcweir sal_uInt16 mnExtras; 67cdf0e10cSrcweir 68cdf0e10cSrcweir bool mbAsciiOnly; 69cdf0e10cSrcweir DECL_DLLPRIVATE_LINK( EditModifyHdl, Edit* ); 70cdf0e10cSrcweir DECL_DLLPRIVATE_LINK( OKHdl, OKButton* ); 71cdf0e10cSrcweir 72cdf0e10cSrcweir public: 73cdf0e10cSrcweir SfxPasswordDialog( Window* pParent, const String* pGroupText = NULL ); 74cdf0e10cSrcweir GetUser() const75cdf0e10cSrcweir String GetUser() const { return maUserED.GetText(); } GetPassword() const76cdf0e10cSrcweir String GetPassword() const { return maPasswordED.GetText(); } GetConfirm() const77cdf0e10cSrcweir String GetConfirm() const { return maConfirmED.GetText(); } 78cdf0e10cSrcweir GetPassword2() const79cdf0e10cSrcweir String GetPassword2() const { return maPassword2ED.GetText(); } GetConfirm2() const80cdf0e10cSrcweir String GetConfirm2() const { return maConfirm2ED.GetText(); } SetGroup2Text(const String & i_rText)81cdf0e10cSrcweir void SetGroup2Text( const String& i_rText ) { maPassword2Box.SetText( i_rText ); } 82cdf0e10cSrcweir 83cdf0e10cSrcweir void SetMinLen( sal_uInt16 Len ); 84cdf0e10cSrcweir void SetMaxLen( sal_uInt16 Len ); SetEditHelpId(const rtl::OString & rId)85cdf0e10cSrcweir void SetEditHelpId( const rtl::OString& rId ) { maPasswordED.SetHelpId( rId ); } ShowExtras(sal_uInt16 nExtras)86cdf0e10cSrcweir void ShowExtras( sal_uInt16 nExtras ) { mnExtras = nExtras; } AllowAsciiOnly(bool i_bAsciiOnly=true)87cdf0e10cSrcweir void AllowAsciiOnly( bool i_bAsciiOnly = true ) { mbAsciiOnly = i_bAsciiOnly; } 88cdf0e10cSrcweir 89cdf0e10cSrcweir virtual short Execute(); 90cdf0e10cSrcweir }; 91cdf0e10cSrcweir 92cdf0e10cSrcweir #endif // #ifndef _SFX_PASSWD_HXX 93cdf0e10cSrcweir 94