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