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, const ResId& rResId);
56 : NoSpaceEdit( Window* pParent );
57 : virtual ~NoSpaceEdit();
58 0 : void SetForbiddenChars(const String& rSet){sForbiddenChars = rSet;}
59 0 : const String& GetForbiddenChars(){return sForbiddenChars;}
60 : };
61 :
62 : /* --------------------------------------------------
63 : * No space and no full stop
64 : * --------------------------------------------------*/
65 0 : class TableNameEdit : public NoSpaceEdit
66 : {
67 : public:
68 0 : TableNameEdit(Window* pWin, const ResId& rResId)
69 0 : : NoSpaceEdit(pWin, rResId)
70 : {
71 0 : SetForbiddenChars(rtl::OUString(" .<>"));
72 0 : }
73 0 : TableNameEdit(Window* pWin)
74 0 : : NoSpaceEdit(pWin)
75 : {
76 0 : SetForbiddenChars(rtl::OUString(" .<>"));
77 0 : }
78 : };
79 :
80 : /* --------------------------------------------------
81 : call a link when KEY_RETURN is pressed
82 : --------------------------------------------------*/
83 : class SW_DLLPUBLIC ReturnActionEdit : public Edit
84 : {
85 : Link aReturnActionLink;
86 : public:
87 0 : ReturnActionEdit( Window* pParent, const ResId& rResId)
88 0 : : Edit(pParent, rResId){}
89 : ~ReturnActionEdit();
90 : virtual void KeyInput( const KeyEvent& );
91 :
92 0 : void SetReturnActionLink(const Link& rLink)
93 0 : { aReturnActionLink = rLink;}
94 : };
95 :
96 : #endif
97 :
98 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|