~ubuntu-branches/ubuntu/hardy/uim/hardy

« back to all changes in this revision

Viewing changes to qt/toolbar-common-uimstateindicator.h

  • Committer: Bazaar Package Importer
  • Author(s): Masahito Omote
  • Date: 2005-12-04 13:10:42 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051204131042-ktzc8b17zi7a3cw8
Tags: 1:0.4.9.1-1
* New upstream release
* libuim0-nox, libuim-nox-dev, and libuim0-dbg-nox is now obsolete.
  Because libuim0 does not depends on X11. They now become dummy package,
  therefore you can safely remove them.
* Add --enable-debug in configure again.
* debian/patches/08_fix_privilage_escalation_CVE_2005_3149: disabled.
* Fix Error on purge because update-uim-config is not found.
  (closes: Bug#339345)
* uim-qt: New package for Qt utilities for uim. qt-immodule does not
  contained yet because of Debian's Qt3 does not support immodule and
  because uim does not recognize libqt4-dev's headers properly. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 
 
3
 Copyright (c) 2003,2004,2005 uim Project http://uim.freedesktop.org/
 
4
 
 
5
 All rights reserved.
 
6
 
 
7
 Redistribution and use in source and binary forms, with or without
 
8
 modification, are permitted provided that the following conditions
 
9
 are met:
 
10
 
 
11
 1. Redistributions of source code must retain the above copyright
 
12
    notice, this list of conditions and the following disclaimer.
 
13
 2. Redistributions in binary form must reproduce the above copyright
 
14
    notice, this list of conditions and the following disclaimer in the
 
15
    documentation and/or other materials provided with the distribution.
 
16
 3. Neither the name of authors nor the names of its contributors
 
17
    may be used to endorse or promote products derived from this software
 
18
    without specific prior written permission.
 
19
 
 
20
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
 
21
 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 
22
 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 
23
 ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE
 
24
 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 
25
 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 
26
 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 
27
 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 
28
 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 
29
 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 
30
 SUCH DAMAGE.
 
31
 
 
32
*/
 
33
#ifndef _UIM_STATE_INDICATOR_H_
 
34
#define _UIM_STATE_INDICATOR_H_
 
35
 
 
36
#include <qhbox.h>
 
37
#include <qintdict.h>
 
38
#include <qpopupmenu.h>
 
39
#include <qtoolbutton.h>
 
40
 
 
41
#include <uim/uim.h>
 
42
#include <uim/uim-helper.h>
 
43
 
 
44
#define BUTTON_SIZE 25
 
45
 
 
46
class QHelperToolbarButton;
 
47
class QHelperPopupMenu;
 
48
 
 
49
class UimStateIndicator : public QHBox
 
50
{
 
51
    Q_OBJECT
 
52
 
 
53
public:
 
54
    UimStateIndicator( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
 
55
    ~UimStateIndicator();
 
56
 
 
57
protected:
 
58
    void checkHelperConnection();
 
59
 
 
60
    void parseHelperStr( const QString& str );
 
61
    void propListUpdate( const QStringList& lines );
 
62
    void propLabelUpdate( const QStringList& lines );
 
63
 
 
64
    static void helper_disconnect_cb();
 
65
 
 
66
public slots:
 
67
    void slotStdinActivated( int socket );
 
68
 
 
69
protected:
 
70
    QPtrList<QHelperToolbarButton> buttons;
 
71
};
 
72
 
 
73
class QHelperToolbarButton : public QToolButton
 
74
{
 
75
public:
 
76
    QHelperToolbarButton( QWidget *parent = 0, const char *name = 0 )
 
77
        : QToolButton( parent, name ){}
 
78
 
 
79
    QSize sizeHint() const
 
80
    {
 
81
        return QSize( BUTTON_SIZE, BUTTON_SIZE );
 
82
    }
 
83
};
 
84
 
 
85
class QHelperPopupMenu : public QPopupMenu
 
86
{
 
87
    Q_OBJECT
 
88
 
 
89
public:
 
90
    QHelperPopupMenu( QWidget *parent = 0, const char *name = 0 );
 
91
    ~QHelperPopupMenu();
 
92
 
 
93
    int insertHelperItem( const QString &menulabelStr,
 
94
                          const QString &menutooltipStr,
 
95
                          const QString &menucommandStr );
 
96
 
 
97
public slots:
 
98
    void slotMenuActivated( int id );
 
99
 
 
100
protected:
 
101
    QIntDict<QString> msgDict;
 
102
};
 
103
 
 
104
 
 
105
#endif /* Not def: _UIM_STATE_INDICATOR_H_ */