summaryrefslogtreecommitdiff
path: root/library/backend/palmtoprecord.h
Unidiff
Diffstat (limited to 'library/backend/palmtoprecord.h') (more/less context) (show whitespace changes)
-rw-r--r--library/backend/palmtoprecord.h33
1 files changed, 17 insertions, 16 deletions
diff --git a/library/backend/palmtoprecord.h b/library/backend/palmtoprecord.h
index 0372011..72f7d1c 100644
--- a/library/backend/palmtoprecord.h
+++ b/library/backend/palmtoprecord.h
@@ -1,16 +1,15 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free 7** GNU General Public License version 2 as published by the Free Software
8** Software Foundation and appearing in the file LICENSE.GPL included 8** Foundation and appearing in the file LICENSE.GPL included in the
9** in the packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** PARTICULAR PURPOSE.
14** 13**
15** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
16** 15**
@@ -18,10 +17,8 @@
18** not clear to you. 17** not clear to you.
19** 18**
20**********************************************************************/ 19**********************************************************************/
21
22#ifndef QTPALMTOP_RECORD_H 20#ifndef QTPALMTOP_RECORD_H
23#define QTPALMTOP_RECORD_H 21#define QTPALMTOP_RECORD_H
24
25#include <qglobal.h> 22#include <qglobal.h>
26#include "qpcglobal.h" 23#include "qpcglobal.h"
27#include "palmtopuidgen.h" 24#include "palmtopuidgen.h"
@@ -30,7 +27,7 @@
30 27
31#if defined(QPC_TEMPLATEDLL) 28#if defined(QPC_TEMPLATEDLL)
32// MOC_SKIP_BEGIN 29// MOC_SKIP_BEGIN
33template class QPC_EXPORT QMap<QString, QString>; 30QPC_TEMPLATEEXTERN template class QPC_EXPORT QMap<QString, QString>;
34// MOC_SKIP_END 31// MOC_SKIP_END
35#endif 32#endif
36 33
@@ -49,10 +46,17 @@ public:
49 46
50 virtual bool match( const QRegExp & ) const { return FALSE; } 47 virtual bool match( const QRegExp & ) const { return FALSE; }
51 48
52 void setCategories( const QArray<int> &v ) { mCats = v; } 49 void setCategories( const QArray<int> &v ) { mCats = v; mCats.sort(); }
53 void setCategories( int single ); 50 void setCategories( int single );
54 const QArray<int> &categories() const { return mCats; } 51 const QArray<int> &categories() const { return mCats; }
55 52
53 void reassignCategoryId( int oldId, int newId )
54 {
55 int index = mCats.find( oldId );
56 if ( index >= 0 )
57 mCats[index] = newId;
58 }
59
56 int uid() const { return mUid; }; 60 int uid() const { return mUid; };
57 virtual void setUid( int i ) { mUid = i; uidGen().store( mUid ); } 61 virtual void setUid( int i ) { mUid = i; uidGen().store( mUid ); }
58 bool isValidUid() const { return mUid != 0; } 62 bool isValidUid() const { return mUid != 0; }
@@ -77,18 +81,15 @@ public:
77 81
78protected: 82protected:
79 virtual UidGen &uidGen() = 0; 83 virtual UidGen &uidGen() = 0;
80
81 virtual QString customToXml() const; 84 virtual QString customToXml() const;
82
83private: 85private:
84 int mUid; 86 int mUid;
85 QArray<int> mCats; 87 QArray<int> mCats;
86
87 QMap<QString, QString> customMap; 88 QMap<QString, QString> customMap;
88
89 RecordPrivate *d; 89 RecordPrivate *d;
90}; 90};
91 91
92} 92}
93 93
94#endif 94#endif
95