~ubuntu-branches/ubuntu/oneiric/kdepim/oneiric-updates

« back to all changes in this revision

Viewing changes to mobile/lib/rangemanager_p.h

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2011-06-28 19:33:24 UTC
  • mfrom: (0.2.13) (0.1.13 sid)
  • Revision ID: package-import@ubuntu.com-20110628193324-8yvjs8sdv9rdoo6c
Tags: 4:4.7.0-0ubuntu1
* New upstream release
  - update install files
  - add missing kdepim-doc package to control file
  - Fix Vcs lines
  - kontact breaks/replaces korganizer << 4:4.6.80
  - tighten the dependency of kdepim-dev on libkdepim4 to fix lintian error

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
#ifndef RANGEMANAGER_P_H
 
3
#define RANGEMANAGER_P_H
 
4
 
 
5
#include <QtCore/QVector>
 
6
 
 
7
/**
 
8
 * @short A class that manages a list of ranges.
 
9
 *
 
10
 */
 
11
class RangeManager
 
12
{
 
13
  public:
 
14
    /**
 
15
     * Creates a new range manager.
 
16
     */
 
17
    RangeManager();
 
18
 
 
19
    /**
 
20
     * Destroys the range manager.
 
21
     */
 
22
    ~RangeManager();
 
23
 
 
24
    /**
 
25
     * Returns the number of ranges.
 
26
     */
 
27
    int count() const;
 
28
 
 
29
    /**
 
30
     * Removes all ranges from the range manager.
 
31
     */
 
32
    void clear();
 
33
 
 
34
    /**
 
35
     * Inserts a new range of the given @p size before @p range.
 
36
     */
 
37
    void insertRange( int range, int size );
 
38
 
 
39
    /**
 
40
     * Removes the given @p range.
 
41
     */
 
42
    void removeRange( int range );
 
43
 
 
44
    /**
 
45
     * Increases the given range by @p elements.
 
46
     */
 
47
    void increaseRange( int range, int elements );
 
48
 
 
49
    /**
 
50
     * Decreases the given range by @p elements.
 
51
     */
 
52
    void decreaseRange( int range, int elements );
 
53
 
 
54
    /**
 
55
     * Returns the absolute start position of the given @p range.
 
56
     */
 
57
    int rangeStart( int range ) const;
 
58
 
 
59
    /**
 
60
     * Returns the number of elements of the given @p range.
 
61
     */
 
62
    int rangeSize( int range ) const;
 
63
 
 
64
    /**
 
65
     * Returns the range that contains the given absolute @p position.
 
66
     */
 
67
    int rangeForPosition( int position ) const;
 
68
 
 
69
    /**
 
70
     * Dumps the current range layout to console. Usefull for debugging.
 
71
     */
 
72
    void dump() const;
 
73
 
 
74
  private:
 
75
    QVector<int> mRangeSizes;
 
76
};
 
77
 
 
78
#endif