Speed up vng Add a LOT
[vng.git] / hunks / HunksCursor.h
blobb9cbf0fb0aba2b9f77d6791b8fde056338928278
1 /*
2 * This file is part of the vng project
3 * Copyright (C) 2008 Thomas Zander <tzander@trolltech.com>
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef HUNKSCURSOR_H
20 #define HUNKSCURSOR_H
22 #include "../InterviewCursor.h"
24 class ChangeSet;
26 class HunksCursor : public InterviewCursor {
27 public:
28 HunksCursor(ChangeSet &changeSet);
29 virtual ~HunksCursor();
31 /// returns the new index
32 virtual int forward(Scope scope = ItemScope, bool skipAnswered = true);
33 /// returns the new index
34 virtual int back(Scope scope = ItemScope);
35 virtual void setResponse(bool response, Scope scope = ItemScope);
36 virtual QString allowedOptions() const;
38 virtual int count();
39 virtual void forceCount();
40 virtual QString currentText() const;
41 virtual QString helpMessage() const;
42 virtual bool isValid() const;
44 private:
45 int currentSubHunkCount();
47 ChangeSet &m_changeSet;
48 int m_totalHunks;
50 protected: // unit test.
51 int currentIndex() const;
52 int m_fileIndex;
53 int m_hunkIndex;
54 int m_subHunkIndex;
57 #endif