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 #ifndef _ACTCTRL_HXX 28 #define _ACTCTRL_HXX 29 30 #ifndef _FIELD_HXX //autogen 31 #include <vcl/field.hxx> 32 #endif 33 #include "swdllapi.h" 34 35 /*-------------------------------------------------------------------- 36 Beschreibung: numerische Eingabe 37 --------------------------------------------------------------------*/ 38 39 class SW_DLLPUBLIC NumEditAction: public NumericField 40 { 41 Link aActionLink; 42 43 protected: 44 virtual void Action(); 45 virtual long Notify( NotifyEvent& rNEvt ); 46 public: 47 NumEditAction( Window* pParent, const ResId& rResId ) : 48 NumericField(pParent, rResId) {} 49 50 void SetActionHdl( const Link& rLink ) { aActionLink = rLink;} 51 const Link& GetActionHdl() const { return aActionLink; } 52 }; 53 54 55 /* -----------------21.04.98 08:11------------------- 56 * Edit, dass keine Spaces akzeptiert 57 * --------------------------------------------------*/ 58 class SW_DLLPUBLIC NoSpaceEdit : public Edit 59 { 60 String sForbiddenChars; 61 protected: 62 virtual void KeyInput( const KeyEvent& ); 63 virtual void Modify(); 64 65 public: 66 NoSpaceEdit( Window* pParent, const ResId& rResId); 67 virtual ~NoSpaceEdit(); 68 void SetForbiddenChars(const String& rSet){sForbiddenChars = rSet;} 69 const String& GetForbiddenChars(){return sForbiddenChars;} 70 }; 71 72 /* -----------------21.04.98 08:33------------------- 73 * Kein Space und kein Punkt 74 * --------------------------------------------------*/ 75 class TableNameEdit : public NoSpaceEdit 76 { 77 public: 78 TableNameEdit(Window* pWin, const ResId& rResId) : 79 NoSpaceEdit(pWin, rResId) 80 {SetForbiddenChars(String::CreateFromAscii(" .<>"));} 81 }; 82 /* -----------------25.06.2003 15:55----------------- 83 call a link when KEY_RETURN is pressed 84 --------------------------------------------------*/ 85 class SW_DLLPUBLIC ReturnActionEdit : public Edit 86 { 87 Link aReturnActionLink; 88 public: 89 ReturnActionEdit( Window* pParent, const ResId& rResId) 90 : Edit(pParent, rResId){} 91 ~ReturnActionEdit(); 92 virtual void KeyInput( const KeyEvent& ); 93 94 void SetReturnActionLink(const Link& rLink) 95 { aReturnActionLink = rLink;} 96 }; 97 98 #endif 99