libyui-ncurses  2.54.5
NCOptionalWidgetFactory.cc
1 /*
2  Copyright (C) 2000-2012 Novell, Inc
3  This library is free software; you can redistribute it and/or modify
4  it under the terms of the GNU Lesser General Public License as
5  published by the Free Software Foundation; either version 2.1 of the
6  License, or (at your option) version 3.0 of the License. This library
7  is distributed in the hope that it will be useful, but WITHOUT ANY
8  WARRANTY; without even the implied warranty of MERCHANTABILITY or
9  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
10  License for more details. You should have received a copy of the GNU
11  Lesser General Public License along with this library; if not, write
12  to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
13  Floor, Boston, MA 02110-1301 USA
14 */
15 
16 
17 /*-/
18 
19  File: NCOptionalWidgetFactory.cc
20 
21  Author: Gabriele Mohr <gs@suse.de>
22 
23 /-*/
24 
25 #include "NCOptionalWidgetFactory.h"
26 #include <yui/YUIException.h>
27 #include <NCTimeField.h>
28 #include <NCDateField.h>
29 
30 
31 #define THROW_UNSUPPORTED( WIDGET_TYPE ) \
32  YUI_THROW( YUIUnsupportedWidgetException( WIDGET_TYPE ) ); \
33  return 0
34 
35 
37  : YOptionalWidgetFactory()
38 {
39  // NOP
40 }
41 
42 
44 {
45  // NOP
46 }
47 
48 bool NCOptionalWidgetFactory::hasDumbTab()
49 {
50  return true;
51 }
52 
53 NCDumbTab *
54 NCOptionalWidgetFactory::createDumbTab( YWidget * parent )
55 {
56  NCDumbTab * dumbTab = new NCDumbTab( parent );
57  YUI_CHECK_NEW( dumbTab );
58 
59  return dumbTab;
60 }
61 
62 bool NCOptionalWidgetFactory::hasTimeField()
63 {
64  return true;
65 }
66 
67 YTimeField* NCOptionalWidgetFactory::createTimeField( YWidget * parent, const std::string & label )
68 {
69  NCTimeField * timeField = new NCTimeField( parent, label );
70  YUI_CHECK_NEW( timeField );
71 
72  return timeField;
73 }
74 
75 
76 bool NCOptionalWidgetFactory::hasDateField()
77 {
78  return true;
79 }
80 
81 YDateField* NCOptionalWidgetFactory::createDateField( YWidget * parent, const std::string & label )
82 {
83  NCDateField * dateField = new NCDateField( parent, label );
84  YUI_CHECK_NEW( dateField );
85 
86  return dateField;
87 }
88 
virtual ~NCOptionalWidgetFactory()
Destructor.