]> Git trees. - libqmvoc.git/commitdiff
started core and ui libs
authorEwald Arnold <ewald@ewald-arnold.de>
Sun, 2 Jun 2002 15:45:49 +0000 (15:45 +0000)
committerEwald Arnold <ewald@ewald-arnold.de>
Sun, 2 Jun 2002 15:45:49 +0000 (15:45 +0000)
svn path=/trunk/kdeedu/libkdeedu/; revision=159018

Makefile.am
kdeeducore/Makefile.am [new file with mode: 0644]
kdeeducore/kdeeducore.kdevprj [new file with mode: 0644]
kdeeducore/kedudata.cpp [new file with mode: 0644]
kdeeducore/kedudata.h [new file with mode: 0644]
kdeeducore/tests/Makefile.am [new file with mode: 0644]
kdeeducore/tests/loader.cpp [new file with mode: 0644]

index 5ff42fc0363ee582c47202aa0a30c89a7e4297cd..4e9ad053842390efb642761d12d5c3df1c1d2a04 100644 (file)
@@ -1,5 +1,5 @@
 INCLUDES= $(all_includes)
-SUBDIRS = 
+SUBDIRS = kdeeduui kdeeducore
 
 lib_LTLIBRARIES = libkdeedu.la
 
@@ -14,7 +14,7 @@ libkdeedu_la_LIBADD = $(LIB_KDECORE)
 
 METASOURCES = AUTO
 
-# updatedir = 
+# updatedir =
 # update_DATA = 
 
 # messages: 
