~ubuntu-branches/ubuntu/precise/okular/precise-proposed

« back to all changes in this revision

Viewing changes to core/textpage_p.h

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2011-12-23 22:53:33 UTC
  • mto: This revision was merged to the branch mainline in revision 13.
  • Revision ID: package-import@ubuntu.com-20111223225333-kkxbdqe29pr2glh5
Tags: upstream-4.7.95
Import upstream version 4.7.95

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
 
14
14
#include <QtCore/QList>
15
15
#include <QtCore/QMap>
 
16
#include <QtCore/QPair>
16
17
#include <QtGui/QMatrix>
17
18
 
18
19
class SearchPoint;
29
30
                                          int *fromLength, int *toLength );
30
31
 
31
32
/**
32
 
 * Make a line of TextList and store the bounding rectangle of line
33
 
 */
34
 
typedef QList<TextList> SortedTextList;
35
 
typedef QList<QRect> LineRect;
36
 
 
37
 
/**
38
33
 * A list of RegionText. It keeps a bunch of TextList with their bounding rectangles
39
34
 */
40
35
typedef QList<RegionText> RegionTextList;
62
57
        void setWordList(const TextList &list);
63
58
 
64
59
        /**
65
 
         * Copy m_words to a new TextList, it is the caller responsability to free the pointers
66
 
         */
67
 
        TextList duplicateWordList() const;
68
 
 
69
 
        /**
70
60
         * Make necessary modifications in the TextList to make the text order correct, so
71
61
         * that textselection works fine
72
62
         */
73
63
        void correctTextOrder();
74
64
 
75
 
        /**
76
 
         * Remove odd spaces which are much bigger than normal spaces from m_words
77
 
         */
78
 
        void removeSpace();
79
 
 
80
 
        /**
81
 
         * Create words from characters
82
 
         */
83
 
        QHash<QRect, RegionText> makeWordFromCharacters();
84
 
 
85
 
        /**
86
 
         * Create lines from TextList and sort them according to their position
87
 
         */
88
 
        void makeAndSortLines(const TextList &words, SortedTextList *lines, LineRect *line_rects);
89
 
 
90
 
        /**
91
 
         * Caluclate statistical info like, word spacing, column spacing, line spacing from the Lines
92
 
         * we made
93
 
         */
94
 
        void calculateStatisticalInformation(const SortedTextList &lines, const LineRect &line_rects, int *word_spacing,
95
 
                                             int *line_spacing, int *column_spacing);
96
 
 
97
 
        /**
98
 
         * Functions necessary for document file segmentation into text regions for document layout
99
 
         * analysis.
100
 
         */
101
 
        RegionTextList XYCutForBoundingBoxes(int tcx, int tcy);
102
 
 
103
 
        /**
104
 
         * Add additional spaces between words, if necessary, which can make the words valuable
105
 
         * while copying after selection
106
 
         */
107
 
        void addNecessarySpace(RegionTextList tree);
108
 
 
109
 
        /**
110
 
         * Break the words into characters, so the text selection wors fine
111
 
         */
112
 
        void breakWordIntoCharacters(const QHash<QRect, RegionText> &words_char_map);
113
 
 
114
65
        // variables those can be accessed directly from TextPage
115
66
        TextList m_words;
116
67
        QMap< int, SearchPoint* > m_searchPoints;