~ubuntu-branches/ubuntu/maverick/uim/maverick

« back to all changes in this revision

Viewing changes to qt4/immodule/qtextutil.h

  • Committer: Bazaar Package Importer
  • Author(s): Masahito Omote
  • Date: 2008-06-25 19:56:33 UTC
  • mfrom: (3.1.18 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080625195633-8jljph4rfq00l8o7
Tags: 1:1.5.1-2
* uim-tcode: provide tutcode-custom.scm, tutcode-bushudic.scm
  and tutcode-rule.scm (Closes: #482659)
* Fix FTBFS: segv during compile (Closes: #483078).
  I personally think this bug is not specific for uim but is a optimization
  problem on gcc-4.3.1. (https://bugs.freedesktop.org/show_bug.cgi?id=16477)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 
 
3
Copyright (c) 2006-2008 uim Project http://code.google.com/p/uim/
 
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_QT4_IMMODULE_QTEXTUTIL_H
 
34
#define UIM_QT4_IMMODULE_QTEXTUTIL_H
 
35
 
 
36
#include <QObject>
 
37
 
 
38
#include "uim/uim.h"
 
39
 
 
40
 
 
41
class QUimInputContext;
 
42
 
 
43
class QUimTextUtil : QObject
 
44
{
 
45
    Q_OBJECT
 
46
 
 
47
public:
 
48
    QUimTextUtil( QObject *parent = 0 );
 
49
    ~QUimTextUtil();
 
50
 
 
51
    static int acquire_text_cb( void *ptr, enum UTextArea text_id,
 
52
                                enum UTextOrigin origin,
 
53
                                int former_req_len, int latter_req_len,
 
54
                                char **former, char **latter );
 
55
    static int delete_text_cb( void *ptr, enum UTextArea text_id,
 
56
                               enum UTextOrigin origin,
 
57
                               int former_req_len, int latter_req_len );
 
58
 
 
59
private:
 
60
    int acquirePrimaryText( enum UTextOrigin origin,
 
61
                            int former_req_len, int latter_req_len,
 
62
                            char **former, char **latter );
 
63
    int acquirePrimaryTextInQLineEdit( enum UTextOrigin origin,
 
64
                                       int former_req_len, int latter_req_len,
 
65
                                       char **former, char **latter );
 
66
    int acquirePrimaryTextInQTextEdit( enum UTextOrigin origin,
 
67
                                       int former_req_len, int latter_req_len,
 
68
                                       char **former, char **latter );
 
69
 
 
70
    int acquireSelectionText( enum UTextOrigin origin,
 
71
                              int former_req_len, int latter_req_len,
 
72
                              char **former, char **latter );
 
73
    int acquireSelectionTextInQLineEdit( enum UTextOrigin origin,
 
74
                                         int former_req_len,
 
75
                                         int latter_req_len,
 
76
                                         char **former, char **latter );
 
77
    int acquireSelectionTextInQTextEdit( enum UTextOrigin origin,
 
78
                                         int former_req_len,
 
79
                                         int latter_req_len,
 
80
                                         char **former, char **latter );
 
81
 
 
82
    int acquireClipboardText( enum UTextOrigin origin,
 
83
                              int former_req_len, int latter_req_len,
 
84
                              char **former, char **latter );
 
85
 
 
86
    int deletePrimaryText( enum UTextOrigin origin,
 
87
                           int former_req_len, int latter_req_len );
 
88
    int deletePrimaryTextInQLineEdit( enum UTextOrigin origin,
 
89
                                      int former_req_len, int latter_req_len );
 
90
    int deletePrimaryTextInQTextEdit( enum UTextOrigin origin,
 
91
                                      int former_req_len, int latter_req_len );
 
92
 
 
93
    int deleteSelectionText( enum UTextOrigin origin,
 
94
                             int former_req_len, int latter_req_len );
 
95
    int deleteSelectionTextInQLineEdit( enum UTextOrigin origin,
 
96
                                       int former_req_len, int latter_req_len );
 
97
    int deleteSelectionTextInQTextEdit( enum UTextOrigin origin,
 
98
                                       int former_req_len, int latter_req_len );
 
99
 
 
100
    void QTextEditPositionBackward( int *para, int *index );
 
101
 
 
102
    void QTextEditPositionForward( int *para, int *index );
 
103
 
 
104
    void savePreedit();
 
105
    void restorePreedit();
 
106
 
 
107
    QWidget *mWidget;
 
108
    QUimInputContext *mIc;
 
109
    bool mPreeditSaved;
 
110
};
 
111
 
 
112
#endif