Fix no newlines warnings. Patch by Peter Oberndorfer
[kdevelopdvcssupport.git] / vcs / vcsannotation.h
blobee051a9941a10771471c69739a9779f731c5bdd4
1 /* This file is part of KDevelop
3 * Copyright 2007 Andreas Pakulat <apaku@gmx.de>
4 * Copyright 2007 Matthew Woehlke <mw_triad@users.sourceforge.net>
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 * 02110-1301, USA.
22 #ifndef VCSANNOTATION_H
23 #define VCSANNOTATION_H
25 #include "vcsexport.h"
26 #include <QtCore/QVariant>
28 class QString;
29 class QDateTime;
30 class KUrl;
32 namespace KDevelop
34 class VcsRevision;
36 /**
37 * Annotation information for a line of a version controlled file
39 class KDEVPLATFORMVCS_EXPORT VcsAnnotationLine
41 public:
42 VcsAnnotationLine();
43 VcsAnnotationLine( const VcsAnnotationLine& );
44 virtual ~VcsAnnotationLine();
45 /**
46 * @return the line number of this annotation line
48 int lineNumber() const;
49 /**
50 * @return the text of this line
52 QString text() const;
53 /**
54 * @return the author that last changed this line
56 QString author() const;
57 /**
58 * @return the revision this line was last changed
60 VcsRevision revision() const;
61 /**
62 * @return the date of the last change to this line
64 QDateTime date() const;
65 /**
66 * set the line number of this annotation line
67 * @param number the line number
69 void setLineNumber( int );
70 /**
71 * set the text of this annotation line
72 * @param text the text of the line
74 void setText( const QString& );
75 /**
76 * set the author of this annotation line
77 * @param author the author of the last change
79 void setAuthor( const QString& );
80 /**
81 * set the revision of this annotation line
82 * @param revision the revision of the last change
84 void setRevision( const VcsRevision& );
85 /**
86 * set the date of this annotation line
87 * @param date the date of the last change
89 void setDate( const QDateTime& );
90 VcsAnnotationLine& operator=( const VcsAnnotationLine& rhs);
91 private:
92 class VcsAnnotationLinePrivate* d;
95 /**
96 * Annotations for a local file.
98 * This class lets the user fetch information for each line of a local file,
99 * including date of last change, author of last change and revision of
100 * last change to the line.
102 class KDEVPLATFORMVCS_EXPORT VcsAnnotation
104 public:
105 VcsAnnotation();
106 VcsAnnotation(const VcsAnnotation&);
107 virtual ~VcsAnnotation();
109 * @return the local url of the file
111 KUrl location() const;
113 * @return the number of lines in the file
115 int lineCount() const;
118 * retrieve the annotation line for the given number
120 VcsAnnotationLine line( int linenumber ) const;
123 * insert a new line to list of lines using
124 * the parameters
126 * @param lineno the line for which to insert the content
127 * @param line the annotation line that should be inserted
130 void insertLine( int lineno, const VcsAnnotationLine& );
133 * @param location the location of the file
135 void setLocation( const KUrl& );
137 VcsAnnotation& operator=( const VcsAnnotation& rhs);
138 private:
139 class VcsAnnotationPrivate* const d;
144 Q_DECLARE_METATYPE( KDevelop::VcsAnnotation )
145 Q_DECLARE_METATYPE( KDevelop::VcsAnnotationLine )
147 #endif