libtdepim

diffalgo.h
1 /*
2  This file is part of libtdepim.
3 
4  Copyright (c) 2004 Tobias Koenig <tokoe@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License as published by the Free Software Foundation; either
9  version 2 of the License, or (at your option) any later version.
10 
11  This library 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 GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 */
21 
22 #ifndef DIFFALGO_H
23 #define DIFFALGO_H
24 
25 #include <tqvaluelist.h>
26 #include <kdemacros.h>
27 
28 namespace KPIM {
29 
38 {
39  public:
40 
44  virtual void begin() = 0;
45 
49  virtual void end() = 0;
50 
54  virtual void setLeftSourceTitle( const TQString &title ) = 0;
55 
59  virtual void setRightSourceTitle( const TQString &title ) = 0;
60 
64  virtual void additionalLeftField( const TQString &id, const TQString &value ) = 0;
65 
69  virtual void additionalRightField( const TQString &id, const TQString &value ) = 0;
70 
74  virtual void conflictField( const TQString &id, const TQString &leftValue,
75  const TQString &rightValue ) = 0;
76 };
77 
78 
79 class TDE_EXPORT DiffAlgo
80 {
81  public:
85  virtual ~DiffAlgo() {}
86 
90  virtual void run() = 0;
91 
95  void begin();
96 
100  void end();
101 
105  void setLeftSourceTitle( const TQString &title );
106 
110  void setRightSourceTitle( const TQString &title );
111 
115  void additionalLeftField( const TQString &id, const TQString &value );
116 
120  void additionalRightField( const TQString &id, const TQString &value );
121 
125  void conflictField( const TQString &id, const TQString &leftValue,
126  const TQString &rightValue );
127 
128  void addDisplay( DiffAlgoDisplay *display );
129  void removeDisplay( DiffAlgoDisplay *display );
130 
131 
132  private:
133  TQValueList<DiffAlgoDisplay*> mDisplays;
134 };
135 
136 }
137 
138 #endif
DiffAlgo and DiffAlgoDisplay work together for displaying differences between two PIM objects like co...
Definition: diffalgo.h:38
virtual void additionalRightField(const TQString &id, const TQString &value)=0
Adds a field which is only available in the right data source.
virtual void conflictField(const TQString &id, const TQString &leftValue, const TQString &rightValue)=0
Adds a conflict between two fields.
virtual void begin()=0
Is called on the start of the diff.
virtual void end()=0
Is called on the end of the diff.
virtual void setLeftSourceTitle(const TQString &title)=0
Sets the title of the left data source.
virtual void additionalLeftField(const TQString &id, const TQString &value)=0
Adds a field which is only available in the left data source.
virtual void setRightSourceTitle(const TQString &title)=0
Sets the title of the right data source.
TDEPIM classes for drag and drop of mails.