PageRenderTime 29ms CodeModel.GetById 16ms app.highlight 10ms RepoModel.GetById 1ms app.codeStats 0ms

/libs/perl/Choicetool/Widgets/Messagebox.pm

#
Perl | 127 lines | 74 code | 29 blank | 24 comment | 2 complexity | ec10be5a5ec11e772467a9ae81844099 MD5 | raw file
  1# -*- perl -*-
  2
  3#
  4# Messagebox.pm
  5#
  6# Copyright (C) 2008, 2009 Francesco Salvestrini
  7#                          Alessandro Massignan
  8#
  9# This program is free software; you can redistribute it and/or modify
 10# it under the terms of the GNU General Public License as published by
 11# the Free Software Foundation; either version 2 of the License, or
 12# (at your option) any later version.
 13#
 14# This program is distributed in the hope that it will be useful,
 15# but WITHOUT ANY WARRANTY; without even the implied warranty of
 16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 17# GNU General Public License for more details.
 18#
 19# You should have received a copy of the GNU General Public License along
 20# with this program; if not, write to the Free Software Foundation, Inc.,
 21# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 22#
 23
 24package Choicetool::Widgets::Messagebox;
 25
 26use 5.8.0;
 27
 28use warnings;
 29use strict;
 30use diagnostics;
 31
 32use Choicetool::Base::Debug;
 33use Choicetool::Base::Trace;
 34use Choicetool::Widgets::Widget;
 35
 36use vars qw(@ISA);
 37@ISA = qw(Choicetool::Widgets::Widget);
 38
 39sub new ($$)
 40{
 41    my $class  = shift;
 42    my $id     = shift;
 43
 44    assert(defined($class));
 45
 46    my $self = $class->SUPER::new($id);
 47
 48    return bless($self, $class);
 49}
 50
 51sub title {
 52    my $self  = shift;
 53    my $value = shift;
 54
 55    assert(defined($self));
 56
 57    if (defined($value)) {
 58        $self->{TITLE} = $value;
 59    }
 60
 61    return $self->{TITLE};
 62}
 63
 64sub symbol {
 65    my $self  = shift;
 66    my $value = shift;
 67
 68    assert(defined($self));
 69
 70    if (defined($value)) {
 71       $self->{SYMBOL} = $value;
 72    }
 73
 74    return $self->{SYMBOL};
 75}
 76
 77#
 78# M4 related methods
 79#
 80
 81sub m4ify_linear_body ($$)
 82{
 83    my $self   = shift;
 84    my $prefix = shift;
 85
 86    assert(defined($self));
 87    assert(defined($prefix));
 88    assert(defined($self->id()));
 89
 90    return
 91        $prefix .
 92        "CT_UI_MESSAGEBOX_DATA([" .
 93        $self->id() .
 94        "])\n";
 95}
 96
 97sub m4ify_hierarchical_header ($$)
 98{
 99    my $self   = shift;
100    my $prefix = shift;
101
102    assert(defined($self));
103    assert(defined($prefix));
104    assert(defined($self->id()));
105    assert(defined($self->title()));
106
107    return
108        $prefix .
109        "CT_UI_MESSAGEBOX_WIDGET([" .
110        $self->id() .
111        "],[" .
112        $self->title() .
113        "])\n";
114}
115
116sub m4ify_hierarchical_footer ($$)
117{
118    my $self   = shift;
119    my $prefix = shift;
120
121    assert(defined($self));
122    assert(defined($prefix));
123
124    return "";
125}
126
1271;