2010-10-14 08:30:41 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2011-03-31 10:05:04 +02:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2013-11-05 02:17:53 +01:00
|
|
|
#ifndef INCLUDED_SW_SOURCE_UI_INC_ACTCTRL_HXX
|
|
|
|
#define INCLUDED_SW_SOURCE_UI_INC_ACTCTRL_HXX
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
#include <vcl/field.hxx>
|
2004-08-23 07:56:31 +00:00
|
|
|
#include "swdllapi.h"
|
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
/*--------------------------------------------------------------------
|
2011-04-20 15:36:36 +02:00
|
|
|
Description: numerical input
|
2000-09-18 16:15:01 +00:00
|
|
|
--------------------------------------------------------------------*/
|
2004-09-27 10:55:59 +00:00
|
|
|
class SW_DLLPUBLIC NumEditAction: public NumericField
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
|
|
|
Link aActionLink;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void Action();
|
|
|
|
virtual long Notify( NotifyEvent& rNEvt );
|
|
|
|
public:
|
|
|
|
NumEditAction( Window* pParent, const ResId& rResId ) :
|
|
|
|
NumericField(pParent, rResId) {}
|
|
|
|
|
|
|
|
void SetActionHdl( const Link& rLink ) { aActionLink = rLink;}
|
|
|
|
const Link& GetActionHdl() const { return aActionLink; }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-01-17 21:50:08 +01:00
|
|
|
/* --------------------------------------------------
|
2011-04-20 15:36:36 +02:00
|
|
|
* Edit that doesn't accept spaces
|
2000-09-18 16:15:01 +00:00
|
|
|
* --------------------------------------------------*/
|
2004-08-23 07:56:31 +00:00
|
|
|
class SW_DLLPUBLIC NoSpaceEdit : public Edit
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2013-10-09 13:02:48 +02:00
|
|
|
OUString sForbiddenChars;
|
2000-09-18 16:15:01 +00:00
|
|
|
protected:
|
|
|
|
virtual void KeyInput( const KeyEvent& );
|
|
|
|
virtual void Modify();
|
|
|
|
|
|
|
|
public:
|
2012-09-04 16:49:42 +01:00
|
|
|
NoSpaceEdit( Window* pParent );
|
2009-09-11 09:17:29 +00:00
|
|
|
virtual ~NoSpaceEdit();
|
2013-10-09 13:02:48 +02:00
|
|
|
void SetForbiddenChars(const OUString& rSet){sForbiddenChars = rSet;}
|
|
|
|
const OUString& GetForbiddenChars(){return sForbiddenChars;}
|
2000-09-18 16:15:01 +00:00
|
|
|
};
|
|
|
|
|
2011-01-17 21:50:08 +01:00
|
|
|
/* --------------------------------------------------
|
2011-04-20 15:36:36 +02:00
|
|
|
* No space and no full stop
|
2000-09-18 16:15:01 +00:00
|
|
|
* --------------------------------------------------*/
|
|
|
|
class TableNameEdit : public NoSpaceEdit
|
|
|
|
{
|
|
|
|
public:
|
2012-09-04 16:49:42 +01:00
|
|
|
TableNameEdit(Window* pWin)
|
|
|
|
: NoSpaceEdit(pWin)
|
|
|
|
{
|
2013-04-07 12:06:47 +02:00
|
|
|
SetForbiddenChars(OUString(" .<>"));
|
2012-09-04 16:49:42 +01:00
|
|
|
}
|
2000-09-18 16:15:01 +00:00
|
|
|
};
|
2010-10-13 10:32:10 +05:30
|
|
|
|
2011-01-17 21:50:08 +01:00
|
|
|
/* --------------------------------------------------
|
2003-06-30 14:57:24 +00:00
|
|
|
call a link when KEY_RETURN is pressed
|
|
|
|
--------------------------------------------------*/
|
2004-08-23 07:56:31 +00:00
|
|
|
class SW_DLLPUBLIC ReturnActionEdit : public Edit
|
2003-06-30 14:57:24 +00:00
|
|
|
{
|
|
|
|
Link aReturnActionLink;
|
|
|
|
public:
|
2013-08-19 08:57:20 +01:00
|
|
|
ReturnActionEdit(Window* pParent, const ResId& rResId);
|
|
|
|
ReturnActionEdit(Window* pParent, WinBits nStyle)
|
|
|
|
: Edit(pParent, nStyle){}
|
2003-06-30 14:57:24 +00:00
|
|
|
~ReturnActionEdit();
|
|
|
|
virtual void KeyInput( const KeyEvent& );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2004-11-16 16:00:00 +00:00
|
|
|
void SetReturnActionLink(const Link& rLink)
|
2003-06-30 14:57:24 +00:00
|
|
|
{ aReturnActionLink = rLink;}
|
|
|
|
};
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
#endif
|
2010-10-14 08:30:41 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|