1 // Copyright (C) 2008 Mark Pustjens <pustjens@dds.nl>
2 // Copyright (C) 2010-2015 Petr Pavlu <setup@dagobah.cz>
4 // This file is part of CenterIM.
6 // CenterIM is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
11 // CenterIM is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with CenterIM. If not, see <http://www.gnu.org/licenses/>.
20 /// InputDialog class.
22 /// @ingroup cppconsui
27 #include "AbstractDialog.h"
28 #include "TextEntry.h"
32 class InputDialog
: public AbstractDialog
{
34 InputDialog(const char *title
, const char *defaultvalue
);
35 virtual ~InputDialog() override
{}
37 virtual void setText(const char *new_text
) { entry_
->setText(new_text
); }
38 virtual const char *getText() const { return entry_
->getText(); }
40 virtual void setFlags(int new_flags
) { entry_
->setFlags(new_flags
); }
41 virtual int getFlags() const { return entry_
->getFlags(); }
43 virtual void setMasked(bool new_masked
) { entry_
->setMasked(new_masked
); }
44 virtual bool isMasked() const { return entry_
->isMasked(); }
46 /// Signal emitted when user closes the dialog.
47 sigc::signal
<void, InputDialog
&, ResponseType
> signal_response
;
53 virtual void emitResponse(ResponseType response
) override
;
56 CONSUI_DISABLE_COPY(InputDialog
);
59 } // namespace CppConsUI
61 #endif // INPUTDIALOG_H
63 // vim: set tabstop=2 shiftwidth=2 textwidth=80 expandtab: