summaryrefslogtreecommitdiffstats
path: root/ksirc/puke/plined.pm
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitbcb704366cb5e333a626c18c308c7e0448a8e69f (patch)
treef0d6ab7d78ecdd9207cf46536376b44b91a1ca71 /ksirc/puke/plined.pm
downloadtdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.tar.gz
tdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ksirc/puke/plined.pm')
-rw-r--r--ksirc/puke/plined.pm84
1 files changed, 84 insertions, 0 deletions
diff --git a/ksirc/puke/plined.pm b/ksirc/puke/plined.pm
new file mode 100644
index 00000000..fbff6f96
--- /dev/null
+++ b/ksirc/puke/plined.pm
@@ -0,0 +1,84 @@
+
+&::PukeSendMessage($PUKE_WIDGET_LOAD,
+ $::PUKE_CONTROLLER,
+ $PWIDGET_LINED,
+ "plined.so",
+ sub { my %ARG = %{shift()};
+ if($ARG{'iArg'} == 1){
+ print "*E* PLineEdit Load failed!\n";
+ }
+ }
+ );
+
+package PLineEdit;
+@ISA = qw(PWidget);
+use strict;
+
+sub new {
+ my $class = shift;
+ my $self = $class->SUPER::new($class, @_);
+
+ $self->{widgetType} = $::PWIDGET_LINED;
+ $self->{maxLength} = -1;
+
+ if($class eq 'PLineEdit'){
+ $self->create();
+ }
+
+ $self->installHandler($::PUKE_WIDGET_EVENT_TIMER, sub{});
+ $self->installHandler($::PUKE_LINED_GET_TEXT_ACK, sub{
+ my %ARG = %{shift()};
+ $ARG{'cArg'} =~ s/^([^\000]*).*/$1/;
+ $self->{text} = $ARG{'cArg'};});
+
+ return $self;
+
+}
+
+sub setMaxLength {
+ my $self = shift;
+
+ my $length = shift;
+
+ $self->{maxLength} = $length;
+ $self->sendMessage('iCommand' => $::PUKE_LINED_SET_MAXLENGTH,
+ 'iArg' => $length,
+ 'CallBack' => sub {my %ARG = %{shift()};
+ $self->{maxLength} = $ARG{'iArg'};});
+
+}
+
+sub setEchoMode {
+ my $self = shift;
+
+ my $mode = shift;
+
+ $self->sendMessage('iCommand' => $::PUKE_LINED_SET_ECHOMODE,
+ 'iArg' => $mode,
+ 'CallBack' => sub {my %ARG = %{shift()};
+ $self->{echoMode} = $ARG{'iArg'};});
+
+}
+
+sub setText {
+ my $self = shift;
+
+ my $text = shift;
+
+ $self->{text} = $text;
+
+ # Don't need the ouput since GET_TEXT_ACK will be called and
+ # we'll set it there
+ $self->sendMessage('iCommand' => $::PUKE_LINED_SET_TEXT,
+ 'cArg' => $text,
+ 'CallBack' => sub {});
+
+}
+
+sub text {
+ my $self = shift;
+
+ return $self->{text};
+}
+
+package main;