summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--libopie/pim/opimstate.h2
-rw-r--r--libopie/pim/opimxref.h36
-rw-r--r--libopie/pim/opimxrefmanager.h36
-rw-r--r--libopie/pim/opimxrefpartner.h40
-rw-r--r--libopie2/opiepim/core/opimstate.h2
-rw-r--r--libopie2/opiepim/core/opimxref.h36
-rw-r--r--libopie2/opiepim/core/opimxrefmanager.h36
-rw-r--r--libopie2/opiepim/core/opimxrefpartner.h40
8 files changed, 228 insertions, 0 deletions
diff --git a/libopie/pim/opimstate.h b/libopie/pim/opimstate.h
index 731181e..cf6af46 100644
--- a/libopie/pim/opimstate.h
+++ b/libopie/pim/opimstate.h
@@ -34,8 +34,10 @@ public:
private:
void deref();
inline void copyInternally();
+
struct Data;
Data* data;
+
class Private;
Private *d;
};
diff --git a/libopie/pim/opimxref.h b/libopie/pim/opimxref.h
new file mode 100644
index 0000000..72154ac
--- a/dev/null
+++ b/libopie/pim/opimxref.h
@@ -0,0 +1,36 @@
+#ifndef OPIM_XREF_H
+#define OPIM_XREF_H
+
+#include <qarray.h>
+#include <qvaluelist.h>
+
+#include <opie/opimxrefpartner.h>
+
+/**
+ * this is a Cross Referecne between
+ * two Cross Reference Partners
+ */
+class OPimXRef {
+public:
+ typedef QValueList<OPimXRef> ValueList;
+ enum Partners { One, Two };
+ OPimXRef( const OPimXRefPartner& ONE, const OPimXRefPartner& );
+ OPimXRef();
+ OPimXRef( const OPimXRef& );
+ ~OPimXRef();
+
+ OPimXRef &operator=( const OPimXRef& );
+ bool operator==( const OPimXRef );
+
+ OPimXRefPartner partner( enum Partners );
+
+ void setPartner( enum Partners, const OPimXRefPartner& );
+
+private:
+ QArray<OPimXRefPartner> m_partners;
+
+ class Private;
+ Private *d;
+};
+
+#endif
diff --git a/libopie/pim/opimxrefmanager.h b/libopie/pim/opimxrefmanager.h
new file mode 100644
index 0000000..147895d
--- a/dev/null
+++ b/libopie/pim/opimxrefmanager.h
@@ -0,0 +1,36 @@
+#ifndef OPIM_XREF_MANAGER_H
+#define OPIM_XREF_MANAGER_H
+
+#include <opie/opimxref.h>
+
+/**
+ * This is a simple manager for
+ * OPimXRefs.
+ * It allows addition, removing, replacing
+ * clearing and 'querying' the XRef...
+ */
+class OPimXRefManager {
+public:
+ OPimXRefManager();
+ OPimXRefManager( const OPimXRefManager& );
+ ~OPimXRefManager();
+
+ OPimXRefManager& operator=( const OPimXRefManager& );
+ bool operator==( const OPimXRefManager& );
+
+ void add( const OPimXRef& );
+ void remove( const OPimXRef& );
+ void replace( const OPimXRef& );
+
+ void clear();
+
+ /**
+ * apps participating
+ */
+ QStringList apps()const;
+ OPimXRef::ValueList list()const;
+ OPimXRef::ValueList list( const QString& appName )const;
+ OPimXRef::ValueList list( int uid )const;
+};
+
+#endif
diff --git a/libopie/pim/opimxrefpartner.h b/libopie/pim/opimxrefpartner.h
new file mode 100644
index 0000000..808b9ab
--- a/dev/null
+++ b/libopie/pim/opimxrefpartner.h
@@ -0,0 +1,40 @@
+#ifndef OPIM_XREF_PARTNER_H
+#define OPIM_XREF_PARTNER_H
+
+#include <qstring.h>
+
+/**
+ * This class represents one partner
+ * of a Cross Reference.
+ * In Opie one application
+ * can link one uid
+ * with one tableId( fieldId ) to another.
+ */
+class OPimXRefPartner {
+public:
+ OPimXRefPartner( const QString& appName = QString::null,
+ int uid = 0, int field = -1 );
+ OPimXRefPartner( const OPimXRefPartner& );
+ OPimXRefPartner& operator=( const OPimXRefPartner& );
+ ~OPimXRefPartner();
+
+ bool operator==(const OPimXRefPartner& );
+
+ QString appName()const;
+ int uid()const;
+ int field()const;
+
+ void setAppName( const QString& appName );
+ void setUid( int uid );
+ void setField( int field );
+private:
+ QString m_app;
+ int m_uid;
+ int m_field;
+
+ class Private;
+ Private* d;
+};
+
+
+#endif
diff --git a/libopie2/opiepim/core/opimstate.h b/libopie2/opiepim/core/opimstate.h
index 731181e..cf6af46 100644
--- a/libopie2/opiepim/core/opimstate.h
+++ b/libopie2/opiepim/core/opimstate.h
@@ -34,8 +34,10 @@ public:
private:
void deref();
inline void copyInternally();
+
struct Data;
Data* data;
+
class Private;
Private *d;
};
diff --git a/libopie2/opiepim/core/opimxref.h b/libopie2/opiepim/core/opimxref.h
new file mode 100644
index 0000000..72154ac
--- a/dev/null
+++ b/libopie2/opiepim/core/opimxref.h
@@ -0,0 +1,36 @@
+#ifndef OPIM_XREF_H
+#define OPIM_XREF_H
+
+#include <qarray.h>
+#include <qvaluelist.h>
+
+#include <opie/opimxrefpartner.h>
+
+/**
+ * this is a Cross Referecne between
+ * two Cross Reference Partners
+ */
+class OPimXRef {
+public:
+ typedef QValueList<OPimXRef> ValueList;
+ enum Partners { One, Two };
+ OPimXRef( const OPimXRefPartner& ONE, const OPimXRefPartner& );
+ OPimXRef();
+ OPimXRef( const OPimXRef& );
+ ~OPimXRef();
+
+ OPimXRef &operator=( const OPimXRef& );
+ bool operator==( const OPimXRef );
+
+ OPimXRefPartner partner( enum Partners );
+
+ void setPartner( enum Partners, const OPimXRefPartner& );
+
+private:
+ QArray<OPimXRefPartner> m_partners;
+
+ class Private;
+ Private *d;
+};
+
+#endif
diff --git a/libopie2/opiepim/core/opimxrefmanager.h b/libopie2/opiepim/core/opimxrefmanager.h
new file mode 100644
index 0000000..147895d
--- a/dev/null
+++ b/libopie2/opiepim/core/opimxrefmanager.h
@@ -0,0 +1,36 @@
+#ifndef OPIM_XREF_MANAGER_H
+#define OPIM_XREF_MANAGER_H
+
+#include <opie/opimxref.h>
+
+/**
+ * This is a simple manager for
+ * OPimXRefs.
+ * It allows addition, removing, replacing
+ * clearing and 'querying' the XRef...
+ */
+class OPimXRefManager {
+public:
+ OPimXRefManager();
+ OPimXRefManager( const OPimXRefManager& );
+ ~OPimXRefManager();
+
+ OPimXRefManager& operator=( const OPimXRefManager& );
+ bool operator==( const OPimXRefManager& );
+
+ void add( const OPimXRef& );
+ void remove( const OPimXRef& );
+ void replace( const OPimXRef& );
+
+ void clear();
+
+ /**
+ * apps participating
+ */
+ QStringList apps()const;
+ OPimXRef::ValueList list()const;
+ OPimXRef::ValueList list( const QString& appName )const;
+ OPimXRef::ValueList list( int uid )const;
+};
+
+#endif
diff --git a/libopie2/opiepim/core/opimxrefpartner.h b/libopie2/opiepim/core/opimxrefpartner.h
new file mode 100644
index 0000000..808b9ab
--- a/dev/null
+++ b/libopie2/opiepim/core/opimxrefpartner.h
@@ -0,0 +1,40 @@
+#ifndef OPIM_XREF_PARTNER_H
+#define OPIM_XREF_PARTNER_H
+
+#include <qstring.h>
+
+/**
+ * This class represents one partner
+ * of a Cross Reference.
+ * In Opie one application
+ * can link one uid
+ * with one tableId( fieldId ) to another.
+ */
+class OPimXRefPartner {
+public:
+ OPimXRefPartner( const QString& appName = QString::null,
+ int uid = 0, int field = -1 );
+ OPimXRefPartner( const OPimXRefPartner& );
+ OPimXRefPartner& operator=( const OPimXRefPartner& );
+ ~OPimXRefPartner();
+
+ bool operator==(const OPimXRefPartner& );
+
+ QString appName()const;
+ int uid()const;
+ int field()const;
+
+ void setAppName( const QString& appName );
+ void setUid( int uid );
+ void setField( int field );
+private:
+ QString m_app;
+ int m_uid;
+ int m_field;
+
+ class Private;
+ Private* d;
+};
+
+
+#endif