File: candidatelist.h

package info (click to toggle)
qimhangul 0.2.0-5
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 1,508 kB
  • ctags: 221
  • sloc: sh: 10,860; cpp: 648; makefile: 40
file content (74 lines) | stat: -rw-r--r-- 1,874 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/* qimhangul - Qt input module for hangul
 * Copyright (C) 2004 Choe Hwanjin
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
 */

#ifndef _CANDIDATE_H_
#define _CANDIDATE_H_

#include <QString>
#include <hangul.h>

class QLabel;
class QFrame;
class QTreeWidget;
class QStatusBar;
class QKeyEvent;
class QMenu;
class QAction;

class CandidateList {
public:
    CandidateList();
    virtual ~CandidateList();

    void open(const HanjaList* list, int x, int y);
    void move(int x, int y);
    void close();

    bool isVisible() const;

    bool filterEvent(const QKeyEvent *event);
    bool isSelected() { return m_selected; }
    QString getCandidate();

private:
    void prev();
    void next();
    void prevPage();
    void nextPage();
    const char* getCurrent();
    const char* getNth(int index);
    void setCurrent(int index);
    void setPosition(int x, int y);
    void updateList();
    void updateCursor();

    const HanjaList *m_list;
    bool m_selected;
    int m_size;
    int m_itemsPerPage;
    int m_currentPage;
    int m_current;

    QFrame *m_frame;
    QLabel **m_indexes;
    QLabel **m_values;
    QLabel **m_comments;
    QLabel *m_statusbar;
};

#endif /* _CANDIDATE_H_ */