From 54860b9c436f31cce71afd180e03b4bf93512b58 Mon Sep 17 00:00:00 2001 From: deva Date: Sun, 28 Dec 2008 11:46:24 +0000 Subject: Basic data model now in place. git-svn-id: file:///mnt/atuin/misc/bak/sync/data/svn/repos/qookie@10 385a8487-d0bc-44c8-a27f-f7cfc1192794 --- QookieAdd | 68 ++++++++++++++++++++++++++++++++ component.cc | 28 +++++++++++++ component.h | 42 ++++++++++++++++++++ course.cc | 27 +++++++++++++ course.h | 42 ++++++++++++++++++++ dish.cc | 27 +++++++++++++ dish.h | 42 ++++++++++++++++++++ document.cc | 100 +++++++++++++++++++++++++++++++++++++++++++++++ document.h | 78 +++++++++++++++++++++++++++++++++++++ ingredient.cc | 28 +++++++++++++ ingredient.h | 40 +++++++++++++++++++ mainwindow.cc | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ mainwindow.h | 53 +++++++++++++++++++++++++ menu.cc | 28 +++++++++++++ menu.h | 42 ++++++++++++++++++++ qookie.cc | 39 +++++++++++++++++++ qookie.pro | 36 +++++++++++++++++ qookie.svg | 123 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ uid.cc | 28 +++++++++++++ uid.h | 32 +++++++++++++++ unit.cc | 28 +++++++++++++ unit.h | 34 ++++++++++++++++ viewer.cc | 31 +++++++++++++++ viewer.h | 37 ++++++++++++++++++ 24 files changed, 1148 insertions(+) create mode 100644 QookieAdd create mode 100644 component.cc create mode 100644 component.h create mode 100644 course.cc create mode 100644 course.h create mode 100644 dish.cc create mode 100644 dish.h create mode 100644 document.cc create mode 100644 document.h create mode 100644 ingredient.cc create mode 100644 ingredient.h create mode 100644 mainwindow.cc create mode 100644 mainwindow.h create mode 100644 menu.cc create mode 100644 menu.h create mode 100644 qookie.cc create mode 100644 qookie.pro create mode 100644 qookie.svg create mode 100644 uid.cc create mode 100644 uid.h create mode 100644 unit.cc create mode 100644 unit.h create mode 100644 viewer.cc create mode 100644 viewer.h diff --git a/QookieAdd b/QookieAdd new file mode 100644 index 0000000..8be129b --- /dev/null +++ b/QookieAdd @@ -0,0 +1,68 @@ +#!/bin/bash +PROJECT="Qookie" + +function allfile() { + WHO="`whoami`" + + echo "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */" > $1; + echo "/***************************************************************************" >> $1; + echo " * $1" >> $1; + echo " *" >> $1 ; + echo " * `date`" >> $1; + echo -n " * Copyright " >> $1 + echo -n `date +%Y | xargs` >> $1 + if [ "$WHO" == "deva" ]; + then + echo " Bent Bisballe Nyeng" >> $1; + echo " * deva@aasimon.org" >> $1; + fi + echo " ****************************************************************************/" >> $1; + echo "" >> $1; + echo "/*" >> $1; + echo " * This file is part of $PROJECT." >> $1; + echo " *" >> $1; + echo " * $PROJECT is free software; you can redistribute it and/or modify" >> $1; + echo " * it under the terms of the GNU General Public License as published by" >> $1; + echo " * the Free Software Foundation; either version 2 of the License, or" >> $1; + echo " * (at your option) any later version." >> $1; + echo " *" >> $1; + echo " * $PROJECT is distributed in the hope that it will be useful," >> $1; + echo " * but WITHOUT ANY WARRANTY; without even the implied warranty of" >> $1; + echo " * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the" >> $1; + echo " * GNU General Public License for more details." >> $1; + echo " *" >> $1; + echo " * You should have received a copy of the GNU General Public License" >> $1; + echo " * along with $PROJECT; if not, write to the Free Software" >> $1; + echo " * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA." >> $1; + echo " */" >> $1; +} + +function ccfile() { + local hf=`echo -n $1 | cut -d'.' -f1`.h; + hfile $hf; + + allfile $1; + echo -n '#include "' >> $1; + echo -n $hf >> $1; + echo '"' >> $1; + echo '' >> $1; +} + +function hfile() { + allfile $1; + local hn=`echo $1 | tr 'a-z.' 'A-Z_'` + local pr=`echo $PROJECT | tr 'a-z.' 'A-Z_'` + echo "#ifndef __${pr}_${hn}__" >> $1; + echo "#define __${pr}_${hn}__" >> $1; + echo "#endif/*__${pr}_${hn}__*/" >> $1; +} + +if [ "$#" = "1" ]; then +if [ "CC" = `echo $1 | cut -d'.' -f2 | tr 'a-z' 'A-Z'` ]; then + ccfile $1; +fi; +if [ "H" = `echo $1 | cut -d'.' -f2 | tr 'a-z' 'A-Z'` ]; then + hfile $1; +fi; +else echo "Usage: $0 filename"; +fi; diff --git a/component.cc b/component.cc new file mode 100644 index 0000000..f493c95 --- /dev/null +++ b/component.cc @@ -0,0 +1,28 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/*************************************************************************** + * component.cc + * + * Sun Dec 28 10:19:20 CET 2008 + * Copyright 2008 Bent Bisballe Nyeng + * deva@aasimon.org + ****************************************************************************/ + +/* + * This file is part of Qookie. + * + * Qookie is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Qookie 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Qookie; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ +#include "component.h" + diff --git a/component.h b/component.h new file mode 100644 index 0000000..a70a9cc --- /dev/null +++ b/component.h @@ -0,0 +1,42 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/*************************************************************************** + * component.h + * + * Sun Dec 28 10:19:20 CET 2008 + * Copyright 2008 Bent Bisballe Nyeng + * deva@aasimon.org + ****************************************************************************/ + +/* + * This file is part of Qookie. + * + * Qookie is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Qookie 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Qookie; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ +#ifndef __QOOKIE_COMPONENT_H__ +#define __QOOKIE_COMPONENT_H__ + +#include +#include +#include "uid.h" + +class Component { +public: + uid_t uid;//uid Integer A unique number defining this component. + QString name; //name String The name or title of the component. + QString description; //description String A short description of the component. + QImage image; //image Binary An image of the component. +}; + +#endif/*__QOOKIE_COMPONENT_H__*/ diff --git a/course.cc b/course.cc new file mode 100644 index 0000000..bb15c2d --- /dev/null +++ b/course.cc @@ -0,0 +1,27 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/*************************************************************************** + * course.cc + * + * Fri Aug 22 18:59:30 CEST 2008 + * Copyright 2008 Bent Bisballe Nyeng + * deva@aasimon.org + ****************************************************************************/ + +/* + * This file is part of Qookie. + * + * Qookie is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Qookie 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Qookie; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ +#include "course.h" diff --git a/course.h b/course.h new file mode 100644 index 0000000..d9bc8ed --- /dev/null +++ b/course.h @@ -0,0 +1,42 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/*************************************************************************** + * course.h + * + * Tue Aug 19 19:59:36 CEST 2008 + * Copyright 2008 Bent Bisballe Nyeng + * deva@aasimon.org + ****************************************************************************/ + +/* + * This file is part of Qookie. + * + * Qookie is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Qookie 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Qookie; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ +#ifndef __QOOKIE_COURSE_H__ +#define __QOOKIE_COURSE_H__ + +#include +#include +#include + +#include "component.h" +#include "ingredient.h" + +class Course : public Component { +public: + QVector ingredients; +}; + +#endif/*__QOOKIE_COURSE_H__*/ diff --git a/dish.cc b/dish.cc new file mode 100644 index 0000000..20baa88 --- /dev/null +++ b/dish.cc @@ -0,0 +1,27 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/*************************************************************************** + * dish.cc + * + * Fri Aug 22 18:59:39 CEST 2008 + * Copyright 2008 Bent Bisballe Nyeng + * deva@aasimon.org + ****************************************************************************/ + +/* + * This file is part of Qookie. + * + * Qookie is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Qookie 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Qookie; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ +#include "dish.h" diff --git a/dish.h b/dish.h new file mode 100644 index 0000000..4c93183 --- /dev/null +++ b/dish.h @@ -0,0 +1,42 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/*************************************************************************** + * dish.h + * + * Tue Aug 19 19:59:29 CEST 2008 + * Copyright 2008 Bent Bisballe Nyeng + * deva@aasimon.org + ****************************************************************************/ + +/* + * This file is part of Qookie. + * + * Qookie is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Qookie 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Qookie; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ +#ifndef __QOOKIE_DISH_H__ +#define __QOOKIE_DISH_H__ + +#include +#include +#include + +#include "component.h" +#include "course.h" + +class Dish : public Component { +public: + QVector courses; +}; + +#endif/*__QOOKIE_DISH_H__*/ diff --git a/document.cc b/document.cc new file mode 100644 index 0000000..d46f089 --- /dev/null +++ b/document.cc @@ -0,0 +1,100 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/*************************************************************************** + * document.cc + * + * Fri Aug 22 19:35:32 CEST 2008 + * Copyright 2008 Bent Bisballe Nyeng + * deva@aasimon.org + ****************************************************************************/ + +/* + * This file is part of Qookie. + * + * Qookie is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Qookie 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Qookie; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ +#include "document.h" + +Document::Document() +{ + setChanged(true); + maxuid = 0; +} + +bool Document::hasChanged() +{ + return changed; +} + +void Document::setChanged(bool changed) +{ + if(this->changed != changed) { + this->changed = changed; + emit documentStatusChanged(changed); + } +} + +uid_t Document::nextUid() +{ + return maxuid++; +} + +void Document::addIngredient(Ingredient *ingredient) +{ + ingredients[ingredient->uid] = ingredient; + if(ingredient->uid > maxuid) maxuid = ingredient->uid; + setChanged(true); +} + +void Document::addCourse(Course *course) +{ + courses[course->uid] = course; + if(course->uid > maxuid) maxuid = course->uid; + setChanged(true); +} + + +void Document::addDish(Dish *dish) +{ + dishes[dish->uid] = dish; + if(dish->uid > maxuid) maxuid = dish->uid; + setChanged(true); +} + +void Document::addMenu(Menu *menu) +{ + menus[menu->uid] = menu; + if(menu->uid > maxuid) maxuid = menu->uid; + setChanged(true); +} + +const Ingredient &Document::ingredient(uid_t uid) const +{ + return *ingredients[uid]; +} + +const Course &Document::course(uid_t uid) const +{ + return *courses[uid]; +} + +const Dish &Document::dish(uid_t uid) const +{ + return *dishes[uid]; +} + +const Menu &Document::menu(uid_t uid) const +{ + return *menus[uid]; +} diff --git a/document.h b/document.h new file mode 100644 index 0000000..ee0cfd5 --- /dev/null +++ b/document.h @@ -0,0 +1,78 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/*************************************************************************** + * document.h + * + * Fri Aug 22 19:35:31 CEST 2008 + * Copyright 2008 Bent Bisballe Nyeng + * deva@aasimon.org + ****************************************************************************/ + +/* + * This file is part of Qookie. + * + * Qookie is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Qookie 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Qookie; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ +#ifndef __QOOKIE_DOCUMENT_H__ +#define __QOOKIE_DOCUMENT_H__ + +#include + +#include "uid.h" +#include "menu.h" +#include "dish.h" +#include "course.h" +#include "ingredient.h" + +/** + * The document class is the internal representation of the Qookie document. + * It is detached to the medium, of its origin (file, database etc.) this is handled by the + * Reader interface class. + */ +class Document : public QObject { +Q_OBJECT +public: + Document(); + + bool hasChanged(); + void setChanged(bool changed); + + void addIngredient(Ingredient *ingredient); + void addCourse(Course *course); + void addDish(Dish *dish); + void addMenu(Menu *menu); + + const Ingredient &ingredient(uid_t uid) const; + const Course &course(uid_t uid) const; + const Dish &dish(uid_t uid) const; + const Menu &menu(uid_t uid) const; + + QString name; + +signals: + void documentStatusChanged(bool changed); + +private: + bool changed; + + QMap< uid_t, Menu *> menus; + QMap< uid_t, Dish *> dishes; + QMap< uid_t, Course *> courses; + QMap< uid_t, Ingredient *> ingredients; + + uid_t nextUid(); + uid_t maxuid; +}; + +#endif/*__QOOKIE_DOCUMENT_H__*/ diff --git a/ingredient.cc b/ingredient.cc new file mode 100644 index 0000000..155424c --- /dev/null +++ b/ingredient.cc @@ -0,0 +1,28 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/*************************************************************************** + * ingredient.cc + * + * Fri Aug 22 18:59:20 CEST 2008 + * Copyright 2008 Bent Bisballe Nyeng + * deva@aasimon.org + ****************************************************************************/ + +/* + * This file is part of Qookie. + * + * Qookie is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Qookie 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Qookie; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ +#include "ingredient.h" + diff --git a/ingredient.h b/ingredient.h new file mode 100644 index 0000000..46a7200 --- /dev/null +++ b/ingredient.h @@ -0,0 +1,40 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/*************************************************************************** + * ingredient.h + * + * Tue Aug 19 19:59:40 CEST 2008 + * Copyright 2008 Bent Bisballe Nyeng + * deva@aasimon.org + ****************************************************************************/ + +/* + * This file is part of Qookie. + * + * Qookie is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Qookie 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Qookie; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ +#ifndef __QOOKIE_INGREDIENT_H__ +#define __QOOKIE_INGREDIENT_H__ + +#include + +#include "component.h" +#include "unit.h" + +class Ingredient : public Component { +public: + Unit *unit; +}; + +#endif/*__QOOKIE_INGREDIENT_H__*/ diff --git a/mainwindow.cc b/mainwindow.cc new file mode 100644 index 0000000..55d5efb --- /dev/null +++ b/mainwindow.cc @@ -0,0 +1,115 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/*************************************************************************** + * mainwindow.cc + * + * Tue Aug 19 19:17:08 CEST 2008 + * Copyright 2008 Bent Bisballe Nyeng + * deva@aasimon.org + ****************************************************************************/ + +/* + * This file is part of Qookie. + * + * Qookie is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Qookie 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Qookie; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ +#include "mainwindow.h" + +#include +#include +#include + +#include + +#include "xmlreader.h" + +MainWindow::MainWindow() +{ + XMLReader reader; + document = reader.read(); + + connect(document, SIGNAL(documentStatusChanged(bool)), this, SLOT(updateDocumentStatus(bool))); + + // + // Create the toolbar + // + QToolBar *toolbar = new QToolBar("A toolbar"); + + // QAction *act_load = toolbar->addAction("Load"); + // connect(act_load, SIGNAL(triggered()), &document, SLOT(load())); + + // QAction *act_save = toolbar->addAction("Save"); + // connect(act_save, SIGNAL(triggered()), &document, SLOT(save())); + + QAction *act_ing = toolbar->addAction("Add Ingredient"); + connect(act_ing, SIGNAL(triggered()), this, SLOT(addIngredient())); + + QAction *act_dish = toolbar->addAction("Add Dish"); + connect(act_dish, SIGNAL(triggered()), this, SLOT(addDish())); + + QAction *act_course = toolbar->addAction("Add Course"); + connect(act_course, SIGNAL(triggered()), this, SLOT(addCourse())); + + QAction *act_menu = toolbar->addAction("Add Menu"); + connect(act_menu, SIGNAL(triggered()), this, SLOT(addMenu())); + + // + // Create the browser docking widget + // + QDockWidget *browser = new QDockWidget("Browser"); + + // + // Create the viewer + // + viewer = new Viewer(); + + setCentralWidget(viewer); + addToolBar(Qt::TopToolBarArea, toolbar); + addDockWidget(Qt::LeftDockWidgetArea, browser); +} + +MainWindow::~MainWindow() +{ + XMLReader reader; + reader.write(document); +} + +void MainWindow::addIngredient() +{ + Ingredient *ingredient = new Ingredient(); + document->addIngredient(ingredient); +} + +void MainWindow::addDish() +{ + Dish *dish = new Dish(); + document->addDish(dish); +} + +void MainWindow::addCourse() +{ + Course *course = new Course(); + document->addCourse(course); +} + +void MainWindow::addMenu() +{ + Menu *menu = new Menu(); + document->addMenu(menu); +} + +void MainWindow::updateDocumentStatus(bool changed) +{ + setWindowTitle(document->name + (changed?"*":"")); +} diff --git a/mainwindow.h b/mainwindow.h new file mode 100644 index 0000000..dbdbd94 --- /dev/null +++ b/mainwindow.h @@ -0,0 +1,53 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/*************************************************************************** + * mainwindow.h + * + * Tue Aug 19 19:17:08 CEST 2008 + * Copyright 2008 Bent Bisballe Nyeng + * deva@aasimon.org + ****************************************************************************/ + +/* + * This file is part of Qookie. + * + * Qookie is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Qookie 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Qookie; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ +#ifndef __QOOKIE_MAINWINDOW_H__ +#define __QOOKIE_MAINWINDOW_H__ + +#include +#include "document.h" +#include "viewer.h" + +class MainWindow : public QMainWindow +{ +Q_OBJECT +public: + MainWindow(); + ~MainWindow(); + +public slots: + void addIngredient(); + void addDish(); + void addCourse(); + void addMenu(); + void updateDocumentStatus(bool changed); + +private: + Document *document; + Viewer *viewer; +}; + +#endif/*__QOOKIE_MAINWINDOW_H__*/ diff --git a/menu.cc b/menu.cc new file mode 100644 index 0000000..8992cb5 --- /dev/null +++ b/menu.cc @@ -0,0 +1,28 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/*************************************************************************** + * menu.cc + * + * Fri Aug 22 18:59:25 CEST 2008 + * Copyright 2008 Bent Bisballe Nyeng + * deva@aasimon.org + ****************************************************************************/ + +/* + * This file is part of Qookie. + * + * Qookie is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Qookie 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Qookie; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ +#include "menu.h" + diff --git a/menu.h b/menu.h new file mode 100644 index 0000000..890b927 --- /dev/null +++ b/menu.h @@ -0,0 +1,42 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/*************************************************************************** + * menu.h + * + * Tue Aug 19 19:59:22 CEST 2008 + * Copyright 2008 Bent Bisballe Nyeng + * deva@aasimon.org + ****************************************************************************/ + +/* + * This file is part of Qookie. + * + * Qookie is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Qookie 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Qookie; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ +#ifndef __QOOKIE_MENU_H__ +#define __QOOKIE_MENU_H__ + +#include +#include +#include + +#include "component.h" +#include "dish.h" + +class Menu : public Component { +public: + QVector dishes; +}; + +#endif/*__QOOKIE_MENU_H__*/ diff --git a/qookie.cc b/qookie.cc new file mode 100644 index 0000000..2329cf9 --- /dev/null +++ b/qookie.cc @@ -0,0 +1,39 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/*************************************************************************** + * qookie.cc + * + * Tue Aug 19 19:17:02 CEST 2008 + * Copyright 2008 Bent Bisballe Nyeng + * deva@aasimon.org + ****************************************************************************/ + +/* + * This file is part of Qookie. + * + * Qookie is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Qookie 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Qookie; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ +#include + +#include "mainwindow.h" + +int main(int argc, char *argv[]) +{ + QApplication qapp(argc, argv); + + MainWindow mainwindow; + mainwindow.show(); + + return qapp.exec(); +} diff --git a/qookie.pro b/qookie.pro new file mode 100644 index 0000000..89c45fa --- /dev/null +++ b/qookie.pro @@ -0,0 +1,36 @@ +# -*- makefile -*- + +TEMPLATE = app +TARGET = +DEPENDPATH += . +INCLUDEPATH += . +QT += core xml gui svg + + +# Input +HEADERS += \ + mainwindow.h \ + viewer.h \ + menu.h \ + component.h \ + dish.h \ + course.h \ + ingredient.h \ + document.h \ + reader.h \ + xmlreader.h \ + uid.h + +SOURCES += \ + mainwindow.cc \ + qookie.cc \ + viewer.cc \ + menu.cc \ + component.cc \ + dish.cc \ + course.cc \ + ingredient.cc \ + document.cc \ + reader.cc \ + xmlreader.cc \ + uid.cc diff --git a/qookie.svg b/qookie.svg new file mode 100644 index 0000000..1cf3839 --- /dev/null +++ b/qookie.svg @@ -0,0 +1,123 @@ + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + diff --git a/uid.cc b/uid.cc new file mode 100644 index 0000000..f25533f --- /dev/null +++ b/uid.cc @@ -0,0 +1,28 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/*************************************************************************** + * uid.cc + * + * Sun Dec 28 10:35:11 CET 2008 + * Copyright 2008 Bent Bisballe Nyeng + * deva@aasimon.org + ****************************************************************************/ + +/* + * This file is part of Qookie. + * + * Qookie is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Qookie 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Qookie; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ +#include "uid.h" + diff --git a/uid.h b/uid.h new file mode 100644 index 0000000..df4a799 --- /dev/null +++ b/uid.h @@ -0,0 +1,32 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/*************************************************************************** + * uid.h + * + * Sun Dec 28 10:35:11 CET 2008 + * Copyright 2008 Bent Bisballe Nyeng + * deva@aasimon.org + ****************************************************************************/ + +/* + * This file is part of Qookie. + * + * Qookie is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Qookie 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Qookie; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ +#ifndef __QOOKIE_UID_H__ +#define __QOOKIE_UID_H__ + +typedef unsigned int uid_t; + +#endif/*__QOOKIE_UID_H__*/ diff --git a/unit.cc b/unit.cc new file mode 100644 index 0000000..5c3a836 --- /dev/null +++ b/unit.cc @@ -0,0 +1,28 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/*************************************************************************** + * unit.cc + * + * Fri Aug 22 19:07:08 CEST 2008 + * Copyright 2008 Bent Bisballe Nyeng + * deva@aasimon.org + ****************************************************************************/ + +/* + * This file is part of Qookie. + * + * Qookie is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Qookie 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Qookie; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ +#include "unit.h" + diff --git a/unit.h b/unit.h new file mode 100644 index 0000000..48743ae --- /dev/null +++ b/unit.h @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/*************************************************************************** + * unit.h + * + * Fri Aug 22 19:07:08 CEST 2008 + * Copyright 2008 Bent Bisballe Nyeng + * deva@aasimon.org + ****************************************************************************/ + +/* + * This file is part of Qookie. + * + * Qookie is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Qookie 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Qookie; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ +#ifndef __QOOKIE_UNIT_H__ +#define __QOOKIE_UNIT_H__ + +class Unit { + +}; + +#endif/*__QOOKIE_UNIT_H__*/ diff --git a/viewer.cc b/viewer.cc new file mode 100644 index 0000000..18b8e68 --- /dev/null +++ b/viewer.cc @@ -0,0 +1,31 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/*************************************************************************** + * viewer.cc + * + * Tue Aug 19 19:48:30 CEST 2008 + * Copyright 2008 Bent Bisballe Nyeng + * deva@aasimon.org + ****************************************************************************/ + +/* + * This file is part of Qookie. + * + * Qookie is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Qookie 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Qookie; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ +#include "viewer.h" + +Viewer::Viewer() : QSvgWidget("qookie.svg") +{ +} diff --git a/viewer.h b/viewer.h new file mode 100644 index 0000000..4abcc3c --- /dev/null +++ b/viewer.h @@ -0,0 +1,37 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/*************************************************************************** + * viewer.h + * + * Tue Aug 19 19:48:29 CEST 2008 + * Copyright 2008 Bent Bisballe Nyeng + * deva@aasimon.org + ****************************************************************************/ + +/* + * This file is part of Qookie. + * + * Qookie is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Qookie 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Qookie; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ +#ifndef __QOOKIE_VIEWER_H__ +#define __QOOKIE_VIEWER_H__ + +#include + +class Viewer : public QSvgWidget { +public: + Viewer(); +}; + +#endif/*__QOOKIE_VIEWER_H__*/ -- cgit v1.2.3