diff --git a/kdeeducore/Makefile.am b/kdeeducore/Makefile.am
new file mode 100644 (file)
index 0000000..0e860fa
--- /dev/null
@@ -0,0 +1,16 @@
+INCLUDES= $(all_includes)
+SUBDIRS = . tests 
+
+lib_LTLIBRARIES = libkdeeducore.la
+
+libkdeeducore_la_SOURCES = kedudata.cpp
+
+libkdeeducore_la_LDFLAGS = $(all_libraries) -no-undefined -version-info 1:0
+
+include_HEADERS = kedudata.h
+# noinst_HEADERS = 
+
+libkdeeducore_la_LIBADD = $(LIB_KDECORE) $(LIB_QT)
+
+METASOURCES = AUTO
+
diff --git a/kdeeducore/kdeeducore.kdevprj b/kdeeducore/kdeeducore.kdevprj
new file mode 100644 (file)
index 0000000..a2b31cd
--- /dev/null
@@ -0,0 +1,84 @@
+[./Makefile.am]
+files=./kdeeducore.kdevprj,
+sub_dirs=
+type=normal
+
+[./kdeeducore.kdevprj]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[Config for BinMakefileAm]
+addcxxflags=
+bin_program=kdeeducore
+cflags=
+cppflags=
+cxxflags=\s-O0
+ldadd=
+ldflags=\s
+libtool_dir=
+path_to_bin_program=.
+
+[General]
+author=earnold
+configure_args=\s--build=i386-linux --host=i386-linux --target=i386-linux\s
+dir_where_make_will_be_called=
+email=earnold@venus
+kdevprj_version=1.3
+lfv_open_groups=
+make_options=\s-j1 all\s
+makefiles=./Makefile.am,Makefile.am,tests/Makefile.am
+modifyMakefiles=false
+project_name=kdeeducore
+project_type=normal_empty
+short_info=
+sub_dir=
+version=1.0
+version_control=CVS
+workspace=1
+
+[LFV Groups]
+GNU=AUTHORS,COPYING,ChangeLog,INSTALL,README,TODO,NEWS,
+Headers=*.h,*.hxx,*.hpp,*.H,
+Others=*,
+Sources=*.cpp,*.c,*.cc,*.C,*.cxx,*.ec,*.ecpp,*.lxx,*.l++,*.ll,*.l,
+Translations=*.ts,*.po,
+User Interface=*.ui,*.kdevdlg,*.rc,
+groups=Headers,Sources,GNU,Translations,User Interface,Others
+
+[Makefile.am]
+dist=true
+files=Makefile.am,kedudata.cpp,kedudata.h
+install=false
+install_location=
+sub_dirs=tests
+type=static_library
+
+[kedudata.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[kedudata.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[tests/Makefile.am]
+dist=true
+files=tests/loader.cpp,tests/Makefile.am
+install=false
+install_location=
+sharedlib_LDFLAGS=-version-info 0:0:0
+sharedlib_rootname=tests
+sub_dirs=
+type=DATA
+
+[tests/loader.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
diff --git a/kdeeducore/kedudata.cpp b/kdeeducore/kedudata.cpp
new file mode 100644 (file)
index 0000000..285b5d9
--- /dev/null
@@ -0,0 +1,111 @@
+/* This file is part of the KDE Edu Library
+   Copyright (C) 2002 Scott Wheeler <wheeler@kde.org>
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public
+   License version 2 as published by the Free Software Foundation.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public License
+   along with this library; see the file COPYING.LIB.  If not, write to
+   the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.
+*/
+
+#include "kedudata.h"
+
+#include <qfile.h>
+
+#include <kdebug.h>
+
+////////////////////////////////////////////////////////////////////////////////
+// class KEduDataItem
+////////////////////////////////////////////////////////////////////////////////
+
+// public methods
+
+KEduDataItem::KEduDataItem()
+{
+
+}
+
+KEduDataItem::KEduDataItem(QDomElement &entry)
+{
+    domElement = entry;
+}
+
+KEduDataItem::~KEduDataItem()
+{
+
+}
+
+QString KEduDataItem::originalText()
+{
+    return getText("o");
+}
+
+QString KEduDataItem::translatedText()
+{
+    return getText("t");
+}
+
+// protected methods
+
+QString KEduDataItem::getText(const QString tagName)
+{
+    if(!domElement.isNull()) {
+
+        QDomNodeList list = domElement.elementsByTagName(tagName);
+
+        if(list.count() > 0) {
+
+            QDomElement element = list.item(0).toElement();
+
+            if(!element.isNull()) {
+                return element.text();
+            }
+            else
+                return QString::null;
+        }
+        else
+            return QString::null;
+    }
+    else
+        return QString::null;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// class KEduData
+////////////////////////////////////////////////////////////////////////////////
+
+// public static methods
+
+KEduDataItemList KEduData::parse(const QString fileName)
+{
+    KEduDataItemList list;
+
+    QDomDocument document;
+    QFile file(fileName);
+    document.setContent(&file);
+
+    QDomNodeList entries = document.elementsByTagName("e");
+
+    // loop through the "e" (entry) tags looking for data
+    for(uint i = 0 ; i < entries.count() ; i++) {
+
+        // get an entry to operate on
+        QDomElement entry = entries.item(i).toElement();
+
+        // if the "node" is in fact an element -- i.e. not null
+        if(!entry.isNull()) {
+            KEduDataItem item(entry);
+            list.append(item);
+        }
+    }
+
+    return list;
+}
diff --git a/kdeeducore/kedudata.h b/kdeeducore/kedudata.h
new file mode 100644 (file)
index 0000000..9ae59d4
--- /dev/null
@@ -0,0 +1,45 @@
+/* This file is part of the KDE Edu Library
+   Copyright (C) 2002 Scott Wheeler <wheeler@kde.org>
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public
+   License version 2 as published by the Free Software Foundation.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public License
+   along with this library; see the file COPYING.LIB.  If not, write to
+   the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.
+*/
+
+#include <qdom.h>
+#include <qvaluelist.h>
+
+class KEduDataItem
+{
+public:
+    KEduDataItem();
+    KEduDataItem(QDomElement &entry);
+    virtual ~KEduDataItem();
+
+    QString originalText();
+    QString translatedText();
+
+protected:
+    QString getText(const QString tagName);
+
+private:
+    QDomElement domElement;
+};
+
+typedef QValueList<KEduDataItem> KEduDataItemList;
+
+class KEduData
+{
+public:
+    static KEduDataItemList parse(const QString fileName);
+};
diff --git a/kdeeducore/tests/Makefile.am b/kdeeducore/tests/Makefile.am
new file mode 100644 (file)
index 0000000..1183d00
--- /dev/null
@@ -0,0 +1,12 @@
+SUBDIRS = .
+INCLUDES = -I.  -I$(top_srcdir)/kdeeducore $(all_includes)
+
+LDADD      = ../libkdeeducore.la
+LDFLAGS    = $(all_libraries)
+
+check_PROGRAMS = loader
+
+#all: check
+
+loader_SOURCES         = loader.cpp
+
diff --git a/kdeeducore/tests/loader.cpp b/kdeeducore/tests/loader.cpp
new file mode 100644 (file)
index 0000000..8d793ca
--- /dev/null
@@ -0,0 +1,7 @@
+
+int main (void)
+{
+
+
+  return 0;
+}