Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 : #ifndef _ACTCTRL_HXX
20 : #define _ACTCTRL_HXX
21 :
22 : #include <vcl/field.hxx>
23 : #include "swdllapi.h"
24 :
25 : /*--------------------------------------------------------------------
26 : Description: numerical input
27 : --------------------------------------------------------------------*/
28 0 : class SW_DLLPUBLIC NumEditAction: public NumericField
29 : {
30 : Link aActionLink;
31 :
32 : protected:
33 : virtual void Action();
34 : virtual long Notify( NotifyEvent& rNEvt );
35 : public:
36 0 : NumEditAction( Window* pParent, const ResId& rResId ) :
37 0 : NumericField(pParent, rResId) {}
38 :
39 0 : void SetActionHdl( const Link& rLink ) { aActionLink = rLink;}
40 : const Link& GetActionHdl() const { return aActionLink; }
41 : };
42 :
43 :
44 : /* --------------------------------------------------
45 : * Edit that doesn't accept spaces
46 : * --------------------------------------------------*/
47 : class SW_DLLPUBLIC NoSpaceEdit : public Edit
48 : {
49 : String sForbiddenChars;
50 : protected:
51 : virtual void KeyInput( const KeyEvent& );
52 : virtual void Modify();
53 :
54 : public:
55 : NoSpaceEdit( Window* pParent );
56 : virtual ~NoSpaceEdit();
57 0 : void SetForbiddenChars(const String& rSet){sForbiddenChars = rSet;}
58 0 : const String& GetForbiddenChars(){return sForbiddenChars;}
59 : };
60 :
61 : /* --------------------------------------------------
62 : * No space and no full stop
63 : * --------------------------------------------------*/
64 0 : class TableNameEdit : public NoSpaceEdit
65 : {
66 : public:
67 0 : TableNameEdit(Window* pWin)
68 0 : : NoSpaceEdit(pWin)
69 : {
70 0 : SetForbiddenChars(OUString(" .<>"));
71 0 : }
72 : };
73 :
74 : /* --------------------------------------------------
75 : call a link when KEY_RETURN is pressed
76 : --------------------------------------------------*/
77 : class SW_DLLPUBLIC ReturnActionEdit : public Edit
78 : {
79 : Link aReturnActionLink;
80 : public:
81 0 : ReturnActionEdit( Window* pParent, const ResId& rResId)
82 0 : : Edit(pParent, rResId){}
83 : ~ReturnActionEdit();
84 : virtual void KeyInput( const KeyEvent& );
85 :
86 0 : void SetReturnActionLink(const Link& rLink)
87 0 : { aReturnActionLink = rLink;}
88 : };
89 :
90 : #endif
91 :
92 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|