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