1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
22 #include <vcl/field.hxx>
25 /*--------------------------------------------------------------------
26 Description: numerical input
27 --------------------------------------------------------------------*/
28 class SW_DLLPUBLIC NumEditAction
: public NumericField
33 virtual void Action();
34 virtual long Notify( NotifyEvent
& rNEvt
);
36 NumEditAction( Window
* pParent
, const ResId
& rResId
) :
37 NumericField(pParent
, rResId
) {}
39 void SetActionHdl( const Link
& rLink
) { aActionLink
= rLink
;}
40 const Link
& GetActionHdl() const { return aActionLink
; }
44 /* --------------------------------------------------
45 * Edit that doesn't accept spaces
46 * --------------------------------------------------*/
47 class SW_DLLPUBLIC NoSpaceEdit
: public Edit
49 String sForbiddenChars
;
51 virtual void KeyInput( const KeyEvent
& );
52 virtual void Modify();
55 NoSpaceEdit( Window
* pParent
, const ResId
& rResId
);
56 NoSpaceEdit( Window
* pParent
);
57 virtual ~NoSpaceEdit();
58 void SetForbiddenChars(const String
& rSet
){sForbiddenChars
= rSet
;}
59 const String
& GetForbiddenChars(){return sForbiddenChars
;}
62 /* --------------------------------------------------
63 * No space and no full stop
64 * --------------------------------------------------*/
65 class TableNameEdit
: public NoSpaceEdit
68 TableNameEdit(Window
* pWin
, const ResId
& rResId
)
69 : NoSpaceEdit(pWin
, rResId
)
71 SetForbiddenChars(OUString(" .<>"));
73 TableNameEdit(Window
* pWin
)
76 SetForbiddenChars(OUString(" .<>"));
80 /* --------------------------------------------------
81 call a link when KEY_RETURN is pressed
82 --------------------------------------------------*/
83 class SW_DLLPUBLIC ReturnActionEdit
: public Edit
85 Link aReturnActionLink
;
87 ReturnActionEdit( Window
* pParent
, const ResId
& rResId
)
88 : Edit(pParent
, rResId
){}
90 virtual void KeyInput( const KeyEvent
& );
92 void SetReturnActionLink(const Link
& rLink
)
93 { aReturnActionLink
= rLink
;}
98 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */